|
@@ -11,13 +11,24 @@
|
|
|
show-mute-btn
|
|
|
@ended="handleVideoEnd"
|
|
|
@timeupdate="handleVideoTimeUpdate"
|
|
|
+ @fullscreenchange="handleFullscreenchange"
|
|
|
autoplay
|
|
|
- ></video>
|
|
|
+ >
|
|
|
+ <view class="video-inner-right-box" v-if="isShowControls">
|
|
|
+ <!-- 倍速控制按钮 -->
|
|
|
+ <view class="video-speed-btn" @click.stop="showSpeedOpt = true">倍速</view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <!-- 倍速选项模块 -->
|
|
|
+ <view class="speed-opt-box" v-if="showSpeedOpt">
|
|
|
+ <view class="item" :style="{ color: item == curSpeed ? '#F3A52F' : '' }" v-for="item in speedOpts" :key="item" @click.stop="handleVideoSpeedChange(item)">{{ item }}X</view>
|
|
|
+ </view>
|
|
|
+ </video>
|
|
|
<view class="title text_twoLine">
|
|
|
{{ videoPopList.Title }}
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="close-icon">
|
|
|
+ <view class="close-icon" v-if="showCloseBtn">
|
|
|
<image @click="handleShow" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/close-icon.png"> </image>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -51,6 +62,11 @@ export default {
|
|
|
return {
|
|
|
videoContext: null,
|
|
|
curVideoTime: 0,
|
|
|
+ showSpeedOpt: false,
|
|
|
+ speedOpts: ["0.5", "0.8", "1.0", "1.25", "1.5", "2.0"],
|
|
|
+ curSpeed: "1.0",
|
|
|
+ isShowControls: false, //是否显示视频的控制栏
|
|
|
+ showCloseBtn: true,
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
@@ -90,8 +106,21 @@ export default {
|
|
|
this.$store.commit("videoPlay/palyTimeUpdate", time);
|
|
|
},
|
|
|
handleShow() {
|
|
|
+ this.showSpeedOpt = false;
|
|
|
+ this.curSpeed = "1.0";
|
|
|
// this.$parent.showVideoPop = false;
|
|
|
- this.$emit("update:showVideoPop",false);
|
|
|
+ this.$emit("update:showVideoPop", false);
|
|
|
+ },
|
|
|
+ // 倍速切换
|
|
|
+ handleVideoSpeedChange(item) {
|
|
|
+ const num = Number(item);
|
|
|
+ this.videoContext.playbackRate(num);
|
|
|
+ this.curSpeed = item;
|
|
|
+ this.showSpeedOpt = false;
|
|
|
+ },
|
|
|
+ handleFullscreenchange(e) {
|
|
|
+ this.showCloseBtn = !e.detail.fullScreen;
|
|
|
+ this.isShowControls = e.detail.fullScreen;
|
|
|
},
|
|
|
},
|
|
|
};
|
|
@@ -141,5 +170,43 @@ export default {
|
|
|
width: 48rpx;
|
|
|
}
|
|
|
}
|
|
|
+ .video-inner-right-box {
|
|
|
+ position: absolute;
|
|
|
+ bottom: 30%;
|
|
|
+ right: 5%;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ align-items: center;
|
|
|
+ }
|
|
|
+ .video-speed-btn {
|
|
|
+ width: 80rpx;
|
|
|
+ height: 44rpx;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ background: rgba(0, 0, 0, 0.4);
|
|
|
+ border-radius: 22rpx;
|
|
|
+ color: #fff;
|
|
|
+ font-size: 12px;
|
|
|
+ }
|
|
|
+ .speed-opt-box {
|
|
|
+ position: absolute;
|
|
|
+ right: 0;
|
|
|
+ top: 0;
|
|
|
+ bottom: 0;
|
|
|
+ width: 20%;
|
|
|
+ background: rgba(0, 0, 0, 0.8);
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ justify-content: space-around;
|
|
|
+ padding-top: 55rpx;
|
|
|
+ .item {
|
|
|
+ color: #fff;
|
|
|
+ font-size: 26rpx;
|
|
|
+ flex: 1;
|
|
|
+ width: 100%;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|