修改视频播放形式

This commit is contained in:
YeMingfei666 2024-12-18 09:13:24 +08:00
parent a291c2f629
commit 0636654dc2
1 changed files with 57 additions and 24 deletions

View File

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