@brightcove/videojs-flashls-source-handler
Advanced tools
Comparing version 1.3.0 to 1.3.1
/** | ||
* @brightcove/videojs-flashls-source-handler | ||
* @version 1.3.0 | ||
* @version 1.3.1 | ||
* @copyright 2017 Brightcove | ||
@@ -18,3 +18,3 @@ * @license Apache-2.0 | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
@@ -68,7 +68,7 @@ /** | ||
tech.audioTracks().addTrack(new _video2.default.AudioTrack({ | ||
tech.audioTracks().addTrack(new _video2['default'].AudioTrack({ | ||
id: altTrack.name, | ||
enabled: enabledIndex === index, | ||
language: altTrack.lang, | ||
default: altTrack.default_track, | ||
'default': altTrack.default_track, | ||
label: altTrack.name | ||
@@ -1060,3 +1060,3 @@ })); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
@@ -1077,3 +1077,3 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
get: function get() { | ||
_video2.default.log.warn('cue.frame.id is deprecated. Use cue.value.key instead.'); | ||
_video2['default'].log.warn('cue.frame.id is deprecated. Use cue.value.key instead.'); | ||
return cue.value.key; | ||
@@ -1084,3 +1084,3 @@ } | ||
get: function get() { | ||
_video2.default.log.warn('cue.frame.value is deprecated. Use cue.value.data instead.'); | ||
_video2['default'].log.warn('cue.frame.value is deprecated. Use cue.value.data instead.'); | ||
return cue.value.data; | ||
@@ -1091,3 +1091,3 @@ } | ||
get: function get() { | ||
_video2.default.log.warn('cue.frame.privateData is deprecated. Use cue.value.data instead.'); | ||
_video2['default'].log.warn('cue.frame.privateData is deprecated. Use cue.value.data instead.'); | ||
return cue.value.data; | ||
@@ -1239,3 +1239,3 @@ } | ||
if (tech.options_ && tech.options_.playerId) { | ||
var _player = (0, _video2.default)(tech.options_.playerId); | ||
var _player = (0, _video2['default'])(tech.options_.playerId); | ||
@@ -1245,3 +1245,3 @@ if (!_player.hasOwnProperty('hls')) { | ||
get: function get() { | ||
_video2.default.log.warn('player.hls is deprecated. Use player.tech_.hls instead.'); | ||
_video2['default'].log.warn('player.hls is deprecated. Use player.tech_.hls instead.'); | ||
tech.trigger({ type: 'usage', name: 'flashls-player-access' }); | ||
@@ -1270,3 +1270,3 @@ return _this; | ||
this.inbandTextTrack_ = null; | ||
this.metadataStream_ = new _metadataStream2.default(); | ||
this.metadataStream_ = new _metadataStream2['default'](); | ||
this.cea608Stream_ = new _captionStream.Cea608Stream(); | ||
@@ -1322,6 +1322,6 @@ this.captionPackets_ = []; | ||
if (seekableEnd === 0) { | ||
return _video2.default.createTimeRange(); | ||
return _video2['default'].createTimeRange(); | ||
} | ||
return _video2.default.createTimeRange(seekableStart, seekableEnd); | ||
return _video2['default'].createTimeRange(seekableStart, seekableEnd); | ||
}; | ||
@@ -1361,3 +1361,3 @@ | ||
var player = _video2.default.players[this.tech_.options_.playerId]; | ||
var player = _video2['default'].players[this.tech_.options_.playerId]; | ||
@@ -1436,3 +1436,3 @@ if (player && player.qualityLevels) { | ||
FlashlsHandler.prototype.onId3updated_ = function onId3updated_(event, data) { | ||
var id3tag = _window2.default.atob(data[0]); | ||
var id3tag = _window2['default'].atob(data[0]); | ||
var bytes = stringToByteArray(id3tag); | ||
@@ -1474,3 +1474,3 @@ var chunk = { | ||
tag.frames.forEach(function (frame) { | ||
var cue = new _window2.default.VTTCue(time, time + 0.1, frame.value || frame.url || frame.data || ''); | ||
var cue = new _window2['default'].VTTCue(time, time + 0.1, frame.value || frame.url || frame.data || ''); | ||
@@ -1527,3 +1527,3 @@ cue.frame = frame; | ||
pts: d.pos * 90000, | ||
bytes: stringToByteArray(_window2.default.atob(d.data)) | ||
bytes: stringToByteArray(_window2['default'].atob(d.data)) | ||
}; | ||
@@ -1579,3 +1579,3 @@ }); | ||
this.inbandTextTrack_.addCue(new _window2.default.VTTCue(caption.startPts / 90000, caption.endPts / 90000, caption.text)); | ||
this.inbandTextTrack_.addCue(new _window2['default'].VTTCue(caption.startPts / 90000, caption.endPts / 90000, caption.text)); | ||
} | ||
@@ -1664,10 +1664,10 @@ }; | ||
// any other Flash source handlers for HLS | ||
_video2.default.getTech('Flash').registerSourceHandler(FlashlsSourceHandler, 0); | ||
_video2['default'].getTech('Flash').registerSourceHandler(FlashlsSourceHandler, 0); | ||
// Include the version number. | ||
FlashlsSourceHandler.VERSION = '1.3.0'; | ||
FlashlsSourceHandler.VERSION = '1.3.1'; | ||
exports.default = FlashlsSourceHandler; | ||
exports['default'] = FlashlsSourceHandler; | ||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) | ||
},{"./flashlsAudioTracks.js":1,"./representations.js":2,"global/window":3,"mux.js/lib/m2ts/caption-stream":4,"mux.js/lib/m2ts/metadata-stream":5}]},{},[8])(8) | ||
}); |
@@ -1,1 +0,1 @@ | ||
!function t(e,a,i){function n(s,o){if(!a[s]){if(!e[s]){var d="function"==typeof require&&require;if(!o&&d)return d(s,!0);if(r)return r(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var h=a[s]={exports:{}};e[s][0].call(h.exports,function(t){var a=e[s][1][t];return n(a||t)},h,h.exports,t,e,a,i)}return a[s].exports}for(var r="function"==typeof require&&require,s=0;s<i.length;s++)n(i[s]);return n}({1:[function(t,e,a){(function(t){"use strict";a.__esModule=!0,a.setupAudioTracks=a.updateAudioTrack=void 0;var e="undefined"!=typeof window?window.videojs:void 0!==t?t.videojs:null,i=function(t){return t&&t.__esModule?t:{default:t}}(e);a.updateAudioTrack=function(t){for(var e=t.el_.vjs_getProperty("audioTracks"),a=t.audioTracks(),i=null,n=0;n<a.length;n++)if(a[n].enabled){i=a[n].id;break}if(null!==i)for(var r=0;r<e.length;r++)if(i===e[r].title)return void t.el_.vjs_setProperty("audioTrack",r)},a.setupAudioTracks=function(t){var e=t.el_.vjs_getProperty("altAudioTracks"),a=t.el_.vjs_getProperty("audioTracks"),n=t.el_.vjs_getProperty("audioTrack");a.forEach(function(a,r){var s=e[a.id];t.audioTracks().addTrack(new i.default.AudioTrack({id:s.name,enabled:n===r,language:s.lang,default:s.default_track,label:s.name}))})}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(t,e,a){"use strict";a.__esModule=!0;var i=a.createRepresentation=function(t,e){var a={id:e.index+"",width:e.width,height:e.height,bandwidth:e.bitrate,isEnabled_:!0};return a.enabled=function(e){if(void 0===e)return a.isEnabled_;e!==a.isEnabled_&&(!0!==e&&!1!==e||(a.isEnabled_=e,t()))},a};a.createRepresentations=function(t){var e=null,a=function(){var a=e.filter(function(t){return t.enabled()});if(a.length===e.length||0===a.length)return t.el_.vjs_setProperty("autoLevelCapping",-1),void t.el_.vjs_setProperty("level",-1);if(1===a.length)return t.el_.vjs_setProperty("level",parseInt(a[0].id,10)),void t.el_.vjs_setProperty("autoLevelCapping",-1);var i=a[a.length-1].id;t.el_.vjs_setProperty("autoLevelCapping",parseInt(i,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(i.bind(null,a))}return e}}},{}],3:[function(t,e,a){(function(t){var a;a="undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{},e.exports=a}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],4:[function(t,e,a){"use strict";var i=t(7),n=function(t){for(var e=0,a={payloadType:-1,payloadSize:0},i=0,n=0;e<t.byteLength&&128!==t[e];){for(;255===t[e];)i+=255,e++;for(i+=t[e++];255===t[e];)n+=255,e++;if(n+=t[e++],!a.payload&&4===i){a.payloadType=i,a.payloadSize=n,a.payload=t.subarray(e,e+n);break}e+=n,i=0,n=0}return a},r=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)},s=function(t,e){var a,i,n,r,s=[];if(!(64&e[0]))return s;for(i=31&e[0],a=0;a<i;a++)n=3*a,r={type:3&e[n+2],pts:t},4&e[n+2]&&(r.ccData=e[n+3]<<8|e[n+4],s.push(r));return s},o=function(){o.prototype.init.call(this),this.captionPackets_=[],this.field1_=new c,this.field1_.on("data",this.trigger.bind(this,"data")),this.field1_.on("done",this.trigger.bind(this,"done"))};o.prototype=new i,o.prototype.push=function(t){var e,a;"sei_rbsp"===t.nalUnitType&&(e=n(t.escapedRBSP),4===e.payloadType&&(a=r(e))&&(this.captionPackets_=this.captionPackets_.concat(s(t.pts,a))))},o.prototype.flush=function(){if(!this.captionPackets_.length)return void this.field1_.flush();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(this.field1_.push,this.field1_),this.captionPackets_.length=0,this.field1_.flush()};var d={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608},l=function(t){return null===t?"":(t=d[t]||t,String.fromCharCode(t))},h=function(){for(var t=[],e=15;e--;)t.push("");return t},c=function(){c.prototype.init.call(this),this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=h(),this.nonDisplayed_=h(),this.lastControlCode_=null,this.push=function(t){if(0===t.type){var e,a,i,n;if((e=32639&t.ccData)===this.lastControlCode_)return void(this.lastControlCode_=null);switch(this.lastControlCode_=4096==(61440&e)?e:null,e){case 0:break;case 5152:this.mode_="popOn";break;case 5167:this.flushDisplayed(t.pts),a=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=a,this.startPts_=t.pts;break;case 5157:this.topRow_=13,this.mode_="rollUp";break;case 5158:this.topRow_=12,this.mode_="rollUp";break;case 5159:this.topRow_=11,this.mode_="rollUp";break;case 5165:this.flushDisplayed(t.pts),this.shiftRowsUp_(),this.startPts_=t.pts;break;case 5153:"popOn"===this.mode_?this.nonDisplayed_[14]=this.nonDisplayed_[14].slice(0,-1):this.displayed_[14]=this.displayed_[14].slice(0,-1);break;case 5164:this.flushDisplayed(t.pts),this.displayed_=h();break;case 5166:this.nonDisplayed_=h();break;default:if(i=e>>>8,n=255&e,i>=16&&i<=23&&n>=64&&n<=127&&(16!==i||n<96)&&(i=32,n=null),(17===i||25===i)&&n>=48&&n<=63&&(i=9834,n=""),16==(240&i))return;0===i&&(i=null),0===n&&(n=null),this[this.mode_](t.pts,i,n)}}}};c.prototype=new i,c.prototype.flushDisplayed=function(t){var e=this.displayed_.map(function(t){return t.trim()}).filter(function(t){return t.length}).join("\n");e.length&&this.trigger("data",{startPts:this.startPts_,endPts:t,text:e})},c.prototype.popOn=function(t,e,a){var i=this.nonDisplayed_[14];i+=l(e),i+=l(a),this.nonDisplayed_[14]=i},c.prototype.rollUp=function(t,e,a){var i=this.displayed_[14];""===i&&(this.flushDisplayed(t),this.startPts_=t),i+=l(e),i+=l(a),this.displayed_[14]=i},c.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]=""},e.exports={CaptionStream:o,Cea608Stream:c}},{}],5:[function(t,e,a){"use strict";var i,n=t(7),r=t(6),s=function(t,e,a){var i,n="";for(i=e;i<a;i++)n+="%"+("00"+t[i].toString(16)).slice(-2);return n},o=function(t,e,a){return decodeURIComponent(s(t,e,a))},d=function(t,e,a){return unescape(s(t,e,a))},l=function(t){return t[0]<<21|t[1]<<14|t[2]<<7|t[3]},h={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=o(t.data,1,e),t.value=o(t.data,e+1,t.data.length-1);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=o(t.data,1,e),t.url=o(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}};i=function(t){var e,a={debug:!(!t||!t.debug),descriptor:t&&t.descriptor},n=0,s=[],o=0;if(i.prototype.init.call(this),this.dispatchType=r.METADATA_STREAM_TYPE.toString(16),a.descriptor)for(e=0;e<a.descriptor.length;e++)this.dispatchType+=("00"+a.descriptor[e].toString(16)).slice(-2);this.push=function(t){var e,i,r,d,c,u;if("timed-metadata"===t.type){if(t.dataAlignmentIndicator&&(o=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)))return void(a.debug&&console.log("Skipping unrecognized metadata packet"));if(s.push(t),o+=t.data.byteLength,1===s.length&&(n=l(t.data.subarray(6,10)),n+=10),!(o<n)){for(e={data:new Uint8Array(n),frames:[],pts:s[0].pts,dts:s[0].dts},c=0;c<n;)e.data.set(s[0].data.subarray(0,n-c),c),c+=s[0].data.byteLength,o-=s[0].data.byteLength,s.shift();i=10,64&e.data[5]&&(i+=4,i+=l(e.data.subarray(10,14)),n-=l(e.data.subarray(16,20)));do{if((r=l(e.data.subarray(i+4,i+8)))<1)return console.log("Malformed ID3 frame encountered. Skipping metadata parsing.");if(u=String.fromCharCode(e.data[i],e.data[i+1],e.data[i+2],e.data[i+3]),d={id:u,data:e.data.subarray(i+10,i+r+10)},d.key=d.id,h[d.id]&&(h[d.id](d),"com.apple.streaming.transportStreamTimestamp"===d.owner)){var p=d.data,f=(1&p[3])<<30|p[4]<<22|p[5]<<14|p[6]<<6|p[7]>>>2;f*=4,f+=3&p[7],d.timeStamp=f,void 0===e.pts&&void 0===e.dts&&(e.pts=d.timeStamp,e.dts=d.timeStamp),this.trigger("timestamp",d)}e.frames.push(d),i+=10,i+=r}while(i<n);this.trigger("data",e)}}}},i.prototype=new n,e.exports=i},{}],6:[function(t,e,a){"use strict";e.exports={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21}},{}],7:[function(t,e,a){"use strict";var i=function(){this.init=function(){var t={};this.on=function(e,a){t[e]||(t[e]=[]),t[e]=t[e].concat(a)},this.off=function(e,a){var i;return!!t[e]&&(i=t[e].indexOf(a),t[e]=t[e].slice(),t[e].splice(i,1),i>-1)},this.trigger=function(e){var a,i,n,r;if(a=t[e])if(2===arguments.length)for(n=a.length,i=0;i<n;++i)a[i].call(this,arguments[1]);else{for(r=[],i=arguments.length,i=1;i<arguments.length;++i)r.push(arguments[i]);for(n=a.length,i=0;i<n;++i)a[i].apply(this,r)}},this.dispose=function(){t={}}}};i.prototype.pipe=function(t){return this.on("data",function(e){t.push(e)}),this.on("done",function(e){t.flush(e)}),t},i.prototype.push=function(t){this.trigger("data",t)},i.prototype.flush=function(t){this.trigger("done",t)},e.exports=i},{}],8:[function(t,e,a){(function(e){"use strict";function i(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")}a.__esModule=!0,a.FlashlsHandler=void 0;var r="undefined"!=typeof window?window.videojs:void 0!==e?e.videojs:null,s=i(r),o=t(3),d=i(o),l=t(4),h=t(5),c=i(h),u=t(2),p=t(1),f=function(t){Object.defineProperties(t.frame,{id:{get:function(){return s.default.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),t.value.key}},value:{get:function(){return s.default.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),t.value.data}},privateData:{get:function(){return s.default.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),t.value.data}}})},_=function(t,e,a){for(var i=t.remoteTextTracks()||[],n=0;n<i.length;n++){var r=i[n];r.kind===e&&r.label===a&&t.removeRemoteTextTrack(r)}},y=function(t){for(var e=new Uint8Array(t.length),a=0;a<t.length;a++)e[a]=t.charCodeAt(a);return e},v=function(t,e){var a=[],i=void 0,n=void 0,r=void 0,s=void 0;if(!(64&e[0]))return a;for(n=31&e[0],i=0;i<n;i++)r=3*i,s={type:3&e[r+2],pts:t},4&e[r+2]&&(s.ccData=e[r+3]<<8|e[r+4],a.push(s));return a},g=function(t,e,a){var i=void 0,n=void 0;if(a&&a.cues)for(i=a.cues.length;i--;)n=a.cues[i],n.startTime<=e&&n.endTime>=t&&a.removeCue(n)},m=function(t,e){t.length&&g(0,t.start(0),e)},T=function(t,e){for(var a=-1,i=0;i<t.length;i++)if(t[i].id===e){a=i;break}t.selectedIndex_=a,t.trigger({selectedIndex:a,type:"change"})},k=a.FlashlsHandler=function(){function t(e,a,i){var r=this;if(n(this,t),a.options_&&a.options_.playerId){var o=(0,s.default)(a.options_.playerId);o.hasOwnProperty("hls")||Object.defineProperty(o,"hls",{get:function(){return s.default.log.warn("player.hls is deprecated. Use player.tech_.hls instead."),a.trigger({type:"usage",name:"flashls-player-access"}),r}})}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_=a,this.metadataTrack_=null,this.inbandTextTrack_=null,this.metadataStream_=new c.default,this.cea608Stream_=new l.Cea608Stream,this.captionPackets_=[],this.onLoadedmetadata_=this.onLoadedmetadata_.bind(this),this.onSeeked_=this.onSeeked_.bind(this),this.onId3updated_=this.onId3updated_.bind(this),this.onCaptionData_=this.onCaptionData_.bind(this),this.onMetadataStreamData_=this.onMetadataStreamData_.bind(this),this.onCea608StreamData_=this.onCea608StreamData_.bind(this),this.onLevelSwitch_=this.onLevelSwitch_.bind(this),this.onAudioTrackChanged=this.onAudioTrackChanged.bind(this),this.tech_.on("loadedmetadata",this.onLoadedmetadata_),this.tech_.on("seeked",this.onSeeked_),this.tech_.on("id3updated",this.onId3updated_),this.tech_.on("captiondata",this.onCaptionData_),this.tech_.on("levelswitch",this.onLevelSwitch_),this.metadataStream_.on("data",this.onMetadataStreamData_),this.cea608Stream_.on("data",this.onCea608StreamData_),this.playlists={media:function(){return r.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?s.default.createTimeRange():s.default.createTimeRange(t,e)},t.prototype.media_=function(){var t=this.tech_.el_.vjs_getProperty("levels"),e=this.tech_.el_.vjs_getProperty("level"),a=void 0;return t.length&&(a={resolvedUri:t[e].url,attributes:{BANDWIDTH:t[e].bitrate,RESOLUTION:{width:t[e].width,height:t[e].height}}}),a},t.prototype.onLoadedmetadata_=function(){var t=this;this.representations=(0,u.createRepresentations)(this.tech_);var e=s.default.players[this.tech_.options_.playerId];e&&e.qualityLevels&&(this.qualityLevels_=e.qualityLevels(),this.representations().forEach(function(e){t.qualityLevels_.addQualityLevel(e)}),T(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_&&T(this.qualityLevels_,e[0].levelIndex+""),this.tech_.trigger({type:"mediachange",bubbles:!0})},t.prototype.onSeeked_=function(){g(0,1/0,this.metadataTrack_);var t=this.tech_.buffered();1===t.length?(g(0,t.start(0),this.inbandTextTrack_),g(t.end(0),1/0,this.inbandTextTrack_)):g(0,1/0,this.inbandTextTrack_)},t.prototype.onId3updated_=function(t,e){var a=d.default.atob(e[0]),i=y(a),n={type:"timed-metadata",dataAlignmentIndicator:!0,data:i};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 a=this.tech_.currentTime();if(t.frames.forEach(function(t){var i=new d.default.VTTCue(a,a+.1,t.value||t.url||t.data||"");i.frame=t,i.value=t,f(i),e.metadataTrack_.addCue(i)}),this.metadataTrack_.cues&&this.metadataTrack_.cues.length){var i=this.metadataTrack_.cues,n=[],r=this.tech_.duration();(isNaN(r)||Math.abs(r)===1/0)&&(r=Number.MAX_VALUE);for(var s=0;s<i.length;s++)n.push(i[s]);n.sort(function(t,e){return t.startTime-e.startTime});for(var o=0;o<n.length-1;o++)n[o].endTime!==n[o+1].startTime&&(n[o].endTime=n[o+1].startTime);n[n.length-1].endTime=r}},t.prototype.onCaptionData_=function(t,e){var a=this;e[0].map(function(t){return{pts:9e4*t.pos,bytes:y(d.default.atob(t.data))}}).forEach(function(t){a.captionPackets_=a.captionPackets_.concat(v(t.pts,t.bytes))}),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(this.cea608Stream_.push,this.cea608Stream_),this.captionPackets_.length=0,this.cea608Stream_.flush())},t.prototype.onCea608StreamData_=function(t){t&&(this.inbandTextTrack_||(_(this.tech_,"captions","cc1"),this.inbandTextTrack_=this.tech_.addRemoteTextTrack({kind:"captions",label:"cc1"},!1).track),m(this.tech_.buffered(),this.inbandTextTrack_),this.inbandTextTrack_.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.onSeeked_),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.qualityLevels_&&this.qualityLevels_.dispose()},t}(),b={},w=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i;b.canPlayType=function(t){return w.test(t)?"maybe":""},b.canHandleSource=function(t,e){return"maybe"===b.canPlayType(t.type)},b.handleSource=function(t,e,a){return e.hls=new k(t,e,a),e.hls.src(t),e.hls},s.default.getTech("Flash").registerSourceHandler(b,0),b.VERSION="1.3.0",a.default=b}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[8]); | ||
!function t(e,a,i){function n(s,o){if(!a[s]){if(!e[s]){var d="function"==typeof require&&require;if(!o&&d)return d(s,!0);if(r)return r(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var h=a[s]={exports:{}};e[s][0].call(h.exports,function(t){var a=e[s][1][t];return n(a||t)},h,h.exports,t,e,a,i)}return a[s].exports}for(var r="function"==typeof require&&require,s=0;s<i.length;s++)n(i[s]);return n}({1:[function(t,e,a){(function(t){"use strict";a.__esModule=!0,a.setupAudioTracks=a.updateAudioTrack=void 0;var e="undefined"!=typeof window?window.videojs:void 0!==t?t.videojs:null,i=function(t){return t&&t.__esModule?t:{default:t}}(e);a.updateAudioTrack=function(t){for(var e=t.el_.vjs_getProperty("audioTracks"),a=t.audioTracks(),i=null,n=0;n<a.length;n++)if(a[n].enabled){i=a[n].id;break}if(null!==i)for(var r=0;r<e.length;r++)if(i===e[r].title)return void t.el_.vjs_setProperty("audioTrack",r)},a.setupAudioTracks=function(t){var e=t.el_.vjs_getProperty("altAudioTracks"),a=t.el_.vjs_getProperty("audioTracks"),n=t.el_.vjs_getProperty("audioTrack");a.forEach(function(a,r){var s=e[a.id];t.audioTracks().addTrack(new i.default.AudioTrack({id:s.name,enabled:n===r,language:s.lang,default:s.default_track,label:s.name}))})}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(t,e,a){"use strict";a.__esModule=!0;var i=a.createRepresentation=function(t,e){var a={id:e.index+"",width:e.width,height:e.height,bandwidth:e.bitrate,isEnabled_:!0};return a.enabled=function(e){if(void 0===e)return a.isEnabled_;e!==a.isEnabled_&&(!0!==e&&!1!==e||(a.isEnabled_=e,t()))},a};a.createRepresentations=function(t){var e=null,a=function(){var a=e.filter(function(t){return t.enabled()});if(a.length===e.length||0===a.length)return t.el_.vjs_setProperty("autoLevelCapping",-1),void t.el_.vjs_setProperty("level",-1);if(1===a.length)return t.el_.vjs_setProperty("level",parseInt(a[0].id,10)),void t.el_.vjs_setProperty("autoLevelCapping",-1);var i=a[a.length-1].id;t.el_.vjs_setProperty("autoLevelCapping",parseInt(i,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(i.bind(null,a))}return e}}},{}],3:[function(t,e,a){(function(t){var a;a="undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{},e.exports=a}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],4:[function(t,e,a){"use strict";var i=t(7),n=function(t){for(var e=0,a={payloadType:-1,payloadSize:0},i=0,n=0;e<t.byteLength&&128!==t[e];){for(;255===t[e];)i+=255,e++;for(i+=t[e++];255===t[e];)n+=255,e++;if(n+=t[e++],!a.payload&&4===i){a.payloadType=i,a.payloadSize=n,a.payload=t.subarray(e,e+n);break}e+=n,i=0,n=0}return a},r=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)},s=function(t,e){var a,i,n,r,s=[];if(!(64&e[0]))return s;for(i=31&e[0],a=0;a<i;a++)n=3*a,r={type:3&e[n+2],pts:t},4&e[n+2]&&(r.ccData=e[n+3]<<8|e[n+4],s.push(r));return s},o=function(){o.prototype.init.call(this),this.captionPackets_=[],this.field1_=new c,this.field1_.on("data",this.trigger.bind(this,"data")),this.field1_.on("done",this.trigger.bind(this,"done"))};o.prototype=new i,o.prototype.push=function(t){var e,a;"sei_rbsp"===t.nalUnitType&&(e=n(t.escapedRBSP),4===e.payloadType&&(a=r(e))&&(this.captionPackets_=this.captionPackets_.concat(s(t.pts,a))))},o.prototype.flush=function(){if(!this.captionPackets_.length)return void this.field1_.flush();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(this.field1_.push,this.field1_),this.captionPackets_.length=0,this.field1_.flush()};var d={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608},l=function(t){return null===t?"":(t=d[t]||t,String.fromCharCode(t))},h=function(){for(var t=[],e=15;e--;)t.push("");return t},c=function(){c.prototype.init.call(this),this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=h(),this.nonDisplayed_=h(),this.lastControlCode_=null,this.push=function(t){if(0===t.type){var e,a,i,n;if((e=32639&t.ccData)===this.lastControlCode_)return void(this.lastControlCode_=null);switch(this.lastControlCode_=4096==(61440&e)?e:null,e){case 0:break;case 5152:this.mode_="popOn";break;case 5167:this.flushDisplayed(t.pts),a=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=a,this.startPts_=t.pts;break;case 5157:this.topRow_=13,this.mode_="rollUp";break;case 5158:this.topRow_=12,this.mode_="rollUp";break;case 5159:this.topRow_=11,this.mode_="rollUp";break;case 5165:this.flushDisplayed(t.pts),this.shiftRowsUp_(),this.startPts_=t.pts;break;case 5153:"popOn"===this.mode_?this.nonDisplayed_[14]=this.nonDisplayed_[14].slice(0,-1):this.displayed_[14]=this.displayed_[14].slice(0,-1);break;case 5164:this.flushDisplayed(t.pts),this.displayed_=h();break;case 5166:this.nonDisplayed_=h();break;default:if(i=e>>>8,n=255&e,i>=16&&i<=23&&n>=64&&n<=127&&(16!==i||n<96)&&(i=32,n=null),(17===i||25===i)&&n>=48&&n<=63&&(i=9834,n=""),16==(240&i))return;0===i&&(i=null),0===n&&(n=null),this[this.mode_](t.pts,i,n)}}}};c.prototype=new i,c.prototype.flushDisplayed=function(t){var e=this.displayed_.map(function(t){return t.trim()}).filter(function(t){return t.length}).join("\n");e.length&&this.trigger("data",{startPts:this.startPts_,endPts:t,text:e})},c.prototype.popOn=function(t,e,a){var i=this.nonDisplayed_[14];i+=l(e),i+=l(a),this.nonDisplayed_[14]=i},c.prototype.rollUp=function(t,e,a){var i=this.displayed_[14];""===i&&(this.flushDisplayed(t),this.startPts_=t),i+=l(e),i+=l(a),this.displayed_[14]=i},c.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]=""},e.exports={CaptionStream:o,Cea608Stream:c}},{}],5:[function(t,e,a){"use strict";var i,n=t(7),r=t(6),s=function(t,e,a){var i,n="";for(i=e;i<a;i++)n+="%"+("00"+t[i].toString(16)).slice(-2);return n},o=function(t,e,a){return decodeURIComponent(s(t,e,a))},d=function(t,e,a){return unescape(s(t,e,a))},l=function(t){return t[0]<<21|t[1]<<14|t[2]<<7|t[3]},h={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=o(t.data,1,e),t.value=o(t.data,e+1,t.data.length-1);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=o(t.data,1,e),t.url=o(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}};i=function(t){var e,a={debug:!(!t||!t.debug),descriptor:t&&t.descriptor},n=0,s=[],o=0;if(i.prototype.init.call(this),this.dispatchType=r.METADATA_STREAM_TYPE.toString(16),a.descriptor)for(e=0;e<a.descriptor.length;e++)this.dispatchType+=("00"+a.descriptor[e].toString(16)).slice(-2);this.push=function(t){var e,i,r,d,c,u;if("timed-metadata"===t.type){if(t.dataAlignmentIndicator&&(o=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)))return void(a.debug&&console.log("Skipping unrecognized metadata packet"));if(s.push(t),o+=t.data.byteLength,1===s.length&&(n=l(t.data.subarray(6,10)),n+=10),!(o<n)){for(e={data:new Uint8Array(n),frames:[],pts:s[0].pts,dts:s[0].dts},c=0;c<n;)e.data.set(s[0].data.subarray(0,n-c),c),c+=s[0].data.byteLength,o-=s[0].data.byteLength,s.shift();i=10,64&e.data[5]&&(i+=4,i+=l(e.data.subarray(10,14)),n-=l(e.data.subarray(16,20)));do{if((r=l(e.data.subarray(i+4,i+8)))<1)return console.log("Malformed ID3 frame encountered. Skipping metadata parsing.");if(u=String.fromCharCode(e.data[i],e.data[i+1],e.data[i+2],e.data[i+3]),d={id:u,data:e.data.subarray(i+10,i+r+10)},d.key=d.id,h[d.id]&&(h[d.id](d),"com.apple.streaming.transportStreamTimestamp"===d.owner)){var p=d.data,f=(1&p[3])<<30|p[4]<<22|p[5]<<14|p[6]<<6|p[7]>>>2;f*=4,f+=3&p[7],d.timeStamp=f,void 0===e.pts&&void 0===e.dts&&(e.pts=d.timeStamp,e.dts=d.timeStamp),this.trigger("timestamp",d)}e.frames.push(d),i+=10,i+=r}while(i<n);this.trigger("data",e)}}}},i.prototype=new n,e.exports=i},{}],6:[function(t,e,a){"use strict";e.exports={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21}},{}],7:[function(t,e,a){"use strict";var i=function(){this.init=function(){var t={};this.on=function(e,a){t[e]||(t[e]=[]),t[e]=t[e].concat(a)},this.off=function(e,a){var i;return!!t[e]&&(i=t[e].indexOf(a),t[e]=t[e].slice(),t[e].splice(i,1),i>-1)},this.trigger=function(e){var a,i,n,r;if(a=t[e])if(2===arguments.length)for(n=a.length,i=0;i<n;++i)a[i].call(this,arguments[1]);else{for(r=[],i=arguments.length,i=1;i<arguments.length;++i)r.push(arguments[i]);for(n=a.length,i=0;i<n;++i)a[i].apply(this,r)}},this.dispose=function(){t={}}}};i.prototype.pipe=function(t){return this.on("data",function(e){t.push(e)}),this.on("done",function(e){t.flush(e)}),t},i.prototype.push=function(t){this.trigger("data",t)},i.prototype.flush=function(t){this.trigger("done",t)},e.exports=i},{}],8:[function(t,e,a){(function(e){"use strict";function i(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")}a.__esModule=!0,a.FlashlsHandler=void 0;var r="undefined"!=typeof window?window.videojs:void 0!==e?e.videojs:null,s=i(r),o=t(3),d=i(o),l=t(4),h=t(5),c=i(h),u=t(2),p=t(1),f=function(t){Object.defineProperties(t.frame,{id:{get:function(){return s.default.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),t.value.key}},value:{get:function(){return s.default.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),t.value.data}},privateData:{get:function(){return s.default.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),t.value.data}}})},_=function(t,e,a){for(var i=t.remoteTextTracks()||[],n=0;n<i.length;n++){var r=i[n];r.kind===e&&r.label===a&&t.removeRemoteTextTrack(r)}},y=function(t){for(var e=new Uint8Array(t.length),a=0;a<t.length;a++)e[a]=t.charCodeAt(a);return e},v=function(t,e){var a=[],i=void 0,n=void 0,r=void 0,s=void 0;if(!(64&e[0]))return a;for(n=31&e[0],i=0;i<n;i++)r=3*i,s={type:3&e[r+2],pts:t},4&e[r+2]&&(s.ccData=e[r+3]<<8|e[r+4],a.push(s));return a},g=function(t,e,a){var i=void 0,n=void 0;if(a&&a.cues)for(i=a.cues.length;i--;)n=a.cues[i],n.startTime<=e&&n.endTime>=t&&a.removeCue(n)},m=function(t,e){t.length&&g(0,t.start(0),e)},T=function(t,e){for(var a=-1,i=0;i<t.length;i++)if(t[i].id===e){a=i;break}t.selectedIndex_=a,t.trigger({selectedIndex:a,type:"change"})},k=a.FlashlsHandler=function(){function t(e,a,i){var r=this;if(n(this,t),a.options_&&a.options_.playerId){var o=(0,s.default)(a.options_.playerId);o.hasOwnProperty("hls")||Object.defineProperty(o,"hls",{get:function(){return s.default.log.warn("player.hls is deprecated. Use player.tech_.hls instead."),a.trigger({type:"usage",name:"flashls-player-access"}),r}})}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_=a,this.metadataTrack_=null,this.inbandTextTrack_=null,this.metadataStream_=new c.default,this.cea608Stream_=new l.Cea608Stream,this.captionPackets_=[],this.onLoadedmetadata_=this.onLoadedmetadata_.bind(this),this.onSeeked_=this.onSeeked_.bind(this),this.onId3updated_=this.onId3updated_.bind(this),this.onCaptionData_=this.onCaptionData_.bind(this),this.onMetadataStreamData_=this.onMetadataStreamData_.bind(this),this.onCea608StreamData_=this.onCea608StreamData_.bind(this),this.onLevelSwitch_=this.onLevelSwitch_.bind(this),this.onAudioTrackChanged=this.onAudioTrackChanged.bind(this),this.tech_.on("loadedmetadata",this.onLoadedmetadata_),this.tech_.on("seeked",this.onSeeked_),this.tech_.on("id3updated",this.onId3updated_),this.tech_.on("captiondata",this.onCaptionData_),this.tech_.on("levelswitch",this.onLevelSwitch_),this.metadataStream_.on("data",this.onMetadataStreamData_),this.cea608Stream_.on("data",this.onCea608StreamData_),this.playlists={media:function(){return r.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?s.default.createTimeRange():s.default.createTimeRange(t,e)},t.prototype.media_=function(){var t=this.tech_.el_.vjs_getProperty("levels"),e=this.tech_.el_.vjs_getProperty("level"),a=void 0;return t.length&&(a={resolvedUri:t[e].url,attributes:{BANDWIDTH:t[e].bitrate,RESOLUTION:{width:t[e].width,height:t[e].height}}}),a},t.prototype.onLoadedmetadata_=function(){var t=this;this.representations=(0,u.createRepresentations)(this.tech_);var e=s.default.players[this.tech_.options_.playerId];e&&e.qualityLevels&&(this.qualityLevels_=e.qualityLevels(),this.representations().forEach(function(e){t.qualityLevels_.addQualityLevel(e)}),T(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_&&T(this.qualityLevels_,e[0].levelIndex+""),this.tech_.trigger({type:"mediachange",bubbles:!0})},t.prototype.onSeeked_=function(){g(0,1/0,this.metadataTrack_);var t=this.tech_.buffered();1===t.length?(g(0,t.start(0),this.inbandTextTrack_),g(t.end(0),1/0,this.inbandTextTrack_)):g(0,1/0,this.inbandTextTrack_)},t.prototype.onId3updated_=function(t,e){var a=d.default.atob(e[0]),i=y(a),n={type:"timed-metadata",dataAlignmentIndicator:!0,data:i};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 a=this.tech_.currentTime();if(t.frames.forEach(function(t){var i=new d.default.VTTCue(a,a+.1,t.value||t.url||t.data||"");i.frame=t,i.value=t,f(i),e.metadataTrack_.addCue(i)}),this.metadataTrack_.cues&&this.metadataTrack_.cues.length){var i=this.metadataTrack_.cues,n=[],r=this.tech_.duration();(isNaN(r)||Math.abs(r)===1/0)&&(r=Number.MAX_VALUE);for(var s=0;s<i.length;s++)n.push(i[s]);n.sort(function(t,e){return t.startTime-e.startTime});for(var o=0;o<n.length-1;o++)n[o].endTime!==n[o+1].startTime&&(n[o].endTime=n[o+1].startTime);n[n.length-1].endTime=r}},t.prototype.onCaptionData_=function(t,e){var a=this;e[0].map(function(t){return{pts:9e4*t.pos,bytes:y(d.default.atob(t.data))}}).forEach(function(t){a.captionPackets_=a.captionPackets_.concat(v(t.pts,t.bytes))}),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(this.cea608Stream_.push,this.cea608Stream_),this.captionPackets_.length=0,this.cea608Stream_.flush())},t.prototype.onCea608StreamData_=function(t){t&&(this.inbandTextTrack_||(_(this.tech_,"captions","cc1"),this.inbandTextTrack_=this.tech_.addRemoteTextTrack({kind:"captions",label:"cc1"},!1).track),m(this.tech_.buffered(),this.inbandTextTrack_),this.inbandTextTrack_.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.onSeeked_),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.qualityLevels_&&this.qualityLevels_.dispose()},t}(),b={},w=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i;b.canPlayType=function(t){return w.test(t)?"maybe":""},b.canHandleSource=function(t,e){return"maybe"===b.canPlayType(t.type)},b.handleSource=function(t,e,a){return e.hls=new k(t,e,a),e.hls.src(t),e.hls},s.default.getTech("Flash").registerSourceHandler(b,0),b.VERSION="1.3.1",a.default=b}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[8]); |
@@ -10,3 +10,3 @@ 'use strict'; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
@@ -60,7 +60,7 @@ /** | ||
tech.audioTracks().addTrack(new _video2.default.AudioTrack({ | ||
tech.audioTracks().addTrack(new _video2['default'].AudioTrack({ | ||
id: altTrack.name, | ||
enabled: enabledIndex === index, | ||
language: altTrack.lang, | ||
default: altTrack.default_track, | ||
'default': altTrack.default_track, | ||
label: altTrack.name | ||
@@ -67,0 +67,0 @@ })); |
@@ -24,3 +24,3 @@ 'use strict'; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
@@ -41,3 +41,3 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
get: function get() { | ||
_video2.default.log.warn('cue.frame.id is deprecated. Use cue.value.key instead.'); | ||
_video2['default'].log.warn('cue.frame.id is deprecated. Use cue.value.key instead.'); | ||
return cue.value.key; | ||
@@ -48,3 +48,3 @@ } | ||
get: function get() { | ||
_video2.default.log.warn('cue.frame.value is deprecated. Use cue.value.data instead.'); | ||
_video2['default'].log.warn('cue.frame.value is deprecated. Use cue.value.data instead.'); | ||
return cue.value.data; | ||
@@ -55,3 +55,3 @@ } | ||
get: function get() { | ||
_video2.default.log.warn('cue.frame.privateData is deprecated. Use cue.value.data instead.'); | ||
_video2['default'].log.warn('cue.frame.privateData is deprecated. Use cue.value.data instead.'); | ||
return cue.value.data; | ||
@@ -203,3 +203,3 @@ } | ||
if (tech.options_ && tech.options_.playerId) { | ||
var _player = (0, _video2.default)(tech.options_.playerId); | ||
var _player = (0, _video2['default'])(tech.options_.playerId); | ||
@@ -209,3 +209,3 @@ if (!_player.hasOwnProperty('hls')) { | ||
get: function get() { | ||
_video2.default.log.warn('player.hls is deprecated. Use player.tech_.hls instead.'); | ||
_video2['default'].log.warn('player.hls is deprecated. Use player.tech_.hls instead.'); | ||
tech.trigger({ type: 'usage', name: 'flashls-player-access' }); | ||
@@ -234,3 +234,3 @@ return _this; | ||
this.inbandTextTrack_ = null; | ||
this.metadataStream_ = new _metadataStream2.default(); | ||
this.metadataStream_ = new _metadataStream2['default'](); | ||
this.cea608Stream_ = new _captionStream.Cea608Stream(); | ||
@@ -286,6 +286,6 @@ this.captionPackets_ = []; | ||
if (seekableEnd === 0) { | ||
return _video2.default.createTimeRange(); | ||
return _video2['default'].createTimeRange(); | ||
} | ||
return _video2.default.createTimeRange(seekableStart, seekableEnd); | ||
return _video2['default'].createTimeRange(seekableStart, seekableEnd); | ||
}; | ||
@@ -325,3 +325,3 @@ | ||
var player = _video2.default.players[this.tech_.options_.playerId]; | ||
var player = _video2['default'].players[this.tech_.options_.playerId]; | ||
@@ -400,3 +400,3 @@ if (player && player.qualityLevels) { | ||
FlashlsHandler.prototype.onId3updated_ = function onId3updated_(event, data) { | ||
var id3tag = _window2.default.atob(data[0]); | ||
var id3tag = _window2['default'].atob(data[0]); | ||
var bytes = stringToByteArray(id3tag); | ||
@@ -438,3 +438,3 @@ var chunk = { | ||
tag.frames.forEach(function (frame) { | ||
var cue = new _window2.default.VTTCue(time, time + 0.1, frame.value || frame.url || frame.data || ''); | ||
var cue = new _window2['default'].VTTCue(time, time + 0.1, frame.value || frame.url || frame.data || ''); | ||
@@ -491,3 +491,3 @@ cue.frame = frame; | ||
pts: d.pos * 90000, | ||
bytes: stringToByteArray(_window2.default.atob(d.data)) | ||
bytes: stringToByteArray(_window2['default'].atob(d.data)) | ||
}; | ||
@@ -543,3 +543,3 @@ }); | ||
this.inbandTextTrack_.addCue(new _window2.default.VTTCue(caption.startPts / 90000, caption.endPts / 90000, caption.text)); | ||
this.inbandTextTrack_.addCue(new _window2['default'].VTTCue(caption.startPts / 90000, caption.endPts / 90000, caption.text)); | ||
} | ||
@@ -628,3 +628,3 @@ }; | ||
// any other Flash source handlers for HLS | ||
_video2.default.getTech('Flash').registerSourceHandler(FlashlsSourceHandler, 0); | ||
_video2['default'].getTech('Flash').registerSourceHandler(FlashlsSourceHandler, 0); | ||
@@ -634,2 +634,2 @@ // Include the version number. | ||
exports.default = FlashlsSourceHandler; | ||
exports['default'] = FlashlsSourceHandler; |
{ | ||
"name": "@brightcove/videojs-flashls-source-handler", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"description": "A source handler to integrate flashls with video.js", | ||
@@ -85,2 +85,3 @@ "main": "es5/index.js", | ||
"babel-preset-es2015": "^6.14.0", | ||
"babel-preset-es3": "^1.0.1", | ||
"babelify": "^7.3.0", | ||
@@ -87,0 +88,0 @@ "bannerize": "^1.0.2", |
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
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
276361
30
255