Commit 6365ba13 by 张立顺

直播背景图片兼容ios

2 parents b6febf04 35c0e2f9
<template> <template>
<!-- v-if="LiveProps[liveDetail.status].isLive" --> <!-- v-if="LiveProps[liveDetail.status].isLive" -->
<div class="videoContainer"> <div class="videoContainer">
<div class="small-box" <<<<<<< HEAD
@click="isSmallBox = false" <div
v-show="isSmallBox"> class="small-box"
@click="isSmallBox = false"
v-show="isSmallBox">
<img class="icon-small-live" <img class="icon-small-live"
src="@/assets/images/icon-small-live.jpg" /> src="@/assets/images/icon-small-live.jpg" />
<div class="flex small-content"> =======
<!-- <div v-if="LiveStatus[liveDetail.status] == 'live'" class="live-line"> --> <div class="small-box"
<div class="live-line"> @click="isSmallBox = false"
<div class="side"></div> v-show="isSmallBox">
<div class="center side"></div> <img class="icon-small-live"
<div class="side"></div> src="@/assets/images/icon-small-live.png" />
>>>>>>> 35c0e2f924989636ebeee213cc6d151e6716a671
<div class="flex small-content">
<!-- <div v-if="LiveStatus[liveDetail.status] == 'live'" class="live-line"> -->
<div class="live-line"
v-if="LiveProps[liveDetail.status].isLive">
<div class="side"></div>
<div class="center side"></div>
<div class="side"></div>
</div>
<img v-if="!LiveProps[liveDetail.status].isLive"
:src="IMAGES.REPLAY_ICON"
class="live-replayIcon" />
<div class="text">{{ LiveProps[liveDetail.status].status }}</div>
</div> </div>
<!-- <div class="text">{{ LiveStatus[liveDetail.status] == 'live' ? '直播' : '回放' }}</div> -->
<!-- <div class="text">{{ LiveProps[liveDetail.status].status }}</div> -->
<div class="text">{{ LiveProps[liveDetail.status].status }}</div>
</div> </div>
</div> <!-- @click="openFullscreen" -->
<!-- @click="openFullscreen" --> <!-- @touchmove.stop.prevent 禁止使用滚动 -->
<!-- @touchmove.stop.prevent 禁止使用滚动 --> <div :style="videoStyle"
<div :style="videoStyle" @touchmove.stop.prevent
@touchmove.stop.prevent id="live-box"
id="live-box" :class="['live-box', { videoFullscreen: videoFullscreen }]"
:class="['live-box', { videoFullscreen: videoFullscreen }]" v-show="!isSmallBox">
v-show="!isSmallBox"> <div class="sprite-icon icon-live-close"
<div class="sprite-icon icon-live-close" v-show="!videoFullscreen && !isSmallBox"
v-show="!videoFullscreen && !isSmallBox" @click="isSmallBox = true"></div>
@click="isSmallBox = true"></div>
<div :class="{ videoShort: isAction }"> <div :class="{ videoShort: isAction }">
<div class="mask"> <div class="mask">
<div class="status flex"> <div class="status flex">
<!-- <div v-if="LiveStatus[liveDetail.status] == 'live'" class="live-line"> --> <div v-if="LiveProps[liveDetail.status].isLive"
<div v-if="LiveProps[liveDetail.status].isLive" class="live-line">
class="live-line"> <div class="side"></div>
<div class="side"></div> <div class="center side"></div>
<div class="center side"></div> <div class="side"></div>
<div class="side"></div> </div>
<!-- 回放图标 -->
<img v-if="!LiveProps[liveDetail.status].isLive"
:src="IMAGES.REPLAY_ICON"
class="live-replayIcon" />
<div class="text">{{ LiveProps[liveDetail.status].text }}</div>
</div> </div>
<!-- 回放图标 --> <template v-if="isShowGif">
<!-- :src="" --> <img class="coverGif"
<img v-if="!LiveProps[liveDetail.status].isLive" :src="LiveProps[liveDetail.status].covergif"
:src="IMAGES.REPLAY_ICON" alt="" />
class="live-replayIcon" /> </template>
<!-- <div class="text">{{ LiveStatus[liveDetail.status] == 'live' ? '正在直播' : '直播回放' }}</div> -->
<div class="text">{{ LiveProps[liveDetail.status].text }}</div>
</div> </div>
<template v-if="isShowGif"> <div class="fullscreen-btn"
<!-- v-if="LiveProps[liveDetail.status].covergif" --> @click="openFullscreen(false)">
<!-- <img v-if="LiveStatus[liveDetail.status] == 'live'" src="https://wimg.588ku.com/gif620/20/04/23/79a7882dfb0c59497976fd8b3bfe60ef.gif" alt="" /> --> <img :src="IMAGES.FULL_SCREEN" />
<img class="coverGif" </div>
:src="LiveProps[liveDetail.status].covergif" <div class="poster-btn"
alt="" /> @click="showKf = true">
<!-- <img v-else <img :src="detail.floatingMaskDiagram" />
:src="IMAGES.COVER_REPLAY" </div>
alt="" /> --> <video id="player-container-id"
</template> preload="auto"
</div> playsinline
<div class="fullscreen-btn" webkit-playsinline></video>
@click="openFullscreen(false)"> <group-modal v-model="showKf"
<img :src="IMAGES.FULL_SCREEN" /> :detail="detail" />
</div>
<div class="poster-btn"
@click="showKf = true">
<img :src="detail.floatingMaskDiagram" />
</div> </div>
<video id="player-container-id" <action :bgBlack="true"
preload="auto" class="BgAction"
playsinline v-show="videoFullscreen && isAction"></action>
webkit-playsinline></video>
<group-modal v-model="showKf"
:detail="detail" />
</div> </div>
<action :bgBlack="true"
class="BgAction"
v-show="videoFullscreen && isAction"></action>
</div>
</div> </div>
</template> </template>
<script type="text/ecmascript-6"> <script type="text/ecmascript-6">
...@@ -116,8 +118,6 @@ export default { ...@@ -116,8 +118,6 @@ export default {
showKf: false, showKf: false,
isShowGif: false, isShowGif: false,
videoStyle: '', videoStyle: '',
// LiveStatus: CONSTANTS.LiveStatus,
// LiveProps: CONSTANTS.LiveProps,
isSmallBox: false, //是否显示小容器直播 isSmallBox: false, //是否显示小容器直播
LiveProps, LiveProps,
IMAGES IMAGES
...@@ -150,10 +150,10 @@ export default { ...@@ -150,10 +150,10 @@ export default {
}, },
mounted() { mounted() {
console.log(this.liveDetail, '============')
this.createPlayerCover() this.createPlayerCover()
this.createPlayer() this.createPlayer()
this.play() this.play()
<<<<<<< HEAD
// console.log('2222222222', this.liveDetail); // console.log('2222222222', this.liveDetail);
// const _this = this // const _this = this
// if (!this.IsIOS) { // if (!this.IsIOS) {
...@@ -198,6 +198,9 @@ export default { ...@@ -198,6 +198,9 @@ export default {
// }) // })
// _this.dealTcPlayerErr14(_this) // _this.dealTcPlayerErr14(_this)
// }) // })
=======
// console.log('2222222222', this.liveDetail)
>>>>>>> 35c0e2f924989636ebeee213cc6d151e6716a671
}, },
methods: { methods: {
createPlayerCover() { createPlayerCover() {
...@@ -210,23 +213,25 @@ export default { ...@@ -210,23 +213,25 @@ export default {
wxConfig.ready(() => { wxConfig.ready(() => {
wx.getNetworkType({ wx.getNetworkType({
success: (result) => { success: (result) => {
console.log('====', { result }); // console.log('====', { result });
this.player.ready(() => { // 设置播放器初始化完成后的回调 this.player.ready(() => { // 设置播放器初始化完成后的回调
this.fixHls() this.fixHls()
const src = this.LiveProps[this.liveDetail.status].isLive ? this.liveDetail.playPath : (this.liveDetail.liveBroadcastRecordingFileList || [])[0]?.videoUrl const src = this.LiveProps[this.liveDetail.status].isLive ? this.liveDetail.playPath : (this.liveDetail.liveBroadcastRecordingFileList || [])[0]?.videoUrl
this.player.src(src) this.player.src(src)
// this.player.src('http://play.glsx.com.cn/live/live.m3u8')
this.player.poster() this.player.poster()
this.player.play() // 播放视频 this.player.play() // 播放视频
// console.log('this.draggable', this.draggable)
this.draggable(document.getElementById('live-box'), this.openFullscreen, 'icon-live-close') this.draggable(document.getElementById('live-box'), this.openFullscreen, 'icon-live-close')
//
}) })
} }
}) })
}) })
}, },
controlBarStyle() {
var [controlBar] = document.getElementsByClassName('vjs-control-bar')
controlBar.style.bottom = this.isAction ? '10vh' : '0'
},
fixHls() { fixHls() {
if (Hls.isSupported()) { if (Hls.isSupported()) {
this.video = document.getElementById(PLAYERDOMID) this.video = document.getElementById(PLAYERDOMID)
...@@ -238,7 +243,7 @@ export default { ...@@ -238,7 +243,7 @@ export default {
}, },
// 打开关闭全屏 // 打开关闭全屏
openFullscreen(status = true) { openFullscreen(status = true) {
console.log('openFullscreen') // console.log('openFullscreen')
this.isShowGif = false this.isShowGif = false
const [live] = document.getElementsByClassName('live-box') const [live] = document.getElementsByClassName('live-box')
const [volumePanel] = document.getElementsByClassName('vjs-volume-panel ') const [volumePanel] = document.getElementsByClassName('vjs-volume-panel ')
...@@ -247,6 +252,7 @@ export default { ...@@ -247,6 +252,7 @@ export default {
this.player.play() this.player.play()
this.videoFullscreen = status this.videoFullscreen = status
live.id = status ? '' : 'live-box' live.id = status ? '' : 'live-box'
this.controlBarStyle()
this.$emit('handleLiveFull', { isFull: this.videoFullscreen }) this.$emit('handleLiveFull', { isFull: this.videoFullscreen })
}, },
// 处理tcplayer错误码14 // 处理tcplayer错误码14
...@@ -274,10 +280,6 @@ export default { ...@@ -274,10 +280,6 @@ export default {
changeGifStatus() { changeGifStatus() {
this.isShowGif = !this.isShowGif this.isShowGif = !this.isShowGif
}, },
handleClose() {
// e.stopPropagation()
console.log('关闭--22222222222222222')
},
continueVideo() { continueVideo() {
this.player.play() this.player.play()
} }
...@@ -289,7 +291,7 @@ export default { ...@@ -289,7 +291,7 @@ export default {
position: fixed; position: fixed;
top: 18%; top: 18%;
right: 0; right: 0;
z-index: 2; z-index: 7;
// position: relative; // position: relative;
width: 52px; width: 52px;
...@@ -307,6 +309,7 @@ export default { ...@@ -307,6 +309,7 @@ export default {
// object-fit: cover; // object-fit: cover;
} }
.small-content { .small-content {
position: relative;
width: 100%; width: 100%;
height: 100%; height: 100%;
z-index: 9; z-index: 9;
...@@ -318,6 +321,15 @@ export default { ...@@ -318,6 +321,15 @@ export default {
border-radius: 0 0 10px 10px; border-radius: 0 0 10px 10px;
// padding: ; // padding: ;
text-align: right; text-align: right;
.live-replayIcon {
position: absolute;
left: 7px;
top: 5px;
display: inline-block;
width: 10px;
height: 10px;
z-index: 9;
}
.text { .text {
z-index: 40; z-index: 40;
margin-left: 15px; margin-left: 15px;
...@@ -434,7 +446,7 @@ export default { ...@@ -434,7 +446,7 @@ export default {
/deep/.vjs-control-bar { /deep/.vjs-control-bar {
opacity: 1 !important; opacity: 1 !important;
bottom: 10vh; // bottom: 10vh;
background: none !important; background: none !important;
// background-color: rgba(0, 0, 0, 0.3); // background-color: rgba(0, 0, 0, 0.3);
} }
......
...@@ -176,9 +176,10 @@ export default { ...@@ -176,9 +176,10 @@ export default {
} }
if (userInfo.phone) this.emit(obj) if (userInfo.phone) this.emit(obj)
else { else {
if (!hasPhoneSelect) this.emit(obj) // if (!hasPhoneSelect) this.emit(obj)
else ssoApi.captchaLogin({ // else
mobile: params.userPhone, ssoApi.captchaLogin({
mobile: params.userPhone || '88888888888',
captcha: 8888, captcha: 8888,
source: 'CROWDFUNDING_H5' source: 'CROWDFUNDING_H5'
}).then(({ code, data, message }) => { }).then(({ code, data, message }) => {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!