当前位置:网站首页>Uniapp implementation forbids video drag fast forward
Uniapp implementation forbids video drag fast forward
2022-06-24 10:16:00 【Ma Xiaotiao coding】
In the process of project development , It's hard to avoid using video Video Tags . According to customer requirements , The video can only be viewed normally , Cannot fast forward manually , The following is the implementation method :
<!--1.video label -->
<video id="myVideo" @timeupdate="videoFun" :src="videourl" initial-time="initial_time" >
<script> export default {
data() {
//2.data Data section return {
videourl: "https://vd3.bdstatic.com/mda-me38qw5ayq6m5x6k/sc/cae_h264/1620080580731464743/mda-me38qw5ayq6m5x6k.mp4?v_from_s=hkapp-haokan-nanjing&auth_key=1654941744-0-0-e46a5e5c83b069fcaf54124cd256af20&bcevod_channel=searchbox_feed&pd=1&cd=0&pt=3&logid=1944747745&vid=1074518001243819841&abtest=102599_2-102777_6-102784_1-17451_1-3000225_3-3000232_1&klogid=1944747745", video_real_time: 0, // Real time playback progress nitial_time: '', // Video jump progress second } }, onLoad(option) {
//3.onload part this.initial_time = '0' // Video progress }, methods: {
//4. Method section videoFun(e){
var isReady = 1; // Whether to enable video fast forward 1 Do not turn on // Jump to the specified playback position initial-time Time is seconds let that = this; // Total playing time var duration = e.detail.duration // Real time playback progress Number of seconds var currentTime = parseInt(e.detail.currentTime) // Current video progress // console.log(" Play the video to " + currentTime + " second ")// View the playing time , In seconds if (that.video_real_time == 0) {
var jump_time = parseInt(that.initial_time) + parseInt(that.video_real_time) } else {
var jump_time = parseInt(that.video_real_time) } if (isReady == 1) {
if (currentTime > jump_time && currentTime - jump_time > 3) {
let videoContext = wx.createVideoContext('myVideo') videoContext.seek(that.video_real_time) wx.showToast({
title: ' I haven't watched the video completely , Don't fast forward ', icon: 'none', duration: 2000, }) } } that.video_real_time = currentTime // Real time playback progress } } } </script>
边栏推荐
- 引擎国产化适配&重构笔记
- 2022-06-23: given a nonnegative array, select any number to make the maximum cumulative sum a multiple of 7, and return the maximum cumulative sum. N is larger, to the 5th power of 10. From meituan. 3
- 卷妹带你学jdbc---2天冲刺Day1
- leetCode-1089: 复写零
- 413 binary tree Foundation
- np.float32()
- 物联网?快来看 Arduino 上云啦
- 上升的气泡canvas破碎动画js特效
- 自定义kindeditor编辑器的工具栏,items即去除不必要的工具栏或者保留部分工具栏
- JS singleton mode
猜你喜欢

TP5 using post to receive array data times variable type error: solution to array error

Arbre binaire partie 1

SVG+js拖拽滑块圆形进度条

微信小程序学习之 实现列表渲染和条件渲染.

CVPR 2022 Oral | 英伟达提出自适应token的高效视觉Transformer网络A-ViT,不重要的token可以提前停止计算

简单的价格表样式代码

Impdp leading schema message ora-31625 exception handling

H5网页如何在微信中自定义分享链接

4.分类管理业务开发

记录一下MySql update会锁定哪些范围的数据
随机推荐
SQL Server AVG函数取整问题
微信小程序學習之 實現列錶渲染和條件渲染.
SSM整合
Regular matching mobile number
大中型企业如何构建自己的监控体系
线程的六种状态
What are the characteristics of EDI local deployment and cloud hosting solutions?
port 22: Connection refused
How does home office manage the data center network infrastructure?
413-二叉树基础
Groovy obtains Jenkins credentials through withcredentials
2022-06-23:给定一个非负数组,任意选择数字,使累加和最大且为7的倍数,返回最大累加和。 n比较大,10的5次方。 来自美团。3.26笔试。
被困英西中学的师生安全和食物有保障
SQL sever试题求最晚入职日期
形状变化loader加载jsjs特效代码
Machine learning perceptron and k-nearest neighbor
leetCode-1051: 高度检查器
MySQL data advanced
Juul, the American e-cigarette giant, suffered a disaster, and all products were forced off the shelves
YOLOv6:又快又准的目标检测框架开源啦