修改app兼容
parent
7636a41cc6
commit
7e2340ab24
|
|
@ -50,8 +50,8 @@
|
|||
}
|
||||
.data-bottom-line .line-item.left,
|
||||
.data-bottom-line .line-item.right {
|
||||
margin-top: 8px;
|
||||
border-bottom: 1px solid #e1e1e1;
|
||||
margin-top: 16rpx;
|
||||
border-bottom: 2rpx solid #e1e1e1;
|
||||
}
|
||||
.data-bottom-line .line-item.msg {
|
||||
color: #999;
|
||||
|
|
@ -65,4 +65,4 @@
|
|||
.data-bottom-line .line-item.right {
|
||||
float: right;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -369,8 +369,8 @@
|
|||
initHlsPlayer(src) {
|
||||
if (hlsjs.isSupported()) {
|
||||
this.hlsPlayer = new hlsjs({
|
||||
manifestLoadingTimeOut: 30000, // 设置播放列表加载超时时间(毫秒)
|
||||
fragLoadingTimeOut: 3000, // 设置片段加载超时时间(毫秒)
|
||||
manifestLoadingTimeOut: 60000, // 设置播放列表加载超时时间(毫秒)
|
||||
fragLoadingTimeOut: 60000, // 设置片段加载超时时间(毫秒)
|
||||
maxLiveSyncPlaybackRate: 1, // 最大追赶播放速率(1.05倍速)
|
||||
lowLatencyMode: true, // 启用低延迟模式
|
||||
debug: false // 启用调试日志
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
<template>
|
||||
<!-- #ifdef H5 -->
|
||||
<h5-hls-video ref="videoPlayer" v-if="video_player_show" :propSrc="video_src" propAutoplay :propMuted="muted" class="video-size" @hlsError="error" @ended="ended" @loadedmetadata="loadedmetadata" @autoPlaySuccess="auto_play_success" @autoPlayError="auto_play_error"></h5-hls-video>
|
||||
<h5-hls-video v-if="video_player_show" :propSrc="video_src" propAutoplay :propMuted="muted" class="video-size" @hlsError="error" @ended="ended" @loadedmetadata="loadedmetadata" @autoPlaySuccess="auto_play_success" @autoPlayError="auto_play_error"></h5-hls-video>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef MP -->
|
||||
<live-player :src="video_src" autoplay :muted="muted" class="video-size" @statechange="statechange" @error="error" />
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef APP -->
|
||||
<video ref="videoPlayer" :src="video_src" autoplay :is-video="true" :controls="false" :muted="muted" object-fit="contain" :style="{'width': windowWidth + 'px', 'height': windowHeight + 'px', 'background-color': 'transparent'}" @error="error" @ended="ended"></video>
|
||||
<video v-if="video_player_show" :src="video_src" autoplay :is-video="true" :controls="false" :muted="muted" object-fit="contain" :style="{'width': windowWidth + 'px', 'height': windowHeight + 'px', 'background-color': 'transparent'}" @play="loadedmetadata" @error="error" @ended="ended"></video>
|
||||
<!-- #endif -->
|
||||
</template>
|
||||
|
||||
|
|
@ -62,25 +62,16 @@
|
|||
methods: {
|
||||
reload_video() {
|
||||
// #ifndef MP
|
||||
const video = this.$refs.videoPlayer;
|
||||
// 深拷贝视频源地址,避免直接修改原地址
|
||||
let src = '';
|
||||
if (!isEmpty(this.propSrc)) {
|
||||
src = this.propSrc;
|
||||
}
|
||||
this.video_src = ''; // 清除原地址
|
||||
//#ifdef H5
|
||||
this.video_player_show = false;
|
||||
//#endif
|
||||
setTimeout(() => {
|
||||
this.video_src = src; // 重新赋值
|
||||
//#ifdef H5
|
||||
this.video_player_show = true;
|
||||
//#endif
|
||||
// #ifdef APP-NVUE
|
||||
video.load(); // 重新加载
|
||||
video.play().catch(() => this.retryLoadVideo());
|
||||
// #endif
|
||||
}, 100);
|
||||
// #endif
|
||||
},
|
||||
|
|
|
|||
|
|
@ -117,6 +117,8 @@ export default {
|
|||
// this.is_live_ended = true;
|
||||
// }
|
||||
} else if (new_data.code == -400) { // 没有登陆的跳转到登陆页
|
||||
// 隐藏加载提示
|
||||
uni.hideLoading();
|
||||
if (app.globalData.is_login_check(res.data)) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
<template>
|
||||
<view :class="theme_view + ' flex-row pr'" :style="'width:' + windowWidth + 'px;height:' + windowHeight + 'px;'">
|
||||
<view class="flex-1 pr live-bg" @dblclick="handle_double_click" @touchend="handle_touch_end" :data-ignore="false">
|
||||
<live-video v-if="!is_live_ended" ref="live-video" :propSrc="live_video_src || 'http://live-pull-all.shopxo.vip/68f764013572f9240ca7ce6c/shopxo122.m3u8'" @loadedmetadata="loadedmetadata" @ended="ended"></live-video>
|
||||
<component-live-video v-if="!is_live_ended" ref="liveVideo" :propSrc="live_video_src || 'http://live-pull-all.shopxo.vip/68f764013572f9240ca7ce6c/shopxo122.m3u8'" @loadedmetadata="loadedmetadata" @ended="ended"></component-live-video>
|
||||
<!-- 简化版点赞效果组件 -->
|
||||
<full-screen-like-effect ref="fullScreenLikeEffect" :propCustomImages="like_show_imgs" :style="'width:' + windowWidth + 'px;height:' + windowHeight + 'px;'"></full-screen-like-effect>
|
||||
<component-full-screen-like-effect ref="fullScreenLikeEffect" :propCustomImages="like_show_imgs" :style="'width:' + windowWidth + 'px;height:' + windowHeight + 'px;'"></component-full-screen-like-effect>
|
||||
</view>
|
||||
<template v-if="!is_loading">
|
||||
<!-- 主播暂时离开的提示信息-->
|
||||
<view v-if="live_be_right_back_error" class="live-pause flex-row align-c jc-c pointer-events-none">
|
||||
<view v-if="live_be_right_back_error" class="live-pause flex-row align-c jc-c" :style="'width:' + windowWidth + 'px;height:' + windowHeight + 'px;'">
|
||||
<view class="flex-1 flex-col align-c jc-c">
|
||||
<component-icon propName="smallbell" propSize="100rpx" propColor="#fff"></component-icon>
|
||||
<text class="pointer-events-auto text-size mb-5 cr-white">主播暂时离开</text>
|
||||
|
|
@ -16,12 +16,12 @@
|
|||
</view>
|
||||
<!-- 主体内容显示 -->
|
||||
<view class="live-content" :style="'width:' + windowWidth + 'px;height:' + windowHeight + 'px;'">
|
||||
<live-content ref="liveContent" :propWindowWidth="windowWidth" :propWindowHeight="windowHeight" :propLiveData="live_data" :propLiveConfig="live_config" :propLiveShowImgs="like_show_imgs" @liveBack="live_back" @handleDoubleClick="handle_double_click" @handleTouchEnd="handle_touch_end" @liveStatus="socket_live_status"></live-content>
|
||||
<component-live-content ref="liveContent" :propWindowWidth="windowWidth" :propWindowHeight="windowHeight" :propLiveData="live_data" :propLiveConfig="live_config" :propLiveShowImgs="like_show_imgs" @liveBack="live_back" @handleDoubleClick="handle_double_click" @handleTouchEnd="handle_touch_end" @liveStatus="socket_live_status"></component-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">
|
||||
<text class="live-ended-text">直播已结束</text>
|
||||
<text class="live-ended-text cr-f">直播已结束</text>
|
||||
<button plain size="mini" class="mt-10 live-ended-button" @tap="live_back">
|
||||
<text class="cr-f pa-5">退出直播间</text>
|
||||
</button>
|
||||
|
|
@ -83,6 +83,10 @@
|
|||
z-index: 10;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
.live-ended-text {
|
||||
color:#fff;
|
||||
font-size:16px;
|
||||
}
|
||||
}
|
||||
.live-ended-button {
|
||||
border-radius: 6px;
|
||||
|
|
|
|||
Loading…
Reference in New Issue