【问题标题】:video-js add simple stop buttonvideo-js 添加简单的停止按钮
【发布时间】:2014-04-13 20:50:27
【问题描述】:

video-js 有默认的切换暂停播放按钮,效果很好。对于特定用途,我想要它旁边的一个按钮,它可以暂停、倒带、显示海报图像和大播放按钮。换句话说,一个停止按钮:-)

它应该是一个简单的插件,但我找不到合适的例子..它可能会从

开始
videojs.plugin('stopbutton', function(options) {

    var StopButton = videojs.Button.extend({ ....

谁能指出添加按钮的最简单示例?

【问题讨论】:

    标签: html5-video video.js


    【解决方案1】:

    查看here 以获得您问题的部分答案。

    如果您决定在 videojs 界面顶部构建自己的“停止”按钮,那么序列将类似于(API ref here):

    myPlayer.pause();
    myPlayer.currentTime(0);
    myPlayer.posterImage.show(); // as per OP plans
    myPlayer.bigPlayButton.show(); // as per OP plans
    

    【讨论】:

    • 感谢您的链接。这里有一个关于编写插件的基本介绍github.com/videojs/video.js/blob/master/docs/guides/plugins.md。在最新版本中,我想要的完整命令集是this.pause(); this.currentTime(0); this.posterImage.show(); this.bigPlayButton.show();
    • 不知道 this.posterImage.show() - 确实方便
    猜你喜欢
    • 1970-01-01
    • 2019-05-10
    • 1970-01-01
    • 2016-01-25
    • 1970-01-01
    • 2016-12-22
    • 2015-11-02
    • 1970-01-01
    • 2020-08-04
    相关资源
    最近更新 更多