fix:su-video组件功能调整

pull/8/head
kele 2023-02-20 16:29:36 +08:00
parent 7a29f6755e
commit 79c361db2e
1 changed files with 2 additions and 19 deletions

View File

@ -1,13 +1,12 @@
<template>
<view class="ui-video-wrap">
<video
v-show="state.isplay"
:id="`sVideo${uid}`"
class="radius"
:style="[{ height: height + 'px' }]"
:src="src"
controls
object-fit="fill"
object-fit="contain"
:enable-progress-gesture="state.enableProgressGesture"
:initial-time="initialTime"
x5-video-player-type="h5"
@ -18,22 +17,12 @@
@play="play"
@pause="pause"
@ended="end"
:poster="poster"
>
<!-- #ifdef APP-PLUS -->
<cover-view :style="{ transform: 'translateX(' + moveX + 'px)' }" />
<!-- #endif -->
</video>
<view
v-show="!state.isplay"
class="poster-wrap radius"
:style="{ height: height + 'px' }"
@click="beforePlay"
>
<image class="poster-image" mode="aspectFill" :src="poster" />
<view class="play-icon ss-flex ss-row-center ss-col-center">
<text class="cicon-play-arrow ss-font-40"></text>
</view>
</view>
</view>
</template>
<script setup>
@ -58,7 +47,6 @@
//
const state = reactive({
isplay: false, //
// #ifdef APP-PLUS
enableProgressGesture: true, //
// #endif
@ -121,16 +109,13 @@
// pause
const pause = () => {
console.log('视频暂停');
state.isplay = false;
};
// end
const end = () => {
console.log('视频结束');
state.isplay = false;
};
//
const startPlay = () => {
state.isplay = true;
nextTick(() => {
const video = uni.createVideoContext(`sVideo${props.index}`, vm);
video.play();
@ -141,12 +126,10 @@
const pausePlay = () => {
const video = uni.createVideoContext(`sVideo${props.index}`, vm);
video.pause();
state.isplay = false;
};
//
const beforePlay = () => {
state.isplay = true;
uni.getNetworkType({
success: (res) => {
console.log(res.networkType, 'res.networkType');