@brightcove/videojs-flashls-source-handler
Advanced tools
Comparing version 1.4.2 to 1.4.3
/** | ||
* @brightcove/videojs-flashls-source-handler | ||
* @version 1.4.2 | ||
* @version 1.4.3 | ||
* @copyright 2018 Brightcove | ||
@@ -2048,3 +2048,3 @@ * @license Apache-2.0 | ||
// Include the version number. | ||
FlashlsSourceHandler.VERSION = '1.4.2'; | ||
FlashlsSourceHandler.VERSION = '1.4.3'; | ||
@@ -2051,0 +2051,0 @@ exports['default'] = FlashlsSourceHandler; |
@@ -1,1 +0,1 @@ | ||
!function t(e,i,a){function n(o,r){if(!i[o]){if(!e[o]){var d="function"==typeof require&&require;if(!r&&d)return d(o,!0);if(s)return s(o,!0);var h=new Error("Cannot find module '"+o+"'");throw h.code="MODULE_NOT_FOUND",h}var l=i[o]={exports:{}};e[o][0].call(l.exports,function(t){var i=e[o][1][t];return n(i||t)},l,l.exports,t,e,i,a)}return i[o].exports}for(var s="function"==typeof require&&require,o=0;o<a.length;o++)n(a[o]);return n}({1:[function(t,e,i){(function(t){"use strict";i.__esModule=!0,i.setupAudioTracks=i.updateAudioTrack=void 0;var e="undefined"!=typeof window?window.videojs:void 0!==t?t.videojs:null,a=function(t){return t&&t.__esModule?t:{default:t}}(e);i.updateAudioTrack=function(t){for(var e=t.el_.vjs_getProperty("audioTracks"),i=t.audioTracks(),a=null,n=0;n<i.length;n++)if(i[n].enabled){a=i[n].id;break}if(null!==a)for(var s=0;s<e.length;s++)if(a===e[s].title)return void t.el_.vjs_setProperty("audioTrack",s)},i.setupAudioTracks=function(t){var e=t.el_.vjs_getProperty("altAudioTracks"),i=t.el_.vjs_getProperty("audioTracks"),n=t.el_.vjs_getProperty("audioTrack");i.forEach(function(i,s){var o=e[i.id];t.audioTracks().addTrack(new a.default.AudioTrack({id:o.name,enabled:n===s,language:o.lang,default:o.default_track,label:o.name}))})}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(t,e,i){"use strict";i.__esModule=!0;var a=i.createRepresentation=function(t,e){var i={id:e.index+"",width:e.width,height:e.height,bandwidth:e.bitrate,isEnabled_:!0};return i.enabled=function(e){if(void 0===e)return i.isEnabled_;e!==i.isEnabled_&&(!0!==e&&!1!==e||(i.isEnabled_=e,t()))},i};i.createRepresentations=function(t){var e=null,i=function(){var i=e.filter(function(t){return t.enabled()});if(i.length===e.length||0===i.length)return t.el_.vjs_setProperty("autoLevelCapping",-1),void t.el_.vjs_setProperty("level",-1);if(1===i.length)return t.el_.vjs_setProperty("level",parseInt(i[0].id,10)),void t.el_.vjs_setProperty("autoLevelCapping",-1);var a=i[i.length-1].id;t.el_.vjs_setProperty("autoLevelCapping",parseInt(a,10)),t.el_.vjs_setProperty("level",-1)};return function(){if(!e){var n=t.el_.vjs_getProperty("levels");e=n.filter(function(t){return!t.audio}).map(a.bind(null,i))}return e}}},{}],3:[function(t,e,i){(function(t){var i;i="undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{},e.exports=i}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],4:[function(t,e,i){"use strict";var a=t(7),n=function(t){for(var e=0,i={payloadType:-1,payloadSize:0},a=0,n=0;e<t.byteLength&&128!==t[e];){for(;255===t[e];)a+=255,e++;for(a+=t[e++];255===t[e];)n+=255,e++;if(n+=t[e++],!i.payload&&4===a){i.payloadType=a,i.payloadSize=n,i.payload=t.subarray(e,e+n);break}e+=n,a=0,n=0}return i},s=function(t){return 181!==t.payload[0]?null:49!=(t.payload[1]<<8|t.payload[2])?null:"GA94"!==String.fromCharCode(t.payload[3],t.payload[4],t.payload[5],t.payload[6])?null:3!==t.payload[7]?null:t.payload.subarray(8,t.payload.length-1)},o=function(t,e){var i,a,n,s,o=[];if(!(64&e[0]))return o;for(a=31&e[0],i=0;i<a;i++)n=3*i,s={type:3&e[n+2],pts:t},4&e[n+2]&&(s.ccData=e[n+3]<<8|e[n+4],o.push(s));return o},r=function(){r.prototype.init.call(this),this.captionPackets_=[],this.ccStreams_=[new u(0,0),new u(0,1),new u(1,0),new u(1,1)],this.reset(),this.ccStreams_.forEach(function(t){t.on("data",this.trigger.bind(this,"data")),t.on("done",this.trigger.bind(this,"done"))},this)};r.prototype=new a,r.prototype.push=function(t){var e,i;if("sei_rbsp"===t.nalUnitType&&(e=n(t.escapedRBSP),4===e.payloadType&&(i=s(e)))){if(t.dts<this.latestDts_)return void(this.ignoreNextEqualDts_=!0);if(t.dts===this.latestDts_&&this.ignoreNextEqualDts_)return void(this.ignoreNextEqualDts_=!1);this.captionPackets_=this.captionPackets_.concat(o(t.pts,i)),this.latestDts_=t.dts}},r.prototype.flush=function(){if(!this.captionPackets_.length)return void this.ccStreams_.forEach(function(t){t.flush()},this);this.captionPackets_.forEach(function(t,e){t.presortIndex=e}),this.captionPackets_.sort(function(t,e){return t.pts===e.pts?t.presortIndex-e.presortIndex:t.pts-e.pts}),this.captionPackets_.forEach(function(t){t.type<2&&this.dispatchCea608Packet(t)},this),this.captionPackets_.length=0,this.ccStreams_.forEach(function(t){t.flush()},this)},r.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach(function(t){t.reset()})},r.prototype.dispatchCea608Packet=function(t){this.setsChannel1Active(t)?this.activeCea608Channel_[t.type]=0:this.setsChannel2Active(t)&&(this.activeCea608Channel_[t.type]=1),null!==this.activeCea608Channel_[t.type]&&this.ccStreams_[(t.type<<1)+this.activeCea608Channel_[t.type]].push(t)},r.prototype.setsChannel1Active=function(t){return 4096==(30720&t.ccData)},r.prototype.setsChannel2Active=function(t){return 6144==(30720&t.ccData)};var d={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},h=function(t){return null===t?"":(t=d[t]||t,String.fromCharCode(t))},l=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],c=function(){for(var t=[],e=15;e--;)t.push("");return t},u=function(t,e){u.prototype.init.call(this),this.field_=t||0,this.dataChannel_=e||0,this.name_="CC"+(1+(this.field_<<1|this.dataChannel_)),this.setConstants(),this.reset(),this.push=function(t){var e,i,a,n,s;if((e=32639&t.ccData)===this.lastControlCode_)return void(this.lastControlCode_=null);if(4096==(61440&e)?this.lastControlCode_=e:e!==this.PADDING_&&(this.lastControlCode_=null),a=e>>>8,n=255&e,e!==this.PADDING_)if(e===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(e===this.END_OF_CAPTION_)this.clearFormatting(t.pts),this.flushDisplayed(t.pts),i=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=i,this.startPts_=t.pts;else if(e===this.ROLL_UP_2_ROWS_)this.topRow_=13,this.mode_="rollUp";else if(e===this.ROLL_UP_3_ROWS_)this.topRow_=12,this.mode_="rollUp";else if(e===this.ROLL_UP_4_ROWS_)this.topRow_=11,this.mode_="rollUp";else if(e===this.CARRIAGE_RETURN_)this.clearFormatting(t.pts),this.flushDisplayed(t.pts),this.shiftRowsUp_(),this.startPts_=t.pts;else if(e===this.BACKSPACE_)"popOn"===this.mode_?this.nonDisplayed_[14]=this.nonDisplayed_[14].slice(0,-1):this.displayed_[14]=this.displayed_[14].slice(0,-1);else if(e===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(t.pts),this.displayed_=c();else if(e===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=c();else if(e===this.RESUME_DIRECT_CAPTIONING_)this.mode_="paintOn";else if(this.isSpecialCharacter(a,n))a=(3&a)<<8,s=h(a|n),this[this.mode_](t.pts,s),this.column_++;else if(this.isExtCharacter(a,n))"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[14]=this.displayed_[14].slice(0,-1),a=(3&a)<<8,s=h(a|n),this[this.mode_](t.pts,s),this.column_++;else if(this.isMidRowCode(a,n))this.clearFormatting(t.pts),this[this.mode_](t.pts," "),this.column_++,14==(14&n)&&this.addFormatting(t.pts,["i"]),1==(1&n)&&this.addFormatting(t.pts,["u"]);else if(this.isOffsetControlCode(a,n))this.column_+=3&n;else if(this.isPAC(a,n)){var o=l.indexOf(7968&e);o!==this.row_&&(this.clearFormatting(t.pts),this.row_=o),1&n&&-1===this.formatting_.indexOf("u")&&this.addFormatting(t.pts,["u"]),16==(16&e)&&(this.column_=4*((14&e)>>1)),this.isColorPAC(n)&&14==(14&n)&&this.addFormatting(t.pts,["i"])}else this.isNormalChar(a)&&(0===n&&(n=null),s=h(a),s+=h(n),this[this.mode_](t.pts,s),this.column_+=s.length)}};u.prototype=new a,u.prototype.flushDisplayed=function(t){var e=this.displayed_.map(function(t){return t.trim()}).join("\n").replace(/^\n+|\n+$/g,"");e.length&&this.trigger("data",{startPts:this.startPts_,endPts:t,text:e,stream:this.name_})},u.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=c(),this.nonDisplayed_=c(),this.lastControlCode_=null,this.column_=0,this.row_=14,this.formatting_=[]},u.prototype.setConstants=function(){0===this.dataChannel_?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):1===this.dataChannel_&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=32|this.CONTROL_,this.END_OF_CAPTION_=47|this.CONTROL_,this.ROLL_UP_2_ROWS_=37|this.CONTROL_,this.ROLL_UP_3_ROWS_=38|this.CONTROL_,this.ROLL_UP_4_ROWS_=39|this.CONTROL_,this.CARRIAGE_RETURN_=45|this.CONTROL_,this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_,this.BACKSPACE_=33|this.CONTROL_,this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_,this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_},u.prototype.isSpecialCharacter=function(t,e){return t===this.EXT_&&e>=48&&e<=63},u.prototype.isExtCharacter=function(t,e){return(t===this.EXT_+1||t===this.EXT_+2)&&e>=32&&e<=63},u.prototype.isMidRowCode=function(t,e){return t===this.EXT_&&e>=32&&e<=47},u.prototype.isOffsetControlCode=function(t,e){return t===this.OFFSET_&&e>=33&&e<=35},u.prototype.isPAC=function(t,e){return t>=this.BASE_&&t<this.BASE_+8&&e>=64&&e<=127},u.prototype.isColorPAC=function(t){return t>=64&&t<=79||t>=96&&t<=127},u.prototype.isNormalChar=function(t){return t>=32&&t<=127},u.prototype.addFormatting=function(t,e){this.formatting_=this.formatting_.concat(e);var i=e.reduce(function(t,e){return t+"<"+e+">"},"");this[this.mode_](t,i)},u.prototype.clearFormatting=function(t){if(this.formatting_.length){var e=this.formatting_.reverse().reduce(function(t,e){return t+"</"+e+">"},"");this.formatting_=[],this[this.mode_](t,e)}},u.prototype.popOn=function(t,e){var i=this.nonDisplayed_[this.row_];i+=e,this.nonDisplayed_[this.row_]=i},u.prototype.rollUp=function(t,e){var i=this.displayed_[14];i+=e,this.displayed_[14]=i},u.prototype.shiftRowsUp_=function(){var t;for(t=0;t<this.topRow_;t++)this.displayed_[t]="";for(t=this.topRow_;t<14;t++)this.displayed_[t]=this.displayed_[t+1];this.displayed_[14]=""},u.prototype.paintOn=function(){},e.exports={CaptionStream:r,Cea608Stream:u}},{}],5:[function(t,e,i){"use strict";var a,n=t(7),s=t(6),o=function(t,e,i){var a,n="";for(a=e;a<i;a++)n+="%"+("00"+t[a].toString(16)).slice(-2);return n},r=function(t,e,i){return decodeURIComponent(o(t,e,i))},d=function(t,e,i){return unescape(o(t,e,i))},h=function(t){return t[0]<<21|t[1]<<14|t[2]<<7|t[3]},l={TXXX:function(t){var e;if(3===t.data[0]){for(e=1;e<t.data.length;e++)if(0===t.data[e]){t.description=r(t.data,1,e),t.value=r(t.data,e+1,t.data.length).replace(/\0*$/,"");break}t.data=t.value}},WXXX:function(t){var e;if(3===t.data[0])for(e=1;e<t.data.length;e++)if(0===t.data[e]){t.description=r(t.data,1,e),t.url=r(t.data,e+1,t.data.length);break}},PRIV:function(t){var e;for(e=0;e<t.data.length;e++)if(0===t.data[e]){t.owner=d(t.data,0,e);break}t.privateData=t.data.subarray(e+1),t.data=t.privateData}};a=function(t){var e,i={debug:!(!t||!t.debug),descriptor:t&&t.descriptor},n=0,o=[],r=0;if(a.prototype.init.call(this),this.dispatchType=s.METADATA_STREAM_TYPE.toString(16),i.descriptor)for(e=0;e<i.descriptor.length;e++)this.dispatchType+=("00"+i.descriptor[e].toString(16)).slice(-2);this.push=function(t){var e,a,s,d,c,u;if("timed-metadata"===t.type){if(t.dataAlignmentIndicator&&(r=0,o.length=0),0===o.length&&(t.data.length<10||t.data[0]!=="I".charCodeAt(0)||t.data[1]!=="D".charCodeAt(0)||t.data[2]!=="3".charCodeAt(0)))return void(i.debug&&console.log("Skipping unrecognized metadata packet"));if(o.push(t),r+=t.data.byteLength,1===o.length&&(n=h(t.data.subarray(6,10)),n+=10),!(r<n)){for(e={data:new Uint8Array(n),frames:[],pts:o[0].pts,dts:o[0].dts},c=0;c<n;)e.data.set(o[0].data.subarray(0,n-c),c),c+=o[0].data.byteLength,r-=o[0].data.byteLength,o.shift();a=10,64&e.data[5]&&(a+=4,a+=h(e.data.subarray(10,14)),n-=h(e.data.subarray(16,20)));do{if((s=h(e.data.subarray(a+4,a+8)))<1)return console.log("Malformed ID3 frame encountered. Skipping metadata parsing.");if(u=String.fromCharCode(e.data[a],e.data[a+1],e.data[a+2],e.data[a+3]),d={id:u,data:e.data.subarray(a+10,a+s+10)},d.key=d.id,l[d.id]&&(l[d.id](d),"com.apple.streaming.transportStreamTimestamp"===d.owner)){var p=d.data,_=(1&p[3])<<30|p[4]<<22|p[5]<<14|p[6]<<6|p[7]>>>2;_*=4,_+=3&p[7],d.timeStamp=_,void 0===e.pts&&void 0===e.dts&&(e.pts=d.timeStamp,e.dts=d.timeStamp),this.trigger("timestamp",d)}e.frames.push(d),a+=10,a+=s}while(a<n);this.trigger("data",e)}}}},a.prototype=new n,e.exports=a},{}],6:[function(t,e,i){"use strict";e.exports={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21}},{}],7:[function(t,e,i){"use strict";var a=function(){this.init=function(){var t={};this.on=function(e,i){t[e]||(t[e]=[]),t[e]=t[e].concat(i)},this.off=function(e,i){var a;return!!t[e]&&(a=t[e].indexOf(i),t[e]=t[e].slice(),t[e].splice(a,1),a>-1)},this.trigger=function(e){var i,a,n,s;if(i=t[e])if(2===arguments.length)for(n=i.length,a=0;a<n;++a)i[a].call(this,arguments[1]);else{for(s=[],a=arguments.length,a=1;a<arguments.length;++a)s.push(arguments[a]);for(n=i.length,a=0;a<n;++a)i[a].apply(this,s)}},this.dispose=function(){t={}}}};a.prototype.pipe=function(t){return this.on("data",function(e){t.push(e)}),this.on("done",function(e){t.flush(e)}),t},a.prototype.push=function(t){this.trigger("data",t)},a.prototype.flush=function(t){this.trigger("done",t)},e.exports=a},{}],8:[function(t,e,i){(function(e){"use strict";function a(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}i.__esModule=!0,i.FlashlsHandler=void 0;var s="undefined"!=typeof window?window.videojs:void 0!==e?e.videojs:null,o=a(s),r=t(3),d=a(r),h=t(4),l=t(5),c=a(l),u=t(2),p=t(1),_=function(t){Object.defineProperties(t.frame,{id:{get:function(){return o.default.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),t.value.key}},value:{get:function(){return o.default.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),t.value.data}},privateData:{get:function(){return o.default.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),t.value.data}}})},f=function(t,e,i){for(var a=t.remoteTextTracks()||[],n=0;n<a.length;n++){var s=a[n];s.kind===e&&s.label===i&&t.removeRemoteTextTrack(s)}},y=function(t){for(var e=new Uint8Array(t.length),i=0;i<t.length;i++)e[i]=t.charCodeAt(i);return e},g=function(t,e,i){var a=void 0,n=void 0;if(i&&i.cues)for(a=i.cues.length;a--;)n=i.cues[a],n.startTime<=e&&n.endTime>=t&&i.removeCue(n)},m=function(t,e){t.length&&g(0,t.start(0),e)},v=function(t,e){for(var i=-1,a=0;a<t.length;a++)if(t[a].id===e){i=a;break}t.selectedIndex_=i,t.trigger({selectedIndex:i,type:"change"})},T=function(t,e){var i=[];if(t&&t.length)for(var a=0;a<t.length;a++)e(t.start(a),t.end(a))&&i.push([t.start(a),t.end(a)]);return o.default.createTimeRanges(i)},C=function(t,e){return T(t,function(t,i){return t-1/30<=e&&i+1/30>=e})},S=i.FlashlsHandler=function(){function t(e,i,a){var s=this;if(n(this,t),i.options_&&i.options_.playerId){var r=(0,o.default)(i.options_.playerId);r.hasOwnProperty("hls")||Object.defineProperty(r,"hls",{get:function(){return o.default.log.warn("player.hls is deprecated. Use player.tech_.hls instead."),i.trigger({type:"usage",name:"flashls-player-access"}),s}})}Object.defineProperties(this,{stats:{get:function(){return this.tech_.el_.vjs_getProperty("stats")}},bandwidth:{get:function(){return this.tech_.el_.vjs_getProperty("stats").bandwidth}}}),this.tech_=i,this.metadataTrack_=null,this.inbandTextTracks_={},this.metadataStream_=new c.default,this.captionStream_=new h.CaptionStream,this.onLoadedmetadata_=this.onLoadedmetadata_.bind(this),this.onSeeking_=this.onSeeking_.bind(this),this.onId3updated_=this.onId3updated_.bind(this),this.onCaptionData_=this.onCaptionData_.bind(this),this.onMetadataStreamData_=this.onMetadataStreamData_.bind(this),this.onCaptionStreamData_=this.onCaptionStreamData_.bind(this),this.onLevelSwitch_=this.onLevelSwitch_.bind(this),this.onLevelLoaded_=this.onLevelLoaded_.bind(this),this.onFragmentLoaded_=this.onFragmentLoaded_.bind(this),this.onAudioTrackChanged=this.onAudioTrackChanged.bind(this),this.tech_.on("loadedmetadata",this.onLoadedmetadata_),this.tech_.on("seeking",this.onSeeking_),this.tech_.on("id3updated",this.onId3updated_),this.tech_.on("captiondata",this.onCaptionData_),this.tech_.on("levelswitch",this.onLevelSwitch_),this.tech_.on("levelloaded",this.onLevelLoaded_),this.tech_.on("fragmentloaded",this.onFragmentLoaded_),this.metadataStream_.on("data",this.onMetadataStreamData_),this.captionStream_.on("data",this.onCaptionStreamData_),this.playlists=new o.default.EventTarget,this.playlists.media=function(){return s.media_()}}return t.prototype.src=function(t){t&&this.tech_.setSrc(t.src)},t.prototype.seekable=function(){var t=this.tech_.el_.vjs_getProperty("seekableStart"),e=this.tech_.el_.vjs_getProperty("seekableEnd");return 0===e?o.default.createTimeRange():o.default.createTimeRange(t,e)},t.prototype.media_=function(){var t=this.tech_.el_.vjs_getProperty("levels"),e=this.tech_.el_.vjs_getProperty("level"),i=void 0;return t.length&&(i={resolvedUri:t[e].url,attributes:{BANDWIDTH:t[e].bitrate,RESOLUTION:{width:t[e].width,height:t[e].height}}}),i},t.prototype.onLoadedmetadata_=function(){var t=this;this.representations=(0,u.createRepresentations)(this.tech_);var e=o.default.players[this.tech_.options_.playerId];e&&e.qualityLevels&&(this.qualityLevels_=e.qualityLevels(),this.representations().forEach(function(e){t.qualityLevels_.addQualityLevel(e)}),v(this.qualityLevels_,this.tech_.el_.vjs_getProperty("level")+"")),(0,p.setupAudioTracks)(this.tech_),this.tech_.audioTracks().on("change",this.onAudioTrackChanged)},t.prototype.onAudioTrackChanged=function(){(0,p.updateAudioTrack)(this.tech_)},t.prototype.onLevelSwitch_=function(t,e){this.qualityLevels_&&v(this.qualityLevels_,e[0].levelIndex+""),this.playlists.trigger("mediachange"),this.tech_.trigger({type:"mediachange",bubbles:!0})},t.prototype.onLevelLoaded_=function(){this.playlists.trigger("loadedplaylist")},t.prototype.onFragmentLoaded_=function(){this.tech_.trigger("bandwidthupdate"),this.captionStream_.flush()},t.prototype.onSeeking_=function(){var t=this;g(0,1/0,this.metadataTrack_),C(this.tech_.buffered(),this.tech_.currentTime()).length||(Object.keys(this.inbandTextTracks_).forEach(function(e){g(0,1/0,t.inbandTextTracks_[e])}),this.captionStream_.reset())},t.prototype.onId3updated_=function(t,e){var i=d.default.atob(e[0]),a=y(i),n={type:"timed-metadata",dataAlignmentIndicator:!0,data:a};this.metadataStream_.push(n)},t.prototype.onMetadataStreamData_=function(t){var e=this;this.metadataTrack_||(this.metadataTrack_=this.tech_.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,this.metadataTrack_.inBandMetadataTrackDispatchType=""),m(this.tech_.buffered(),this.metadataTrack_);var i=this.tech_.currentTime();if(t.frames.forEach(function(t){var a=new d.default.VTTCue(i,i+.1,t.value||t.url||t.data||"");a.frame=t,a.value=t,_(a),e.metadataTrack_.addCue(a)}),this.metadataTrack_.cues&&this.metadataTrack_.cues.length){var a=this.metadataTrack_.cues,n=[],s=this.tech_.duration();(isNaN(s)||Math.abs(s)===1/0)&&(s=Number.MAX_VALUE);for(var o=0;o<a.length;o++)n.push(a[o]);n.sort(function(t,e){return t.startTime-e.startTime});for(var r=0;r<n.length-1;r++)n[r].endTime!==n[r+1].startTime&&(n[r].endTime=n[r+1].startTime);n[n.length-1].endTime=s}},t.prototype.onCaptionData_=function(t,e){var i=this;e[0].forEach(function(t){i.captionStream_.push({pts:9e4*t.pos,dts:9e4*t.dts,escapedRBSP:y(d.default.atob(t.data)),nalUnitType:"sei_rbsp"})})},t.prototype.onCaptionStreamData_=function(t){t&&(this.inbandTextTracks_[t.stream]||(f(this.tech_,"captions",t.stream),this.inbandTextTracks_[t.stream]=this.tech_.addRemoteTextTrack({kind:"captions",label:t.stream,id:t.stream},!1).track),m(this.tech_.buffered(),this.inbandTextTracks_[t.stream]),this.inbandTextTracks_[t.stream].addCue(new d.default.VTTCue(t.startPts/9e4,t.endPts/9e4,t.text)))},t.prototype.dispose=function(){this.tech_.off("loadedmetadata",this.onLoadedmetadata_),this.tech_.off("seeked",this.onSeeking_),this.tech_.off("id3updated",this.onId3updated_),this.tech_.off("captiondata",this.onCaptionData_),this.tech_.audioTracks().off("change",this.onAudioTrackChanged),this.tech_.off("levelswitch",this.onLevelSwitch_),this.tech_.off("levelloaded",this.onLevelLoaded_),this.tech_.off("fragmentloaded",this.onFragmentLoaded_),this.qualityLevels_&&this.qualityLevels_.dispose()},t}(),b={},E=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i;b.canPlayType=function(t){return E.test(t)?"maybe":""},b.canHandleSource=function(t,e){return"maybe"===b.canPlayType(t.type)},b.handleSource=function(t,e,i){return e.hls=new S(t,e,i),e.hls.src(t),e.hls},o.default.getTech("Flash").registerSourceHandler(b,0),b.VERSION="1.4.2",i.default=b}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[8]); | ||
!function t(e,i,a){function n(o,r){if(!i[o]){if(!e[o]){var d="function"==typeof require&&require;if(!r&&d)return d(o,!0);if(s)return s(o,!0);var h=new Error("Cannot find module '"+o+"'");throw h.code="MODULE_NOT_FOUND",h}var l=i[o]={exports:{}};e[o][0].call(l.exports,function(t){var i=e[o][1][t];return n(i||t)},l,l.exports,t,e,i,a)}return i[o].exports}for(var s="function"==typeof require&&require,o=0;o<a.length;o++)n(a[o]);return n}({1:[function(t,e,i){(function(t){"use strict";i.__esModule=!0,i.setupAudioTracks=i.updateAudioTrack=void 0;var e="undefined"!=typeof window?window.videojs:void 0!==t?t.videojs:null,a=function(t){return t&&t.__esModule?t:{default:t}}(e);i.updateAudioTrack=function(t){for(var e=t.el_.vjs_getProperty("audioTracks"),i=t.audioTracks(),a=null,n=0;n<i.length;n++)if(i[n].enabled){a=i[n].id;break}if(null!==a)for(var s=0;s<e.length;s++)if(a===e[s].title)return void t.el_.vjs_setProperty("audioTrack",s)},i.setupAudioTracks=function(t){var e=t.el_.vjs_getProperty("altAudioTracks"),i=t.el_.vjs_getProperty("audioTracks"),n=t.el_.vjs_getProperty("audioTrack");i.forEach(function(i,s){var o=e[i.id];t.audioTracks().addTrack(new a.default.AudioTrack({id:o.name,enabled:n===s,language:o.lang,default:o.default_track,label:o.name}))})}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(t,e,i){"use strict";i.__esModule=!0;var a=i.createRepresentation=function(t,e){var i={id:e.index+"",width:e.width,height:e.height,bandwidth:e.bitrate,isEnabled_:!0};return i.enabled=function(e){if(void 0===e)return i.isEnabled_;e!==i.isEnabled_&&(!0!==e&&!1!==e||(i.isEnabled_=e,t()))},i};i.createRepresentations=function(t){var e=null,i=function(){var i=e.filter(function(t){return t.enabled()});if(i.length===e.length||0===i.length)return t.el_.vjs_setProperty("autoLevelCapping",-1),void t.el_.vjs_setProperty("level",-1);if(1===i.length)return t.el_.vjs_setProperty("level",parseInt(i[0].id,10)),void t.el_.vjs_setProperty("autoLevelCapping",-1);var a=i[i.length-1].id;t.el_.vjs_setProperty("autoLevelCapping",parseInt(a,10)),t.el_.vjs_setProperty("level",-1)};return function(){if(!e){var n=t.el_.vjs_getProperty("levels");e=n.filter(function(t){return!t.audio}).map(a.bind(null,i))}return e}}},{}],3:[function(t,e,i){(function(t){var i;i="undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{},e.exports=i}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],4:[function(t,e,i){"use strict";var a=t(7),n=function(t){for(var e=0,i={payloadType:-1,payloadSize:0},a=0,n=0;e<t.byteLength&&128!==t[e];){for(;255===t[e];)a+=255,e++;for(a+=t[e++];255===t[e];)n+=255,e++;if(n+=t[e++],!i.payload&&4===a){i.payloadType=a,i.payloadSize=n,i.payload=t.subarray(e,e+n);break}e+=n,a=0,n=0}return i},s=function(t){return 181!==t.payload[0]?null:49!=(t.payload[1]<<8|t.payload[2])?null:"GA94"!==String.fromCharCode(t.payload[3],t.payload[4],t.payload[5],t.payload[6])?null:3!==t.payload[7]?null:t.payload.subarray(8,t.payload.length-1)},o=function(t,e){var i,a,n,s,o=[];if(!(64&e[0]))return o;for(a=31&e[0],i=0;i<a;i++)n=3*i,s={type:3&e[n+2],pts:t},4&e[n+2]&&(s.ccData=e[n+3]<<8|e[n+4],o.push(s));return o},r=function(){r.prototype.init.call(this),this.captionPackets_=[],this.ccStreams_=[new u(0,0),new u(0,1),new u(1,0),new u(1,1)],this.reset(),this.ccStreams_.forEach(function(t){t.on("data",this.trigger.bind(this,"data")),t.on("done",this.trigger.bind(this,"done"))},this)};r.prototype=new a,r.prototype.push=function(t){var e,i;if("sei_rbsp"===t.nalUnitType&&(e=n(t.escapedRBSP),4===e.payloadType&&(i=s(e)))){if(t.dts<this.latestDts_)return void(this.ignoreNextEqualDts_=!0);if(t.dts===this.latestDts_&&this.ignoreNextEqualDts_)return void(this.ignoreNextEqualDts_=!1);this.captionPackets_=this.captionPackets_.concat(o(t.pts,i)),this.latestDts_=t.dts}},r.prototype.flush=function(){if(!this.captionPackets_.length)return void this.ccStreams_.forEach(function(t){t.flush()},this);this.captionPackets_.forEach(function(t,e){t.presortIndex=e}),this.captionPackets_.sort(function(t,e){return t.pts===e.pts?t.presortIndex-e.presortIndex:t.pts-e.pts}),this.captionPackets_.forEach(function(t){t.type<2&&this.dispatchCea608Packet(t)},this),this.captionPackets_.length=0,this.ccStreams_.forEach(function(t){t.flush()},this)},r.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach(function(t){t.reset()})},r.prototype.dispatchCea608Packet=function(t){this.setsChannel1Active(t)?this.activeCea608Channel_[t.type]=0:this.setsChannel2Active(t)&&(this.activeCea608Channel_[t.type]=1),null!==this.activeCea608Channel_[t.type]&&this.ccStreams_[(t.type<<1)+this.activeCea608Channel_[t.type]].push(t)},r.prototype.setsChannel1Active=function(t){return 4096==(30720&t.ccData)},r.prototype.setsChannel2Active=function(t){return 6144==(30720&t.ccData)};var d={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},h=function(t){return null===t?"":(t=d[t]||t,String.fromCharCode(t))},l=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],c=function(){for(var t=[],e=15;e--;)t.push("");return t},u=function(t,e){u.prototype.init.call(this),this.field_=t||0,this.dataChannel_=e||0,this.name_="CC"+(1+(this.field_<<1|this.dataChannel_)),this.setConstants(),this.reset(),this.push=function(t){var e,i,a,n,s;if((e=32639&t.ccData)===this.lastControlCode_)return void(this.lastControlCode_=null);if(4096==(61440&e)?this.lastControlCode_=e:e!==this.PADDING_&&(this.lastControlCode_=null),a=e>>>8,n=255&e,e!==this.PADDING_)if(e===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(e===this.END_OF_CAPTION_)this.clearFormatting(t.pts),this.flushDisplayed(t.pts),i=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=i,this.startPts_=t.pts;else if(e===this.ROLL_UP_2_ROWS_)this.topRow_=13,this.mode_="rollUp";else if(e===this.ROLL_UP_3_ROWS_)this.topRow_=12,this.mode_="rollUp";else if(e===this.ROLL_UP_4_ROWS_)this.topRow_=11,this.mode_="rollUp";else if(e===this.CARRIAGE_RETURN_)this.clearFormatting(t.pts),this.flushDisplayed(t.pts),this.shiftRowsUp_(),this.startPts_=t.pts;else if(e===this.BACKSPACE_)"popOn"===this.mode_?this.nonDisplayed_[14]=this.nonDisplayed_[14].slice(0,-1):this.displayed_[14]=this.displayed_[14].slice(0,-1);else if(e===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(t.pts),this.displayed_=c();else if(e===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=c();else if(e===this.RESUME_DIRECT_CAPTIONING_)this.mode_="paintOn";else if(this.isSpecialCharacter(a,n))a=(3&a)<<8,s=h(a|n),this[this.mode_](t.pts,s),this.column_++;else if(this.isExtCharacter(a,n))"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[14]=this.displayed_[14].slice(0,-1),a=(3&a)<<8,s=h(a|n),this[this.mode_](t.pts,s),this.column_++;else if(this.isMidRowCode(a,n))this.clearFormatting(t.pts),this[this.mode_](t.pts," "),this.column_++,14==(14&n)&&this.addFormatting(t.pts,["i"]),1==(1&n)&&this.addFormatting(t.pts,["u"]);else if(this.isOffsetControlCode(a,n))this.column_+=3&n;else if(this.isPAC(a,n)){var o=l.indexOf(7968&e);o!==this.row_&&(this.clearFormatting(t.pts),this.row_=o),1&n&&-1===this.formatting_.indexOf("u")&&this.addFormatting(t.pts,["u"]),16==(16&e)&&(this.column_=4*((14&e)>>1)),this.isColorPAC(n)&&14==(14&n)&&this.addFormatting(t.pts,["i"])}else this.isNormalChar(a)&&(0===n&&(n=null),s=h(a),s+=h(n),this[this.mode_](t.pts,s),this.column_+=s.length)}};u.prototype=new a,u.prototype.flushDisplayed=function(t){var e=this.displayed_.map(function(t){return t.trim()}).join("\n").replace(/^\n+|\n+$/g,"");e.length&&this.trigger("data",{startPts:this.startPts_,endPts:t,text:e,stream:this.name_})},u.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=c(),this.nonDisplayed_=c(),this.lastControlCode_=null,this.column_=0,this.row_=14,this.formatting_=[]},u.prototype.setConstants=function(){0===this.dataChannel_?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):1===this.dataChannel_&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=32|this.CONTROL_,this.END_OF_CAPTION_=47|this.CONTROL_,this.ROLL_UP_2_ROWS_=37|this.CONTROL_,this.ROLL_UP_3_ROWS_=38|this.CONTROL_,this.ROLL_UP_4_ROWS_=39|this.CONTROL_,this.CARRIAGE_RETURN_=45|this.CONTROL_,this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_,this.BACKSPACE_=33|this.CONTROL_,this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_,this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_},u.prototype.isSpecialCharacter=function(t,e){return t===this.EXT_&&e>=48&&e<=63},u.prototype.isExtCharacter=function(t,e){return(t===this.EXT_+1||t===this.EXT_+2)&&e>=32&&e<=63},u.prototype.isMidRowCode=function(t,e){return t===this.EXT_&&e>=32&&e<=47},u.prototype.isOffsetControlCode=function(t,e){return t===this.OFFSET_&&e>=33&&e<=35},u.prototype.isPAC=function(t,e){return t>=this.BASE_&&t<this.BASE_+8&&e>=64&&e<=127},u.prototype.isColorPAC=function(t){return t>=64&&t<=79||t>=96&&t<=127},u.prototype.isNormalChar=function(t){return t>=32&&t<=127},u.prototype.addFormatting=function(t,e){this.formatting_=this.formatting_.concat(e);var i=e.reduce(function(t,e){return t+"<"+e+">"},"");this[this.mode_](t,i)},u.prototype.clearFormatting=function(t){if(this.formatting_.length){var e=this.formatting_.reverse().reduce(function(t,e){return t+"</"+e+">"},"");this.formatting_=[],this[this.mode_](t,e)}},u.prototype.popOn=function(t,e){var i=this.nonDisplayed_[this.row_];i+=e,this.nonDisplayed_[this.row_]=i},u.prototype.rollUp=function(t,e){var i=this.displayed_[14];i+=e,this.displayed_[14]=i},u.prototype.shiftRowsUp_=function(){var t;for(t=0;t<this.topRow_;t++)this.displayed_[t]="";for(t=this.topRow_;t<14;t++)this.displayed_[t]=this.displayed_[t+1];this.displayed_[14]=""},u.prototype.paintOn=function(){},e.exports={CaptionStream:r,Cea608Stream:u}},{}],5:[function(t,e,i){"use strict";var a,n=t(7),s=t(6),o=function(t,e,i){var a,n="";for(a=e;a<i;a++)n+="%"+("00"+t[a].toString(16)).slice(-2);return n},r=function(t,e,i){return decodeURIComponent(o(t,e,i))},d=function(t,e,i){return unescape(o(t,e,i))},h=function(t){return t[0]<<21|t[1]<<14|t[2]<<7|t[3]},l={TXXX:function(t){var e;if(3===t.data[0]){for(e=1;e<t.data.length;e++)if(0===t.data[e]){t.description=r(t.data,1,e),t.value=r(t.data,e+1,t.data.length).replace(/\0*$/,"");break}t.data=t.value}},WXXX:function(t){var e;if(3===t.data[0])for(e=1;e<t.data.length;e++)if(0===t.data[e]){t.description=r(t.data,1,e),t.url=r(t.data,e+1,t.data.length);break}},PRIV:function(t){var e;for(e=0;e<t.data.length;e++)if(0===t.data[e]){t.owner=d(t.data,0,e);break}t.privateData=t.data.subarray(e+1),t.data=t.privateData}};a=function(t){var e,i={debug:!(!t||!t.debug),descriptor:t&&t.descriptor},n=0,o=[],r=0;if(a.prototype.init.call(this),this.dispatchType=s.METADATA_STREAM_TYPE.toString(16),i.descriptor)for(e=0;e<i.descriptor.length;e++)this.dispatchType+=("00"+i.descriptor[e].toString(16)).slice(-2);this.push=function(t){var e,a,s,d,c,u;if("timed-metadata"===t.type){if(t.dataAlignmentIndicator&&(r=0,o.length=0),0===o.length&&(t.data.length<10||t.data[0]!=="I".charCodeAt(0)||t.data[1]!=="D".charCodeAt(0)||t.data[2]!=="3".charCodeAt(0)))return void(i.debug&&console.log("Skipping unrecognized metadata packet"));if(o.push(t),r+=t.data.byteLength,1===o.length&&(n=h(t.data.subarray(6,10)),n+=10),!(r<n)){for(e={data:new Uint8Array(n),frames:[],pts:o[0].pts,dts:o[0].dts},c=0;c<n;)e.data.set(o[0].data.subarray(0,n-c),c),c+=o[0].data.byteLength,r-=o[0].data.byteLength,o.shift();a=10,64&e.data[5]&&(a+=4,a+=h(e.data.subarray(10,14)),n-=h(e.data.subarray(16,20)));do{if((s=h(e.data.subarray(a+4,a+8)))<1)return console.log("Malformed ID3 frame encountered. Skipping metadata parsing.");if(u=String.fromCharCode(e.data[a],e.data[a+1],e.data[a+2],e.data[a+3]),d={id:u,data:e.data.subarray(a+10,a+s+10)},d.key=d.id,l[d.id]&&(l[d.id](d),"com.apple.streaming.transportStreamTimestamp"===d.owner)){var p=d.data,_=(1&p[3])<<30|p[4]<<22|p[5]<<14|p[6]<<6|p[7]>>>2;_*=4,_+=3&p[7],d.timeStamp=_,void 0===e.pts&&void 0===e.dts&&(e.pts=d.timeStamp,e.dts=d.timeStamp),this.trigger("timestamp",d)}e.frames.push(d),a+=10,a+=s}while(a<n);this.trigger("data",e)}}}},a.prototype=new n,e.exports=a},{}],6:[function(t,e,i){"use strict";e.exports={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21}},{}],7:[function(t,e,i){"use strict";var a=function(){this.init=function(){var t={};this.on=function(e,i){t[e]||(t[e]=[]),t[e]=t[e].concat(i)},this.off=function(e,i){var a;return!!t[e]&&(a=t[e].indexOf(i),t[e]=t[e].slice(),t[e].splice(a,1),a>-1)},this.trigger=function(e){var i,a,n,s;if(i=t[e])if(2===arguments.length)for(n=i.length,a=0;a<n;++a)i[a].call(this,arguments[1]);else{for(s=[],a=arguments.length,a=1;a<arguments.length;++a)s.push(arguments[a]);for(n=i.length,a=0;a<n;++a)i[a].apply(this,s)}},this.dispose=function(){t={}}}};a.prototype.pipe=function(t){return this.on("data",function(e){t.push(e)}),this.on("done",function(e){t.flush(e)}),t},a.prototype.push=function(t){this.trigger("data",t)},a.prototype.flush=function(t){this.trigger("done",t)},e.exports=a},{}],8:[function(t,e,i){(function(e){"use strict";function a(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}i.__esModule=!0,i.FlashlsHandler=void 0;var s="undefined"!=typeof window?window.videojs:void 0!==e?e.videojs:null,o=a(s),r=t(3),d=a(r),h=t(4),l=t(5),c=a(l),u=t(2),p=t(1),_=function(t){Object.defineProperties(t.frame,{id:{get:function(){return o.default.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),t.value.key}},value:{get:function(){return o.default.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),t.value.data}},privateData:{get:function(){return o.default.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),t.value.data}}})},f=function(t,e,i){for(var a=t.remoteTextTracks()||[],n=0;n<a.length;n++){var s=a[n];s.kind===e&&s.label===i&&t.removeRemoteTextTrack(s)}},y=function(t){for(var e=new Uint8Array(t.length),i=0;i<t.length;i++)e[i]=t.charCodeAt(i);return e},g=function(t,e,i){var a=void 0,n=void 0;if(i&&i.cues)for(a=i.cues.length;a--;)n=i.cues[a],n.startTime<=e&&n.endTime>=t&&i.removeCue(n)},m=function(t,e){t.length&&g(0,t.start(0),e)},v=function(t,e){for(var i=-1,a=0;a<t.length;a++)if(t[a].id===e){i=a;break}t.selectedIndex_=i,t.trigger({selectedIndex:i,type:"change"})},T=function(t,e){var i=[];if(t&&t.length)for(var a=0;a<t.length;a++)e(t.start(a),t.end(a))&&i.push([t.start(a),t.end(a)]);return o.default.createTimeRanges(i)},C=function(t,e){return T(t,function(t,i){return t-1/30<=e&&i+1/30>=e})},S=i.FlashlsHandler=function(){function t(e,i,a){var s=this;if(n(this,t),i.options_&&i.options_.playerId){var r=(0,o.default)(i.options_.playerId);r.hasOwnProperty("hls")||Object.defineProperty(r,"hls",{get:function(){return o.default.log.warn("player.hls is deprecated. Use player.tech_.hls instead."),i.trigger({type:"usage",name:"flashls-player-access"}),s}})}Object.defineProperties(this,{stats:{get:function(){return this.tech_.el_.vjs_getProperty("stats")}},bandwidth:{get:function(){return this.tech_.el_.vjs_getProperty("stats").bandwidth}}}),this.tech_=i,this.metadataTrack_=null,this.inbandTextTracks_={},this.metadataStream_=new c.default,this.captionStream_=new h.CaptionStream,this.onLoadedmetadata_=this.onLoadedmetadata_.bind(this),this.onSeeking_=this.onSeeking_.bind(this),this.onId3updated_=this.onId3updated_.bind(this),this.onCaptionData_=this.onCaptionData_.bind(this),this.onMetadataStreamData_=this.onMetadataStreamData_.bind(this),this.onCaptionStreamData_=this.onCaptionStreamData_.bind(this),this.onLevelSwitch_=this.onLevelSwitch_.bind(this),this.onLevelLoaded_=this.onLevelLoaded_.bind(this),this.onFragmentLoaded_=this.onFragmentLoaded_.bind(this),this.onAudioTrackChanged=this.onAudioTrackChanged.bind(this),this.tech_.on("loadedmetadata",this.onLoadedmetadata_),this.tech_.on("seeking",this.onSeeking_),this.tech_.on("id3updated",this.onId3updated_),this.tech_.on("captiondata",this.onCaptionData_),this.tech_.on("levelswitch",this.onLevelSwitch_),this.tech_.on("levelloaded",this.onLevelLoaded_),this.tech_.on("fragmentloaded",this.onFragmentLoaded_),this.metadataStream_.on("data",this.onMetadataStreamData_),this.captionStream_.on("data",this.onCaptionStreamData_),this.playlists=new o.default.EventTarget,this.playlists.media=function(){return s.media_()}}return t.prototype.src=function(t){t&&this.tech_.setSrc(t.src)},t.prototype.seekable=function(){var t=this.tech_.el_.vjs_getProperty("seekableStart"),e=this.tech_.el_.vjs_getProperty("seekableEnd");return 0===e?o.default.createTimeRange():o.default.createTimeRange(t,e)},t.prototype.media_=function(){var t=this.tech_.el_.vjs_getProperty("levels"),e=this.tech_.el_.vjs_getProperty("level"),i=void 0;return t.length&&(i={resolvedUri:t[e].url,attributes:{BANDWIDTH:t[e].bitrate,RESOLUTION:{width:t[e].width,height:t[e].height}}}),i},t.prototype.onLoadedmetadata_=function(){var t=this;this.representations=(0,u.createRepresentations)(this.tech_);var e=o.default.players[this.tech_.options_.playerId];e&&e.qualityLevels&&(this.qualityLevels_=e.qualityLevels(),this.representations().forEach(function(e){t.qualityLevels_.addQualityLevel(e)}),v(this.qualityLevels_,this.tech_.el_.vjs_getProperty("level")+"")),(0,p.setupAudioTracks)(this.tech_),this.tech_.audioTracks().on("change",this.onAudioTrackChanged)},t.prototype.onAudioTrackChanged=function(){(0,p.updateAudioTrack)(this.tech_)},t.prototype.onLevelSwitch_=function(t,e){this.qualityLevels_&&v(this.qualityLevels_,e[0].levelIndex+""),this.playlists.trigger("mediachange"),this.tech_.trigger({type:"mediachange",bubbles:!0})},t.prototype.onLevelLoaded_=function(){this.playlists.trigger("loadedplaylist")},t.prototype.onFragmentLoaded_=function(){this.tech_.trigger("bandwidthupdate"),this.captionStream_.flush()},t.prototype.onSeeking_=function(){var t=this;g(0,1/0,this.metadataTrack_),C(this.tech_.buffered(),this.tech_.currentTime()).length||(Object.keys(this.inbandTextTracks_).forEach(function(e){g(0,1/0,t.inbandTextTracks_[e])}),this.captionStream_.reset())},t.prototype.onId3updated_=function(t,e){var i=d.default.atob(e[0]),a=y(i),n={type:"timed-metadata",dataAlignmentIndicator:!0,data:a};this.metadataStream_.push(n)},t.prototype.onMetadataStreamData_=function(t){var e=this;this.metadataTrack_||(this.metadataTrack_=this.tech_.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,this.metadataTrack_.inBandMetadataTrackDispatchType=""),m(this.tech_.buffered(),this.metadataTrack_);var i=this.tech_.currentTime();if(t.frames.forEach(function(t){var a=new d.default.VTTCue(i,i+.1,t.value||t.url||t.data||"");a.frame=t,a.value=t,_(a),e.metadataTrack_.addCue(a)}),this.metadataTrack_.cues&&this.metadataTrack_.cues.length){var a=this.metadataTrack_.cues,n=[],s=this.tech_.duration();(isNaN(s)||Math.abs(s)===1/0)&&(s=Number.MAX_VALUE);for(var o=0;o<a.length;o++)n.push(a[o]);n.sort(function(t,e){return t.startTime-e.startTime});for(var r=0;r<n.length-1;r++)n[r].endTime!==n[r+1].startTime&&(n[r].endTime=n[r+1].startTime);n[n.length-1].endTime=s}},t.prototype.onCaptionData_=function(t,e){var i=this;e[0].forEach(function(t){i.captionStream_.push({pts:9e4*t.pos,dts:9e4*t.dts,escapedRBSP:y(d.default.atob(t.data)),nalUnitType:"sei_rbsp"})})},t.prototype.onCaptionStreamData_=function(t){t&&(this.inbandTextTracks_[t.stream]||(f(this.tech_,"captions",t.stream),this.inbandTextTracks_[t.stream]=this.tech_.addRemoteTextTrack({kind:"captions",label:t.stream,id:t.stream},!1).track),m(this.tech_.buffered(),this.inbandTextTracks_[t.stream]),this.inbandTextTracks_[t.stream].addCue(new d.default.VTTCue(t.startPts/9e4,t.endPts/9e4,t.text)))},t.prototype.dispose=function(){this.tech_.off("loadedmetadata",this.onLoadedmetadata_),this.tech_.off("seeked",this.onSeeking_),this.tech_.off("id3updated",this.onId3updated_),this.tech_.off("captiondata",this.onCaptionData_),this.tech_.audioTracks().off("change",this.onAudioTrackChanged),this.tech_.off("levelswitch",this.onLevelSwitch_),this.tech_.off("levelloaded",this.onLevelLoaded_),this.tech_.off("fragmentloaded",this.onFragmentLoaded_),this.qualityLevels_&&this.qualityLevels_.dispose()},t}(),b={},E=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i;b.canPlayType=function(t){return E.test(t)?"maybe":""},b.canHandleSource=function(t,e){return"maybe"===b.canPlayType(t.type)},b.handleSource=function(t,e,i){return e.hls=new S(t,e,i),e.hls.src(t),e.hls},o.default.getTech("Flash").registerSourceHandler(b,0),b.VERSION="1.4.3",i.default=b}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[8]); |
{ | ||
"name": "@brightcove/videojs-flashls-source-handler", | ||
"version": "1.4.2", | ||
"version": "1.4.3", | ||
"description": "A source handler to integrate flashls with video.js", | ||
@@ -75,3 +75,3 @@ "main": "es5/index.js", | ||
"dependencies": { | ||
"@brightcove/videojs-flashls-swf": "6.4.1", | ||
"@brightcove/videojs-flashls-swf": "6.4.2", | ||
"browserify-versionify": "^1.0.6", | ||
@@ -95,11 +95,7 @@ "global": "^4.3.0", | ||
"glob": "^6.0.3", | ||
"karma": "^1.3.0", | ||
"karma-browserstack-launcher": "^1.1.1", | ||
"karma-chrome-launcher": "^0.2.2", | ||
"karma-detect-browsers": "^2.0.2", | ||
"karma-firefox-launcher": "^0.1.7", | ||
"karma-ie-launcher": "^0.2.0", | ||
"karma": "^2.0.0", | ||
"karma-chrome-launcher": "^2.2.0", | ||
"karma-detect-browsers": "^2.2.6", | ||
"karma-firefox-launcher": "^1.1.0", | ||
"karma-qunit": "^0.1.9", | ||
"karma-safari-launcher": "^0.1.1", | ||
"karma-teamcity-reporter": "^1.0.0", | ||
"lodash": "^4.11.2", | ||
@@ -106,0 +102,0 @@ "mkdirp": "^0.5.1", |
# videojs-flashls-source-handler | ||
[![Build Status][travis-icon]][travis-link] | ||
[![Slack Status][slack-icon]][slack-link] | ||
A source handler to integrate flashls with video.js | ||
@@ -72,1 +75,5 @@ | ||
[videojs]: http://videojs.com/ | ||
[slack-icon]: http://slack.videojs.com/badge.svg | ||
[slack-link]: http://slack.videojs.com | ||
[travis-icon]: https://travis-ci.org/brightcove/videojs-flashls-source-handler.svg?branch=master | ||
[travis-link]: https://travis-ci.org/brightcove/videojs-flashls-source-handler |
module.exports = function(config) { | ||
var detectBrowsers = { | ||
enabled: false, | ||
usePhantomJS: false | ||
}, | ||
browsers = config.browsers, | ||
reporters = ['dots']; | ||
// On TC CI, we can only run in Browserstack. | ||
if (process.env.BROWSER_STACK_USERNAME) { | ||
browsers = ['chrome_bs']; | ||
reporters = ['teamcity']; | ||
} | ||
// If no browsers are specified, we enable `karma-detect-browsers` | ||
// this will detect all browsers that are available for testing | ||
if (!browsers.length) { | ||
detectBrowsers.enabled = true; | ||
} | ||
config.set({ | ||
@@ -33,21 +14,31 @@ basePath: '..', | ||
browsers: browsers, | ||
customLaunchers: { | ||
chrome_bs: { | ||
base: 'BrowserStack', | ||
browser: 'chrome', | ||
os: 'Windows', | ||
os_version: '8.1' | ||
ChromeHeadlessWithFlags: { | ||
base: 'ChromeHeadless', | ||
flags: [ | ||
'--mute-audio', | ||
'--no-sandbox', | ||
'--no-user-gesture-required' | ||
] | ||
} | ||
}, | ||
detectBrowsers: { | ||
usePhantomJS: false, | ||
browserStack: { | ||
project: process.env.npm_package_name, | ||
name: process.env.TEAMCITY_PROJECT_NAME + process.env.BUILD_NUMBER, | ||
pollingTimeout: 30000 | ||
// detect what browsers are installed on the system and | ||
// use headless mode and flags to allow for playback | ||
postDetection: function(browsers) { | ||
var newBrowsers = []; | ||
if (browsers.indexOf('Chrome') !== -1) { | ||
newBrowsers.push('ChromeHeadlessWithFlags'); | ||
} | ||
if (browsers.indexOf('Firefox') !== -1) { | ||
newBrowsers.push('FirefoxHeadless'); | ||
} | ||
return newBrowsers; | ||
} | ||
}, | ||
detectBrowsers: detectBrowsers, | ||
reporters: reporters, | ||
reporters: ['dots'], | ||
port: 9876, | ||
@@ -54,0 +45,0 @@ colors: true, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
313692
26
79
5951
5
+ Added@brightcove/flashls@1.2.2(transitive)
+ Added@brightcove/videojs-flashls-swf@6.4.2(transitive)
- Removed@brightcove/flashls@1.2.1(transitive)
- Removed@brightcove/videojs-flashls-swf@6.4.1(transitive)