diff --git a/media/player/videojs/amd/build/videojs-ogvjs-lazy.min.js b/media/player/videojs/amd/build/videojs-ogvjs-lazy.min.js index 05e6c0e20c6..4cae52dd6a0 100644 --- a/media/player/videojs/amd/build/videojs-ogvjs-lazy.min.js +++ b/media/player/videojs/amd/build/videojs-ogvjs-lazy.min.js @@ -1,10 +1,9 @@ /** * videojs-ogvjs - * @version 0.2.1 + * @version 1.0.0 * @copyright 2023 Huong Nguyen * @license MIT */ -/*! @name videojs-ogvjs @version 0.2.1 @license MIT */ -var global,factory;global=window,factory=function(videojs,ogvBase){function _interopDefaultLegacy(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var videojs__default=_interopDefaultLegacy(videojs),OGVCompat__default=_interopDefaultLegacy(ogvBase.OGVCompat),OGVLoader__default=_interopDefaultLegacy(ogvBase.OGVLoader),OGVPlayer__default=_interopDefaultLegacy(ogvBase.OGVPlayer);function createCommonjsModule(fn,basedir,module){return fn(module={path:basedir,exports:{},require:function(path,base){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==base&&module.path)}},module.exports),module.exports}var setPrototypeOf=createCommonjsModule((function(module){function _setPrototypeOf(o,p){return module.exports=_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,p){return o.__proto__=p,o},module.exports.__esModule=!0,module.exports.default=module.exports,_setPrototypeOf(o,p)}module.exports=_setPrototypeOf,module.exports.__esModule=!0,module.exports.default=module.exports})),inheritsLoose=createCommonjsModule((function(module){module.exports=function(subClass,superClass){subClass.prototype=Object.create(superClass.prototype),subClass.prototype.constructor=subClass,setPrototypeOf(subClass,superClass)},module.exports.__esModule=!0,module.exports.default=module.exports})),Tech=videojs__default.default.getComponent("Tech"),getDeviceOS=function(){var ua=navigator.userAgent;return/android/i.test(ua)?"Android":/iPad|iPhone|iPod/.test(ua)?"iPhoneOS":"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1?"iPadOS":"Other"},OgvJS=function(_Tech){function OgvJS(options,ready){var _this;return(_this=_Tech.call(this,options,ready)||this).el_.src=options.source.src,OgvJS.setIfAvailable(_this.el_,"autoplay",options.autoplay),OgvJS.setIfAvailable(_this.el_,"loop",options.loop),OgvJS.setIfAvailable(_this.el_,"poster",options.poster),OgvJS.setIfAvailable(_this.el_,"preload",options.preload),_this.on("loadedmetadata",(function(){if("iPhoneOS"===getDeviceOS()){var canvas=_this.el_.getElementsByTagName("canvas")[0];canvas.style.removeProperty("width"),canvas.style.removeProperty("margin")}})),_this.triggerReady(),_this}inheritsLoose(OgvJS,_Tech);var _proto=OgvJS.prototype;return _proto.createEl=function(){var options=this.options_;if(!options.base)throw new Error("Please specify the base for the ogv.js library");OGVLoader__default.default.base=options.base;var el=new OGVPlayer__default.default(options);return el.className+=" vjs-tech",options.tag=el,el},_proto.play=function(){this.el_.play()},_proto.playbackRate=function(){return this.el_.playbackRate||1},_proto.setPlaybackRate=function(val){this.el_.hasOwnProperty("playbackRate")&&(this.el_.playbackRate=val)},_proto.played=function(){return this.el_.played},_proto.pause=function(){this.el_.pause()},_proto.paused=function(){return this.el_.paused},_proto.currentTime=function(){return this.el_.currentTime},_proto.setCurrentTime=function(seconds){try{this.el_.currentTime=seconds}catch(e){videojs__default.default.log(e,"Media is not ready. (Video.JS)")}},_proto.duration=function(){return this.el_.duration&&this.el_.duration!==1/0?this.el_.duration:0},_proto.buffered=function(){return this.el_.buffered},_proto.volume=function(){return this.el_.hasOwnProperty("volume")?this.el_.volume:1},_proto.setVolume=function(percentAsDecimal){"iPhoneOS"!==getDeviceOS()&&"iPadOS"!==getDeviceOS()&&this.el_.hasOwnProperty("volume")&&(this.el_.volume=percentAsDecimal)},_proto.muted=function(){return this.el_.muted},_proto.setMuted=function(muted){this.el_.muted=!!muted},_proto.defaultMuted=function(){return this.el_.defaultMuted||!1},_proto.width=function(){return this.el_.offsetWidth},_proto.height=function(){return this.el_.offsetHeight},_proto.videoWidth=function(){return this.el_.videoWidth},_proto.videoHeight=function(){return this.el_.videoHeight},_proto.src=function(_src){if(void 0===_src)return this.el_.src;this.el_.src=_src},_proto.load=function(){this.el_.load()},_proto.currentSrc=function(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc},_proto.poster=function(){return this.el_.poster},_proto.setPoster=function(url){this.el_.poster=url},_proto.preload=function(){return this.el_.preload||"none"},_proto.setPreload=function(val){this.el_.hasOwnProperty("preload")&&(this.el_.preload=val)},_proto.autoplay=function(){return this.el_.autoplay||!1},_proto.setAutoplay=function(val){this.el_.hasOwnProperty("autoplay")&&(this.el_.autoplay=!!val)},_proto.controls=function(){return this.el_.controls||!1},_proto.setControls=function(val){this.el_.hasOwnProperty("controls")&&(this.el_.controls=!!val)},_proto.loop=function(){return this.el_.loop||!1},_proto.setLoop=function(val){this.el_.hasOwnProperty("loop")&&(this.el_.loop=!!val)},_proto.seekable=function(){return this.el_.seekable},_proto.seeking=function(){return this.el_.seeking},_proto.ended=function(){return this.el_.ended},_proto.networkState=function(){return this.el_.networkState},_proto.readyState=function(){return this.el_.readyState},_proto.supportsFullScreen=function(){return!1},_proto.error=function(){return this.el_.error},OgvJS}(Tech);return OgvJS.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"],OgvJS.setIfAvailable=function(el,name,value){el.hasOwnProperty(name)&&(el[name]=value)},OgvJS.isSupported=function(){return OGVCompat__default.default.supported("OGVPlayer")},OgvJS.canPlayType=function(type){return-1!==type.indexOf("/ogg")||type.indexOf("/webm")?"maybe":""},OgvJS.canPlaySource=function(srcObj){return OgvJS.canPlayType(srcObj.type)},OgvJS.canControlVolume=function(){return"iPhoneOS"!==getDeviceOS()&&"iPadOS"!==getDeviceOS()&&(new OGVPlayer__default.default).hasOwnProperty("volume")},OgvJS.canMuteVolume=function(){return!0},OgvJS.canControlPlaybackRate=function(){return!0},OgvJS.supportsNativeTextTracks=function(){return!1},OgvJS.supportsFullscreenResize=function(){return!0},OgvJS.supportsProgressEvents=function(){return!0},OgvJS.supportsTimeupdateEvents=function(){return!0},[["featuresVolumeControl","canControlVolume"],["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresFullscreenResize","supportsFullscreenResize"],["featuresProgressEvents","supportsProgressEvents"],["featuresTimeupdateEvents","supportsTimeupdateEvents"]].forEach((function(_ref){var key=_ref[0],fn=_ref[1];!function(obj,key,getValue,setter){void 0===setter&&(setter=!0);var set=function(value){Object.defineProperty(obj,key,{value:value,enumerable:!0,writable:!0})},options={configurable:!0,enumerable:!0,get:function(){var value=getValue();return set(value),value}};setter&&(options.set=set),Object.defineProperty(obj,key,options)}(OgvJS.prototype,key,(function(){return OgvJS[fn]()}),!0)})),Tech.registerTech("OgvJS",OgvJS),OgvJS},"object"==typeof exports&&"undefined"!=typeof module?module.exports=factory(require("video.js"),require("OGVCompat"),require("OGVLoader"),require("OGVPlayer")):"function"==typeof define&&define.amd?define("media_videojs/videojs-ogvjs-lazy",["media_videojs/video-lazy","./local/ogv/ogv"],factory):(global="undefined"!=typeof globalThis?globalThis:global||self).videojsOgvjs=factory(global.videojs,global.OGVCompat,global.OGVLoader,global.OGVPlayer); +define("media_videojs/videojs-ogvjs-lazy",["media_videojs/video-lazy","./local/ogv/ogv"],(function(videojs,ogv){const OGVCompat=ogv.OGVCompat,OGVLoader=ogv.OGVLoader,OGVPlayer=ogv.OGVPlayer,Tech=videojs.getComponent("Tech"),getDeviceOS=()=>{const ua=navigator.userAgent;return/android/i.test(ua)?"Android":/iPad|iPhone|iPod/.test(ua)?"iPhoneOS":"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1?"iPadOS":"Other"};class OgvJS extends Tech{constructor(options,ready){super(options,ready),this.el_.src=options.source.src,OgvJS.setIfAvailable(this.el_,"autoplay",options.autoplay),OgvJS.setIfAvailable(this.el_,"loop",options.loop),OgvJS.setIfAvailable(this.el_,"poster",options.poster),OgvJS.setIfAvailable(this.el_,"preload",options.preload),this.on("loadedmetadata",(()=>{if("iPhoneOS"===getDeviceOS()){const canvas=this.el_.getElementsByTagName("canvas")[0];canvas.style.removeProperty("width"),canvas.style.removeProperty("margin")}})),this.triggerReady()}createEl(){const options=this.options_;if(!options.base)throw new Error("Please specify the base for the ogv.js library");OGVLoader.base=options.base;const el=new OGVPlayer(options);return el.className+=" vjs-tech",options.tag=el,el}play(){this.el_.play()}playbackRate(){return this.el_.playbackRate||1}setPlaybackRate(val){this.el_.hasOwnProperty("playbackRate")&&(this.el_.playbackRate=val)}played(){return this.el_.played}pause(){this.el_.pause()}paused(){return this.el_.paused}currentTime(){return this.el_.currentTime}setCurrentTime(seconds){try{this.el_.currentTime=seconds}catch(e){videojs.log(e,"Media is not ready. (Video.JS)")}}duration(){return this.el_.duration&&this.el_.duration!==1/0?this.el_.duration:0}buffered(){return this.el_.buffered}volume(){return this.el_.hasOwnProperty("volume")?this.el_.volume:1}setVolume(percentAsDecimal){"iPhoneOS"!==getDeviceOS()&&"iPadOS"!==getDeviceOS()&&this.el_.hasOwnProperty("volume")&&(this.el_.volume=percentAsDecimal)}muted(){return this.el_.muted}setMuted(muted){this.el_.muted=!!muted}defaultMuted(){return this.el_.defaultMuted||!1}width(){return this.el_.offsetWidth}height(){return this.el_.offsetHeight}videoWidth(){return this.el_.videoWidth}videoHeight(){return this.el_.videoHeight}src(src){if(void 0===src)return this.el_.src;this.el_.src=src}load(){this.el_.load()}currentSrc(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc}poster(){return this.el_.poster}setPoster(url){this.el_.poster=url}preload(){return this.el_.preload||"none"}setPreload(val){this.el_.hasOwnProperty("preload")&&(this.el_.preload=val)}autoplay(){return this.el_.autoplay||!1}setAutoplay(val){this.el_.hasOwnProperty("autoplay")&&(this.el_.autoplay=!!val)}controls(){return this.el_.controls||!1}setControls(val){this.el_.hasOwnProperty("controls")&&(this.el_.controls=!!val)}loop(){return this.el_.loop||!1}setLoop(val){this.el_.hasOwnProperty("loop")&&(this.el_.loop=!!val)}seekable(){return this.el_.seekable}seeking(){return this.el_.seeking}ended(){return this.el_.ended}networkState(){return this.el_.networkState}readyState(){return this.el_.readyState}supportsFullScreen(){return!1}error(){return this.el_.error}}return OgvJS.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"],OgvJS.setIfAvailable=(el,name,value)=>{el.hasOwnProperty(name)&&(el[name]=value)},OgvJS.isSupported=()=>OGVCompat.supported("OGVPlayer"),OgvJS.canPlayType=type=>-1!==type.indexOf("/ogg")||type.indexOf("/webm")?"maybe":"",OgvJS.canPlaySource=srcObj=>OgvJS.canPlayType(srcObj.type),OgvJS.canControlVolume=()=>{if("iPhoneOS"===getDeviceOS()||"iPadOS"===getDeviceOS())return!1;return(new OGVPlayer).hasOwnProperty("volume")},OgvJS.canMuteVolume=()=>!0,OgvJS.canControlPlaybackRate=()=>!0,OgvJS.supportsNativeTextTracks=()=>!1,OgvJS.supportsFullscreenResize=()=>!0,OgvJS.supportsProgressEvents=()=>!0,OgvJS.supportsTimeupdateEvents=()=>!0,[["featuresVolumeControl","canControlVolume"],["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresFullscreenResize","supportsFullscreenResize"],["featuresProgressEvents","supportsProgressEvents"],["featuresTimeupdateEvents","supportsTimeupdateEvents"]].forEach((_ref=>{let[key,fn]=_ref;!function(obj,key,getValue){const set=value=>{Object.defineProperty(obj,key,{value:value,enumerable:!0,writable:!0})},options={configurable:!0,enumerable:!0,get(){const value=getValue();return set(value),value}};(!(arguments.length>3&&void 0!==arguments[3])||arguments[3])&&(options.set=set),Object.defineProperty(obj,key,options)}(OgvJS.prototype,key,(()=>OgvJS[fn]()),!0)})),Tech.registerTech("OgvJS",OgvJS),OgvJS})); //# sourceMappingURL=videojs-ogvjs-lazy.min.js.map \ No newline at end of file diff --git a/media/player/videojs/amd/build/videojs-ogvjs-lazy.min.js.map b/media/player/videojs/amd/build/videojs-ogvjs-lazy.min.js.map index 925ad9049e0..72194ac852e 100644 --- a/media/player/videojs/amd/build/videojs-ogvjs-lazy.min.js.map +++ b/media/player/videojs/amd/build/videojs-ogvjs-lazy.min.js.map @@ -1 +1 @@ -{"version":3,"file":"videojs-ogvjs-lazy.min.js","sources":["../src/videojs-ogvjs-lazy.js"],"sourcesContent":["/**\n * videojs-ogvjs\n * @version 0.2.1\n * @copyright 2023 Huong Nguyen \n * @license MIT\n */\n/*! @name videojs-ogvjs @version 0.2.1 @license MIT */\n(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('video.js'), require('OGVCompat'), require('OGVLoader'), require('OGVPlayer')) :\n\t\ttypeof define === 'function' && define.amd ? define(['media_videojs/video-lazy', './local/ogv/ogv'], factory) :\n\t\t\t(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.videojsOgvjs = factory(global.videojs, global.OGVCompat, global.OGVLoader, global.OGVPlayer));\n}(this, (function (videojs, ogvBase) { 'use strict';\n\n\tfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\n\tvar videojs__default = /*#__PURE__*/_interopDefaultLegacy(videojs);\n\tvar OGVCompat__default = /*#__PURE__*/_interopDefaultLegacy(ogvBase.OGVCompat);\n\tvar OGVLoader__default = /*#__PURE__*/_interopDefaultLegacy(ogvBase.OGVLoader);\n\tvar OGVPlayer__default = /*#__PURE__*/_interopDefaultLegacy(ogvBase.OGVPlayer);\n\n\tfunction createCommonjsModule(fn, basedir, module) {\n\t\treturn module = {\n\t\t\tpath: basedir,\n\t\t\texports: {},\n\t\t\trequire: function (path, base) {\n\t\t\t\treturn commonjsRequire(path, (base === undefined || base === null) ? module.path : base);\n\t\t\t}\n\t\t}, fn(module, module.exports), module.exports;\n\t}\n\n\tfunction commonjsRequire () {\n\t\tthrow new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');\n\t}\n\n\tvar setPrototypeOf = createCommonjsModule(function (module) {\n\t\tfunction _setPrototypeOf(o, p) {\n\t\t\tmodule.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n\t\t\t\to.__proto__ = p;\n\t\t\t\treturn o;\n\t\t\t}, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\t\t\treturn _setPrototypeOf(o, p);\n\t\t}\n\n\t\tmodule.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\t});\n\n\tvar inheritsLoose = createCommonjsModule(function (module) {\n\t\tfunction _inheritsLoose(subClass, superClass) {\n\t\t\tsubClass.prototype = Object.create(superClass.prototype);\n\t\t\tsubClass.prototype.constructor = subClass;\n\t\t\tsetPrototypeOf(subClass, superClass);\n\t\t}\n\n\t\tmodule.exports = _inheritsLoose, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\t});\n\n\tvar Tech = videojs__default['default'].getComponent('Tech');\n\tvar androidOS = 'Android';\n\tvar iPhoneOS = 'iPhoneOS';\n\tvar iPadOS = 'iPadOS';\n\tvar otherOS = 'Other';\n\t/**\n\t * Object.defineProperty but \"lazy\", which means that the value is only set after\n\t * it retrieved the first time, rather than being set right away.\n\t *\n\t * @param {Object} obj the object to set the property on.\n\t * @param {string} key the key for the property to set.\n\t * @param {Function} getValue the function used to get the value when it is needed.\n\t * @param {boolean} setter whether a setter should be allowed or not.\n\t */\n\n\tvar defineLazyProperty = function defineLazyProperty(obj, key, getValue, setter) {\n\t\tif (setter === void 0) {\n\t\t\tsetter = true;\n\t\t}\n\n\t\tvar set = function set(value) {\n\t\t\tObject.defineProperty(obj, key, {\n\t\t\t\tvalue: value,\n\t\t\t\tenumerable: true,\n\t\t\t\twritable: true\n\t\t\t});\n\t\t};\n\n\t\tvar options = {\n\t\t\tconfigurable: true,\n\t\t\tenumerable: true,\n\t\t\tget: function get() {\n\t\t\t\tvar value = getValue();\n\t\t\t\tset(value);\n\t\t\t\treturn value;\n\t\t\t}\n\t\t};\n\n\t\tif (setter) {\n\t\t\toptions.set = set;\n\t\t}\n\n\t\treturn Object.defineProperty(obj, key, options);\n\t};\n\t/**\n\t * Get the device's OS.\n\t *\n\t * @return {string} Device's OS.\n\t */\n\n\n\tvar getDeviceOS = function getDeviceOS() {\n\t\t/* global navigator */\n\t\tvar ua = navigator.userAgent;\n\n\t\tif (/android/i.test(ua)) {\n\t\t\treturn androidOS;\n\t\t} else if (/iPad|iPhone|iPod/.test(ua)) {\n\t\t\treturn iPhoneOS;\n\t\t} else if (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1) {\n\t\t\treturn iPadOS;\n\t\t}\n\n\t\treturn otherOS;\n\t};\n\t/**\n\t * OgvJS Media Controller - Wrapper for ogv.js Media API\n\t *\n\t * @mixes Tech~SourceHandlerAdditions\n\t * @extends Tech\n\t */\n\n\n\tvar OgvJS = /*#__PURE__*/function (_Tech) {\n\t\tinheritsLoose(OgvJS, _Tech);\n\n\t\t/**\n\t\t * Create an instance of this Tech.\n\t\t *\n\t\t * @param {Object} [options] The key/value store of player options.\n\t\t * @param {Component~ReadyCallback} ready Callback function to call when the `OgvJS` Tech is ready.\n\t\t */\n\t\tfunction OgvJS(options, ready) {\n\t\t\tvar _this;\n\n\t\t\t_this = _Tech.call(this, options, ready) || this;\n\t\t\t_this.el_.src = options.source.src;\n\t\t\tOgvJS.setIfAvailable(_this.el_, 'autoplay', options.autoplay);\n\t\t\tOgvJS.setIfAvailable(_this.el_, 'loop', options.loop);\n\t\t\tOgvJS.setIfAvailable(_this.el_, 'poster', options.poster);\n\t\t\tOgvJS.setIfAvailable(_this.el_, 'preload', options.preload);\n\n\t\t\t_this.on('loadedmetadata', function () {\n\t\t\t\tif (getDeviceOS() === iPhoneOS) {\n\t\t\t\t\t// iPhoneOS add some inline styles to the canvas, we need to remove it.\n\t\t\t\t\tvar canvas = _this.el_.getElementsByTagName('canvas')[0];\n\n\t\t\t\t\tcanvas.style.removeProperty('width');\n\t\t\t\t\tcanvas.style.removeProperty('margin');\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t_this.triggerReady();\n\n\t\t\treturn _this;\n\t\t}\n\t\t/**\n\t\t * Create the 'OgvJS' Tech's DOM element.\n\t\t *\n\t\t * @return {Element} The element that gets created.\n\t\t */\n\n\n\t\tvar _proto = OgvJS.prototype;\n\n\t\t_proto.createEl = function createEl() {\n\t\t\tvar options = this.options_;\n\n\t\t\tif (options.base) {\n\t\t\t\tOGVLoader__default['default'].base = options.base;\n\t\t\t} else {\n\t\t\t\tthrow new Error('Please specify the base for the ogv.js library');\n\t\t\t}\n\n\t\t\tvar el = new OGVPlayer__default['default'](options);\n\t\t\tel.className += ' vjs-tech';\n\t\t\toptions.tag = el;\n\t\t\treturn el;\n\t\t}\n\t\t/**\n\t\t * Start playback\n\t\t *\n\t\t * @method play\n\t\t */\n\t\t;\n\n\t\t_proto.play = function play() {\n\t\t\tthis.el_.play();\n\t\t}\n\t\t/**\n\t\t * Get the current playback speed.\n\t\t *\n\t\t * @return {number}\n\t\t * @method playbackRate\n\t\t */\n\t\t;\n\n\t\t_proto.playbackRate = function playbackRate() {\n\t\t\treturn this.el_.playbackRate || 1;\n\t\t}\n\t\t/**\n\t\t * Set the playback speed.\n\t\t *\n\t\t * @param {number} val Speed for the player to play.\n\t\t * @method setPlaybackRate\n\t\t */\n\t\t;\n\n\t\t_proto.setPlaybackRate = function setPlaybackRate(val) {\n\t\t\tif (this.el_.hasOwnProperty('playbackRate')) {\n\t\t\t\tthis.el_.playbackRate = val;\n\t\t\t}\n\t\t}\n\t\t/**\n\t\t * Returns a TimeRanges object that represents the ranges of the media resource that the user agent has played.\n\t\t *\n\t\t * @return {TimeRangeObject} the range of points on the media timeline that has been reached through normal playback\n\t\t */\n\t\t;\n\n\t\t_proto.played = function played() {\n\t\t\treturn this.el_.played;\n\t\t}\n\t\t/**\n\t\t * Pause playback\n\t\t *\n\t\t * @method pause\n\t\t */\n\t\t;\n\n\t\t_proto.pause = function pause() {\n\t\t\tthis.el_.pause();\n\t\t}\n\t\t/**\n\t\t * Is the player paused or not.\n\t\t *\n\t\t * @return {boolean}\n\t\t * @method paused\n\t\t */\n\t\t;\n\n\t\t_proto.paused = function paused() {\n\t\t\treturn this.el_.paused;\n\t\t}\n\t\t/**\n\t\t * Get current playing time.\n\t\t *\n\t\t * @return {number}\n\t\t * @method currentTime\n\t\t */\n\t\t;\n\n\t\t_proto.currentTime = function currentTime() {\n\t\t\treturn this.el_.currentTime;\n\t\t}\n\t\t/**\n\t\t * Set current playing time.\n\t\t *\n\t\t * @param {number} seconds Current time of audio/video.\n\t\t * @method setCurrentTime\n\t\t */\n\t\t;\n\n\t\t_proto.setCurrentTime = function setCurrentTime(seconds) {\n\t\t\ttry {\n\t\t\t\tthis.el_.currentTime = seconds;\n\t\t\t} catch (e) {\n\t\t\t\tvideojs__default['default'].log(e, 'Media is not ready. (Video.JS)');\n\t\t\t}\n\t\t}\n\t\t/**\n\t\t * Get media's duration.\n\t\t *\n\t\t * @return {number}\n\t\t * @method duration\n\t\t */\n\t\t;\n\n\t\t_proto.duration = function duration() {\n\t\t\tif (this.el_.duration && this.el_.duration !== Infinity) {\n\t\t\t\treturn this.el_.duration;\n\t\t\t}\n\n\t\t\treturn 0;\n\t\t}\n\t\t/**\n\t\t * Get a TimeRange object that represents the intersection\n\t\t * of the time ranges for which the user agent has all\n\t\t * relevant media.\n\t\t *\n\t\t * @return {TimeRangeObject}\n\t\t * @method buffered\n\t\t */\n\t\t;\n\n\t\t_proto.buffered = function buffered() {\n\t\t\treturn this.el_.buffered;\n\t\t}\n\t\t/**\n\t\t * Get current volume level.\n\t\t *\n\t\t * @return {number}\n\t\t * @method volume\n\t\t */\n\t\t;\n\n\t\t_proto.volume = function volume() {\n\t\t\treturn this.el_.hasOwnProperty('volume') ? this.el_.volume : 1;\n\t\t}\n\t\t/**\n\t\t * Set current playing volume level.\n\t\t *\n\t\t * @param {number} percentAsDecimal Volume percent as a decimal.\n\t\t * @method setVolume\n\t\t */\n\t\t;\n\n\t\t_proto.setVolume = function setVolume(percentAsDecimal) {\n\t\t\t// Apple does not allow iOS and iPadOS devices to set the volume on UI.\n\t\t\tif (getDeviceOS() !== iPhoneOS && getDeviceOS() !== iPadOS && this.el_.hasOwnProperty('volume')) {\n\t\t\t\tthis.el_.volume = percentAsDecimal;\n\t\t\t}\n\t\t}\n\t\t/**\n\t\t * Is the player muted or not.\n\t\t *\n\t\t * @return {boolean}\n\t\t * @method muted\n\t\t */\n\t\t;\n\n\t\t_proto.muted = function muted() {\n\t\t\treturn this.el_.muted;\n\t\t}\n\t\t/**\n\t\t * Mute the player.\n\t\t *\n\t\t * @param {boolean} muted True to mute the player.\n\t\t */\n\t\t;\n\n\t\t_proto.setMuted = function setMuted(muted) {\n\t\t\tthis.el_.muted = !!muted;\n\t\t}\n\t\t/**\n\t\t * Is the player muted by default or not.\n\t\t *\n\t\t * @return {boolean}\n\t\t * @method defaultMuted\n\t\t */\n\t\t;\n\n\t\t_proto.defaultMuted = function defaultMuted() {\n\t\t\treturn this.el_.defaultMuted || false;\n\t\t}\n\t\t/**\n\t\t * Get the player width.\n\t\t *\n\t\t * @return {number}\n\t\t * @method width\n\t\t */\n\t\t;\n\n\t\t_proto.width = function width() {\n\t\t\treturn this.el_.offsetWidth;\n\t\t}\n\t\t/**\n\t\t * Get the player height.\n\t\t *\n\t\t * @return {number}\n\t\t * @method height\n\t\t */\n\t\t;\n\n\t\t_proto.height = function height() {\n\t\t\treturn this.el_.offsetHeight;\n\t\t}\n\t\t/**\n\t\t * Get the video width.\n\t\t *\n\t\t * @return {number}\n\t\t * @method videoWidth\n\t\t */\n\t\t;\n\n\t\t_proto.videoWidth = function videoWidth() {\n\t\t\treturn this.el_.videoWidth;\n\t\t}\n\t\t/**\n\t\t * Get the video height.\n\t\t *\n\t\t * @return {number}\n\t\t * @method videoHeight\n\t\t */\n\t\t;\n\n\t\t_proto.videoHeight = function videoHeight() {\n\t\t\treturn this.el_.videoHeight;\n\t\t}\n\t\t/**\n\t\t * Get/set media source.\n\t\t *\n\t\t * @param {Object=} src Source object\n\t\t * @return {Object}\n\t\t * @method src\n\t\t */\n\t\t;\n\n\t\t_proto.src = function src(_src) {\n\t\t\tif (typeof _src === 'undefined') {\n\t\t\t\treturn this.el_.src;\n\t\t\t}\n\n\t\t\tthis.el_.src = _src;\n\t\t}\n\t\t/**\n\t\t * Load the media into the player.\n\t\t *\n\t\t * @method load\n\t\t */\n\t\t;\n\n\t\t_proto.load = function load() {\n\t\t\tthis.el_.load();\n\t\t}\n\t\t/**\n\t\t * Get current media source.\n\t\t *\n\t\t * @return {Object}\n\t\t * @method currentSrc\n\t\t */\n\t\t;\n\n\t\t_proto.currentSrc = function currentSrc() {\n\t\t\tif (this.currentSource_) {\n\t\t\t\treturn this.currentSource_.src;\n\t\t\t}\n\n\t\t\treturn this.el_.currentSrc;\n\t\t}\n\t\t/**\n\t\t * Get media poster URL.\n\t\t *\n\t\t * @return {string}\n\t\t * @method poster\n\t\t */\n\t\t;\n\n\t\t_proto.poster = function poster() {\n\t\t\treturn this.el_.poster;\n\t\t}\n\t\t/**\n\t\t * Set media poster URL.\n\t\t *\n\t\t * @param {string} url the poster image's url.\n\t\t * @method\n\t\t */\n\t\t;\n\n\t\t_proto.setPoster = function setPoster(url) {\n\t\t\tthis.el_.poster = url;\n\t\t}\n\t\t/**\n\t\t * Is the media preloaded or not.\n\t\t *\n\t\t * @return {string}\n\t\t * @method preload\n\t\t */\n\t\t;\n\n\t\t_proto.preload = function preload() {\n\t\t\treturn this.el_.preload || 'none';\n\t\t}\n\t\t/**\n\t\t * Set the media preload method.\n\t\t *\n\t\t * @param {string} val Value for preload attribute.\n\t\t * @method setPreload\n\t\t */\n\t\t;\n\n\t\t_proto.setPreload = function setPreload(val) {\n\t\t\tif (this.el_.hasOwnProperty('preload')) {\n\t\t\t\tthis.el_.preload = val;\n\t\t\t}\n\t\t}\n\t\t/**\n\t\t * Is the media auto-played or not.\n\t\t *\n\t\t * @return {boolean}\n\t\t * @method autoplay\n\t\t */\n\t\t;\n\n\t\t_proto.autoplay = function autoplay() {\n\t\t\treturn this.el_.autoplay || false;\n\t\t}\n\t\t/**\n\t\t * Set media autoplay method.\n\t\t *\n\t\t * @param {boolean} val Value for autoplay attribute.\n\t\t * @method setAutoplay\n\t\t */\n\t\t;\n\n\t\t_proto.setAutoplay = function setAutoplay(val) {\n\t\t\tif (this.el_.hasOwnProperty('autoplay')) {\n\t\t\t\tthis.el_.autoplay = !!val;\n\t\t\t}\n\t\t}\n\t\t/**\n\t\t * Does the media has controls or not.\n\t\t *\n\t\t * @return {boolean}\n\t\t * @method controls\n\t\t */\n\t\t;\n\n\t\t_proto.controls = function controls() {\n\t\t\treturn this.el_.controls || false;\n\t\t}\n\t\t/**\n\t\t * Set the media controls method.\n\t\t *\n\t\t * @param {boolean} val Value for controls attribute.\n\t\t * @method setControls\n\t\t */\n\t\t;\n\n\t\t_proto.setControls = function setControls(val) {\n\t\t\tif (this.el_.hasOwnProperty('controls')) {\n\t\t\t\tthis.el_.controls = !!val;\n\t\t\t}\n\t\t}\n\t\t/**\n\t\t * Is the media looped or not.\n\t\t *\n\t\t * @return {boolean}\n\t\t * @method loop\n\t\t */\n\t\t;\n\n\t\t_proto.loop = function loop() {\n\t\t\treturn this.el_.loop || false;\n\t\t}\n\t\t/**\n\t\t * Set the media loop method.\n\t\t *\n\t\t * @param {boolean} val Value for loop attribute.\n\t\t * @method setLoop\n\t\t */\n\t\t;\n\n\t\t_proto.setLoop = function setLoop(val) {\n\t\t\tif (this.el_.hasOwnProperty('loop')) {\n\t\t\t\tthis.el_.loop = !!val;\n\t\t\t}\n\t\t}\n\t\t/**\n\t\t * Get a TimeRanges object that represents the\n\t\t * ranges of the media resource to which it is possible\n\t\t * for the user agent to seek.\n\t\t *\n\t\t * @return {TimeRangeObject}\n\t\t * @method seekable\n\t\t */\n\t\t;\n\n\t\t_proto.seekable = function seekable() {\n\t\t\treturn this.el_.seekable;\n\t\t}\n\t\t/**\n\t\t * Is player in the \"seeking\" state or not.\n\t\t *\n\t\t * @return {boolean}\n\t\t * @method seeking\n\t\t */\n\t\t;\n\n\t\t_proto.seeking = function seeking() {\n\t\t\treturn this.el_.seeking;\n\t\t}\n\t\t/**\n\t\t * Is the media ended or not.\n\t\t *\n\t\t * @return {boolean}\n\t\t * @method ended\n\t\t */\n\t\t;\n\n\t\t_proto.ended = function ended() {\n\t\t\treturn this.el_.ended;\n\t\t}\n\t\t/**\n\t\t * Get the current state of network activity\n\t\t * NETWORK_EMPTY (numeric value 0)\n\t\t * NETWORK_IDLE (numeric value 1)\n\t\t * NETWORK_LOADING (numeric value 2)\n\t\t * NETWORK_NO_SOURCE (numeric value 3)\n\t\t *\n\t\t * @return {number}\n\t\t * @method networkState\n\t\t */\n\t\t;\n\n\t\t_proto.networkState = function networkState() {\n\t\t\treturn this.el_.networkState;\n\t\t}\n\t\t/**\n\t\t * Get the current state of the player.\n\t\t * HAVE_NOTHING (numeric value 0)\n\t\t * HAVE_METADATA (numeric value 1)\n\t\t * HAVE_CURRENT_DATA (numeric value 2)\n\t\t * HAVE_FUTURE_DATA (numeric value 3)\n\t\t * HAVE_ENOUGH_DATA (numeric value 4)\n\t\t *\n\t\t * @return {number}\n\t\t * @method readyState\n\t\t */\n\t\t;\n\n\t\t_proto.readyState = function readyState() {\n\t\t\treturn this.el_.readyState;\n\t\t}\n\t\t/**\n\t\t * Does the player support native fullscreen mode or not. (Mobile devices)\n\t\t *\n\t\t * @return {boolean}\n\t\t */\n\t\t;\n\n\t\t_proto.supportsFullScreen = function supportsFullScreen() {\n\t\t\t// iOS devices have some problem with HTML5 fullscreen api so we need to fallback to fullWindow mode.\n\t\t\treturn false;\n\t\t}\n\t\t/**\n\t\t * Get media player error.\n\t\t *\n\t\t * @return {string}\n\t\t * @method error\n\t\t */\n\t\t;\n\n\t\t_proto.error = function error() {\n\t\t\treturn this.el_.error;\n\t\t};\n\n\t\treturn OgvJS;\n\t}(Tech);\n\t/**\n\t * List of available events of the media player.\n\t *\n\t * @private\n\t * @type {Array}\n\t */\n\n\n\tOgvJS.Events = ['loadstart', 'suspend', 'abort', 'error', 'emptied', 'stalled', 'loadedmetadata', 'loadeddata', 'canplay', 'canplaythrough', 'playing', 'waiting', 'seeking', 'seeked', 'ended', 'durationchange', 'timeupdate', 'progress', 'play', 'pause', 'ratechange', 'resize', 'volumechange'];\n\t/**\n\t * Set the value for the player is it has that property.\n\t *\n\t * @param {Element} el\n\t * @param {string} name\n\t * @param value\n\t */\n\n\tOgvJS.setIfAvailable = function (el, name, value) {\n\t\tif (el.hasOwnProperty(name)) {\n\t\t\tel[name] = value;\n\t\t}\n\t};\n\t/**\n\t * Check if browser/device is supported by Ogv.JS.\n\t *\n\t * @return {boolean}\n\t */\n\n\n\tOgvJS.isSupported = function () {\n\t\treturn OGVCompat__default['default'].supported('OGVPlayer');\n\t};\n\t/**\n\t * Check if the tech can support the given type.\n\t *\n\t * @param {string} type The mimetype to check\n\t * @return {string} 'probably', 'maybe', or '' (empty string)\n\t */\n\n\n\tOgvJS.canPlayType = function (type) {\n\t\treturn type.indexOf('/ogg') !== -1 || type.indexOf('/webm') ? 'maybe' : '';\n\t};\n\t/**\n\t * Check if the tech can support the given source\n\t *\n\t * @param srcObj The source object\n\t * @return {string} The options passed to the tech\n\t */\n\n\n\tOgvJS.canPlaySource = function (srcObj) {\n\t\treturn OgvJS.canPlayType(srcObj.type);\n\t};\n\t/**\n\t * Check if the volume can be changed in this browser/device.\n\t * Volume cannot be changed in a lot of mobile devices.\n\t * Specifically, it can't be changed on iOS and iPadOS.\n\t *\n\t * @return {boolean} True if volume can be controlled.\n\t */\n\n\n\tOgvJS.canControlVolume = function () {\n\t\tif (getDeviceOS() === iPhoneOS || getDeviceOS() === iPadOS) {\n\t\t\treturn false;\n\t\t}\n\n\t\tvar p = new OGVPlayer__default['default']();\n\t\treturn p.hasOwnProperty('volume');\n\t};\n\t/**\n\t * Check if the volume can be muted in this browser/device.\n\t *\n\t * @return {boolean} True if volume can be muted.\n\t */\n\n\n\tOgvJS.canMuteVolume = function () {\n\t\treturn true;\n\t};\n\t/**\n\t * Check if the playback rate can be changed in this browser/device.\n\t *\n\t * @return {boolean} True if playback rate can be controlled.\n\t */\n\n\n\tOgvJS.canControlPlaybackRate = function () {\n\t\treturn true;\n\t};\n\t/**\n\t * Check to see if native 'TextTracks' are supported by this browser/device.\n\t *\n\t * @return {boolean} True if native 'TextTracks' are supported.\n\t */\n\n\n\tOgvJS.supportsNativeTextTracks = function () {\n\t\treturn false;\n\t};\n\t/**\n\t * Check if the fullscreen resize is supported by this browser/device.\n\t *\n\t * @return {boolean} True if the fullscreen resize is supported.\n\t */\n\n\n\tOgvJS.supportsFullscreenResize = function () {\n\t\treturn true;\n\t};\n\t/**\n\t * Check if the progress events is supported by this browser/device.\n\t *\n\t * @return {boolean} True if the progress events is supported.\n\t */\n\n\n\tOgvJS.supportsProgressEvents = function () {\n\t\treturn true;\n\t};\n\t/**\n\t * Check if the time update events is supported by this browser/device.\n\t *\n\t * @return {boolean} True if the time update events is supported.\n\t */\n\n\n\tOgvJS.supportsTimeupdateEvents = function () {\n\t\treturn true;\n\t};\n\t/**\n\t * Boolean indicating whether the 'OgvJS' tech supports volume control.\n\t *\n\t * @type {boolean}\n\t * @default {@link OgvJS.canControlVolume}\n\t */\n\n\t/**\n\t * Boolean indicating whether the 'OgvJS' tech supports muting volume.\n\t *\n\t * @type {boolean}\n\t * @default {@link OgvJS.canMuteVolume}\n\t */\n\n\t/**\n\t * Boolean indicating whether the 'OgvJS' tech supports changing the speed at which the media plays.\n\t * Examples:\n\t * - Set player to play 2x (twice) as fast.\n\t * - Set player to play 0.5x (half) as fast.\n\t *\n\t * @type {boolean}\n\t * @default {@link OgvJS.canControlPlaybackRate}\n\t */\n\n\t/**\n\t * Boolean indicating whether the 'OgvJS' tech currently supports native 'TextTracks'.\n\t *\n\t * @type {boolean}\n\t * @default {@link OgvJS.supportsNativeTextTracks}\n\t */\n\n\t/**\n\t * Boolean indicating whether the 'OgvJS' tech currently supports fullscreen resize.\n\t *\n\t * @type {boolean}\n\t * @default {@link OgvJS.supportsFullscreenResize}\n\t */\n\n\t/**\n\t * Boolean indicating whether the 'OgvJS' tech currently supports progress events.\n\t *\n\t * @type {boolean}\n\t * @default {@link OgvJS.supportsProgressEvents}\n\t */\n\n\t/**\n\t * Boolean indicating whether the 'OgvJS' tech currently supports time update events.\n\t *\n\t * @type {boolean}\n\t * @default {@link OgvJS.supportsTimeupdateEvents}\n\t */\n\n\n\t[['featuresVolumeControl', 'canControlVolume'], ['featuresMuteControl', 'canMuteVolume'], ['featuresPlaybackRate', 'canControlPlaybackRate'], ['featuresNativeTextTracks', 'supportsNativeTextTracks'], ['featuresFullscreenResize', 'supportsFullscreenResize'], ['featuresProgressEvents', 'supportsProgressEvents'], ['featuresTimeupdateEvents', 'supportsTimeupdateEvents']].forEach(function (_ref) {\n\t\tvar key = _ref[0],\n\t\t\tfn = _ref[1];\n\t\tdefineLazyProperty(OgvJS.prototype, key, function () {\n\t\t\treturn OgvJS[fn]();\n\t\t}, true);\n\t});\n\tTech.registerTech('OgvJS', OgvJS);\n\n\treturn OgvJS;\n\n})));\n"],"names":["global","factory","this","videojs","ogvBase","_interopDefaultLegacy","e","videojs__default","OGVCompat__default","OGVCompat","OGVLoader__default","OGVLoader","OGVPlayer__default","OGVPlayer","createCommonjsModule","fn","basedir","module","path","exports","require","base","Error","commonjsRequire","setPrototypeOf","_setPrototypeOf","o","p","Object","bind","__proto__","__esModule","inheritsLoose","subClass","superClass","prototype","create","constructor","Tech","getComponent","getDeviceOS","ua","navigator","userAgent","test","platform","maxTouchPoints","OgvJS","_Tech","options","ready","_this","call","el_","src","source","setIfAvailable","autoplay","loop","poster","preload","on","canvas","getElementsByTagName","style","removeProperty","triggerReady","_proto","createEl","options_","el","className","tag","play","playbackRate","setPlaybackRate","val","hasOwnProperty","played","pause","paused","currentTime","setCurrentTime","seconds","log","duration","Infinity","buffered","volume","setVolume","percentAsDecimal","muted","setMuted","defaultMuted","width","offsetWidth","height","offsetHeight","videoWidth","videoHeight","_src","load","currentSrc","currentSource_","setPoster","url","setPreload","setAutoplay","controls","setControls","setLoop","seekable","seeking","ended","networkState","readyState","supportsFullScreen","error","Events","name","value","isSupported","supported","canPlayType","type","indexOf","canPlaySource","srcObj","canControlVolume","canMuteVolume","canControlPlaybackRate","supportsNativeTextTracks","supportsFullscreenResize","supportsProgressEvents","supportsTimeupdateEvents","forEach","_ref","key","obj","getValue","setter","set","defineProperty","enumerable","writable","configurable","get","defineLazyProperty","registerTech","define","amd","globalThis","self","videojsOgvjs"],"mappings":";;;;;;;AAOC,IAAUA,OAAQC,QAARD,OAITE,OAJiBD,QAIV,SAAUE,QAASC,kBAElBC,sBAAuBC,UAAYA,GAAkB,iBAANA,GAAkB,YAAaA,EAAIA,EAAI,SAAaA,OAExGC,iBAAgCF,sBAAsBF,SACtDK,mBAAkCH,sBAAsBD,QAAQK,WAChEC,mBAAkCL,sBAAsBD,QAAQO,WAChEC,mBAAkCP,sBAAsBD,QAAQS,oBAE3DC,qBAAqBC,GAAIC,QAASC,eAOvCF,GANIE,OAAS,CACfC,KAAMF,QACNG,QAAS,GACTC,QAAS,SAAUF,KAAMG,8BAOpB,IAAIC,MAAM,2EANPC,CAAuBF,MAAAA,MAAuCJ,OAAOC,QAEhED,OAAOE,SAAUF,OAAOE,YAOnCK,eAAiBV,sBAAqB,SAAUG,iBAC1CQ,gBAAgBC,EAAGC,UAC3BV,OAAOE,QAAUM,gBAAkBG,OAAOJ,eAAiBI,OAAOJ,eAAeK,OAAS,SAAyBH,EAAGC,UACrHD,EAAEI,UAAYH,EACPD,GACLT,OAAOE,QAAQY,YAAa,EAAMd,OAAOE,QAAP,QAA4BF,OAAOE,QACj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UAAU,KAIR/F,QAAU,CACbgG,cAAc,EACdF,YAAY,EACZG,IAAK,eACA1B,MAAQmB,kBACZE,IAAIrB,OACGA,QAILoB,SACH3F,QAAQ4F,IAAMA,KAGRjH,OAAOkH,eAAeJ,IAAKD,IAAKxF,SAwuBvCkG,CAAmBpG,MAAMZ,UAAWsG,KAAK,kBACjC1F,MAAMhC,SACX,MAEJuB,KAAK8G,aAAa,QAASrG,OAEpBA,OAx0BY,iBAAZ5B,SAA0C,oBAAXF,OAAyBA,OAAOE,QAAUlB,QAAQmB,QAAQ,YAAaA,QAAQ,aAAcA,QAAQ,aAAcA,QAAQ,cAC9I,mBAAXiI,QAAyBA,OAAOC,IAAMD,0CAAO,CAAC,2BAA4B,mBAAoBpJ,UACnGD,OAA+B,oBAAfuJ,WAA6BA,WAAavJ,QAAUwJ,MAAaC,aAAexJ,QAAQD,OAAOG,QAASH,OAAOS,UAAWT,OAAOW,UAAWX,OAAOa"} \ No newline at end of file +{"version":3,"file":"videojs-ogvjs-lazy.min.js","sources":["../src/videojs-ogvjs-lazy.js"],"sourcesContent":["/**\n * videojs-ogvjs\n * @version 1.0.0\n * @copyright 2023 Huong Nguyen \n * @license MIT\n */\ndefine(['media_videojs/video-lazy', './local/ogv/ogv'], (function (videojs, ogv) { 'use strict';\n\n\t// We can access public classes either as ogv.OGVPlayer or just OGVPlayer.\n\t// But ogv.OGVPlayer will make the lint tools happier.\n\tconst OGVCompat = ogv.OGVCompat;\n\tconst OGVLoader = ogv.OGVLoader;\n\tconst OGVPlayer = ogv.OGVPlayer;\n\tconst Tech = videojs.getComponent('Tech');\n\n\tconst androidOS = 'Android';\n\tconst iPhoneOS = 'iPhoneOS';\n\tconst iPadOS = 'iPadOS';\n\tconst otherOS = 'Other';\n\n\t/**\n\t * Object.defineProperty but \"lazy\", which means that the value is only set after\n\t * it retrieved the first time, rather than being set right away.\n\t *\n\t * @param {Object} obj the object to set the property on.\n\t * @param {string} key the key for the property to set.\n\t * @param {Function} getValue the function used to get the value when it is needed.\n\t * @param {boolean} setter whether a setter should be allowed or not.\n\t */\n\tconst defineLazyProperty = (obj, key, getValue, setter = true) => {\n\t\tconst set = (value) => {\n\t\t\tObject.defineProperty(obj, key, {value, enumerable: true, writable: true});\n\t\t};\n\n\t\tconst options = {\n\t\t\tconfigurable: true,\n\t\t\tenumerable: true,\n\t\t\tget() {\n\t\t\t\tconst value = getValue();\n\n\t\t\t\tset(value);\n\t\t\t\treturn value;\n\t\t\t}\n\t\t};\n\n\t\tif (setter) {\n\t\t\toptions.set = set;\n\t\t}\n\n\t\treturn Object.defineProperty(obj, key, options);\n\t};\n\n\t/**\n\t * Get the device's OS.\n\t *\n\t * @return {string} Device's OS.\n\t */\n\tconst getDeviceOS = () => {\n\t\t/* global navigator */\n\t\tconst ua = navigator.userAgent;\n\n\t\tif (/android/i.test(ua)) {\n\t\t\treturn androidOS;\n\t\t} else if (/iPad|iPhone|iPod/.test(ua)) {\n\t\t\treturn iPhoneOS;\n\t\t} else if ((navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1)) {\n\t\t\treturn iPadOS;\n\t\t}\n\t\treturn otherOS;\n\t};\n\n\t/**\n\t * OgvJS Media Controller - Wrapper for ogv.js Media API\n\t *\n\t * @mixes Tech~SourceHandlerAdditions\n\t * @extends Tech\n\t */\n\tclass OgvJS extends Tech {\n\n\t\t/**\n\t\t * Create an instance of this Tech.\n\t\t *\n\t\t * @param {Object} [options] The key/value store of player options.\n\t\t * @param {Component~ReadyCallback} ready Callback function to call when the `OgvJS` Tech is ready.\n\t\t */\n\t\tconstructor(options, ready) {\n\t\t\tsuper(options, ready);\n\n\t\t\tthis.el_.src = options.source.src;\n\t\t\tOgvJS.setIfAvailable(this.el_, 'autoplay', options.autoplay);\n\t\t\tOgvJS.setIfAvailable(this.el_, 'loop', options.loop);\n\t\t\tOgvJS.setIfAvailable(this.el_, 'poster', options.poster);\n\t\t\tOgvJS.setIfAvailable(this.el_, 'preload', options.preload);\n\n\t\t\tthis.on('loadedmetadata', () => {\n\t\t\t\tif (getDeviceOS() === iPhoneOS) {\n\t\t\t\t\t// iPhoneOS add some inline styles to the canvas, we need to remove it.\n\t\t\t\t\tconst canvas = this.el_.getElementsByTagName('canvas')[0];\n\n\t\t\t\t\tcanvas.style.removeProperty('width');\n\t\t\t\t\tcanvas.style.removeProperty('margin');\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tthis.triggerReady();\n\t\t}\n\n\t\t/**\n\t\t * Create the 'OgvJS' Tech's DOM element.\n\t\t *\n\t\t * @return {Element} The element that gets created.\n\t\t */\n\t\tcreateEl() {\n\t\t\tconst options = this.options_;\n\n\t\t\tif (options.base) {\n\t\t\t\tOGVLoader.base = options.base;\n\t\t\t} else {\n\t\t\t\tthrow new Error('Please specify the base for the ogv.js library');\n\t\t\t}\n\n\t\t\tconst el = new OGVPlayer(options);\n\n\t\t\tel.className += ' vjs-tech';\n\t\t\toptions.tag = el;\n\n\t\t\treturn el;\n\t\t}\n\n\t\t/**\n\t\t * Start playback\n\t\t *\n\t\t * @method play\n\t\t */\n\t\tplay() {\n\t\t\tthis.el_.play();\n\t\t}\n\n\t\t/**\n\t\t * Get the current playback speed.\n\t\t *\n\t\t * @return {number}\n\t\t * @method playbackRate\n\t\t */\n\t\tplaybackRate() {\n\t\t\treturn this.el_.playbackRate || 1;\n\t\t}\n\n\t\t/**\n\t\t * Set the playback speed.\n\t\t *\n\t\t * @param {number} val Speed for the player to play.\n\t\t * @method setPlaybackRate\n\t\t */\n\t\tsetPlaybackRate(val) {\n\t\t\tif (this.el_.hasOwnProperty('playbackRate')) {\n\t\t\t\tthis.el_.playbackRate = val;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Returns a TimeRanges object that represents the ranges of the media resource that the user agent has played.\n\t\t *\n\t\t * @return {TimeRangeObject} the range of points on the media timeline that has been reached through normal playback\n\t\t */\n\t\tplayed() {\n\t\t\treturn this.el_.played;\n\t\t}\n\n\t\t/**\n\t\t * Pause playback\n\t\t *\n\t\t * @method pause\n\t\t */\n\t\tpause() {\n\t\t\tthis.el_.pause();\n\t\t}\n\n\t\t/**\n\t\t * Is the player paused or not.\n\t\t *\n\t\t * @return {boolean}\n\t\t * @method paused\n\t\t */\n\t\tpaused() {\n\t\t\treturn this.el_.paused;\n\t\t}\n\n\t\t/**\n\t\t * Get current playing time.\n\t\t *\n\t\t * @return {number}\n\t\t * @method currentTime\n\t\t */\n\t\tcurrentTime() {\n\t\t\treturn this.el_.currentTime;\n\t\t}\n\n\t\t/**\n\t\t * Set current playing time.\n\t\t *\n\t\t * @param {number} seconds Current time of audio/video.\n\t\t * @method setCurrentTime\n\t\t */\n\t\tsetCurrentTime(seconds) {\n\t\t\ttry {\n\t\t\t\tthis.el_.currentTime = seconds;\n\t\t\t} catch (e) {\n\t\t\t\tvideojs.log(e, 'Media is not ready. (Video.JS)');\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Get media's duration.\n\t\t *\n\t\t * @return {number}\n\t\t * @method duration\n\t\t */\n\t\tduration() {\n\t\t\tif (this.el_.duration && this.el_.duration !== Infinity) {\n\t\t\t\treturn this.el_.duration;\n\t\t\t}\n\n\t\t\treturn 0;\n\t\t}\n\n\t\t/**\n\t\t * Get a TimeRange object that represents the intersection\n\t\t * of the time ranges for which the user agent has all\n\t\t * relevant media.\n\t\t *\n\t\t * @return {TimeRangeObject}\n\t\t * @method buffered\n\t\t */\n\t\tbuffered() {\n\t\t\treturn this.el_.buffered;\n\t\t}\n\n\t\t/**\n\t\t * Get current volume level.\n\t\t *\n\t\t * @return {number}\n\t\t * @method volume\n\t\t */\n\t\tvolume() {\n\t\t\treturn this.el_.hasOwnProperty('volume') ? this.el_.volume : 1;\n\t\t}\n\n\t\t/**\n\t\t * Set current playing volume level.\n\t\t *\n\t\t * @param {number} percentAsDecimal Volume percent as a decimal.\n\t\t * @method setVolume\n\t\t */\n\t\tsetVolume(percentAsDecimal) {\n\t\t\t// Apple does not allow iOS and iPadOS devices to set the volume on UI.\n\t\t\tif (getDeviceOS() !== iPhoneOS && getDeviceOS() !== iPadOS && this.el_.hasOwnProperty('volume')) {\n\t\t\t\tthis.el_.volume = percentAsDecimal;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Is the player muted or not.\n\t\t *\n\t\t * @return {boolean}\n\t\t * @method muted\n\t\t */\n\t\tmuted() {\n\t\t\treturn this.el_.muted;\n\t\t}\n\n\t\t/**\n\t\t * Mute the player.\n\t\t *\n\t\t * @param {boolean} muted True to mute the player.\n\t\t */\n\t\tsetMuted(muted) {\n\t\t\tthis.el_.muted = !!muted;\n\t\t}\n\n\t\t/**\n\t\t * Is the player muted by default or not.\n\t\t *\n\t\t * @return {boolean}\n\t\t * @method defaultMuted\n\t\t */\n\t\tdefaultMuted() {\n\t\t\treturn this.el_.defaultMuted || false;\n\t\t}\n\n\t\t/**\n\t\t * Get the player width.\n\t\t *\n\t\t * @return {number}\n\t\t * @method width\n\t\t */\n\t\twidth() {\n\t\t\treturn this.el_.offsetWidth;\n\t\t}\n\n\t\t/**\n\t\t * Get the player height.\n\t\t *\n\t\t * @return {number}\n\t\t * @method height\n\t\t */\n\t\theight() {\n\t\t\treturn this.el_.offsetHeight;\n\t\t}\n\n\t\t/**\n\t\t * Get the video width.\n\t\t *\n\t\t * @return {number}\n\t\t * @method videoWidth\n\t\t */\n\t\tvideoWidth() {\n\t\t\treturn this.el_.videoWidth;\n\t\t}\n\n\t\t/**\n\t\t * Get the video height.\n\t\t *\n\t\t * @return {number}\n\t\t * @method videoHeight\n\t\t */\n\t\tvideoHeight() {\n\t\t\treturn this.el_.videoHeight;\n\t\t}\n\n\t\t/**\n\t\t * Get/set media source.\n\t\t *\n\t\t * @param {Object=} src Source object\n\t\t * @return {Object}\n\t\t * @method src\n\t\t */\n\t\tsrc(src) {\n\t\t\tif (typeof src === 'undefined') {\n\t\t\t\treturn this.el_.src;\n\t\t\t}\n\t\t\tthis.el_.src = src;\n\t\t}\n\n\t\t/**\n\t\t * Load the media into the player.\n\t\t *\n\t\t * @method load\n\t\t */\n\t\tload() {\n\t\t\tthis.el_.load();\n\t\t}\n\n\t\t/**\n\t\t * Get current media source.\n\t\t *\n\t\t * @return {Object}\n\t\t * @method currentSrc\n\t\t */\n\t\tcurrentSrc() {\n\t\t\tif (this.currentSource_) {\n\t\t\t\treturn this.currentSource_.src;\n\t\t\t}\n\t\t\treturn this.el_.currentSrc;\n\t\t}\n\n\t\t/**\n\t\t * Get media poster URL.\n\t\t *\n\t\t * @return {string}\n\t\t * @method poster\n\t\t */\n\t\tposter() {\n\t\t\treturn this.el_.poster;\n\t\t}\n\n\t\t/**\n\t\t * Set media poster URL.\n\t\t *\n\t\t * @param {string} url the poster image's url.\n\t\t * @method\n\t\t */\n\t\tsetPoster(url) {\n\t\t\tthis.el_.poster = url;\n\t\t}\n\n\t\t/**\n\t\t * Is the media preloaded or not.\n\t\t *\n\t\t * @return {string}\n\t\t * @method preload\n\t\t */\n\t\tpreload() {\n\t\t\treturn this.el_.preload || 'none';\n\t\t}\n\n\t\t/**\n\t\t * Set the media preload method.\n\t\t *\n\t\t * @param {string} val Value for preload attribute.\n\t\t * @method setPreload\n\t\t */\n\t\tsetPreload(val) {\n\t\t\tif (this.el_.hasOwnProperty('preload')) {\n\t\t\t\tthis.el_.preload = val;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Is the media auto-played or not.\n\t\t *\n\t\t * @return {boolean}\n\t\t * @method autoplay\n\t\t */\n\t\tautoplay() {\n\t\t\treturn this.el_.autoplay || false;\n\t\t}\n\n\t\t/**\n\t\t * Set media autoplay method.\n\t\t *\n\t\t * @param {boolean} val Value for autoplay attribute.\n\t\t * @method setAutoplay\n\t\t */\n\t\tsetAutoplay(val) {\n\t\t\tif (this.el_.hasOwnProperty('autoplay')) {\n\t\t\t\tthis.el_.autoplay = !!val;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Does the media has controls or not.\n\t\t *\n\t\t * @return {boolean}\n\t\t * @method controls\n\t\t */\n\t\tcontrols() {\n\t\t\treturn this.el_.controls || false;\n\t\t}\n\n\t\t/**\n\t\t * Set the media controls method.\n\t\t *\n\t\t * @param {boolean} val Value for controls attribute.\n\t\t * @method setControls\n\t\t */\n\t\tsetControls(val) {\n\t\t\tif (this.el_.hasOwnProperty('controls')) {\n\t\t\t\tthis.el_.controls = !!val;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Is the media looped or not.\n\t\t *\n\t\t * @return {boolean}\n\t\t * @method loop\n\t\t */\n\t\tloop() {\n\t\t\treturn this.el_.loop || false;\n\t\t}\n\n\t\t/**\n\t\t * Set the media loop method.\n\t\t *\n\t\t * @param {boolean} val Value for loop attribute.\n\t\t * @method setLoop\n\t\t */\n\t\tsetLoop(val) {\n\t\t\tif (this.el_.hasOwnProperty('loop')) {\n\t\t\t\tthis.el_.loop = !!val;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Get a TimeRanges object that represents the\n\t\t * ranges of the media resource to which it is possible\n\t\t * for the user agent to seek.\n\t\t *\n\t\t * @return {TimeRangeObject}\n\t\t * @method seekable\n\t\t */\n\t\tseekable() {\n\t\t\treturn this.el_.seekable;\n\t\t}\n\n\t\t/**\n\t\t * Is player in the \"seeking\" state or not.\n\t\t *\n\t\t * @return {boolean}\n\t\t * @method seeking\n\t\t */\n\t\tseeking() {\n\t\t\treturn this.el_.seeking;\n\t\t}\n\n\t\t/**\n\t\t * Is the media ended or not.\n\t\t *\n\t\t * @return {boolean}\n\t\t * @method ended\n\t\t */\n\t\tended() {\n\t\t\treturn this.el_.ended;\n\t\t}\n\n\t\t/**\n\t\t * Get the current state of network activity\n\t\t * NETWORK_EMPTY (numeric value 0)\n\t\t * NETWORK_IDLE (numeric value 1)\n\t\t * NETWORK_LOADING (numeric value 2)\n\t\t * NETWORK_NO_SOURCE (numeric value 3)\n\t\t *\n\t\t * @return {number}\n\t\t * @method networkState\n\t\t */\n\t\tnetworkState() {\n\t\t\treturn this.el_.networkState;\n\t\t}\n\n\t\t/**\n\t\t * Get the current state of the player.\n\t\t * HAVE_NOTHING (numeric value 0)\n\t\t * HAVE_METADATA (numeric value 1)\n\t\t * HAVE_CURRENT_DATA (numeric value 2)\n\t\t * HAVE_FUTURE_DATA (numeric value 3)\n\t\t * HAVE_ENOUGH_DATA (numeric value 4)\n\t\t *\n\t\t * @return {number}\n\t\t * @method readyState\n\t\t */\n\t\treadyState() {\n\t\t\treturn this.el_.readyState;\n\t\t}\n\n\t\t/**\n\t\t * Does the player support native fullscreen mode or not. (Mobile devices)\n\t\t *\n\t\t * @return {boolean}\n\t\t */\n\t\tsupportsFullScreen() {\n\t\t\t// iOS devices have some problem with HTML5 fullscreen api so we need to fallback to fullWindow mode.\n\t\t\treturn false;\n\t\t}\n\n\t\t/**\n\t\t * Get media player error.\n\t\t *\n\t\t * @return {string}\n\t\t * @method error\n\t\t */\n\t\terror() {\n\t\t\treturn this.el_.error;\n\t\t}\n\n\t}\n\n\t/**\n\t * List of available events of the media player.\n\t *\n\t * @private\n\t * @type {Array}\n\t */\n\tOgvJS.Events = [\n\t\t'loadstart',\n\t\t'suspend',\n\t\t'abort',\n\t\t'error',\n\t\t'emptied',\n\t\t'stalled',\n\t\t'loadedmetadata',\n\t\t'loadeddata',\n\t\t'canplay',\n\t\t'canplaythrough',\n\t\t'playing',\n\t\t'waiting',\n\t\t'seeking',\n\t\t'seeked',\n\t\t'ended',\n\t\t'durationchange',\n\t\t'timeupdate',\n\t\t'progress',\n\t\t'play',\n\t\t'pause',\n\t\t'ratechange',\n\t\t'resize',\n\t\t'volumechange'\n\t];\n\n\t/**\n\t * Set the value for the player is it has that property.\n\t *\n\t * @param {Element} el\n\t * @param {string} name\n\t * @param value\n\t */\n\tOgvJS.setIfAvailable = (el, name, value) => {\n\t\tif (el.hasOwnProperty(name)) {\n\t\t\tel[name] = value;\n\t\t}\n\t};\n\n\t/**\n\t * Check if browser/device is supported by Ogv.JS.\n\t *\n\t * @return {boolean}\n\t */\n\tOgvJS.isSupported = () => {\n\t\treturn OGVCompat.supported('OGVPlayer');\n\t};\n\n\t/**\n\t * Check if the tech can support the given type.\n\t *\n\t * @param {string} type The mimetype to check\n\t * @return {string} 'probably', 'maybe', or '' (empty string)\n\t */\n\tOgvJS.canPlayType = (type) => {\n\t\treturn (type.indexOf('/ogg') !== -1 || type.indexOf('/webm')) ? 'maybe' : '';\n\t};\n\n\t/**\n\t * Check if the tech can support the given source\n\t *\n\t * @param srcObj The source object\n\t * @return {string} The options passed to the tech\n\t */\n\tOgvJS.canPlaySource = (srcObj) => {\n\t\treturn OgvJS.canPlayType(srcObj.type);\n\t};\n\n\t/**\n\t * Check if the volume can be changed in this browser/device.\n\t * Volume cannot be changed in a lot of mobile devices.\n\t * Specifically, it can't be changed on iOS and iPadOS.\n\t *\n\t * @return {boolean} True if volume can be controlled.\n\t */\n\tOgvJS.canControlVolume = () => {\n\t\tif (getDeviceOS() === iPhoneOS || getDeviceOS() === iPadOS) {\n\t\t\treturn false;\n\t\t}\n\t\tconst p = new OGVPlayer();\n\n\t\treturn p.hasOwnProperty('volume');\n\t};\n\n\t/**\n\t * Check if the volume can be muted in this browser/device.\n\t *\n\t * @return {boolean} True if volume can be muted.\n\t */\n\tOgvJS.canMuteVolume = () => {\n\t\treturn true;\n\t};\n\n\t/**\n\t * Check if the playback rate can be changed in this browser/device.\n\t *\n\t * @return {boolean} True if playback rate can be controlled.\n\t */\n\tOgvJS.canControlPlaybackRate = () => {\n\t\treturn true;\n\t};\n\n\t/**\n\t * Check to see if native 'TextTracks' are supported by this browser/device.\n\t *\n\t * @return {boolean} True if native 'TextTracks' are supported.\n\t */\n\tOgvJS.supportsNativeTextTracks = () => {\n\t\treturn false;\n\t};\n\n\t/**\n\t * Check if the fullscreen resize is supported by this browser/device.\n\t *\n\t * @return {boolean} True if the fullscreen resize is supported.\n\t */\n\tOgvJS.supportsFullscreenResize = () => {\n\t\treturn true;\n\t};\n\n\t/**\n\t * Check if the progress events is supported by this browser/device.\n\t *\n\t * @return {boolean} True if the progress events is supported.\n\t */\n\tOgvJS.supportsProgressEvents = () => {\n\t\treturn true;\n\t};\n\n\t/**\n\t * Check if the time update events is supported by this browser/device.\n\t *\n\t * @return {boolean} True if the time update events is supported.\n\t */\n\tOgvJS.supportsTimeupdateEvents = () => {\n\t\treturn true;\n\t};\n\n\t/**\n\t * Boolean indicating whether the 'OgvJS' tech supports volume control.\n\t *\n\t * @type {boolean}\n\t * @default {@link OgvJS.canControlVolume}\n\t */\n\t/**\n\t * Boolean indicating whether the 'OgvJS' tech supports muting volume.\n\t *\n\t * @type {boolean}\n\t * @default {@link OgvJS.canMuteVolume}\n\t */\n\t/**\n\t * Boolean indicating whether the 'OgvJS' tech supports changing the speed at which the media plays.\n\t * Examples:\n\t * - Set player to play 2x (twice) as fast.\n\t * - Set player to play 0.5x (half) as fast.\n\t *\n\t * @type {boolean}\n\t * @default {@link OgvJS.canControlPlaybackRate}\n\t */\n\t/**\n\t * Boolean indicating whether the 'OgvJS' tech currently supports native 'TextTracks'.\n\t *\n\t * @type {boolean}\n\t * @default {@link OgvJS.supportsNativeTextTracks}\n\t */\n\t/**\n\t * Boolean indicating whether the 'OgvJS' tech currently supports fullscreen resize.\n\t *\n\t * @type {boolean}\n\t * @default {@link OgvJS.supportsFullscreenResize}\n\t */\n\t/**\n\t * Boolean indicating whether the 'OgvJS' tech currently supports progress events.\n\t *\n\t * @type {boolean}\n\t * @default {@link OgvJS.supportsProgressEvents}\n\t */\n\t/**\n\t * Boolean indicating whether the 'OgvJS' tech currently supports time update events.\n\t *\n\t * @type {boolean}\n\t * @default {@link OgvJS.supportsTimeupdateEvents}\n\t */\n\t[\n\t\t['featuresVolumeControl', 'canControlVolume'],\n\t\t['featuresMuteControl', 'canMuteVolume'],\n\t\t['featuresPlaybackRate', 'canControlPlaybackRate'],\n\t\t['featuresNativeTextTracks', 'supportsNativeTextTracks'],\n\t\t['featuresFullscreenResize', 'supportsFullscreenResize'],\n\t\t['featuresProgressEvents', 'supportsProgressEvents'],\n\t\t['featuresTimeupdateEvents', 'supportsTimeupdateEvents']\n\t].forEach(([key, fn]) => {\n\t\tdefineLazyProperty(OgvJS.prototype, key, () => OgvJS[fn](), true);\n\t});\n\n\tTech.registerTech('OgvJS', OgvJS);\n\n\treturn OgvJS;\n\n}));\n"],"names":["define","videojs","ogv","OGVCompat","OGVLoader","OGVPlayer","Tech","getComponent","getDeviceOS","ua","navigator","userAgent","test","platform","maxTouchPoints","OgvJS","constructor","options","ready","el_","src","source","setIfAvailable","this","autoplay","loop","poster","preload","on","canvas","getElementsByTagName","style","removeProperty","triggerReady","createEl","options_","base","Error","el","className","tag","play","playbackRate","setPlaybackRate","val","hasOwnProperty","played","pause","paused","currentTime","setCurrentTime","seconds","e","log","duration","Infinity","buffered","volume","setVolume","percentAsDecimal","muted","setMuted","defaultMuted","width","offsetWidth","height","offsetHeight","videoWidth","videoHeight","load","currentSrc","currentSource_","setPoster","url","setPreload","setAutoplay","controls","setControls","setLoop","seekable","seeking","ended","networkState","readyState","supportsFullScreen","error","Events","name","value","isSupported","supported","canPlayType","type","indexOf","canPlaySource","srcObj","canControlVolume","canMuteVolume","canControlPlaybackRate","supportsNativeTextTracks","supportsFullscreenResize","supportsProgressEvents","supportsTimeupdateEvents","forEach","_ref","key","fn","obj","getValue","set","Object","defineProperty","enumerable","writable","configurable","get","defineLazyProperty","prototype","registerTech"],"mappings":";;;;;;AAMAA,0CAAO,CAAC,2BAA4B,oBAAqB,SAAUC,QAASC,WAIrEC,UAAYD,IAAIC,UAChBC,UAAYF,IAAIE,UAChBC,UAAYH,IAAIG,UAChBC,KAAOL,QAAQM,aAAa,QA4C5BC,YAAc,WAEbC,GAAKC,UAAUC,gBAEjB,WAAWC,KAAKH,IA9CH,UAgDN,mBAAmBG,KAAKH,IA/CnB,WAiDmB,aAAvBC,UAAUG,UAA2BH,UAAUI,eAAiB,EAhD9D,SACC,eA2DVC,cAAcT,KAQnBU,YAAYC,QAASC,aACdD,QAASC,Y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vjs-lazy.js b/media/player/videojs/amd/src/videojs-ogvjs-lazy.js index ebb7d7d186a..a3fb4806900 100644 --- a/media/player/videojs/amd/src/videojs-ogvjs-lazy.js +++ b/media/player/videojs/amd/src/videojs-ogvjs-lazy.js @@ -1,64 +1,23 @@ /** * videojs-ogvjs - * @version 0.2.1 + * @version 1.0.0 * @copyright 2023 Huong Nguyen * @license MIT */ -/*! @name videojs-ogvjs @version 0.2.1 @license MIT */ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('video.js'), require('OGVCompat'), require('OGVLoader'), require('OGVPlayer')) : - typeof define === 'function' && define.amd ? define(['media_videojs/video-lazy', './local/ogv/ogv'], factory) : - (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.videojsOgvjs = factory(global.videojs, global.OGVCompat, global.OGVLoader, global.OGVPlayer)); -}(this, (function (videojs, ogvBase) { 'use strict'; +define(['media_videojs/video-lazy', './local/ogv/ogv'], (function (videojs, ogv) { 'use strict'; - function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } + // We can access public classes either as ogv.OGVPlayer or just OGVPlayer. + // But ogv.OGVPlayer will make the lint tools happier. + const OGVCompat = ogv.OGVCompat; + const OGVLoader = ogv.OGVLoader; + const OGVPlayer = ogv.OGVPlayer; + const Tech = videojs.getComponent('Tech'); - var videojs__default = /*#__PURE__*/_interopDefaultLegacy(videojs); - var OGVCompat__default = /*#__PURE__*/_interopDefaultLegacy(ogvBase.OGVCompat); - var OGVLoader__default = /*#__PURE__*/_interopDefaultLegacy(ogvBase.OGVLoader); - var OGVPlayer__default = /*#__PURE__*/_interopDefaultLegacy(ogvBase.OGVPlayer); + const androidOS = 'Android'; + const iPhoneOS = 'iPhoneOS'; + const iPadOS = 'iPadOS'; + const otherOS = 'Other'; - function createCommonjsModule(fn, basedir, module) { - return module = { - path: basedir, - exports: {}, - require: function (path, base) { - return commonjsRequire(path, (base === undefined || base === null) ? module.path : base); - } - }, fn(module, module.exports), module.exports; - } - - function commonjsRequire () { - throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs'); - } - - var setPrototypeOf = createCommonjsModule(function (module) { - function _setPrototypeOf(o, p) { - module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }, module.exports.__esModule = true, module.exports["default"] = module.exports; - return _setPrototypeOf(o, p); - } - - module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports; - }); - - var inheritsLoose = createCommonjsModule(function (module) { - function _inheritsLoose(subClass, superClass) { - subClass.prototype = Object.create(superClass.prototype); - subClass.prototype.constructor = subClass; - setPrototypeOf(subClass, superClass); - } - - module.exports = _inheritsLoose, module.exports.__esModule = true, module.exports["default"] = module.exports; - }); - - var Tech = videojs__default['default'].getComponent('Tech'); - var androidOS = 'Android'; - var iPhoneOS = 'iPhoneOS'; - var iPadOS = 'iPadOS'; - var otherOS = 'Other'; /** * Object.defineProperty but "lazy", which means that the value is only set after * it retrieved the first time, rather than being set right away. @@ -68,25 +27,17 @@ * @param {Function} getValue the function used to get the value when it is needed. * @param {boolean} setter whether a setter should be allowed or not. */ - - var defineLazyProperty = function defineLazyProperty(obj, key, getValue, setter) { - if (setter === void 0) { - setter = true; - } - - var set = function set(value) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - writable: true - }); + const defineLazyProperty = (obj, key, getValue, setter = true) => { + const set = (value) => { + Object.defineProperty(obj, key, {value, enumerable: true, writable: true}); }; - var options = { + const options = { configurable: true, enumerable: true, - get: function get() { - var value = getValue(); + get() { + const value = getValue(); + set(value); return value; } @@ -98,37 +49,33 @@ return Object.defineProperty(obj, key, options); }; + /** * Get the device's OS. * * @return {string} Device's OS. */ - - - var getDeviceOS = function getDeviceOS() { + const getDeviceOS = () => { /* global navigator */ - var ua = navigator.userAgent; + const ua = navigator.userAgent; if (/android/i.test(ua)) { return androidOS; } else if (/iPad|iPhone|iPod/.test(ua)) { return iPhoneOS; - } else if (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1) { + } else if ((navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1)) { return iPadOS; } - return otherOS; }; + /** * OgvJS Media Controller - Wrapper for ogv.js Media API * * @mixes Tech~SourceHandlerAdditions * @extends Tech */ - - - var OgvJS = /*#__PURE__*/function (_Tech) { - inheritsLoose(OgvJS, _Tech); + class OgvJS extends Tech { /** * Create an instance of this Tech. @@ -136,159 +83,147 @@ * @param {Object} [options] The key/value store of player options. * @param {Component~ReadyCallback} ready Callback function to call when the `OgvJS` Tech is ready. */ - function OgvJS(options, ready) { - var _this; + constructor(options, ready) { + super(options, ready); - _this = _Tech.call(this, options, ready) || this; - _this.el_.src = options.source.src; - OgvJS.setIfAvailable(_this.el_, 'autoplay', options.autoplay); - OgvJS.setIfAvailable(_this.el_, 'loop', options.loop); - OgvJS.setIfAvailable(_this.el_, 'poster', options.poster); - OgvJS.setIfAvailable(_this.el_, 'preload', options.preload); + this.el_.src = options.source.src; + OgvJS.setIfAvailable(this.el_, 'autoplay', options.autoplay); + OgvJS.setIfAvailable(this.el_, 'loop', options.loop); + OgvJS.setIfAvailable(this.el_, 'poster', options.poster); + OgvJS.setIfAvailable(this.el_, 'preload', options.preload); - _this.on('loadedmetadata', function () { + this.on('loadedmetadata', () => { if (getDeviceOS() === iPhoneOS) { // iPhoneOS add some inline styles to the canvas, we need to remove it. - var canvas = _this.el_.getElementsByTagName('canvas')[0]; + const canvas = this.el_.getElementsByTagName('canvas')[0]; canvas.style.removeProperty('width'); canvas.style.removeProperty('margin'); } }); - _this.triggerReady(); - - return _this; + this.triggerReady(); } + /** * Create the 'OgvJS' Tech's DOM element. * * @return {Element} The element that gets created. */ - - - var _proto = OgvJS.prototype; - - _proto.createEl = function createEl() { - var options = this.options_; + createEl() { + const options = this.options_; if (options.base) { - OGVLoader__default['default'].base = options.base; + OGVLoader.base = options.base; } else { throw new Error('Please specify the base for the ogv.js library'); } - var el = new OGVPlayer__default['default'](options); + const el = new OGVPlayer(options); + el.className += ' vjs-tech'; options.tag = el; + return el; } + /** * Start playback * * @method play */ - ; - - _proto.play = function play() { + play() { this.el_.play(); } + /** * Get the current playback speed. * * @return {number} * @method playbackRate */ - ; - - _proto.playbackRate = function playbackRate() { + playbackRate() { return this.el_.playbackRate || 1; } + /** * Set the playback speed. * * @param {number} val Speed for the player to play. * @method setPlaybackRate */ - ; - - _proto.setPlaybackRate = function setPlaybackRate(val) { + setPlaybackRate(val) { if (this.el_.hasOwnProperty('playbackRate')) { this.el_.playbackRate = val; } } + /** * Returns a TimeRanges object that represents the ranges of the media resource that the user agent has played. * * @return {TimeRangeObject} the range of points on the media timeline that has been reached through normal playback */ - ; - - _proto.played = function played() { + played() { return this.el_.played; } + /** * Pause playback * * @method pause */ - ; - - _proto.pause = function pause() { + pause() { this.el_.pause(); } + /** * Is the player paused or not. * * @return {boolean} * @method paused */ - ; - - _proto.paused = function paused() { + paused() { return this.el_.paused; } + /** * Get current playing time. * * @return {number} * @method currentTime */ - ; - - _proto.currentTime = function currentTime() { + currentTime() { return this.el_.currentTime; } + /** * Set current playing time. * * @param {number} seconds Current time of audio/video. * @method setCurrentTime */ - ; - - _proto.setCurrentTime = function setCurrentTime(seconds) { + setCurrentTime(seconds) { try { this.el_.currentTime = seconds; } catch (e) { - videojs__default['default'].log(e, 'Media is not ready. (Video.JS)'); + videojs.log(e, 'Media is not ready. (Video.JS)'); } } + /** * Get media's duration. * * @return {number} * @method duration */ - ; - - _proto.duration = function duration() { + duration() { if (this.el_.duration && this.el_.duration !== Infinity) { return this.el_.duration; } return 0; } + /** * Get a TimeRange object that represents the intersection * of the time ranges for which the user agent has all @@ -297,112 +232,102 @@ * @return {TimeRangeObject} * @method buffered */ - ; - - _proto.buffered = function buffered() { + buffered() { return this.el_.buffered; } + /** * Get current volume level. * * @return {number} * @method volume */ - ; - - _proto.volume = function volume() { + volume() { return this.el_.hasOwnProperty('volume') ? this.el_.volume : 1; } + /** * Set current playing volume level. * * @param {number} percentAsDecimal Volume percent as a decimal. * @method setVolume */ - ; - - _proto.setVolume = function setVolume(percentAsDecimal) { + setVolume(percentAsDecimal) { // Apple does not allow iOS and iPadOS devices to set the volume on UI. if (getDeviceOS() !== iPhoneOS && getDeviceOS() !== iPadOS && this.el_.hasOwnProperty('volume')) { this.el_.volume = percentAsDecimal; } } + /** * Is the player muted or not. * * @return {boolean} * @method muted */ - ; - - _proto.muted = function muted() { + muted() { return this.el_.muted; } + /** * Mute the player. * * @param {boolean} muted True to mute the player. */ - ; - - _proto.setMuted = function setMuted(muted) { + setMuted(muted) { this.el_.muted = !!muted; } + /** * Is the player muted by default or not. * * @return {boolean} * @method defaultMuted */ - ; - - _proto.defaultMuted = function defaultMuted() { + defaultMuted() { return this.el_.defaultMuted || false; } + /** * Get the player width. * * @return {number} * @method width */ - ; - - _proto.width = function width() { + width() { return this.el_.offsetWidth; } + /** * Get the player height. * * @return {number} * @method height */ - ; - - _proto.height = function height() { + height() { return this.el_.offsetHeight; } + /** * Get the video width. * * @return {number} * @method videoWidth */ - ; - - _proto.videoWidth = function videoWidth() { + videoWidth() { return this.el_.videoWidth; } + /** * Get the video height. * * @return {number} * @method videoHeight */ - ; - - _proto.videoHeight = function videoHeight() { + videoHeight() { return this.el_.videoHeight; } + /** * Get/set media source. * @@ -410,158 +335,143 @@ * @return {Object} * @method src */ - ; - - _proto.src = function src(_src) { - if (typeof _src === 'undefined') { + src(src) { + if (typeof src === 'undefined') { return this.el_.src; } - - this.el_.src = _src; + this.el_.src = src; } + /** * Load the media into the player. * * @method load */ - ; - - _proto.load = function load() { + load() { this.el_.load(); } + /** * Get current media source. * * @return {Object} * @method currentSrc */ - ; - - _proto.currentSrc = function currentSrc() { + currentSrc() { if (this.currentSource_) { return this.currentSource_.src; } - return this.el_.currentSrc; } + /** * Get media poster URL. * * @return {string} * @method poster */ - ; - - _proto.poster = function poster() { + poster() { return this.el_.poster; } + /** * Set media poster URL. * * @param {string} url the poster image's url. * @method */ - ; - - _proto.setPoster = function setPoster(url) { + setPoster(url) { this.el_.poster = url; } + /** * Is the media preloaded or not. * * @return {string} * @method preload */ - ; - - _proto.preload = function preload() { + preload() { return this.el_.preload || 'none'; } + /** * Set the media preload method. * * @param {string} val Value for preload attribute. * @method setPreload */ - ; - - _proto.setPreload = function setPreload(val) { + setPreload(val) { if (this.el_.hasOwnProperty('preload')) { this.el_.preload = val; } } + /** * Is the media auto-played or not. * * @return {boolean} * @method autoplay */ - ; - - _proto.autoplay = function autoplay() { + autoplay() { return this.el_.autoplay || false; } + /** * Set media autoplay method. * * @param {boolean} val Value for autoplay attribute. * @method setAutoplay */ - ; - - _proto.setAutoplay = function setAutoplay(val) { + setAutoplay(val) { if (this.el_.hasOwnProperty('autoplay')) { this.el_.autoplay = !!val; } } + /** * Does the media has controls or not. * * @return {boolean} * @method controls */ - ; - - _proto.controls = function controls() { + controls() { return this.el_.controls || false; } + /** * Set the media controls method. * * @param {boolean} val Value for controls attribute. * @method setControls */ - ; - - _proto.setControls = function setControls(val) { + setControls(val) { if (this.el_.hasOwnProperty('controls')) { this.el_.controls = !!val; } } + /** * Is the media looped or not. * * @return {boolean} * @method loop */ - ; - - _proto.loop = function loop() { + loop() { return this.el_.loop || false; } + /** * Set the media loop method. * * @param {boolean} val Value for loop attribute. * @method setLoop */ - ; - - _proto.setLoop = function setLoop(val) { + setLoop(val) { if (this.el_.hasOwnProperty('loop')) { this.el_.loop = !!val; } } + /** * Get a TimeRanges object that represents the * ranges of the media resource to which it is possible @@ -570,33 +480,30 @@ * @return {TimeRangeObject} * @method seekable */ - ; - - _proto.seekable = function seekable() { + seekable() { return this.el_.seekable; } + /** * Is player in the "seeking" state or not. * * @return {boolean} * @method seeking */ - ; - - _proto.seeking = function seeking() { + seeking() { return this.el_.seeking; } + /** * Is the media ended or not. * * @return {boolean} * @method ended */ - ; - - _proto.ended = function ended() { + ended() { return this.el_.ended; } + /** * Get the current state of network activity * NETWORK_EMPTY (numeric value 0) @@ -607,11 +514,10 @@ * @return {number} * @method networkState */ - ; - - _proto.networkState = function networkState() { + networkState() { return this.el_.networkState; } + /** * Get the current state of the player. * HAVE_NOTHING (numeric value 0) @@ -623,45 +529,64 @@ * @return {number} * @method readyState */ - ; - - _proto.readyState = function readyState() { + readyState() { return this.el_.readyState; } + /** * Does the player support native fullscreen mode or not. (Mobile devices) * * @return {boolean} */ - ; - - _proto.supportsFullScreen = function supportsFullScreen() { + supportsFullScreen() { // iOS devices have some problem with HTML5 fullscreen api so we need to fallback to fullWindow mode. return false; } + /** * Get media player error. * * @return {string} * @method error */ - ; - - _proto.error = function error() { + error() { return this.el_.error; - }; + } + + } - return OgvJS; - }(Tech); /** * List of available events of the media player. * * @private * @type {Array} */ + OgvJS.Events = [ + 'loadstart', + 'suspend', + 'abort', + 'error', + 'emptied', + 'stalled', + 'loadedmetadata', + 'loadeddata', + 'canplay', + 'canplaythrough', + 'playing', + 'waiting', + 'seeking', + 'seeked', + 'ended', + 'durationchange', + 'timeupdate', + 'progress', + 'play', + 'pause', + 'ratechange', + 'resize', + 'volumechange' + ]; - - OgvJS.Events = ['loadstart', 'suspend', 'abort', 'error', 'emptied', 'stalled', 'loadedmetadata', 'loadeddata', 'canplay', 'canplaythrough', 'playing', 'waiting', 'seeking', 'seeked', 'ended', 'durationchange', 'timeupdate', 'progress', 'play', 'pause', 'ratechange', 'resize', 'volumechange']; /** * Set the value for the player is it has that property. * @@ -669,44 +594,41 @@ * @param {string} name * @param value */ - - OgvJS.setIfAvailable = function (el, name, value) { + OgvJS.setIfAvailable = (el, name, value) => { if (el.hasOwnProperty(name)) { el[name] = value; } }; + /** * Check if browser/device is supported by Ogv.JS. * * @return {boolean} */ - - - OgvJS.isSupported = function () { - return OGVCompat__default['default'].supported('OGVPlayer'); + OgvJS.isSupported = () => { + return OGVCompat.supported('OGVPlayer'); }; + /** * Check if the tech can support the given type. * * @param {string} type The mimetype to check * @return {string} 'probably', 'maybe', or '' (empty string) */ - - - OgvJS.canPlayType = function (type) { - return type.indexOf('/ogg') !== -1 || type.indexOf('/webm') ? 'maybe' : ''; + OgvJS.canPlayType = (type) => { + return (type.indexOf('/ogg') !== -1 || type.indexOf('/webm')) ? 'maybe' : ''; }; + /** * Check if the tech can support the given source * * @param srcObj The source object * @return {string} The options passed to the tech */ - - - OgvJS.canPlaySource = function (srcObj) { + OgvJS.canPlaySource = (srcObj) => { return OgvJS.canPlayType(srcObj.type); }; + /** * Check if the volume can be changed in this browser/device. * Volume cannot be changed in a lot of mobile devices. @@ -714,90 +636,81 @@ * * @return {boolean} True if volume can be controlled. */ - - - OgvJS.canControlVolume = function () { + OgvJS.canControlVolume = () => { if (getDeviceOS() === iPhoneOS || getDeviceOS() === iPadOS) { return false; } + const p = new OGVPlayer(); - var p = new OGVPlayer__default['default'](); return p.hasOwnProperty('volume'); }; + /** * Check if the volume can be muted in this browser/device. * * @return {boolean} True if volume can be muted. */ - - - OgvJS.canMuteVolume = function () { + OgvJS.canMuteVolume = () => { return true; }; + /** * Check if the playback rate can be changed in this browser/device. * * @return {boolean} True if playback rate can be controlled. */ - - - OgvJS.canControlPlaybackRate = function () { + OgvJS.canControlPlaybackRate = () => { return true; }; + /** * Check to see if native 'TextTracks' are supported by this browser/device. * * @return {boolean} True if native 'TextTracks' are supported. */ - - - OgvJS.supportsNativeTextTracks = function () { + OgvJS.supportsNativeTextTracks = () => { return false; }; + /** * Check if the fullscreen resize is supported by this browser/device. * * @return {boolean} True if the fullscreen resize is supported. */ - - - OgvJS.supportsFullscreenResize = function () { + OgvJS.supportsFullscreenResize = () => { return true; }; + /** * Check if the progress events is supported by this browser/device. * * @return {boolean} True if the progress events is supported. */ - - - OgvJS.supportsProgressEvents = function () { + OgvJS.supportsProgressEvents = () => { return true; }; + /** * Check if the time update events is supported by this browser/device. * * @return {boolean} True if the time update events is supported. */ - - - OgvJS.supportsTimeupdateEvents = function () { + OgvJS.supportsTimeupdateEvents = () => { return true; }; + /** * Boolean indicating whether the 'OgvJS' tech supports volume control. * * @type {boolean} * @default {@link OgvJS.canControlVolume} */ - /** * Boolean indicating whether the 'OgvJS' tech supports muting volume. * * @type {boolean} * @default {@link OgvJS.canMuteVolume} */ - /** * Boolean indicating whether the 'OgvJS' tech supports changing the speed at which the media plays. * Examples: @@ -807,45 +720,44 @@ * @type {boolean} * @default {@link OgvJS.canControlPlaybackRate} */ - /** * Boolean indicating whether the 'OgvJS' tech currently supports native 'TextTracks'. * * @type {boolean} * @default {@link OgvJS.supportsNativeTextTracks} */ - /** * Boolean indicating whether the 'OgvJS' tech currently supports fullscreen resize. * * @type {boolean} * @default {@link OgvJS.supportsFullscreenResize} */ - /** * Boolean indicating whether the 'OgvJS' tech currently supports progress events. * * @type {boolean} * @default {@link OgvJS.supportsProgressEvents} */ - /** * Boolean indicating whether the 'OgvJS' tech currently supports time update events. * * @type {boolean} * @default {@link OgvJS.supportsTimeupdateEvents} */ - - - [['featuresVolumeControl', 'canControlVolume'], ['featuresMuteControl', 'canMuteVolume'], ['featuresPlaybackRate', 'canControlPlaybackRate'], ['featuresNativeTextTracks', 'supportsNativeTextTracks'], ['featuresFullscreenResize', 'supportsFullscreenResize'], ['featuresProgressEvents', 'supportsProgressEvents'], ['featuresTimeupdateEvents', 'supportsTimeupdateEvents']].forEach(function (_ref) { - var key = _ref[0], - fn = _ref[1]; - defineLazyProperty(OgvJS.prototype, key, function () { - return OgvJS[fn](); - }, true); + [ + ['featuresVolumeControl', 'canControlVolume'], + ['featuresMuteControl', 'canMuteVolume'], + ['featuresPlaybackRate', 'canControlPlaybackRate'], + ['featuresNativeTextTracks', 'supportsNativeTextTracks'], + ['featuresFullscreenResize', 'supportsFullscreenResize'], + ['featuresProgressEvents', 'supportsProgressEvents'], + ['featuresTimeupdateEvents', 'supportsTimeupdateEvents'] + ].forEach(([key, fn]) => { + defineLazyProperty(OgvJS.prototype, key, () => OgvJS[fn](), true); }); + Tech.registerTech('OgvJS', OgvJS); return OgvJS; -}))); +})); diff --git a/media/player/videojs/readme_moodle.txt b/media/player/videojs/readme_moodle.txt index 63f6d8f3345..da85cc545f9 100644 --- a/media/player/videojs/readme_moodle.txt +++ b/media/player/videojs/readme_moodle.txt @@ -27,7 +27,7 @@ Instructions to import YouTube Playback Technology into Moodle: with define(['media_videojs/video-lazy'] -Ogv.js Playback Technology for VideoJS 0.2.1 +Ogv.js Playback Technology for VideoJS 1.0.0 --------------------------------------------- https://github.com/HuongNV13/videojs-ogvjs @@ -35,24 +35,10 @@ Instructions to import Ogv.js Playback Technology into Moodle: 1. Download the latest release from https://github.com/HuongNV13/videojs-ogvjs/releases (do not choose "Source code") -2. Copy videojs-ogvjs.js into 'amd/src/videojs-ogvjs-lazy.js' +2. Copy Videojs-Ogvjs.amd.js into 'amd/src/videojs-ogvjs-lazy.js' In the beginning of the js file: Replace - define(['video.js', 'OGVCompat', 'OGVLoader', 'OGVPlayer'] + define(['video.js', 'ogv'] with define(['media_videojs/video-lazy', './local/ogv/ogv'] - - Replace - function (videojs, OGVCompat, OGVLoader, OGVPlayer) - with - function (videojs, ogvBase) - - Replace - var OGVCompat__default = /*#__PURE__*/_interopDefaultLegacy(OGVCompat); - var OGVLoader__default = /*#__PURE__*/_interopDefaultLegacy(OGVLoader); - var OGVPlayer__default = /*#__PURE__*/_interopDefaultLegacy(OGVPlayer); - with - var OGVCompat__default = /*#__PURE__*/_interopDefaultLegacy(ogvBase.OGVCompat); - var OGVLoader__default = /*#__PURE__*/_interopDefaultLegacy(ogvBase.OGVLoader); - var OGVPlayer__default = /*#__PURE__*/_interopDefaultLegacy(ogvBase.OGVPlayer); diff --git a/media/player/videojs/thirdpartylibs.xml b/media/player/videojs/thirdpartylibs.xml index d30bb864066..bc3f7ba105c 100644 --- a/media/player/videojs/thirdpartylibs.xml +++ b/media/player/videojs/thirdpartylibs.xml @@ -63,7 +63,7 @@ amd/src/videojs-ogvjs-lazy.js ogv.js Tech plugin for Video.JS The ogv.js tech plugin for VideoJS - 0.2.1 + 1.0.0 MIT https://github.com/HuongNV13/videojs-ogvjs