当前位置:网站首页>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>
边栏推荐
- 4.分类管理业务开发
- numpy.logical_or
- Why is JSX syntax so popular?
- 记录一下MySql update会锁定哪些范围的数据
- Programming questions (continuously updated)
- Use of vim
- leetCode-1051: 高度检查器
- 411 stack and queue (20. valid parentheses, 1047. delete all adjacent duplicates in the string, 150. inverse Polish expression evaluation, 239. sliding window maximum, 347. the first k high-frequency
- Three ways to use applicationcontextinitializer
- PHP encapsulates a file upload class (supports single file and multiple file uploads)
猜你喜欢
Phpstrom code formatting settings
Yolov6: the fast and accurate target detection framework is open source
Wechat applet learning to achieve list rendering and conditional rendering
Go language development environment setup +goland configuration under the latest Windows
Getting user information for applet learning (getuserprofile and getUserInfo)
Juul, the American e-cigarette giant, suffered a disaster, and all products were forced off the shelves
Mise en œuvre du rendu de liste et du rendu conditionnel pour l'apprentissage des applets Wechat.
Geogebra instance clock
时尚的弹出模态登录注册窗口
1.项目环境搭建
随机推荐
Mise en œuvre du rendu de liste et du rendu conditionnel pour l'apprentissage des applets Wechat.
Observer mode
美国电子烟巨头 Juul 遭遇灭顶之灾,所有产品强制下架
微信小程序學習之 實現列錶渲染和條件渲染.
[db2] sql0805n solution and thinking
np.float32()
Leetcode-498: diagonal traversal
How to improve the efficiency of network infrastructure troubleshooting and bid farewell to data blackouts?
414-二叉树的递归遍历
涂鸦智能携多款重磅智能照明解决方案,亮相2022美国国际照明展
线程池的执行流程
学习使用php实现无限极评论和无限极转二级评论解决方案
学习使用phpstripslashe函数去除反斜杠
CVPR 2022 oral | NVIDIA proposes an efficient visual transformer network a-vit with adaptive token. The calculation of unimportant tokens can be stopped in advance
MySQL data advanced
Distributed | how to make "secret calls" with dble
6.套餐管理业务开发
numpy.logical_and()
Programming questions (continuously updated)
5.菜品管理业务开发