当前位置:网站首页>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>
边栏推荐
- 正规方程、、、
- SQL Server AVG函数取整问题
- 线程的 sleep() 方法与 wait() 方法的区别
- Producer / consumer model
- 415-二叉树(144. 二叉树的前序遍历、145. 二叉树的后序遍历、94. 二叉树的中序遍历)
- Graffiti smart brings a variety of heavy smart lighting solutions to the 2022 American International Lighting Exhibition
- Recursive traversal of 414 binary tree
- 线程的六种状态
- Indexeddb local storage, homepage optimization
- 简单的价格表样式代码
猜你喜欢
随机推荐
Floating point notation (summarized from cs61c and CMU CSAPP)
包装类型与基本类型的区别
How to improve the efficiency of network infrastructure troubleshooting and bid farewell to data blackouts?
微信小程序学习之 实现列表渲染和条件渲染.
SVG+js拖拽滑块圆形进度条
Is there a reliable and low commission futures account opening channel in China? Is it safe to open an account online?
[db2] sql0805n solution and thinking
线程池的执行流程
分布式 | 如何与 DBLE 进行“秘密通话”
SQL statistics of users logged in for N consecutive days
np.float32()
上升的气泡canvas破碎动画js特效
Go language development environment setup +goland configuration under the latest Windows
uniapp实现禁止video拖拽快进
为什么 JSX 语法这么香?
Three ways to use applicationcontextinitializer
一群骷髅在飞canvas动画js特效
415-二叉树(144. 二叉树的前序遍历、145. 二叉树的后序遍历、94. 二叉树的中序遍历)
Graffiti smart brings a variety of heavy smart lighting solutions to the 2022 American International Lighting Exhibition
读取csv(tsv)文件出错









