Commit 0e8b3413 by haojie

音频直播,未完成

parent c9ec9cdc
......@@ -74,6 +74,13 @@ export const getRoutes = () => {
component: () => import('@/pages/OnlyVideoLive/indexV2.vue'),
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,
......
......@@ -201,10 +201,12 @@ const startLive = (item: any) => {
// 音频直播页
if (isDev()) {
router.push({
path: routerConfig.onlyVideoLive.path,
name: routerConfig.onlyVideoLive.name,
path: routerConfig.onlyAudioLive.path,
name: routerConfig.onlyAudioLive.name,
query: params,
});
} else {
callPyjsInWindow('openAudioLivePage', params);
}
}
}
......
<template>
<div class="custom-start-only-video-page">
<div class="start-only-video-live">
<AddVideoPlay
v-model:currentPlayMainIndex="currentPlayMainIndex"
v-model:showActionVideo="showActionVideo"
v-model:firstVideoIsMain="firstVideoIsMain"
v-model:endVideoIsMain="endVideoIsMain"
:loading="loading"
:playId="addVideoId"
: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 class="only-audio-page">
<template v-for="(item, index) in mainVideoList" :key="item.name">
<audio
:src="item.url"
@canplay="onCanplay(index)"
:ref="(ref:HTMLAudioElement) => (item.ref = ref)"
@ended="onPlayEnd(index)"
></audio>
</template>
</div>
</template>
<script lang="ts" setup>
import AddVideoPlay from '@/components/AddVideoPlay.vue';
import { ref } from 'vue';
import useScript from './useScript';
const {
currentPlayMainIndex,
loading,
addVideoId,
liveDetail,
addVideo,
......@@ -47,26 +32,26 @@ const {
currentTimeChange,
mainVideoListChange,
initActionVideo,
audioCanplay,
onPlayEnd,
} = useScript();
const isFirst = ref(true);
const onCanplay = async (index: number) => {
if (isFirst.value) {
audioCanplay();
isFirst.value = false;
}
};
</script>
<style lang="less">
@import '@/style/variables.less';
.custom-start-only-video-page {
.only-audio-page {
display: flex;
width: 100% !important;
padding: 0 !important;
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>
......@@ -27,6 +27,11 @@ export default {
path: '/startLiveOnlyVideo',
name: 'startLiveOnlyVideo',
},
// 音频直播
onlyAudioLive: {
path: '/startLiveOnlyAudio',
name: 'startLiveOnlyAudio',
},
// 只有人工回复的页面
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