Commit 0e8b3413 by haojie

音频直播,未完成

parent c9ec9cdc
...@@ -74,6 +74,13 @@ export const getRoutes = () => { ...@@ -74,6 +74,13 @@ export const getRoutes = () => {
component: () => import('@/pages/OnlyVideoLive/indexV2.vue'), component: () => import('@/pages/OnlyVideoLive/indexV2.vue'),
meta: { title: 'snowhome', header: false, navbar: false }, meta: { title: 'snowhome', header: false, navbar: false },
}, },
// 只有音频的页面
{
path: routerConfig.onlyAudioLive.path,
name: routerConfig.onlyAudioLive.name,
component: () => import('@/pages/onlyAudioLive/index.vue'),
meta: { title: 'snowhome', header: false, navbar: false },
},
// 只有人工回复的页面 // 只有人工回复的页面
{ {
path: routerConfig.interactiveResponse.path, path: routerConfig.interactiveResponse.path,
......
...@@ -201,10 +201,12 @@ const startLive = (item: any) => { ...@@ -201,10 +201,12 @@ const startLive = (item: any) => {
// 音频直播页 // 音频直播页
if (isDev()) { if (isDev()) {
router.push({ router.push({
path: routerConfig.onlyVideoLive.path, path: routerConfig.onlyAudioLive.path,
name: routerConfig.onlyVideoLive.name, name: routerConfig.onlyAudioLive.name,
query: params, query: params,
}); });
} else {
callPyjsInWindow('openAudioLivePage', params);
} }
} }
} }
......
<template> <template>
<div class="custom-start-only-video-page"> <div class="only-audio-page">
<div class="start-only-video-live"> <template v-for="(item, index) in mainVideoList" :key="item.name">
<AddVideoPlay <audio
v-model:currentPlayMainIndex="currentPlayMainIndex" :src="item.url"
v-model:showActionVideo="showActionVideo" @canplay="onCanplay(index)"
v-model:firstVideoIsMain="firstVideoIsMain" :ref="(ref:HTMLAudioElement) => (item.ref = ref)"
v-model:endVideoIsMain="endVideoIsMain" @ended="onPlayEnd(index)"
:loading="loading" ></audio>
:playId="addVideoId" </template>
:liveDetail="liveDetail"
:video2="addVideo"
:actionVideo="actionVideo"
:mainVideoList="mainVideoList"
:currentMainVideoIndex="currentMainVideoIndex"
:playInfo="playInfo"
:realVideoList="realVideoList"
@playEnd="playEnd"
@actionPlayChange="actionPlayChange"
@initActionVideo="initActionVideo"
@currentTime="currentTimeChange"
@mainVideoListChange="mainVideoListChange"
></AddVideoPlay>
</div>
</div> </div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import AddVideoPlay from '@/components/AddVideoPlay.vue'; import { ref } from 'vue';
import useScript from './useScript'; import useScript from './useScript';
const { const {
currentPlayMainIndex, currentPlayMainIndex,
loading,
addVideoId, addVideoId,
liveDetail, liveDetail,
addVideo, addVideo,
...@@ -47,26 +32,26 @@ const { ...@@ -47,26 +32,26 @@ const {
currentTimeChange, currentTimeChange,
mainVideoListChange, mainVideoListChange,
initActionVideo, initActionVideo,
audioCanplay,
onPlayEnd,
} = useScript(); } = useScript();
const isFirst = ref(true);
const onCanplay = async (index: number) => {
if (isFirst.value) {
audioCanplay();
isFirst.value = false;
}
};
</script> </script>
<style lang="less"> <style lang="less">
@import '@/style/variables.less'; @import '@/style/variables.less';
.custom-start-only-video-page { .only-audio-page {
display: flex; display: flex;
width: 100% !important; width: 100% !important;
padding: 0 !important; padding: 0 !important;
overflow: hidden; overflow: hidden;
& > * {
width: 100%;
background: #303030;
height: 100%;
}
.start-only-video-live {
display: flex;
justify-content: center;
align-items: center;
box-sizing: border-box;
}
} }
</style> </style>
...@@ -27,6 +27,11 @@ export default { ...@@ -27,6 +27,11 @@ export default {
path: '/startLiveOnlyVideo', path: '/startLiveOnlyVideo',
name: 'startLiveOnlyVideo', name: 'startLiveOnlyVideo',
}, },
// 音频直播
onlyAudioLive: {
path: '/startLiveOnlyAudio',
name: 'startLiveOnlyAudio',
},
// 只有人工回复的页面 // 只有人工回复的页面
interactiveResponse: { interactiveResponse: {
path: '/interactiveResponse', path: '/interactiveResponse',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment