//实时播放进度 秒数
var currentTime = parseInt(e.detail.currentTime)
console.log("视频播放到第" + currentTime + "秒")//查看正在播放时间,以秒为单位
if(currentTime>300){
let videoContext = wx.createVideoContext('myVideo', this)
console.log(videoContext)
videoContext.pause
念消videoContext.seek("1")
videoContext.pause
wx.showModal({
title: '充值提示',
content: "非会员只能看前五分钟的内容",//提示内容
confirmColor: '#2EA7E0',//确定按钮的颜色
胡高仔 showCancel: false,//不显示取消按钮
success (res) {
if (res.confirm) {
console.log('用户点击确定按钮')
} else if (res.cancel) {
console.log('用户点击取消按钮')
}
}
})
}
裤汪 },
<video bindtimeupdate="timeUpdate" id="myVideo" src="{{kino_mazmuni.info.resource_url}}" initial-time="{{kino_mazmuni.duration_time}}" title="{{kino_mazmuni.info.video_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='https://apqak.alkuyi.com/alkuyi_video_poster.png' objectFit="cover" class="bofangqi">
官网: https://developers.weixin.qq.com/miniprogram/dev/component/video.html相关API:wx.createVideoContext(string id, Object this)
controls:是否显示默认播放控件(播放/暂停按钮、播放进度、时间)
muted:是否静音
show-play-btn:是否显示视频底部控氏隐制栏的播放按钮
show-center-play-btn:是否显示视频中间的播放按钮祥枝
show-mute-btn:是否显示静音按钮
事歼宴厅件:
bindended:当播放到末尾时触发 ended 事件
接口:
wx.createVideoContext(string id, Object this)
https://gitee.com/susuhhhhhh/wxmini_demo
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)