修改视频播放形式
This commit is contained in:
parent
a291c2f629
commit
0636654dc2
|
|
@ -1,5 +1,6 @@
|
|||
<template>
|
||||
<view>
|
||||
|
||||
<swiper @longpress="openBs()" :style="{height:winHeight}" :circular="true" class="swipers" @change="change"
|
||||
:current="current" :vertical="true" :indicator-dots="false" :autoplay="false" :interval="0" :duration="1">
|
||||
<swiper-item class="swipers-item" v-for="(item,index) in swiperList" :key="item.courseDetailsId">
|
||||
|
|
@ -9,7 +10,7 @@
|
|||
<!-- #ifdef MP-WEIXIN -->
|
||||
<!-- wxUrl -->
|
||||
<video :show-fullscreen-btn="false" @controlstoggle="controlstoggles" @timeupdate="timeupdate"
|
||||
@waiting="waiting()" object-fit="contain" v-if="current === index && item.videoUrl"
|
||||
@waiting="waiting()" object-fit="cover" v-if="current === index && item.videoUrl"
|
||||
:play-strategy="2" :show-loading="true" codec="software" :muted="false"
|
||||
:show-center-play-btn="true" :loop="false" @ended="ended"
|
||||
@play="videoPlay('myVideo'+item.courseDetailsId)" :enable-progress-gesture="false"
|
||||
|
|
@ -20,7 +21,7 @@
|
|||
<!-- #ifndef MP-WEIXIN -->
|
||||
<video :show-fullscreen-btn="false" @click.stop.prevent="isSelectType" :controls="true"
|
||||
@controlstoggle="controlstoggles" @timeupdate="timeupdate" @waiting="waiting()"
|
||||
object-fit="contain" v-if="current === index && item.videoUrl" :play-strategy="2"
|
||||
object-fit="cover" v-if="current === index && item.videoUrl" :play-strategy="2"
|
||||
:show-loading="true" codec="software" :muted="false" :show-center-play-btn="true" :loop="false"
|
||||
@ended="ended" @play="videoPlay('myVideo'+item.courseDetailsId)"
|
||||
:enable-progress-gesture="false" :poster="item.titleImg" :ref="'myVideo'+item.courseDetailsId"
|
||||
|
|
@ -305,7 +306,9 @@
|
|||
var videoAd = null;
|
||||
// #endif
|
||||
|
||||
import {returnIsSafari} from '@/utils/app.js'
|
||||
import {
|
||||
returnIsSafari
|
||||
} from '@/utils/app.js'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
|
|
@ -456,11 +459,11 @@
|
|||
},
|
||||
computed: {
|
||||
listStyle() {
|
||||
if(this.isSafari){
|
||||
return {
|
||||
'min-height':'540rpx'
|
||||
}
|
||||
}
|
||||
// if (this.isSafari) {
|
||||
// return {
|
||||
// 'min-height': '540rpx'
|
||||
// }
|
||||
// }
|
||||
return ''
|
||||
},
|
||||
//当前视频是否可以看广告解锁
|
||||
|
|
@ -515,6 +518,7 @@
|
|||
// #endif
|
||||
|
||||
},
|
||||
|
||||
onLoad(e) {
|
||||
//在苹果系统微信小程序是否开启支付
|
||||
this.isWxIosPay = uni.getStorageSync('isWxIosPay')
|
||||
|
|
@ -742,6 +746,21 @@
|
|||
// #ifndef MP-WEIXIN || MP-KUAISHOU
|
||||
this.meunTop = 37
|
||||
// #endif
|
||||
|
||||
|
||||
// const windowResizeCallback = (res) => {
|
||||
// console.log('变化后的窗口宽度=' + res.size.windowWidth)
|
||||
// console.log('变化后的窗口高度=' + res.size.windowHeight)
|
||||
// this.onResize(res)
|
||||
// setTimeout(()=>{
|
||||
// this.onResize(res)
|
||||
// },500)
|
||||
// }
|
||||
// uni.onWindowResize(windowResizeCallback)
|
||||
|
||||
// #ifdef H5
|
||||
|
||||
// #endif
|
||||
},
|
||||
watch: {
|
||||
//监听当前播放的集数
|
||||
|
|
@ -784,6 +803,16 @@
|
|||
},
|
||||
},
|
||||
methods: {
|
||||
onResize(res) {
|
||||
const sysInfo = uni.getSystemInfoSync()
|
||||
//获取可是区域高度
|
||||
const winHeight = sysInfo.windowHeight
|
||||
if (winHeight && winHeight > 0) {
|
||||
this.winHeight = winHeight + 'px'
|
||||
} else {
|
||||
this.winHeight = '100vh'
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 获取金币比例
|
||||
*/
|
||||
|
|
@ -1871,9 +1900,11 @@
|
|||
page {
|
||||
background-color: #000;
|
||||
}
|
||||
|
||||
::v-deep .u-drawer-content {
|
||||
// position: fixed;
|
||||
}
|
||||
|
||||
.videoListCurr {
|
||||
background-color: #ff7581 !important;
|
||||
color: #ffffff !important;
|
||||
|
|
@ -2035,6 +2066,8 @@
|
|||
|
||||
.swipers {
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
|
||||
.swipers-item {
|
||||
width: 100%;
|
||||
|
|
|
|||
Loading…
Reference in New Issue