/** * videojs-flash * @version 2.2.1 * @copyright 2019 Brightcove, Inc. * @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.videojsFlash=t(e.videojs)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e["default"]:e;var n,t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},o="undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{},r=e.getComponent("Tech"),i=e.dom,a=e.url,s=e.createTimeRange,c=e.mergeOptions,u=o&&o.navigator||{},l=(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(p,n=r),p.prototype.createEl=function(){var e=this.options_;e.swf||(e.swf="https://vjs.zencdn.net/swf/5.4.2/video-js.swf");var t=e.techId,r=c({readyFunction:"videojs.Flash.onReady",eventProxyFunction:"videojs.Flash.onEvent",errorEventProxyFunction:"videojs.Flash.onError",autoplay:e.autoplay,preload:e.preload,loop:e.loop,muted:e.muted},e.flashVars),n=c({wmode:"opaque",bgcolor:"#000000"},e.params),o=c({id:t,name:t,"class":"vjs-tech"},e.attributes);return this.el_=p.embed(e.swf,r,n,o),(this.el_.tech=this).el_},p.prototype.play=function(){this.ended()&&this.setCurrentTime(0),this.el_.vjs_play()},p.prototype.pause=function(){this.el_.vjs_pause()},p.prototype.src=function(e){return e===undefined?this.currentSrc():this.setSrc(e)},p.prototype.setSrc=function(e){var t=this;e=a.getAbsoluteURL(e),this.el_.vjs_src(e),this.autoplay()&&this.setTimeout(function(){return t.play()},0)},p.prototype.seeking=function(){return this.lastSeekTarget_!==undefined},p.prototype.setCurrentTime=function(e){var t=this.seekable();t.length&&(e=(e=e>t.start(0)?e:t.start(0))'}),n=c({data:e,width:"100%",height:"100%"},n),Object.getOwnPropertyNames(n).forEach(function(e){a+=e+'="'+n[e]+'" '}),'"+i+""},function b(o){return o.streamingFormats={"rtmp/mp4":"MP4","rtmp/flv":"FLV"},o.streamFromParts=function(e,t){return e+"&"+t},o.streamToParts=function(e){var t={connection:"",stream:""};if(!e)return t;var r=e.search(/&(?![\w-]+=)/),n=void 0;return-1!==r?n=r+1:0===(r=n=e.lastIndexOf("/")+1)&&(r=n=e.length),t.connection=e.substring(0,r),t.stream=e.substring(n,e.length),t},o.isStreamingType=function(e){return e in o.streamingFormats},o.RTMP_RE=/^rtmp[set]?:\/\//i,o.isStreamingSrc=function(e){return o.RTMP_RE.test(e)},o.rtmpSourceHandler={},o.rtmpSourceHandler.canPlayType=function(e){return o.isStreamingType(e)?"maybe":""},o.rtmpSourceHandler.canHandleSource=function(e,t){var r=o.rtmpSourceHandler.canPlayType(e.type);return r||(o.isStreamingSrc(e.src)?"maybe":"")},o.rtmpSourceHandler.handleSource=function(e,t,r){var n=o.streamToParts(e.src);t.setRtmpConnection(n.connection),t.setRtmpStream(n.stream)},o.registerSourceHandler(o.rtmpSourceHandler),o}(l),r.getTech("Flash")?(e.log.warn("Not using videojs-flash as it appears to already be registered"),e.log.warn("videojs-flash should only be used with video.js@6 and above")):e.registerTech("Flash",l),l.VERSION="2.2.1",l});