LocalCDN-Firefox-Chrome-Brave/resources/videojs-seek-buttons/2.2.1/videojs-seek-buttons.min.jsm

3 lines
2.5 KiB
JavaScript

/*! @name videojs-seek-buttons @version 2.2.1 @license Apache-2.0 */
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("video.js")):"function"==typeof define&&define.amd?define(["video.js"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).videojsSeekButtons=t(e.videojs)}(this,(function(e){"use strict";function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=t(e);function r(e,t,o){return e(o={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&o.path)}},o.exports),o.exports}var n=r((function(e){function t(o,r){return e.exports=t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,t(o,r)}e.exports=t,e.exports.default=e.exports,e.exports.__esModule=!0})),s=r((function(e){e.exports=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,n(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0})),i=o.default.getComponent("Button"),a={forwardIndex:1,backIndex:1},c=o.default.registerPlugin||o.default.plugin,d=function(e){var t=this;this.ready((function(){!function(e,t){e.addClass("vjs-seek-buttons"),t.forward&&t.forward>0&&(e.controlBar.seekForward=e.controlBar.addChild("seekButton",{direction:"forward",seconds:t.forward},t.forwardIndex)),t.back&&t.back>0&&(e.controlBar.seekBack=e.controlBar.addChild("seekButton",{direction:"back",seconds:t.back},t.backIndex))}(t,o.default.mergeOptions(a,e))}))};d.VERSION="2.2.1";var u=function(e){function t(t,o){var r;return"forward"===(r=e.call(this,t,o)||this).options_.direction?r.controlText(r.localize("Seek forward {{seconds}} seconds").replace("{{seconds}}",r.options_.seconds)):"back"===r.options_.direction&&r.controlText(r.localize("Seek back {{seconds}} seconds").replace("{{seconds}}",r.options_.seconds)),r}s(t,e);var o=t.prototype;return o.buildCSSClass=function(){return"vjs-seek-button skip-"+this.options_.direction+" skip-"+this.options_.seconds+" "+e.prototype.buildCSSClass.call(this)},o.handleClick=function(){var e=this.player_.currentTime();if("forward"===this.options_.direction){var t=this.player_.duration();this.player_.liveTracker&&this.player_.liveTracker.isLive()&&(t=this.player_.liveTracker.seekableEnd()),this.player_.currentTime(Math.min(e+this.options_.seconds,t))}else"back"===this.options_.direction&&this.player_.currentTime(Math.max(0,e-this.options_.seconds))},t}(i);return o.default.registerComponent("SeekButton",u),c("seekButtons",d),d}));