mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-04 02:09:22 +02:00
7 lines
No EOL
2.4 KiB
JavaScript
7 lines
No EOL
2.4 KiB
JavaScript
/**
|
|
* videojs-seek-buttons
|
|
* @version 1.2.4
|
|
* @copyright 2018 Ben Clifford
|
|
* @license Apache-2.0
|
|
*/
|
|
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o(require("video.js")):"function"==typeof define&&define.amd?define(["video.js"],o):e.videojsSeekButtons=o(e.videojs)}(this,function(e){"use strict";var o=function(e,o){if(!(e instanceof o))throw new TypeError("Cannot call a class as a function")},t=function(e,o){if("function"!=typeof o&&null!==o)throw new TypeError("Super expression must either be null or a function, not "+typeof o);e.prototype=Object.create(o&&o.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),o&&(Object.setPrototypeOf?Object.setPrototypeOf(e,o):e.__proto__=o)},n=function(e,o){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!o||"object"!=typeof o&&"function"!=typeof o?e:o},r=(e="default"in e?e.default:e).getComponent("Button"),i=e.getComponent("Component"),s={},c=e.registerPlugin||e.plugin,a=function(e,o){e.addClass("vjs-seek-buttons"),o.forward&&o.forward>0&&(e.controlBar.seekForward=e.controlBar.addChild("seekButton",{direction:"forward",seconds:o.forward}),e.controlBar.el().insertBefore(e.controlBar.seekForward.el(),e.controlBar.el().firstChild.nextSibling)),o.back&&o.back>0&&(e.controlBar.seekBack=e.controlBar.addChild("seekButton",{direction:"back",seconds:o.back}),e.controlBar.el().insertBefore(e.controlBar.seekBack.el(),e.controlBar.el().firstChild.nextSibling))},l=function(o){var t=this;this.ready(function(){a(t,e.mergeOptions(s,o))})},d=function(e){function r(t,i){o(this,r);var s=n(this,e.call(this,t,i));return"forward"===s.options_.direction?s.controlText(s.localize("Seek forward {{seconds}} seconds").replace("{{seconds}}",s.options_.seconds)):"back"===s.options_.direction&&s.controlText(s.localize("Seek back {{seconds}} seconds").replace("{{seconds}}",s.options_.seconds)),s}return t(r,e),r.prototype.buildCSSClass=function(){return"vjs-seek-button skip-"+this.options_.direction+" skip-"+this.options_.seconds+" "+e.prototype.buildCSSClass.call(this)},r.prototype.handleClick=function(){var e=this.player_.currentTime();"forward"===this.options_.direction?this.player_.currentTime(e+this.options_.seconds):"back"===this.options_.direction&&this.player_.currentTime(e-this.options_.seconds)},r}(r);return i.registerComponent("SeekButton",d),c("seekButtons",l),l.VERSION="1.2.4",l}); |