filesbox/web/dist/design/designstatic/chatroom/video/videojs-flash.min.js

7 lines
7.8 KiB
JavaScript
Raw Permalink Normal View History

2024-07-26 06:10:54 +00:00
/**
* videojs-flash
* @version 2.1.1
* @copyright 2018 Brightcove, Inc.
* @license Apache-2.0
*/(function(a,u){typeof exports=="object"&&typeof module!="undefined"?module.exports=u(require("video.js")):typeof define=="function"&&define.amd?define(["video.js"],u):a.videojsFlash=u(a.videojs)})(this,function(a){"use strict";function u(r){var t=r.charAt(0).toUpperCase()+r.slice(1);T["set"+t]=function(e){return this.el_.vjs_setProperty(r,e)}}function w(r){T[r]=function(){return this.el_.vjs_getProperty(r)}}a=a&&a.hasOwnProperty("default")?a.default:a;for(var b=typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},s=typeof window!="undefined"?window:b!==void 0?b:typeof self!="undefined"?self:{},P=function(r,t){if(!(r instanceof t))throw new TypeError("Cannot call a class as a function")},F=function(r,t){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||typeof t!="object"&&typeof t!="function"?r:t},v=a.getComponent("Tech"),p=a.dom,_=a.url,f=a.createTimeRange,l=a.mergeOptions,m=s&&s.navigator||{},o=function(r){function t(e,n){P(this,t);var i=F(this,r.call(this,e,n));return e.source&&i.ready(function(){this.setSource(e.source)},!0),e.startTime&&i.ready(function(){this.load(),this.play(),this.currentTime(e.startTime)},!0),s.videojs=s.videojs||{},s.videojs.Flash=s.videojs.Flash||{},s.videojs.Flash.onReady=t.onReady,s.videojs.Flash.onEvent=t.onEvent,s.videojs.Flash.onError=t.onError,i.on("seeked",function(){this.lastSeekTarget_=void 0}),i}return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof n);e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(e,n):e.__proto__=n)}(t,r),t.prototype.createEl=function(){var e=this.options_;e.swf||(e.swf="https://vjs.zencdn.net/swf/5.4.1/video-js.swf");var n=e.techId,i=l({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),h=l({wmode:"opaque",bgcolor:"#000000"},e.params),y=l({id:n,name:n,class:"vjs-tech"},e.attributes);return this.el_=t.embed(e.swf,i,h,y),this.el_.tech=this,this.el_},t.prototype.play=function(){this.ended()&&this.setCurrentTime(0),this.el_.vjs_play()},t.prototype.pause=function(){this.el_.vjs_pause()},t.prototype.src=function(e){return e===void 0?this.currentSrc():this.setSrc(e)},t.prototype.setSrc=function(e){var n=this;e=_.getAbsoluteURL(e),this.el_.vjs_src(e),this.autoplay()&&this.setTimeout(function(){return n.play()},0)},t.prototype.seeking=function(){return this.lastSeekTarget_!==void 0},t.prototype.setCurrentTime=function(e){var n=this.seekable();n.length&&(e=(e=e>n.start(0)?e:n.start(0))<n.end(n.length-1)?e:n.end(n.length-1),this.lastSeekTarget_=e,this.trigger("seeking"),this.el_.vjs_setProperty("currentTime",e),r.prototype.setCurrentTime.call(this))},t.prototype.currentTime=function(){return this.seeking()?this.lastSeekTarget_||0:this.el_.vjs_getProperty("currentTime")},t.prototype.currentSrc=function(){return this.currentSource_?this.currentSource_.src:this.el_.vjs_getProperty("currentSrc")},t.prototype.duration=function(){if(this.readyState()===0)return NaN;var e=this.el_.vjs_getProperty("duration");return e>=0?e:Infinity},t.prototype.load=function(){this.el_.vjs_load()},t.prototype.poster=function(){this.el_.vjs_getProperty("poster")},t.prototype.setPoster=function(){},t.prototype.seekable=function(){var e=this.duration();return e===0?f():f(0,e)},t.prototype.buffered=function(){var e=this.el_.vjs_getProperty("buffered");return e.length===0?f():f(e[0][0],e[0][1])},t.prototype.supportsFullScreen=function(){return!1},t.prototype.enterFullScreen=function(){return!1},t.prototype.getVideoPlaybackQuality=function(){var e=this.el_.vjs_getProperty("getVideoPlaybackQuality");return s.performance&&typeof s.performance.now=="function"?e.creationTime=s.performance.now():s.performance&&s.performance.timing&&typeof s.performance.timing.navig