imeUpdate: function (e) {
//实时播放进度 秒数
var currentTime = parseInt(edetailcurrentTime)
consolelog("视频播放到第" + currentTime + "秒")//查看正在播放时间,以秒为单位
if(currentTime>300){
let videoContext = wxcreateVideoContext('myVideo', this);
consolelog(videoContext);
videoContextpause;
videoContextseek("1")
videoContextpause;
wxshowModal({
title: '充值提示',
content: "非会员只能看前五分钟的内容",//提示内容
confirmColor: '#2EA7E0',//确定按钮的颜色
showCancel: false,//不显示取消按钮
success (res) {
if (resconfirm) {
consolelog('用户点击确定按钮')
} else if (rescancel) {
consolelog('用户点击取消按钮')
}
}
})
}
},
<video bindtimeupdate="timeUpdate" id="myVideo" src="{{kino_mazmuniinforesource_url}}" initial-time="{{kino_mazmuniduration_time}}" title="{{kino_mazmuniinfovideo_name}}" object-fit="fill" enable-auto-rotation="true" vslide-gesture="true" enable-play-gesture="true" auto-pause-if-navigate="true" show-screen-lock-button="true" duration="15" enable-auto-rotation="true" duration="true" show-fullscreen-btn show-casting-button="true" autoplay="true" poster='>
1在跳转到H5上面 autoplay 无效。
2网上搜索过各种方法,目前各大厂也需要用户点击方可播放,但是如果加上muted=true 静音播放,在跳转过来变可以自动播放了。
但是需要手动来开启声音。还是不推荐使用,通常处于用户体验,节省流量来考虑的话,一进来还是手动点击才人性化。最好尽量引导手动点击。
3参考>
以上就是关于小程序video的各种事件 如何让小程序视频只播放前五秒全部的内容,包括:小程序video的各种事件 如何让小程序视频只播放前五秒、win10不能播放微信里小程序看一看视频、uniapp微信小程序跳转H5后video自动播放等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)