Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@brightcove/videojs-flashls-source-handler

Package Overview
Dependencies
Maintainers
84
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@brightcove/videojs-flashls-source-handler - npm Package Compare versions

Comparing version 1.4.7 to 1.4.8

7

CHANGELOG.md

@@ -0,1 +1,8 @@

<a name="1.4.8"></a>
## [1.4.8](https://github.com/brightcove/videojs-flashls-source-handler/compare/v1.4.7...v1.4.8) (2019-03-21)
### Chores
* **package:** Update videojs-flashls-swf to 6.4.5 (#42) ([d0cbef6](https://github.com/brightcove/videojs-flashls-source-handler/commit/d0cbef6)), closes [#42](https://github.com/brightcove/videojs-flashls-source-handler/issues/42)
<a name="1.4.7"></a>

@@ -2,0 +9,0 @@ ## [1.4.7](https://github.com/brightcove/videojs-flashls-source-handler/compare/v1.4.6...v1.4.7) (2019-01-31)

4

dist/videojs-flashls-source-handler.min.js

@@ -1,2 +0,2 @@

/*! @name @brightcove/videojs-flashls-source-handler @version 1.4.7 @license Apache-2.0 */
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("global/window"),require("video.js")):"function"==typeof define&&define.amd?define(["exports","global/window","video.js"],e):e(t.videojsFlashlsSourceHandler={},t.window,t.videojs)}(this,function(t,e,i){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e,i=i&&i.hasOwnProperty("default")?i.default:i;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,s,n;if(i=t[e])if(2===arguments.length)for(s=i.length,a=0;a<s;++a)i[a].call(this,arguments[1]);else{for(n=[],a=arguments.length,a=1;a<arguments.length;++a)n.push(arguments[a]);for(s=i.length,a=0;a<s;++a)i[a].apply(this,n)}},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)};var s=a,n=function(t){for(var e=0,i={payloadType:-1,payloadSize:0},a=0,s=0;e<t.byteLength&&128!==t[e];){for(;255===t[e];)a+=255,e++;for(a+=t[e++];255===t[e];)s+=255,e++;if(s+=t[e++],!i.payload&&4===a){i.payloadType=a,i.payloadSize=s,i.payload=t.subarray(e,e+s);break}e+=s,a=0,s=0}return i},o=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)},r=function(t,e){var i,a,s,n,o=[];if(!(64&e[0]))return o;for(a=31&e[0],i=0;i<a;i++)n={type:3&e[2+(s=3*i)],pts:t},4&e[s+2]&&(n.ccData=e[s+3]<<8|e[s+4],o.push(n));return o},h=4,d=function(){d.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)};d.prototype=new s,d.prototype.push=function(t){var e,i,a;if("sei_rbsp"===t.nalUnitType&&(e=n(t.escapedRBSP)).payloadType===h&&(i=o(e)))if(t.dts<this.latestDts_)this.ignoreNextEqualDts_=!0;else{if(t.dts===this.latestDts_&&this.ignoreNextEqualDts_)return this.numSameDts_--,void(this.numSameDts_||(this.ignoreNextEqualDts_=!1));a=r(t.pts,i),this.captionPackets_=this.captionPackets_.concat(a),this.latestDts_!==t.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=t.dts}},d.prototype.flush=function(){this.captionPackets_.length?(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)):this.ccStreams_.forEach(function(t){t.flush()},this)},d.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach(function(t){t.reset()})},d.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)},d.prototype.setsChannel1Active=function(t){return 4096==(30720&t.ccData)},d.prototype.setsChannel2Active=function(t){return 6144==(30720&t.ccData)};var l={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},_=function(t){return null===t?"":(t=l[t]||t,String.fromCharCode(t))},c=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],p=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,s,n;if((e=32639&t.ccData)!==this.lastControlCode_){if(4096==(61440&e)?this.lastControlCode_=e:e!==this.PADDING_&&(this.lastControlCode_=null),a=e>>>8,s=255&e,e!==this.PADDING_)if(e===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(e===this.END_OF_CAPTION_)this.mode_="popOn",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.rollUpRows_=2,this.setRollUp(t.pts);else if(e===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(t.pts);else if(e===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(t.pts);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_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1);else if(e===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(t.pts),this.displayed_=p();else if(e===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=p();else if(e===this.RESUME_DIRECT_CAPTIONING_)"paintOn"!==this.mode_&&(this.flushDisplayed(t.pts),this.displayed_=p()),this.mode_="paintOn",this.startPts_=t.pts;else if(this.isSpecialCharacter(a,s))n=_((a=(3&a)<<8)|s),this[this.mode_](t.pts,n),this.column_++;else if(this.isExtCharacter(a,s))"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1),n=_((a=(3&a)<<8)|s),this[this.mode_](t.pts,n),this.column_++;else if(this.isMidRowCode(a,s))this.clearFormatting(t.pts),this[this.mode_](t.pts," "),this.column_++,14==(14&s)&&this.addFormatting(t.pts,["i"]),1==(1&s)&&this.addFormatting(t.pts,["u"]);else if(this.isOffsetControlCode(a,s))this.column_+=3&s;else if(this.isPAC(a,s)){var o=c.indexOf(7968&e);"rollUp"===this.mode_&&this.setRollUp(t.pts,o),o!==this.row_&&(this.clearFormatting(t.pts),this.row_=o),1&s&&-1===this.formatting_.indexOf("u")&&this.addFormatting(t.pts,["u"]),16==(16&e)&&(this.column_=4*((14&e)>>1)),this.isColorPAC(s)&&14==(14&s)&&this.addFormatting(t.pts,["i"])}else this.isNormalChar(a)&&(0===s&&(s=null),n=_(a),n+=_(s),this[this.mode_](t.pts,n),this.column_+=n.length)}else this.lastControlCode_=null}};u.prototype=new s,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_=p(),this.nonDisplayed_=p(),this.lastControlCode_=null,this.column_=0,this.row_=14,this.rollUpRows_=2,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.setRollUp=function(t,e){if("rollUp"!==this.mode_&&(this.row_=14,this.mode_="rollUp",this.flushDisplayed(t),this.nonDisplayed_=p(),this.displayed_=p()),void 0!==e&&e!==this.row_)for(var i=0;i<this.rollUpRows_;i++)this.displayed_[e-i]=this.displayed_[this.row_-i],this.displayed_[this.row_-i]="";void 0===e&&(e=this.row_),this.topRow_=e-this.rollUpRows_+1},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_[this.row_];i+=e,this.displayed_[this.row_]=i},u.prototype.shiftRowsUp_=function(){var t;for(t=0;t<this.topRow_;t++)this.displayed_[t]="";for(t=this.row_+1;t<15;t++)this.displayed_[t]="";for(t=this.topRow_;t<this.row_;t++)this.displayed_[t]=this.displayed_[t+1];this.displayed_[this.row_]=""},u.prototype.paintOn=function(t,e){var i=this.displayed_[this.row_];i+=e,this.displayed_[this.row_]=i};var f,y={CaptionStream:d,Cea608Stream:u}.CaptionStream,m={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},g=function(t,e,i){var a,s="";for(a=e;a<i;a++)s+="%"+("00"+t[a].toString(16)).slice(-2);return s},v=function(t,e,i){return decodeURIComponent(g(t,e,i))},T=function(t){return t[0]<<21|t[1]<<14|t[2]<<7|t[3]},C={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=v(t.data,1,e),t.value=v(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=v(t.data,1,e),t.url=v(t.data,e+1,t.data.length);break}},PRIV:function(t){var e,i;for(e=0;e<t.data.length;e++)if(0===t.data[e]){t.owner=(i=t.data,unescape(g(i,0,e)));break}t.privateData=t.data.subarray(e+1),t.data=t.privateData}};(f=function(t){var e,i={debug:!(!t||!t.debug),descriptor:t&&t.descriptor},a=0,s=[],n=0;if(f.prototype.init.call(this),this.dispatchType=m.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,o,r,h,d;if("timed-metadata"===t.type)if(t.dataAlignmentIndicator&&(n=0,s.length=0),0===s.length&&(t.data.length<10||t.data[0]!=="I".charCodeAt(0)||t.data[1]!=="D".charCodeAt(0)||t.data[2]!=="3".charCodeAt(0)))i.debug&&console.log("Skipping unrecognized metadata packet");else if(s.push(t),n+=t.data.byteLength,1===s.length&&(a=T(t.data.subarray(6,10)),a+=10),!(n<a)){for(e={data:new Uint8Array(a),frames:[],pts:s[0].pts,dts:s[0].dts},d=0;d<a;)e.data.set(s[0].data.subarray(0,a-d),d),d+=s[0].data.byteLength,n-=s[0].data.byteLength,s.shift();o=10,64&e.data[5]&&(o+=4,o+=T(e.data.subarray(10,14)),a-=T(e.data.subarray(16,20)));do{if((r=T(e.data.subarray(o+4,o+8)))<1)return console.log("Malformed ID3 frame encountered. Skipping metadata parsing.");if((h={id:String.fromCharCode(e.data[o],e.data[o+1],e.data[o+2],e.data[o+3]),data:e.data.subarray(o+10,o+r+10)}).key=h.id,C[h.id]&&(C[h.id](h),"com.apple.streaming.transportStreamTimestamp"===h.owner)){var l=h.data,_=(1&l[3])<<30|l[4]<<22|l[5]<<14|l[6]<<6|l[7]>>>2;_*=4,_+=3&l[7],h.timeStamp=_,void 0===e.pts&&void 0===e.dts&&(e.pts=h.timeStamp,e.dts=h.timeStamp),this.trigger("timestamp",h)}e.frames.push(h),o+=10,o+=r}while(o<a);this.trigger("data",e)}}}).prototype=new s;var S=f,b=function(t){for(var e=new Uint8Array(t.length),i=0;i<t.length;i++)e[i]=t.charCodeAt(i);return e},P=function(t,e,i){var a,s;if(i&&i.cues)for(a=i.cues.length;a--;)(s=i.cues[a]).startTime<=e&&s.endTime>=t&&i.removeCue(s)},w=function(t,e){t.length&&P(0,t.start(0),e)},D=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"})},E=function(t,e){return function(t,e){var a=[];if(t&&t.length)for(var s=0;s<t.length;s++)e(t.start(s),t.end(s))&&a.push([t.start(s),t.end(s)]);return i.createTimeRanges(a)}(t,function(t,i){return t-1/30<=e&&i+1/30>=e})},R=function(){function t(t,e,a){var s=this;if(e.options_&&e.options_.playerId){var n=i(e.options_.playerId);n.hasOwnProperty("hls")||Object.defineProperty(n,"hls",{get:function(){return i.log.warn("player.hls is deprecated. Use player.tech_.hls instead."),e.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_=e,this.metadataTrack_=null,this.inbandTextTracks_={},this.metadataStream_=new S,this.captionStream_=new y,this.offsetPts=null,this.offsetDts=null,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.onPlay_=this.onPlay_.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.tech_.on("play",this.onPlay_),this.metadataStream_.on("data",this.onMetadataStreamData_),this.captionStream_.on("data",this.onCaptionStreamData_),this.playlists=new i.EventTarget,this.playlists.media=function(){return s.media_()}}var a=t.prototype;return a.src=function(t){t&&this.tech_.setSrc(t.src)},a.onPlay_=function(){if(this.tech_.duration()===1/0){var t=this.seekable();if(this.tech_.currentTime()<t.start(0))return this.tech_.setCurrentTime(t.end(t.length-1))}},a.seekable=function(){var t=this.tech_.el_.vjs_getProperty("seekableStart"),e=this.tech_.el_.vjs_getProperty("seekableEnd");return 0===e?i.createTimeRange():i.createTimeRange(t,e)},a.media_=function(){var t,e=this.tech_.el_.vjs_getProperty("levels"),i=this.tech_.el_.vjs_getProperty("level");return e.length&&(t={resolvedUri:e[i].url,attributes:{BANDWIDTH:e[i].bitrate,RESOLUTION:{width:e[i].width,height:e[i].height}}}),t},a.onLoadedmetadata_=function(){var t,e,a,s=this;this.representations=(t=this.tech_,e=null,a=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)},function(){if(!e){var i=t.el_.vjs_getProperty("levels");e=i.filter(function(t){return!t.audio}).map(function(t,e){var i={id:e.index+"",width:e.width,height:e.height,bandwidth:e.bitrate,isEnabled_:!0,enabled:function(e){if(void 0===e)return i.isEnabled_;e!==i.isEnabled_&&(!0!==e&&!1!==e||(i.isEnabled_=e,t()))}};return i}.bind(null,a))}return e});var n=i.players[this.tech_.options_.playerId];n&&n.qualityLevels&&(this.qualityLevels_=n.qualityLevels(),this.representations().forEach(function(t){s.qualityLevels_.addQualityLevel(t)}),D(this.qualityLevels_,this.tech_.el_.vjs_getProperty("level")+"")),function(t){var e=t.el_.vjs_getProperty("altAudioTracks"),a=t.el_.vjs_getProperty("audioTracks"),s=t.el_.vjs_getProperty("audioTrack");a.forEach(function(a,n){var o=e[a.id];t.audioTracks().addTrack(new i.AudioTrack({id:o.name,enabled:s===n,language:o.lang,default:o.default_track,label:o.name}))})}(this.tech_),this.tech_.audioTracks().on("change",this.onAudioTrackChanged)},a.onAudioTrackChanged=function(){!function(t){for(var e=t.el_.vjs_getProperty("audioTracks"),i=t.audioTracks(),a=null,s=0;s<i.length;s++)if(i[s].enabled){a=i[s].id;break}if(null!==a)for(var n=0;n<e.length;n++)if(a===e[n].title)return void t.el_.vjs_setProperty("audioTrack",n)}(this.tech_)},a.onLevelSwitch_=function(t,e){this.qualityLevels_&&D(this.qualityLevels_,e[0].levelIndex+""),this.playlists.trigger("mediachange"),this.tech_.trigger({type:"mediachange",bubbles:!0})},a.onLevelLoaded_=function(){this.playlists.trigger("loadedplaylist")},a.onFragmentLoaded_=function(){this.tech_.trigger("bandwidthupdate"),this.captionStream_.flush()},a.onSeeking_=function(){var t=this;P(0,1/0,this.metadataTrack_),E(this.tech_.buffered(),this.tech_.currentTime()).length||(Object.keys(this.inbandTextTracks_).forEach(function(e){P(0,1/0,t.inbandTextTracks_[e])}),this.captionStream_.reset())},a.onId3updated_=function(t,i){var a=e.atob(i[0]),s={type:"timed-metadata",dataAlignmentIndicator:!0,data:b(a)};this.metadataStream_.push(s)},a.onMetadataStreamData_=function(t){var a=this;this.metadataTrack_||(this.metadataTrack_=this.tech_.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,this.metadataTrack_.inBandMetadataTrackDispatchType="15"),w(this.tech_.buffered(),this.metadataTrack_);var s=this.tech_.currentTime();if(t.frames.forEach(function(t){var n=new e.VTTCue(s,s+.1,t.value||t.url||t.data||"");n.frame=t,n.value=t,function(t){Object.defineProperties(t.frame,{id:{get:function(){return i.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),t.value.key}},value:{get:function(){return i.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),t.value.data}},privateData:{get:function(){return i.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),t.value.data}}})}(n),a.metadataTrack_.addCue(n)}),this.metadataTrack_.cues&&this.metadataTrack_.cues.length){var n=this.metadataTrack_.cues,o=[],r=this.tech_.duration();(isNaN(r)||Math.abs(r)===1/0)&&(r=Number.MAX_VALUE);for(var h=0;h<n.length;h++)o.push(n[h]);o.sort(function(t,e){return t.startTime-e.startTime});for(var d=0;d<o.length-1;d++)o[d].endTime!==o[d+1].startTime&&(o[d].endTime=o[d+1].startTime);o[o.length-1].endTime=r}},a.onCaptionData_=function(t,i){var a=this;i[0].forEach(function(t){a.offsetPts||(a.offsetPts=t.pos),a.offsetDts||(a.offsetDts=t.dts),a.captionStream_.push({pts:9e4*(t.pos-a.offsetPts),dts:9e4*(t.dts-a.offsetDts),escapedRBSP:b(e.atob(t.data)),nalUnitType:"sei_rbsp"})})},a.onCaptionStreamData_=function(t){t&&(this.inbandTextTracks_[t.stream]||(!function(t,e,i){for(var a=t.remoteTextTracks()||[],s=0;s<a.length;s++){var n=a[s];n.kind===e&&n.label===i&&t.removeRemoteTextTrack(n)}}(this.tech_,"captions",t.stream),this.inbandTextTracks_[t.stream]=this.tech_.addRemoteTextTrack({kind:"captions",label:t.stream,id:t.stream},!1).track),w(this.tech_.buffered(),this.inbandTextTracks_[t.stream]),this.inbandTextTracks_[t.stream].addCue(new e.VTTCue(t.startPts/9e4,t.endPts/9e4,t.text)))},a.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.tech_.off("play",this.onPlay_),this.qualityLevels_&&this.qualityLevels_.dispose()},t}(),O={},k=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i;O.canPlayType=function(t){return k.test(t)?"maybe":""},O.canHandleSource=function(t,e){return"maybe"===O.canPlayType(t.type)},O.handleSource=function(t,e,i){return e.hls=new R(t,e,i),e.hls.src(t),e.hls},i.getTech("Flash").registerSourceHandler(O,0),O.VERSION="1.4.7",t.FlashlsHandler=R,t.default=O,Object.defineProperty(t,"__esModule",{value:!0})});
/*! @name @brightcove/videojs-flashls-source-handler @version 1.4.8 @license Apache-2.0 */
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("global/window"),require("video.js")):"function"==typeof define&&define.amd?define(["exports","global/window","video.js"],e):e(t.videojsFlashlsSourceHandler={},t.window,t.videojs)}(this,function(t,e,i){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e,i=i&&i.hasOwnProperty("default")?i.default:i;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,s,n;if(i=t[e])if(2===arguments.length)for(s=i.length,a=0;a<s;++a)i[a].call(this,arguments[1]);else{for(n=[],a=arguments.length,a=1;a<arguments.length;++a)n.push(arguments[a]);for(s=i.length,a=0;a<s;++a)i[a].apply(this,n)}},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)};var s=a,n=function(t){for(var e=0,i={payloadType:-1,payloadSize:0},a=0,s=0;e<t.byteLength&&128!==t[e];){for(;255===t[e];)a+=255,e++;for(a+=t[e++];255===t[e];)s+=255,e++;if(s+=t[e++],!i.payload&&4===a){i.payloadType=a,i.payloadSize=s,i.payload=t.subarray(e,e+s);break}e+=s,a=0,s=0}return i},o=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)},r=function(t,e){var i,a,s,n,o=[];if(!(64&e[0]))return o;for(a=31&e[0],i=0;i<a;i++)n={type:3&e[2+(s=3*i)],pts:t},4&e[s+2]&&(n.ccData=e[s+3]<<8|e[s+4],o.push(n));return o},h=4,d=function(){d.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)};d.prototype=new s,d.prototype.push=function(t){var e,i,a;if("sei_rbsp"===t.nalUnitType&&(e=n(t.escapedRBSP)).payloadType===h&&(i=o(e)))if(t.dts<this.latestDts_)this.ignoreNextEqualDts_=!0;else{if(t.dts===this.latestDts_&&this.ignoreNextEqualDts_)return this.numSameDts_--,void(this.numSameDts_||(this.ignoreNextEqualDts_=!1));a=r(t.pts,i),this.captionPackets_=this.captionPackets_.concat(a),this.latestDts_!==t.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=t.dts}},d.prototype.flush=function(){this.captionPackets_.length?(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)):this.ccStreams_.forEach(function(t){t.flush()},this)},d.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach(function(t){t.reset()})},d.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)},d.prototype.setsChannel1Active=function(t){return 4096==(30720&t.ccData)},d.prototype.setsChannel2Active=function(t){return 6144==(30720&t.ccData)};var l={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},_=function(t){return null===t?"":(t=l[t]||t,String.fromCharCode(t))},c=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],p=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,s,n;if((e=32639&t.ccData)!==this.lastControlCode_){if(4096==(61440&e)?this.lastControlCode_=e:e!==this.PADDING_&&(this.lastControlCode_=null),a=e>>>8,s=255&e,e!==this.PADDING_)if(e===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(e===this.END_OF_CAPTION_)this.mode_="popOn",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.rollUpRows_=2,this.setRollUp(t.pts);else if(e===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(t.pts);else if(e===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(t.pts);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_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1);else if(e===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(t.pts),this.displayed_=p();else if(e===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=p();else if(e===this.RESUME_DIRECT_CAPTIONING_)"paintOn"!==this.mode_&&(this.flushDisplayed(t.pts),this.displayed_=p()),this.mode_="paintOn",this.startPts_=t.pts;else if(this.isSpecialCharacter(a,s))n=_((a=(3&a)<<8)|s),this[this.mode_](t.pts,n),this.column_++;else if(this.isExtCharacter(a,s))"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1),n=_((a=(3&a)<<8)|s),this[this.mode_](t.pts,n),this.column_++;else if(this.isMidRowCode(a,s))this.clearFormatting(t.pts),this[this.mode_](t.pts," "),this.column_++,14==(14&s)&&this.addFormatting(t.pts,["i"]),1==(1&s)&&this.addFormatting(t.pts,["u"]);else if(this.isOffsetControlCode(a,s))this.column_+=3&s;else if(this.isPAC(a,s)){var o=c.indexOf(7968&e);"rollUp"===this.mode_&&this.setRollUp(t.pts,o),o!==this.row_&&(this.clearFormatting(t.pts),this.row_=o),1&s&&-1===this.formatting_.indexOf("u")&&this.addFormatting(t.pts,["u"]),16==(16&e)&&(this.column_=4*((14&e)>>1)),this.isColorPAC(s)&&14==(14&s)&&this.addFormatting(t.pts,["i"])}else this.isNormalChar(a)&&(0===s&&(s=null),n=_(a),n+=_(s),this[this.mode_](t.pts,n),this.column_+=n.length)}else this.lastControlCode_=null}};u.prototype=new s,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_=p(),this.nonDisplayed_=p(),this.lastControlCode_=null,this.column_=0,this.row_=14,this.rollUpRows_=2,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.setRollUp=function(t,e){if("rollUp"!==this.mode_&&(this.row_=14,this.mode_="rollUp",this.flushDisplayed(t),this.nonDisplayed_=p(),this.displayed_=p()),void 0!==e&&e!==this.row_)for(var i=0;i<this.rollUpRows_;i++)this.displayed_[e-i]=this.displayed_[this.row_-i],this.displayed_[this.row_-i]="";void 0===e&&(e=this.row_),this.topRow_=e-this.rollUpRows_+1},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_[this.row_];i+=e,this.displayed_[this.row_]=i},u.prototype.shiftRowsUp_=function(){var t;for(t=0;t<this.topRow_;t++)this.displayed_[t]="";for(t=this.row_+1;t<15;t++)this.displayed_[t]="";for(t=this.topRow_;t<this.row_;t++)this.displayed_[t]=this.displayed_[t+1];this.displayed_[this.row_]=""},u.prototype.paintOn=function(t,e){var i=this.displayed_[this.row_];i+=e,this.displayed_[this.row_]=i};var f,y={CaptionStream:d,Cea608Stream:u}.CaptionStream,m={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},g=function(t,e,i){var a,s="";for(a=e;a<i;a++)s+="%"+("00"+t[a].toString(16)).slice(-2);return s},v=function(t,e,i){return decodeURIComponent(g(t,e,i))},T=function(t){return t[0]<<21|t[1]<<14|t[2]<<7|t[3]},C={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=v(t.data,1,e),t.value=v(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=v(t.data,1,e),t.url=v(t.data,e+1,t.data.length);break}},PRIV:function(t){var e,i;for(e=0;e<t.data.length;e++)if(0===t.data[e]){t.owner=(i=t.data,unescape(g(i,0,e)));break}t.privateData=t.data.subarray(e+1),t.data=t.privateData}};(f=function(t){var e,i={debug:!(!t||!t.debug),descriptor:t&&t.descriptor},a=0,s=[],n=0;if(f.prototype.init.call(this),this.dispatchType=m.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,o,r,h,d;if("timed-metadata"===t.type)if(t.dataAlignmentIndicator&&(n=0,s.length=0),0===s.length&&(t.data.length<10||t.data[0]!=="I".charCodeAt(0)||t.data[1]!=="D".charCodeAt(0)||t.data[2]!=="3".charCodeAt(0)))i.debug&&console.log("Skipping unrecognized metadata packet");else if(s.push(t),n+=t.data.byteLength,1===s.length&&(a=T(t.data.subarray(6,10)),a+=10),!(n<a)){for(e={data:new Uint8Array(a),frames:[],pts:s[0].pts,dts:s[0].dts},d=0;d<a;)e.data.set(s[0].data.subarray(0,a-d),d),d+=s[0].data.byteLength,n-=s[0].data.byteLength,s.shift();o=10,64&e.data[5]&&(o+=4,o+=T(e.data.subarray(10,14)),a-=T(e.data.subarray(16,20)));do{if((r=T(e.data.subarray(o+4,o+8)))<1)return console.log("Malformed ID3 frame encountered. Skipping metadata parsing.");if((h={id:String.fromCharCode(e.data[o],e.data[o+1],e.data[o+2],e.data[o+3]),data:e.data.subarray(o+10,o+r+10)}).key=h.id,C[h.id]&&(C[h.id](h),"com.apple.streaming.transportStreamTimestamp"===h.owner)){var l=h.data,_=(1&l[3])<<30|l[4]<<22|l[5]<<14|l[6]<<6|l[7]>>>2;_*=4,_+=3&l[7],h.timeStamp=_,void 0===e.pts&&void 0===e.dts&&(e.pts=h.timeStamp,e.dts=h.timeStamp),this.trigger("timestamp",h)}e.frames.push(h),o+=10,o+=r}while(o<a);this.trigger("data",e)}}}).prototype=new s;var S=f,b=function(t){for(var e=new Uint8Array(t.length),i=0;i<t.length;i++)e[i]=t.charCodeAt(i);return e},P=function(t,e,i){var a,s;if(i&&i.cues)for(a=i.cues.length;a--;)(s=i.cues[a]).startTime<=e&&s.endTime>=t&&i.removeCue(s)},w=function(t,e){t.length&&P(0,t.start(0),e)},D=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"})},E=function(t,e){return function(t,e){var a=[];if(t&&t.length)for(var s=0;s<t.length;s++)e(t.start(s),t.end(s))&&a.push([t.start(s),t.end(s)]);return i.createTimeRanges(a)}(t,function(t,i){return t-1/30<=e&&i+1/30>=e})},R=function(){function t(t,e,a){var s=this;if(e.options_&&e.options_.playerId){var n=i(e.options_.playerId);n.hasOwnProperty("hls")||Object.defineProperty(n,"hls",{get:function(){return i.log.warn("player.hls is deprecated. Use player.tech_.hls instead."),e.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_=e,this.metadataTrack_=null,this.inbandTextTracks_={},this.metadataStream_=new S,this.captionStream_=new y,this.offsetPts=null,this.offsetDts=null,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.onPlay_=this.onPlay_.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.tech_.on("play",this.onPlay_),this.metadataStream_.on("data",this.onMetadataStreamData_),this.captionStream_.on("data",this.onCaptionStreamData_),this.playlists=new i.EventTarget,this.playlists.media=function(){return s.media_()}}var a=t.prototype;return a.src=function(t){t&&this.tech_.setSrc(t.src)},a.onPlay_=function(){if(this.tech_.duration()===1/0){var t=this.seekable();if(this.tech_.currentTime()<t.start(0))return this.tech_.setCurrentTime(t.end(t.length-1))}},a.seekable=function(){var t=this.tech_.el_.vjs_getProperty("seekableStart"),e=this.tech_.el_.vjs_getProperty("seekableEnd");return 0===e?i.createTimeRange():i.createTimeRange(t,e)},a.media_=function(){var t,e=this.tech_.el_.vjs_getProperty("levels"),i=this.tech_.el_.vjs_getProperty("level");return e.length&&(t={resolvedUri:e[i].url,attributes:{BANDWIDTH:e[i].bitrate,RESOLUTION:{width:e[i].width,height:e[i].height}}}),t},a.onLoadedmetadata_=function(){var t,e,a,s=this;this.representations=(t=this.tech_,e=null,a=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)},function(){if(!e){var i=t.el_.vjs_getProperty("levels");e=i.filter(function(t){return!t.audio}).map(function(t,e){var i={id:e.index+"",width:e.width,height:e.height,bandwidth:e.bitrate,isEnabled_:!0,enabled:function(e){if(void 0===e)return i.isEnabled_;e!==i.isEnabled_&&(!0!==e&&!1!==e||(i.isEnabled_=e,t()))}};return i}.bind(null,a))}return e});var n=i.players[this.tech_.options_.playerId];n&&n.qualityLevels&&(this.qualityLevels_=n.qualityLevels(),this.representations().forEach(function(t){s.qualityLevels_.addQualityLevel(t)}),D(this.qualityLevels_,this.tech_.el_.vjs_getProperty("level")+"")),function(t){var e=t.el_.vjs_getProperty("altAudioTracks"),a=t.el_.vjs_getProperty("audioTracks"),s=t.el_.vjs_getProperty("audioTrack");a.forEach(function(a,n){var o=e[a.id];t.audioTracks().addTrack(new i.AudioTrack({id:o.name,enabled:s===n,language:o.lang,default:o.default_track,label:o.name}))})}(this.tech_),this.tech_.audioTracks().on("change",this.onAudioTrackChanged)},a.onAudioTrackChanged=function(){!function(t){for(var e=t.el_.vjs_getProperty("audioTracks"),i=t.audioTracks(),a=null,s=0;s<i.length;s++)if(i[s].enabled){a=i[s].id;break}if(null!==a)for(var n=0;n<e.length;n++)if(a===e[n].title)return void t.el_.vjs_setProperty("audioTrack",n)}(this.tech_)},a.onLevelSwitch_=function(t,e){this.qualityLevels_&&D(this.qualityLevels_,e[0].levelIndex+""),this.playlists.trigger("mediachange"),this.tech_.trigger({type:"mediachange",bubbles:!0})},a.onLevelLoaded_=function(){this.playlists.trigger("loadedplaylist")},a.onFragmentLoaded_=function(){this.tech_.trigger("bandwidthupdate"),this.captionStream_.flush()},a.onSeeking_=function(){var t=this;P(0,1/0,this.metadataTrack_),E(this.tech_.buffered(),this.tech_.currentTime()).length||(Object.keys(this.inbandTextTracks_).forEach(function(e){P(0,1/0,t.inbandTextTracks_[e])}),this.captionStream_.reset())},a.onId3updated_=function(t,i){var a=e.atob(i[0]),s={type:"timed-metadata",dataAlignmentIndicator:!0,data:b(a)};this.metadataStream_.push(s)},a.onMetadataStreamData_=function(t){var a=this;this.metadataTrack_||(this.metadataTrack_=this.tech_.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,this.metadataTrack_.inBandMetadataTrackDispatchType="15"),w(this.tech_.buffered(),this.metadataTrack_);var s=this.tech_.currentTime();if(t.frames.forEach(function(t){var n=new e.VTTCue(s,s+.1,t.value||t.url||t.data||"");n.frame=t,n.value=t,function(t){Object.defineProperties(t.frame,{id:{get:function(){return i.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),t.value.key}},value:{get:function(){return i.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),t.value.data}},privateData:{get:function(){return i.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),t.value.data}}})}(n),a.metadataTrack_.addCue(n)}),this.metadataTrack_.cues&&this.metadataTrack_.cues.length){var n=this.metadataTrack_.cues,o=[],r=this.tech_.duration();(isNaN(r)||Math.abs(r)===1/0)&&(r=Number.MAX_VALUE);for(var h=0;h<n.length;h++)o.push(n[h]);o.sort(function(t,e){return t.startTime-e.startTime});for(var d=0;d<o.length-1;d++)o[d].endTime!==o[d+1].startTime&&(o[d].endTime=o[d+1].startTime);o[o.length-1].endTime=r}},a.onCaptionData_=function(t,i){var a=this;i[0].forEach(function(t){a.offsetPts||(a.offsetPts=t.pos),a.offsetDts||(a.offsetDts=t.dts),a.captionStream_.push({pts:9e4*(t.pos-a.offsetPts),dts:9e4*(t.dts-a.offsetDts),escapedRBSP:b(e.atob(t.data)),nalUnitType:"sei_rbsp"})})},a.onCaptionStreamData_=function(t){t&&(this.inbandTextTracks_[t.stream]||(!function(t,e,i){for(var a=t.remoteTextTracks()||[],s=0;s<a.length;s++){var n=a[s];n.kind===e&&n.label===i&&t.removeRemoteTextTrack(n)}}(this.tech_,"captions",t.stream),this.inbandTextTracks_[t.stream]=this.tech_.addRemoteTextTrack({kind:"captions",label:t.stream,id:t.stream},!1).track),w(this.tech_.buffered(),this.inbandTextTracks_[t.stream]),this.inbandTextTracks_[t.stream].addCue(new e.VTTCue(t.startPts/9e4,t.endPts/9e4,t.text)))},a.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.tech_.off("play",this.onPlay_),this.qualityLevels_&&this.qualityLevels_.dispose()},t}(),O={},k=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i;O.canPlayType=function(t){return k.test(t)?"maybe":""},O.canHandleSource=function(t,e){return"maybe"===O.canPlayType(t.type)},O.handleSource=function(t,e,i){return e.hls=new R(t,e,i),e.hls.src(t),e.hls},i.getTech("Flash").registerSourceHandler(O,0),O.VERSION="1.4.8",t.FlashlsHandler=R,t.default=O,Object.defineProperty(t,"__esModule",{value:!0})});
{
"name": "@brightcove/videojs-flashls-source-handler",
"version": "1.4.7",
"version": "1.4.8",
"description": "A source handler to integrate flashls with video.js",

@@ -58,3 +58,3 @@ "main": "dist/videojs-flashls-source-handler.cjs.js",

"dependencies": {
"@brightcove/videojs-flashls-swf": "6.4.4",
"@brightcove/videojs-flashls-swf": "6.4.5",
"global": "^4.3.2",

@@ -70,3 +70,3 @@ "mux.js": "^4.3.2",

"jsdoc": "https://github.com/BrandonOCasey/jsdoc#feat/plugin-from-cli",
"karma": "^3.0.0",
"karma": "^4.0.1",
"lint-staged": "^8.1.0",

@@ -81,4 +81,4 @@ "not-prerelease": "^1.0.1",

"videojs-flash": "^2.1.1",
"videojs-generate-karma-config": "~5.0.0",
"videojs-generate-rollup-config": "~2.3.1",
"videojs-generate-karma-config": "~5.1.0",
"videojs-generate-rollup-config": "^3.1.0",
"videojs-generator-verify": "^1.0.5",

@@ -85,0 +85,0 @@ "videojs-standard": "~8.0.2"

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc