Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如何得到用户点播完毕或点播进度? #18

Open
ziqiming opened this issue Jun 9, 2021 · 3 comments
Open

如何得到用户点播完毕或点播进度? #18

ziqiming opened this issue Jun 9, 2021 · 3 comments

Comments

@ziqiming
Copy link

ziqiming commented Jun 9, 2021

怎么调用呢?

@avajayam
Copy link
Contributor

怎么调用呢?

目前插件没有对外暴露媒体方法,需要自己注册监听,
点播结束mediaDom.addEventListener('ended', function(e) {}

点播进度可以通过currentTime属性获取,mediaDom.currentTime

@ziqiming
Copy link
Author

不能做成这样的调用方式吗?我认为这样更容易使用

zymedia('video',{
beforePlay:function(){
//点击播放
},
successPlay:function(){
//播放完毕
},
loadingPlay:function(){
//播放中,每N秒返回一次
}
})

还有,$('video').attr("src" , "1.mp4") 播放完毕后改变了新的播放地址怎么让他执行播放?

@avajayam
Copy link
Contributor

zymedia

不能做成这样的调用方式吗?我认为这样更容易使用

zymedia('video',{
beforePlay:function(){
//点击播放
},
successPlay:function(){
//播放完毕
},
loadingPlay:function(){
//播放中,每N秒返回一次
}
})

还有,$('video').attr("src" , "1.mp4") 播放完毕后改变了新的播放地址怎么让他执行播放?

通过参数传入回调适合页面只有一个视频或多个视频回调是一样的场景,如果多个视频回调不一样,写法会比较复杂,这边需要再评估下。

播放结束后改变播放源,可以主动执行下播放事件,比如$('video').trigger('play')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants