Commit a8473955 by 李伟康

视频直播

1 parent 7c657734
...@@ -331,7 +331,7 @@ export default { ...@@ -331,7 +331,7 @@ export default {
}) })
else this.to(path, { orderInfo }) else this.to(path, { orderInfo })
} }
if (videoFullscreen) { if (videoFullscreen && orderInfo.liveBroadcastRoomId) {
console.log('直播间下单', orderInfo) console.log('直播间下单', orderInfo)
const res = await shopmallApi.liveRoomReport({ const res = await shopmallApi.liveRoomReport({
bizDataCode: orderInfo.orderCode, bizDataCode: orderInfo.orderCode,
......
...@@ -47,8 +47,8 @@ ...@@ -47,8 +47,8 @@
<div v-show="videoFullscreen"> <div v-show="videoFullscreen">
<!-- IM --> <!-- IM -->
<im v-if="LiveProps[liveDetail.status].isLive" :liveDetail="liveDetail" :isAction="isAction" :detail="detail" class="Im"></im> <im v-if="LiveProps[liveDetail.status].isLive && !mediaLive" :liveDetail="liveDetail" :isAction="isAction" :detail="detail" class="Im"></im>
<action :videoFullscreen="true" class="BgAction" v-show="isAction && !LiveProps[liveDetail.status].isLive"></action> <action :videoFullscreen="true" class="BgAction" v-show="isAction && (!LiveProps[liveDetail.status].isLive|| mediaLive)"></action>
</div> </div>
</div> </div>
</div> </div>
...@@ -118,7 +118,8 @@ export default { ...@@ -118,7 +118,8 @@ export default {
liveBroadcastRecordingFileList: [] liveBroadcastRecordingFileList: []
} }
} }
} },
mediaLive:Boolean
}, },
mounted() { mounted() {
this.createPlayerCover() this.createPlayerCover()
...@@ -140,7 +141,7 @@ export default { ...@@ -140,7 +141,7 @@ export default {
this.player.ready(() => { // 设置播放器初始化完成后的回调 this.player.ready(() => { // 设置播放器初始化完成后的回调
this.fixHls() this.fixHls()
const _this = this const _this = this
const src = this.LiveProps[this.liveDetail.status].isLive ? this.liveDetail.pullWebRtcUrl : (this.liveDetail.liveBroadcastRecordingFileList || [])[this.fileIdx]?.videoUrl const src = _this.mediaLive ? this.liveDetail.liveBroadcastMediaUrl : this.LiveProps[this.liveDetail.status].isLive ? this.liveDetail.pullWebRtcUrl : (this.liveDetail.liveBroadcastRecordingFileList || [])[this.fileIdx]?.videoUrl
this.player.src(src) this.player.src(src)
this.player.poster() this.player.poster()
this.player.play() // 播放视频 this.player.play() // 播放视频
......
...@@ -17,11 +17,12 @@ ...@@ -17,11 +17,12 @@
活动重新配置中,请稍后重试 活动重新配置中,请稍后重试
</div> </div>
<div v-else> <div v-else>
<template v-if="detail.liveBroadcastRoomId && liveDetail && liveDetail.status != 0"> <template v-if="(detail.liveBroadcastRoomId || detail.liveBroadcastMediaUrl) && liveDetail && liveDetail.status != 0">
<live-box <live-box
ref="liveBox" ref="liveBox"
:detail="detail" :detail="detail"
:liveDetail="liveDetail" :liveDetail="liveDetail"
:mediaLive="detail.liveBroadcastMediaUrl?true:false"
@handleLiveFull="handleLiveFull" @handleLiveFull="handleLiveFull"
></live-box> ></live-box>
</template> </template>
...@@ -461,6 +462,21 @@ export default { ...@@ -461,6 +462,21 @@ export default {
if (this.detail.liveBroadcastRoomId) { if (this.detail.liveBroadcastRoomId) {
this.getLiveDetail(id) this.getLiveDetail(id)
} }
if (data.liveBroadcastMediaUrl) {
// this.setData({
// mediaLiveObject: {
// liveBroadcastMediaUrl: data.liveBroadcastMediaUrl,
// liveBroadcastRoomCover: data.liveBroadcastRoomCover,
// liveBroadcastStateFlag: data.liveBroadcastStateFlag //1直播中,2直播回放
// }
// })
this.liveDetail = {
status: data.liveBroadcastStateFlag, //1直播中,2直播回放
liveBroadcastMediaUrl: data.liveBroadcastMediaUrl,
liveBroadcastRecordingFileList: [data.liveBroadcastMediaUrl]
}
}
}) })
}, },
getLiveDetail (id) { getLiveDetail (id) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!