奇点
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

7 lines
7.9 KiB

3 years ago
/**
* 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))<t.end(t.length-1)?e:t.end(t.length-1),this.lastSeekTarget_=e,this.trigger("seeking"),this.el_.vjs_setProperty("currentTime",e),n.prototype.setCurrentTime.call(this))},p.prototype.currentTime=function(){return this.seeking()?this.lastSeekTarget_||0:this.el_.vjs_getProperty("currentTime")},p.prototype.currentSrc=function(){return this.currentSource_?this.currentSource_.src:this.el_.vjs_getProperty("currentSrc")},p.prototype.duration=function S(){if(0===this.readyState())return NaN;var S=this.el_.vjs_getProperty("duration");return 0<=S?S:Infinity},p.prototype.load=function(){this.el_.vjs_load()},p.prototype.poster=function(){this.el_.vjs_getProperty("poster")},p.prototype.setPoster=function(){},p.prototype.seekable=function(){var e=this.duration();return 0===e?s():s(0,e)},p.prototype.buffered=function(){var e=this.el_.vjs_getProperty("buffered");return 0===e.length?s():s(e[0][0],e[0][1])},p.prototype.supportsFullScreen=function(){return!1},p.prototype.enterFullScreen=function(){return!1},p.prototype.getVideoPlaybackQuality=function(){var e=this.el_.vjs_getProperty("getVideoPlaybackQuality");return o.performance&&"function"==typeof o.performance.now?e.creationTime=o.performance.now():o.performance&&o.performance.timing&&"number"==typeof o.performance.timing.navigationStart&&(e.creationTime=o.Date.now()-o.performance.timing.navigationStart),e},p);function p(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,p);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,n.call(this,e,t));return e.source&&r.ready(function(){this.setSource(e.source)},!0),e.startTime&&r.ready(function(){this.load(),this.play(),this.currentTime(e.startTime)},!0),o.videojs=o.videojs||{},o.videojs.Flash=o.videojs.Flash||{},o.videojs.Flash.onReady=p.onReady,o.videojs.Flash.onEvent=p.onEvent,o.videojs.Flash.onError=p.onError,r.on("seeked",function(){this.lastSeekTarget_=undefined}),r}var d=["rtmpConnection","rtmpStream","preload","defaultPlayback