3 lines
1.7 KiB
JavaScript
3 lines
1.7 KiB
JavaScript
/*! @name videojs-seek-buttons @version 1.6.0 @license Apache-2.0 */
|
|
!function(o,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("video.js")):"function"==typeof define&&define.amd?define(["video.js"],e):(o=o||self).videojsSeekButtons=e(o.videojs)}(this,function(o){"use strict";var e=(o=o&&o.hasOwnProperty("default")?o.default:o).getComponent("Button"),t={forwardIndex:1,backIndex:1},n=o.registerPlugin||o.plugin,r=function(e){var n=this;this.ready(function(){!function(o,e){o.addClass("vjs-seek-buttons"),e.forward&&e.forward>0&&(o.controlBar.seekForward=o.controlBar.addChild("seekButton",{direction:"forward",seconds:e.forward},e.forwardIndex)),e.back&&e.back>0&&(o.controlBar.seekBack=o.controlBar.addChild("seekButton",{direction:"back",seconds:e.back},e.backIndex))}(n,o.mergeOptions(t,e))})};r.VERSION="1.6.0";var s=function(o){var e,t;function n(e,t){var n;return"forward"===(n=o.call(this,e,t)||this).options_.direction?n.controlText(n.localize("Seek forward {{seconds}} seconds").replace("{{seconds}}",n.options_.seconds)):"back"===n.options_.direction&&n.controlText(n.localize("Seek back {{seconds}} seconds").replace("{{seconds}}",n.options_.seconds)),n}t=o,(e=n).prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t;var r=n.prototype;return r.buildCSSClass=function(){return"vjs-seek-button skip-"+this.options_.direction+" skip-"+this.options_.seconds+" "+o.prototype.buildCSSClass.call(this)},r.handleClick=function(){var o=this.player_.currentTime();"forward"===this.options_.direction?this.player_.currentTime(o+this.options_.seconds):"back"===this.options_.direction&&this.player_.currentTime(o-this.options_.seconds)},n}(e);return o.registerComponent("SeekButton",s),n("seekButtons",r),r});
|