修改app兼容

master
于肖磊 2025-12-17 15:07:36 +08:00
parent 7636a41cc6
commit 7e2340ab24
5 changed files with 18 additions and 21 deletions

View File

@ -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>

View File

@ -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 //

View File

@ -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
},

View File

@ -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 {

View File

@ -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;