新增socket链接
parent
8a98cb3cf5
commit
4150f122f4
|
|
@ -368,7 +368,13 @@
|
|||
// 播放视频流
|
||||
initHlsPlayer(src) {
|
||||
if (hlsjs.isSupported()) {
|
||||
this.hlsPlayer = new hlsjs()
|
||||
this.hlsPlayer = new hlsjs({
|
||||
manifestLoadingTimeOut: 1000, // 设置播放列表加载超时时间(毫秒)
|
||||
fragLoadingTimeOut: 1000, // 设置片段加载超时时间(毫秒)
|
||||
maxLiveSyncPlaybackRate: 1, // 最大追赶播放速率(1.05倍速)
|
||||
lowLatencyMode: true, // 启用低延迟模式
|
||||
debug: false // 启用调试日志
|
||||
})
|
||||
this.hlsPlayer.loadSource(src)
|
||||
this.hlsPlayer.attachMedia(this.videoEl)
|
||||
this.hlsPlayer.on(hlsjs.Events.MANIFEST_PARSED, () => {
|
||||
|
|
|
|||
|
|
@ -598,6 +598,7 @@
|
|||
break;
|
||||
// 消息
|
||||
case 'message':
|
||||
console.log(data, 'message');
|
||||
// 如果最后前一条是进入直播间的提示,则删除
|
||||
if (this.bulletins.length > 0 && this.bulletins[this.bulletins.length - 1].type == 'go') {
|
||||
this.bulletins.splice(this.bulletins.length - 1, 1);
|
||||
|
|
@ -613,6 +614,7 @@
|
|||
this.scroll_to_lower();
|
||||
break;
|
||||
case 'live-status':
|
||||
console.log(data.content, 'live-status');
|
||||
this.$emit('liveStatus', data.content);
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ export default {
|
|||
lastTapPosition: { x: 0, y: 0 }, // 记录上次点击位置
|
||||
lastLikeTime: 0, // 记录上次点赞时间,用于防抖
|
||||
live_status: 'start',
|
||||
live_end_msg: '主播暂时离开,请稍等...',
|
||||
live_end_msg: '直播已结束',
|
||||
}
|
||||
},
|
||||
|
||||
|
|
@ -220,7 +220,7 @@ export default {
|
|||
this.lastTapPosition = { x, y };
|
||||
},
|
||||
socket_live_status(status) {
|
||||
console.log(status);
|
||||
console.log(status, '直播间状态');
|
||||
this.live_status = status;
|
||||
// 如果是开始直播了或者继续直播了,则取消直播结束标记
|
||||
console.log(this.is_live_ended);
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
<full-screen-like-effect ref="fullScreenLikeEffect" :propCustomImages="like_show_imgs" :style="'width:' + windowWidth + 'px;height:' + windowHeight + 'px;'"></full-screen-like-effect>
|
||||
</view>
|
||||
<view v-if="!is_loading" class="live-content" :style="'width:' + windowWidth + 'px;height:' + windowHeight + 'px;'">
|
||||
<live-content ref="liveContent" :propLiveConfig="live_config" :propLiveShowImgs="like_show_imgs" @live-back="live_back" @handleDoubleClick="handle_double_click" @handleTouchEnd="handle_touch_end" @liveStatus="socket_live_status"></live-content>
|
||||
<live-content ref="liveContent" :propLiveConfig="live_config" :propLiveShowImgs="like_show_imgs" @liveBack="live_back" @handleDoubleClick="handle_double_click" @handleTouchEnd="handle_touch_end" @liveStatus="socket_live_status"></live-content>
|
||||
</view>
|
||||
<view v-if="is_live_ended" class="live-ended flex-row align-c jc-c" :style="'width:' + windowWidth + 'px;height:' + windowHeight + 'px;'">
|
||||
<view class="flex-col align-c">
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
<full-screen-like-effect ref="fullScreenLikeEffect" :propCustomImages="like_show_imgs"></full-screen-like-effect>
|
||||
</view>
|
||||
<view v-if="!is_loading" :class="'live-content ' + (!is_live_ended ? 'pointer-events-none' : '')">
|
||||
<live-content ref="liveContent" :propLiveConfig="live_config" :propLiveShowImgs="like_show_imgs" @live-back="live_back" @liveStatus="socket_live_status"></live-content>
|
||||
<live-content ref="liveContent" :propLiveConfig="live_config" :propLiveShowImgs="like_show_imgs" @liveBack="live_back" @liveStatus="socket_live_status"></live-content>
|
||||
</view>
|
||||
<view v-if="is_live_ended" class="live-ended flex-row align-c jc-c">
|
||||
<view class="flex-col align-c">
|
||||
|
|
|
|||
Loading…
Reference in New Issue