forked from video-dev/hls.js
-
Notifications
You must be signed in to change notification settings - Fork 90
/
hls-demo.js.map
1 lines (1 loc) · 89.2 KB
/
hls-demo.js.map
1
{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap 4272408a55a30c66251b","webpack:///./demo/main.js","webpack:///./demo/demo-utils.js","webpack:///./tests/test-streams.js"],"names":["testStreams","require","defaultTestStreamUrl","url","sourceURL","decodeURIComponent","getURLParam","demoConfig","JSON","parse","atob","enableStreaming","getDemoConfigPropOrDefault","autoRecoverError","enableWorker","levelCapping","limitMetrics","defaultAudioCodec","undefined","widevineLicenseUrl","dumpfMP4","bufferingIdx","selectedTestStream","video","$","startTime","Date","now","lastSeekingIdx","lastStartPosition","lastDuration","lastAudioTrackSwitchingIdx","hls","events","stats","tracks","fmp4Data","document","ready","Object","keys","forEach","key","stream","option","Option","description","append","change","val","streamUrl","loadSelectedStream","width","click","checked","onDemoConfigChanged","value","prop","Hls","version","html","volume","hideAllTabs","toggle","windowSliding","setupGlobals","window","t0","performance","load","buffer","level","bitrate","recoverDecodingErrorDate","recoverSwapAudioCodecDate","onClickBufferedRange","updateLevelInfo","createfMP4","goToMetricsPermaLink","toggleTab","trimArray","target","limit","length","shift","trimEventHistory","x","isSupported","handleUnsupported","hideCanvas","destroy","bufferTimer","clearInterval","logStatus","unescape","hlsConfig","debug","config","emeEnabled","console","log","loadSource","autoLevelCapping","attachMedia","on","Events","MEDIA_ATTACHED","push","time","type","MEDIA_DETACHED","FRAG_PARSING_INIT_SEGMENT","event","data","showCanvas","id","FRAG_PARSING_METADATA","LEVEL_SWITCHING","Math","round","levels","MANIFEST_PARSED","name","start","end","trequest","latency","tfirst","tload","duration","refreshCanvas","levelNb","levelParsed","AUDIO_TRACKS_UPDATED","audioTracks","updateAudioTrackInfo","AUDIO_TRACK_SWITCHING","AUDIO_TRACK_SWITCHED","LEVEL_LOADED","isLive","details","live","startSN","endSN","parsing","tparsed","parsingDuration","sumLevelParsingMs","levelParsingUs","AUDIO_TRACK_LOADED","FRAG_BUFFERED","frag","id2","sn","tbuffered","bw","total","size","pos","setInterval","checkBuffer","process","fragBuffered","fragMinLatency","min","fragMaxLatency","max","fragMinProcess","fragMaxProcess","fragMinKbps","fragMaxKbps","autoLevelCappingMin","autoLevelCappingMax","fragBufferedBytes","sumLatency","sumKbps","sumProcess","sumParsing","fraglastLatency","fragAvgLatency","fragLastProcess","fragAvgProcess","fragLastKbps","fragAvgKbps","fragparsingKbps","fragparsingMs","autoLevelCappingLast","LEVEL_SWITCHED","FRAG_CHANGED","tagList","autoLevel","levelStart","fragChangedAuto","autoLevelMin","autoLevelMax","levelLastAuto","autoLevelLast","autoLevelSwitch","sumAutoLevel","autoLevelAvg","fragChangedManual","manualLevelMin","manualLevelMax","manualLevelLast","manualLevelSwitch","FRAG_LOAD_EMERGENCY_ABORTED","fragLoadEmergencyAborted","FRAG_DECRYPTED","fragDecrypted","totalDecryptTime","fragAvgDecryptTime","tdecrypt","tstart","ERROR","warn","ErrorDetails","MANIFEST_LOAD_ERROR","context","response","code","text","err","MANIFEST_LOAD_TIMEOUT","logError","MANIFEST_PARSING_ERROR","reason","LEVEL_LOAD_ERROR","LEVEL_LOAD_TIMEOUT","LEVEL_SWITCH_ERROR","FRAG_LOAD_ERROR","FRAG_LOAD_TIMEOUT","FRAG_LOOP_LOADING_ERROR","FRAG_DECRYPT_ERROR","FRAG_PARSING_ERROR","KEY_LOAD_ERROR","decryptdata","uri","KEY_LOAD_TIMEOUT","BUFFER_APPEND_ERROR","BUFFER_ADD_CODEC_ERROR","mimeType","message","BUFFER_APPENDING_ERROR","BUFFER_STALLED_ERROR","fatal","error","ErrorTypes","MEDIA_ERROR","handleMediaError","NETWORK_ERROR","fatalError","stringify","sortObject","BUFFER_CREATED","BUFFER_APPENDING","FPS_DROP","evt","currentDropped","currentDecoded","fpsDropEvent","fpsTotalDroppedFrames","totalDroppedFrames","addEventListener","handleVideoEvent","navigator","userAgent","toLowerCase","indexOf","videoWidth","videoHeight","currentTime","errorTxt","mediaError","currentTarget","MEDIA_ERR_ABORTED","MEDIA_ERR_DECODE","MEDIA_ERR_NETWORK","MEDIA_ERR_SRC_NOT_SUPPORTED","recoverMediaError","swapAudioCodec","timeRangesToString","r","i","v","canvas","ctx","getContext","buffered","bufferingDuration","fillStyle","fillRect","height","clientWidth","bufferLen","paused","bufEvents","bufEventLen","event0","event1","slopeBuf0","slopeBuf1","slopePos0","slopePos1","abs","pop","seekable","played","media","videoPlaybackQuality","getVideoPlaybackQuality","Function","droppedVideoFrames","corruptedVideoFrames","webkitDroppedFrameCount","showMetrics","show","hideMetrics","hide","getMetrics","json","jsonpacked","jsonpack","pack","btoa","copyMetricsToClipBoard","copyTextToClipboard","goToMetrics","URL","substr","lastIndexOf","open","b64","minsecs","ts","m","floor","s","clientX","offsetLeft","button_template","button_enabled","button_disabled","html1","autoLevelEnabled","html2","html3","html4","currentLevel","levelName","label","level2label","loadLevel","nextLevel","audioTrackId","audioTrack","len","index","propName","defaultVal","sParam","defaultValue","sPageURL","location","search","substring","sURLVariables","split","sParameterName","escape","serializedDemoConfig","baseURL","permalinkURL","encodeURIComponent","blob","Blob","arrayConcat","filename","toISOString","saveAs","inputArray","totalLength","reduce","prev","cur","result","Uint8Array","offset","element","set","tabElId","appendLog","textElId","el","logText","timestamp","newMessage","obj","temp","sort","textArea","createElement","body","appendChild","select","successful","execCommand","msg","removeChild","createTestStream","abr","blacklist_ua","createTestStreamWithConfig","Error","testStream","module","exports","bbb","nudgeMaxRetry","bigBuckBunny480p","arte","deltatreDAI","issue666","issue649","closedCaptions","oceansAES","mp3Audio","mpegAudioOnly","fmp4","fmp4Bitmovin","offset_pts","angelOneShakaWidevine","audioOnlyMultipleLevels","pdtDuplicate","pdtLargeGap","pdtBadValues","pdtOneValue"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AAC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GA9ES;AAqFfC,gBAAc;AACZ,WAAO,8GADK;AAEZ,mBAAe,sBAFH;AAGZ,YAAQ,KAHI;AAIZ,WAAO,IAJK;AAKZ,oBAAgB,CAAC,QAAD,EAAW,mBAAX;AALJ,GArFC;AA4FfC,cAAY;AACV,WAAO,2DADG;AAEV,mBAAe,mCAFL;AAGV,YAAQ,KAHE;AAIV,WAAO;AAJG,GA5FG;AAkGf;;;;;;AAMAC,yBAAuBnB,2BAA2B;AAChDxZ,SAAK,kFAD2C;AAEhD2C,iBAAa,6DAFmC;AAGhD4W,kBAAc,CAAC,SAAD,EAAY,QAAZ,EAAsB,mBAAtB;AAHkC,GAA3B,EAKvB;AACEvY,wBAAoB,8CADtB;AAEE+E,gBAAY;AAFd,GALuB,CAxGR;AAkHf6U,2BAAyB;AACvB,WAAO,wEADgB;AAEvB,mBAAe,qCAFQ;AAGvB,YAAQ,KAHe;AAIvB,WAAO;AAJgB,GAlHV;AAwHfC,gBAAc;AACZ7a,SAAK,sEADO;AAEZ2C,iBAAa;AAFD,GAxHC;AA4HfmY,eAAa;AACX9a,SAAK,mEADM;AAEX2C,iBAAa;AAFF,GA5HE;AAgIfoY,gBAAc;AACZ/a,SAAK,yEADO;AAEZ2C,iBAAa;AAFD,GAhIC;AAoIfqY,eAAa;AACXhb,SAAK,oEADM;AAEX2C,iBAAa;AAFF;AApIE,CAAjB,C","file":"hls-demo.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"HlsDemo\"] = factory();\n\telse\n\t\troot[\"HlsDemo\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/dist/\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 4272408a55a30c66251b","import {sortObject, copyTextToClipboard} from './demo-utils'\n\nconst testStreams = require('../tests/test-streams');\nconst defaultTestStreamUrl = testStreams['bbb'].url;\nconst sourceURL = decodeURIComponent(getURLParam('src', defaultTestStreamUrl))\n\nlet demoConfig = getURLParam('demoConfig', null)\nif (demoConfig) {\n demoConfig = JSON.parse(atob(demoConfig))\n} else {\n demoConfig = {}\n}\n\nlet enableStreaming = getDemoConfigPropOrDefault('enableStreaming', true);\nlet autoRecoverError = getDemoConfigPropOrDefault('autoRecoverError', true);\nlet enableWorker = getDemoConfigPropOrDefault('enableWorker', true);\nlet levelCapping = getDemoConfigPropOrDefault('levelCapping', -1);\nlet limitMetrics = getDemoConfigPropOrDefault('limitMetrics', -1);\nlet defaultAudioCodec = getDemoConfigPropOrDefault('defaultAudioCodec', undefined);\nlet widevineLicenseUrl = getDemoConfigPropOrDefault('widevineLicenseURL', undefined);\nlet dumpfMP4 = getDemoConfigPropOrDefault('dumpfMP4', false);\n\nlet bufferingIdx = -1;\nlet selectedTestStream = null;\nlet video = $('#video')[0];\nlet startTime = Date.now()\n\nlet lastSeekingIdx;\nlet lastStartPosition;\nlet lastDuration;\nlet lastAudioTrackSwitchingIdx;\nlet hls;\nlet url;\nlet events;\nlet stats;\nlet tracks;\nlet fmp4Data;\n\n$(document).ready(function() {\n Object.keys(testStreams).forEach((key) => {\n const stream = testStreams[key];\n const option = new Option(stream.description, key);\n $('#streamSelect').append(option);\n })\n\n $('#streamSelect').change(function() {\n selectedTestStream = testStreams[$('#streamSelect').val()];\n const streamUrl = selectedTestStream.url;\n $('#streamURL').val(streamUrl);\n loadSelectedStream();\n });\n\n $('#streamURL').change(function() {\n selectedTestStream = null;\n loadSelectedStream();\n });\n\n $('#videoSize').change(function() {\n $('#video').width($('#videoSize').val());\n $('#bufferedCanvas').width($('#videoSize').val());\n });\n\n $('#enableStreaming').click(function() {\n enableStreaming = this.checked;\n loadSelectedStream();\n });\n\n $('#autoRecoverError').click(function() {\n autoRecoverError = this.checked;\n onDemoConfigChanged();\n });\n\n $('#enableWorker').click(function() {\n enableWorker = this.checked;\n onDemoConfigChanged();\n });\n\n $('#dumpfMP4').click(function() {\n dumpfMP4 = this.checked;\n onDemoConfigChanged();\n });\n\n $('#limitMetrics').change(function() {\n limitMetrics = this.value;\n onDemoConfigChanged();\n })\n\n $('#levelCapping').change(function() {\n levelCapping = this.value;\n onDemoConfigChanged();\n });\n\n $('#defaultAudioCodec').change(function() {\n defaultAudioCodec = this.value;\n onDemoConfigChanged();\n });\n\n $('#limitMetrics').val(limitMetrics);\n $('#enableStreaming').prop('checked', enableStreaming );\n $('#autoRecoverError').prop('checked', autoRecoverError );\n $('#enableWorker').prop('checked', enableWorker );\n $('#dumpfMP4').prop('checked', dumpfMP4 );\n $('#levelCapping').val(levelCapping);\n $('#defaultAudioCodec').val(defaultAudioCodec || 'undefined');\n\n $('h2').append(' <a target=_blank href=https://github.com/video-dev/hls.js/releases/tag/v' + Hls.version + '>v' + Hls.version + '</a>');\n $('#currentVersion').html('Hls version:' + Hls.version);\n\n $('#streamURL').val(sourceURL)\n\n video.volume = 0.05;\n\n hideAllTabs();\n\n $('#metricsButtonWindow').toggle(windowSliding);\n $('#metricsButtonFixed').toggle(!windowSliding);\n\n loadSelectedStream();\n\n});\n\nfunction setupGlobals() {\n window.events = events = {\n url : url,\n t0 : performance.now(),\n load : [],\n buffer : [],\n video : [],\n level : [],\n bitrate: []\n };\n\n // actual values, only on window\n window.recoverDecodingErrorDate = null;\n window.recoverSwapAudioCodecDate = null;\n\n window.fmp4Data = fmp4Data = {\n 'audio': [],\n 'video': []\n };\n\n window.onClickBufferedRange = onClickBufferedRange;\n\n window.updateLevelInfo = updateLevelInfo;\n window.onDemoConfigChanged = onDemoConfigChanged;\n window.createfMP4 = createfMP4;\n window.goToMetricsPermaLink = goToMetricsPermaLink;\n window.toggleTab = toggleTab;\n window.onDemoConfigChanged = onDemoConfigChanged;\n}\n\nfunction trimArray( target, limit ) {\n if( limit < 0 ) {\n return;\n }\n\n while(target.length > limit )\n {\n target.shift();\n }\n}\n\nfunction trimEventHistory() {\n const x = limitMetrics;\n\n if(x < 0) {\n return;\n }\n\n trimArray(events.load, x);\n trimArray(events.buffer, x);\n trimArray(events.video, x);\n trimArray(events.level, x);\n trimArray(events.bitrate, x);\n}\n\nfunction loadSelectedStream() {\n\n if (!Hls.isSupported()) {\n handleUnsupported();\n return;\n }\n\n url = $('#streamURL').val()\n\n setupGlobals();\n hideCanvas();\n\n if(hls) {\n hls.destroy();\n if(hls.bufferTimer) {\n clearInterval(hls.bufferTimer);\n hls.bufferTimer = undefined;\n }\n hls = null;\n }\n\n if(!enableStreaming) {\n logStatus('Streaming disabled');\n return;\n }\n\n logStatus('Loading ' + url);\n\n if (widevineLicenseUrl) {\n widevineLicenseUrl = unescape(widevineLicenseUrl)\n }\n\n const hlsConfig = {\n debug : true,\n enableWorker : enableWorker,\n defaultAudioCodec: defaultAudioCodec,\n widevineLicenseUrl: widevineLicenseUrl\n };\n\n if (selectedTestStream && selectedTestStream.config) {\n Object.assign(hlsConfig, selectedTestStream.config)\n }\n\n if (hlsConfig.widevineLicenseUrl) {\n $('#widevineLicenseUrl').val(hlsConfig.widevineLicenseUrl);\n }\n\n widevineLicenseUrl = hlsConfig.widevineLicenseUrl = $('#widevineLicenseUrl').val();\n\n if (hlsConfig.widevineLicenseUrl) {\n hlsConfig.emeEnabled = true;\n }\n\n onDemoConfigChanged();\n console.log('Using Hls.js config:', hlsConfig);\n\n window.hls = hls = new Hls(hlsConfig);\n\n logStatus('Loading manifest and attaching video element...');\n\n hls.loadSource(url);\n hls.autoLevelCapping = levelCapping;\n hls.attachMedia(video);\n\n hls.on(Hls.Events.MEDIA_ATTACHED, function() {\n logStatus('Media element attached');\n bufferingIdx = -1;\n events.video.push({\n time: performance.now() - events.t0,\n type: 'Media attached'\n });\n trimEventHistory();\n });\n\n hls.on(Hls.Events.MEDIA_DETACHED, function() {\n logStatus('Media element detached');\n bufferingIdx = -1;\n tracks = [];\n events.video.push({\n time: performance.now() - events.t0,\n type: 'Media detached'\n });\n trimEventHistory();\n });\n\n hls.on(Hls.Events.FRAG_PARSING_INIT_SEGMENT, function(event, data) {\n showCanvas();\n var event = {\n time: performance.now() - events.t0,\n type: data.id + ' init segment'\n };\n events.video.push(event);\n trimEventHistory();\n });\n\n hls.on(Hls.Events.FRAG_PARSING_METADATA, function(event, data) {\n //console.log(\"Id3 samples \", data.samples);\n });\n\n hls.on(Hls.Events.LEVEL_SWITCHING, function(event, data) {\n events.level.push({\n time : performance.now() - events.t0,\n id : data.level,\n bitrate: Math.round(hls.levels[data.level].bitrate/1000)\n });\n trimEventHistory();\n updateLevelInfo();\n });\n\n hls.on(Hls.Events.MANIFEST_PARSED, function(event, data) {\n var event = {\n type : 'manifest',\n name : '',\n start : 0,\n end : data.levels.length,\n time : data.stats.trequest - events.t0,\n latency : data.stats.tfirst - data.stats.trequest,\n load : data.stats.tload - data.stats.tfirst,\n duration: data.stats.tload - data.stats.tfirst,\n };\n events.load.push(event);\n trimEventHistory();\n refreshCanvas();\n });\n\n hls.on(Hls.Events.MANIFEST_PARSED, function(event, data) {\n logStatus('No of quality levels found: ' + hls.levels.length);\n logStatus('Manifest successfully loaded');\n stats = {\n levelNb : data.levels.length,\n levelParsed: 0\n };\n trimEventHistory();\n updateLevelInfo();\n });\n\n hls.on(Hls.Events.AUDIO_TRACKS_UPDATED, function(event, data) {\n logStatus('No of audio tracks found: ' + data.audioTracks.length);\n updateAudioTrackInfo();\n });\n\n hls.on(Hls.Events.AUDIO_TRACK_SWITCHING, function(event, data) {\n logStatus('Audio track switching...');\n updateAudioTrackInfo();\n var event = {\n time: performance.now() - events.t0,\n type: 'audio switching',\n name: '@' + data.id\n };\n events.video.push(event);\n trimEventHistory();\n lastAudioTrackSwitchingIdx = events.video.length-1;\n });\n\n hls.on(Hls.Events.AUDIO_TRACK_SWITCHED, function(event, data) {\n logStatus('Audio track switched');\n updateAudioTrackInfo();\n var event = {\n time: performance.now() - events.t0,\n type: 'audio switched',\n name: '@' + data.id\n };\n if (lastAudioTrackSwitchingIdx !== undefined) {\n events.video[lastAudioTrackSwitchingIdx].duration = event.time - events.video[lastAudioTrackSwitchingIdx].time;\n lastAudioTrackSwitchingIdx = undefined;\n }\n events.video.push(event);\n trimEventHistory();\n });\n\n hls.on(Hls.Events.LEVEL_LOADED, function(event, data) {\n events.isLive = data.details.live;\n var event = {\n type : 'level',\n id : data.level,\n start : data.details.startSN,\n end : data.details.endSN,\n time : data.stats.trequest - events.t0,\n latency : data.stats.tfirst - data.stats.trequest,\n load : data.stats.tload - data.stats.tfirst,\n parsing : data.stats.tparsed - data.stats.tload,\n duration: data.stats.tload - data.stats.tfirst\n };\n const parsingDuration = data.stats.tparsed - data.stats.tload;\n if (stats.levelParsed)\n {this.sumLevelParsingMs += parsingDuration;}\n else\n {this.sumLevelParsingMs = parsingDuration;}\n\n stats.levelParsed++;\n stats.levelParsingUs = Math.round(1000*this.sumLevelParsingMs / stats.levelParsed);\n\n //console.log('parsing level duration :' + stats.levelParsingUs + 'us,count:' + stats.levelParsed);\n\n events.load.push(event);\n trimEventHistory();\n refreshCanvas();\n });\n\n hls.on(Hls.Events.AUDIO_TRACK_LOADED, function(event, data) {\n events.isLive = data.details.live;\n var event = {\n type : 'audio track',\n id : data.id,\n start : data.details.startSN,\n end : data.details.endSN,\n time : data.stats.trequest - events.t0,\n latency : data.stats.tfirst - data.stats.trequest,\n load : data.stats.tload - data.stats.tfirst,\n parsing : data.stats.tparsed - data.stats.tload,\n duration: data.stats.tload - data.stats.tfirst\n };\n events.load.push(event);\n trimEventHistory();\n refreshCanvas();\n });\n\n hls.on(Hls.Events.FRAG_BUFFERED, function(event, data) {\n var event = {\n type : data.frag.type + ' fragment',\n id : data.frag.level,\n id2 : data.frag.sn,\n time : data.stats.trequest - events.t0,\n latency : data.stats.tfirst - data.stats.trequest,\n load : data.stats.tload - data.stats.tfirst,\n parsing : data.stats.tparsed - data.stats.tload,\n buffer : data.stats.tbuffered - data.stats.tparsed,\n duration: data.stats.tbuffered - data.stats.tfirst,\n bw : Math.round(8*data.stats.total/(data.stats.tbuffered - data.stats.trequest)),\n size : data.stats.total\n };\n events.load.push(event);\n events.bitrate.push({\n time : performance.now() - events.t0,\n bitrate : event.bw,\n duration: data.frag.duration,\n level : event.id\n });\n if(hls.bufferTimer === undefined) {\n events.buffer.push({\n time : 0,\n buffer: 0,\n pos : 0\n });\n hls.bufferTimer = window.setInterval(checkBuffer, 100);\n }\n trimEventHistory();\n refreshCanvas();\n updateLevelInfo();\n\n let latency = data.stats.tfirst - data.stats.trequest,\n parsing = data.stats.tparsed - data.stats.tload,\n process = data.stats.tbuffered - data.stats.trequest,\n bitrate = Math.round(8 * data.stats.length / (data.stats.tbuffered - data.stats.tfirst));\n if (stats.fragBuffered) {\n stats.fragMinLatency = Math.min(stats.fragMinLatency, latency);\n stats.fragMaxLatency = Math.max(stats.fragMaxLatency, latency);\n stats.fragMinProcess = Math.min(stats.fragMinProcess, process);\n stats.fragMaxProcess = Math.max(stats.fragMaxProcess, process);\n stats.fragMinKbps = Math.min(stats.fragMinKbps, bitrate);\n stats.fragMaxKbps = Math.max(stats.fragMaxKbps, bitrate);\n stats.autoLevelCappingMin = Math.min(stats.autoLevelCappingMin, hls.autoLevelCapping);\n stats.autoLevelCappingMax = Math.max(stats.autoLevelCappingMax, hls.autoLevelCapping);\n stats.fragBuffered++;\n } else {\n stats.fragMinLatency = stats.fragMaxLatency = latency;\n stats.fragMinProcess = stats.fragMaxProcess = process;\n stats.fragMinKbps = stats.fragMaxKbps = bitrate;\n stats.fragBuffered = 1;\n stats.fragBufferedBytes = 0;\n stats.autoLevelCappingMin = stats.autoLevelCappingMax = hls.autoLevelCapping;\n this.sumLatency = 0;\n this.sumKbps = 0;\n this.sumProcess = 0;\n this.sumParsing = 0;\n }\n stats.fraglastLatency = latency;\n this.sumLatency += latency;\n stats.fragAvgLatency = Math.round(this.sumLatency / stats.fragBuffered);\n stats.fragLastProcess = process;\n this.sumProcess += process;\n this.sumParsing += parsing;\n stats.fragAvgProcess = Math.round(this.sumProcess / stats.fragBuffered);\n stats.fragLastKbps = bitrate;\n this.sumKbps += bitrate;\n stats.fragAvgKbps = Math.round(this.sumKbps / stats.fragBuffered);\n stats.fragBufferedBytes += data.stats.total;\n stats.fragparsingKbps = Math.round(8*stats.fragBufferedBytes / this.sumParsing);\n stats.fragparsingMs = Math.round(this.sumParsing);\n stats.autoLevelCappingLast = hls.autoLevelCapping;\n });\n\n hls.on(Hls.Events.LEVEL_SWITCHED, function(event, data) {\n var event = {\n time: performance.now() - events.t0,\n type: 'level switched',\n name: data.level\n };\n events.video.push(event);\n trimEventHistory();\n refreshCanvas();\n updateLevelInfo();\n });\n\n hls.on(Hls.Events.FRAG_CHANGED, function(event, data) {\n var event = {\n time: performance.now() - events.t0,\n type: 'frag changed',\n name: data.frag.sn + ' @ ' + data.frag.level\n };\n events.video.push(event);\n trimEventHistory();\n refreshCanvas();\n updateLevelInfo();\n stats.tagList = data.frag.tagList;\n\n let level = data.frag.level, autoLevel = data.frag.autoLevel;\n if (stats.levelStart === undefined)\n {stats.levelStart = level;}\n\n if (autoLevel) {\n if (stats.fragChangedAuto) {\n stats.autoLevelMin = Math.min(stats.autoLevelMin, level);\n stats.autoLevelMax = Math.max(stats.autoLevelMax, level);\n stats.fragChangedAuto++;\n if (this.levelLastAuto && level !== stats.autoLevelLast)\n {stats.autoLevelSwitch++;}\n\n } else {\n stats.autoLevelMin = stats.autoLevelMax = level;\n stats.autoLevelSwitch = 0;\n stats.fragChangedAuto = 1;\n this.sumAutoLevel = 0;\n }\n this.sumAutoLevel += level;\n stats.autoLevelAvg = Math.round(1000 * this.sumAutoLevel / stats.fragChangedAuto) / 1000;\n stats.autoLevelLast = level;\n } else {\n if (stats.fragChangedManual) {\n stats.manualLevelMin = Math.min(stats.manualLevelMin, level);\n stats.manualLevelMax = Math.max(stats.manualLevelMax, level);\n stats.fragChangedManual++;\n if (!this.levelLastAuto && level !== stats.manualLevelLast)\n {stats.manualLevelSwitch++;}\n\n } else {\n stats.manualLevelMin = stats.manualLevelMax = level;\n stats.manualLevelSwitch = 0;\n stats.fragChangedManual = 1;\n }\n stats.manualLevelLast = level;\n }\n this.levelLastAuto = autoLevel;\n });\n\n hls.on(Hls.Events.FRAG_LOAD_EMERGENCY_ABORTED, function(event, data) {\n if (stats) {\n if (stats.fragLoadEmergencyAborted === undefined)\n {stats.fragLoadEmergencyAborted = 1;}\n else\n {stats.fragLoadEmergencyAborted++;}\n\n }\n });\n\n hls.on(Hls.Events.FRAG_DECRYPTED, function(event, data) {\n if (!stats.fragDecrypted) {\n stats.fragDecrypted = 0;\n this.totalDecryptTime = 0;\n stats.fragAvgDecryptTime = 0;\n }\n stats.fragDecrypted++;\n this.totalDecryptTime += data.stats.tdecrypt - data.stats.tstart;\n stats.fragAvgDecryptTime = this.totalDecryptTime / stats.fragDecrypted;\n });\n\n hls.on(Hls.Events.ERROR, function(event, data) {\n console.warn('Error event:', data);\n switch(data.details) {\n case Hls.ErrorDetails.MANIFEST_LOAD_ERROR:\n try {\n $('#errorOut').html('Cannot load <a href=\"' + data.context.url + '\">' + url + '</a><br>HTTP response code:' + data.response.code + ' <br>' + data.response.text);\n if(data.response.code === 0){\n $('#errorOut').append('This might be a CORS issue, consider installing <a href=\"https://chrome.google.com/webstore/detail/allow-control-allow-origi/nlfbmbojpeacfghkpbjhddihlkkiljbi\">Allow-Control-Allow-Origin</a> Chrome Extension');\n }\n } catch(err) {\n $('#errorOut').html('Cannot load <a href=\"' + data.context.url + '\">' + url + '</a><br>Response body: ' + data.response.text);\n }\n break;\n case Hls.ErrorDetails.MANIFEST_LOAD_TIMEOUT:\n logError('Timeout while loading manifest');\n break;\n case Hls.ErrorDetails.MANIFEST_PARSING_ERROR:\n logError('Error while parsing manifest:' + data.reason);\n break;\n case Hls.ErrorDetails.LEVEL_LOAD_ERROR:\n logError('Error while loading level playlist');\n break;\n case Hls.ErrorDetails.LEVEL_LOAD_TIMEOUT:\n logError('Timeout while loading level playlist');\n break;\n case Hls.ErrorDetails.LEVEL_SWITCH_ERROR:\n logError('Error while trying to switch to level ' + data.level);\n break;\n case Hls.ErrorDetails.FRAG_LOAD_ERROR:\n logError('Error while loading fragment ' + data.frag.url);\n break;\n case Hls.ErrorDetails.FRAG_LOAD_TIMEOUT:\n logError('Timeout while loading fragment ' + data.frag.url);\n break;\n case Hls.ErrorDetails.FRAG_LOOP_LOADING_ERROR:\n logError('Fragment-loop loading error');\n break;\n case Hls.ErrorDetails.FRAG_DECRYPT_ERROR:\n logError('Decrypting error:' + data.reason);\n break;\n case Hls.ErrorDetails.FRAG_PARSING_ERROR:\n logError('Parsing error:' + data.reason);\n break;\n case Hls.ErrorDetails.KEY_LOAD_ERROR:\n logError('Error while loading key ' + data.frag.decryptdata.uri);\n break;\n case Hls.ErrorDetails.KEY_LOAD_TIMEOUT:\n logError('Timeout while loading key ' + data.frag.decryptdata.uri);\n break;\n case Hls.ErrorDetails.BUFFER_APPEND_ERROR:\n logError('Buffer append error');\n break;\n case Hls.ErrorDetails.BUFFER_ADD_CODEC_ERROR:\n logError('Buffer add codec error for ' + data.mimeType + ':' + data.err.message);\n break;\n case Hls.ErrorDetails.BUFFER_APPENDING_ERROR:\n logError('Buffer appending error');\n break;\n case Hls.ErrorDetails.BUFFER_STALLED_ERROR:\n logError('Buffer stalled error');\n break;\n default:\n break;\n }\n if(data.fatal) {\n console.error('Fatal error :' + data.details);\n switch(data.type) {\n case Hls.ErrorTypes.MEDIA_ERROR:\n handleMediaError();\n break;\n case Hls.ErrorTypes.NETWORK_ERROR:\n logError('A network error occured');\n break;\n default:\n logError('An unrecoverable error occured');\n hls.destroy();\n break;\n }\n }\n if(!stats) {\n stats = {};\n }\n // track all errors independently\n if (stats[data.details] === undefined)\n {stats[data.details] = 1;}\n else\n {stats[data.details] += 1;}\n\n // track fatal error\n if (data.fatal) {\n if (stats.fatalError === undefined) {\n stats.fatalError = 1;\n } else {\n stats.fatalError += 1;\n }\n }\n $('#statisticsOut').text(JSON.stringify(sortObject(stats), null, '\\t'));\n });\n\n hls.on(Hls.Events.BUFFER_CREATED, function(event, data) {\n tracks = data.tracks;\n });\n\n hls.on(Hls.Events.BUFFER_APPENDING, function(event, data) {\n if (dumpfMP4) {\n fmp4Data[data.type].push(data.data);\n }\n });\n\n hls.on(Hls.Events.FPS_DROP, function(event, data) {\n let evt = {\n time: performance.now() - events.t0,\n type: 'frame drop',\n name: data.currentDropped + '/' + data.currentDecoded\n };\n events.video.push(evt);\n trimEventHistory();\n if (stats) {\n if (stats.fpsDropEvent === undefined)\n {stats.fpsDropEvent = 1;}\n else\n {stats.fpsDropEvent++;}\n\n stats.fpsTotalDroppedFrames = data.totalDroppedFrames;\n }\n });\n\n video.addEventListener('resize', handleVideoEvent);\n video.addEventListener('seeking', handleVideoEvent);\n video.addEventListener('seeked', handleVideoEvent);\n video.addEventListener('pause', handleVideoEvent);\n video.addEventListener('play', handleVideoEvent);\n video.addEventListener('canplay', handleVideoEvent);\n video.addEventListener('canplaythrough', handleVideoEvent);\n video.addEventListener('ended', handleVideoEvent);\n video.addEventListener('playing', handleVideoEvent);\n video.addEventListener('error', handleVideoEvent);\n video.addEventListener('loadedmetadata', handleVideoEvent);\n video.addEventListener('loadeddata', handleVideoEvent);\n video.addEventListener('durationchange', handleVideoEvent);\n}\n\nfunction handleUnsupported() {\n if(navigator.userAgent.toLowerCase().indexOf('firefox') !== -1) {\n logStatus('You are using Firefox, it looks like MediaSource is not enabled,<br>please ensure the following keys are set appropriately in <b>about:config</b><br>media.mediasource.enabled=true<br>media.mediasource.mp4.enabled=true<br><b>media.mediasource.whitelist=false</b>');\n } else {\n logStatus('Your Browser does not support MediaSourceExtension / MP4 mediasource');\n }\n}\n\nfunction handleVideoEvent(evt) {\n let data = '';\n switch(evt.type) {\n case 'durationchange':\n if(evt.target.duration - lastDuration <= 0.5) {\n // some browsers report several duration change events with almost the same value ... avoid spamming video events\n return;\n }\n lastDuration = evt.target.duration;\n data = Math.round(evt.target.duration*1000);\n break;\n case 'resize':\n data = evt.target.videoWidth + '/' + evt.target.videoHeight;\n break;\n case 'loadedmetadata':\n case 'loadeddata':\n case 'canplay':\n case 'canplaythrough':\n case 'ended':\n case 'seeking':\n case 'seeked':\n case 'play':\n case 'playing':\n lastStartPosition = evt.target.currentTime;\n case 'pause':\n case 'waiting':\n case 'stalled':\n case 'error':\n data = Math.round(evt.target.currentTime*1000);\n if(evt.type === 'error') {\n let errorTxt, mediaError=evt.currentTarget.error;\n switch(mediaError.code) {\n case mediaError.MEDIA_ERR_ABORTED:\n errorTxt = 'You aborted the video playback';\n break;\n case mediaError.MEDIA_ERR_DECODE:\n errorTxt = 'The video playback was aborted due to a corruption problem or because the video used features your browser did not support';\n handleMediaError();\n break;\n case mediaError.MEDIA_ERR_NETWORK:\n errorTxt = 'A network error caused the video download to fail part-way';\n break;\n case mediaError.MEDIA_ERR_SRC_NOT_SUPPORTED:\n errorTxt = 'The video could not be loaded, either because the server or network failed or because the format is not supported';\n break;\n }\n\n if (mediaError.message) {\n errorTxt += ' - ' + mediaError.message;\n }\n\n logStatus(errorTxt);\n console.error(errorTxt);\n }\n break;\n default:\n break;\n }\n\n let event = {\n time: performance.now() - events.t0,\n type: evt.type,\n name: data\n };\n\n events.video.push(event);\n if(evt.type === 'seeking') {\n lastSeekingIdx = events.video.length-1;\n }\n\n if(evt.type === 'seeked') {\n events.video[lastSeekingIdx].duration = event.time - events.video[lastSeekingIdx].time;\n }\n\n trimEventHistory();\n}\n\nfunction handleMediaError() {\n if(autoRecoverError) {\n let now = performance.now();\n if(!recoverDecodingErrorDate || (now - recoverDecodingErrorDate) > 3000) {\n recoverDecodingErrorDate = performance.now();\n $('#statusOut').append(', trying to recover media error.');\n hls.recoverMediaError();\n } else {\n if(!recoverSwapAudioCodecDate || (now - recoverSwapAudioCodecDate) > 3000) {\n recoverSwapAudioCodecDate = performance.now();\n $('#statusOut').append(', trying to swap audio codec and recover media error.');\n hls.swapAudioCodec();\n hls.recoverMediaError();\n } else {\n $('#statusOut').append(', cannot recover. Last media error recovery failed.');\n }\n }\n }\n}\n\nfunction timeRangesToString(r) {\n let log = '';\n for (let i=0; i<r.length; i++) {\n log += '[' + r.start(i) + ', ' + r.end(i) + ']';\n log += ' ';\n }\n return log;\n}\n\nfunction checkBuffer() {\n let v = $('#video')[0];\n let canvas = $('#bufferedCanvas')[0];\n let ctx = canvas.getContext('2d');\n let r = v.buffered;\n let bufferingDuration;\n ctx.fillStyle = 'black';\n ctx.fillRect(0, 0, canvas.width, canvas.height);\n ctx.fillStyle = 'gray';\n if (r) {\n if(!canvas.width || canvas.width !== v.clientWidth)\n {canvas.width = v.clientWidth;}\n\n var pos = v.currentTime, bufferLen;\n for (var i=0, bufferLen=0; i<r.length; i++) {\n let start = r.start(i)/v.duration * canvas.width;\n let end = r.end(i)/v.duration * canvas.width;\n ctx.fillRect(start, 3, Math.max(2, end-start), 10);\n if(pos >= r.start(i) && pos < r.end(i)) {\n // play position is inside this buffer TimeRange, retrieve end of buffer position and buffer length\n bufferLen = r.end(i) - pos;\n }\n }\n // check if we are in buffering / or playback ended state\n if(bufferLen <= 0.1 && v.paused === false && (pos-lastStartPosition) > 0.5) {\n // don't create buffering event if we are at the end of the playlist, don't report ended for live playlist\n if(lastDuration -pos <= 0.5 && events.isLive === false) {\n } else {\n // we are not at the end of the playlist ... real buffering\n if(bufferingIdx !== -1) {\n bufferingDuration = performance.now() - events.t0 - events.video[bufferingIdx].time;\n events.video[bufferingIdx].duration = bufferingDuration;\n events.video[bufferingIdx].name = bufferingDuration;\n } else {\n events.video.push({\n type: 'buffering',\n time: performance.now() - events.t0\n });\n trimEventHistory();\n // we are in buffering state\n bufferingIdx = events.video.length-1;\n }\n }\n }\n\n if(bufferLen > 0.1 && bufferingIdx !=-1) {\n bufferingDuration = performance.now() - events.t0 - events.video[bufferingIdx].time;\n events.video[bufferingIdx].duration = bufferingDuration;\n events.video[bufferingIdx].name = bufferingDuration;\n // we are out of buffering state\n bufferingIdx = -1;\n }\n\n // update buffer/position for current Time\n let event = {\n time : performance.now() - events.t0,\n buffer: Math.round(bufferLen*1000),\n pos : Math.round(pos*1000)\n };\n let bufEvents = events.buffer, bufEventLen = bufEvents.length;\n if(bufEventLen > 1) {\n let event0 = bufEvents[bufEventLen-2], event1 = bufEvents[bufEventLen-1];\n let slopeBuf0 = (event0.buffer - event1.buffer)/(event0.time-event1.time);\n let slopeBuf1 = (event1.buffer - event.buffer)/(event1.time-event.time);\n\n let slopePos0 = (event0.pos - event1.pos)/(event0.time-event1.time);\n let slopePos1 = (event1.pos - event.pos)/(event1.time-event.time);\n // compute slopes. if less than 30% difference, remove event1\n if((slopeBuf0 === slopeBuf1 || Math.abs(slopeBuf0/slopeBuf1 -1) <= 0.3) &&\n (slopePos0 === slopePos1 || Math.abs(slopePos0/slopePos1 -1) <= 0.3))\n {bufEvents.pop();}\n\n }\n events.buffer.push(event);\n trimEventHistory();\n refreshCanvas();\n\n let log = 'Duration: '\n + v.duration + '\\n'\n + 'Buffered: '\n + timeRangesToString(v.buffered) + '\\n'\n + 'Seekable: '\n + timeRangesToString(v.seekable) + '\\n'\n + 'Played: '\n + timeRangesToString(v.played) + '\\n';\n\n if (hls.media) {\n for(let type in tracks) {\n log += 'Buffer for ' + type + ' contains: ' + timeRangesToString(tracks[type].buffer.buffered) + '\\n';\n }\n\n const videoPlaybackQuality = v.getVideoPlaybackQuality;\n if(videoPlaybackQuality && typeof (videoPlaybackQuality) === typeof (Function)) {\n log += 'Dropped frames: '+ v.getVideoPlaybackQuality().droppedVideoFrames + '\\n';\n log += 'Corrupted frames:'+ v.getVideoPlaybackQuality().corruptedVideoFrames + '\\n';\n } else if(v.webkitDroppedFrameCount) {\n log+='Dropped frames:'+ v.webkitDroppedFrameCount + '\\n';\n }\n }\n $('#bufferedOut').text(log);\n\n $('#statisticsOut').text(JSON.stringify(sortObject(stats), null, '\\t'));\n\n ctx.fillStyle = 'blue';\n\n const x = v.currentTime / v.duration * canvas.width;\n ctx.fillRect(x, 0, 2, 15);\n }\n\n}\n\nfunction showCanvas() {\n showMetrics();\n $('#bufferedOut').show();\n $('#bufferedCanvas').show();\n}\n\nfunction hideCanvas() {\n hideMetrics();\n $('#bufferedOut').hide();\n $('#bufferedCanvas').hide();\n}\n\nfunction getMetrics() {\n let json = JSON.stringify(events);\n let jsonpacked = jsonpack.pack(json);\n // console.log('packing JSON from ' + json.length + ' to ' + jsonpacked.length + ' bytes');\n return btoa(jsonpacked);\n}\n\nfunction copyMetricsToClipBoard() {\n copyTextToClipboard(getMetrics());\n}\n\nfunction goToMetrics() {\n let url = document.URL;\n url = url.substr(0, url.lastIndexOf('/')+1) + 'metrics.html';\n // console.log(url);\n window.open(url, '_blank');\n}\n\nfunction goToMetricsPermaLink() {\n let url = document.URL;\n let b64 = getMetrics();\n url = url.substr(0, url.lastIndexOf('/')+1) + 'metrics.html#data=' + b64;\n // console.log(url);\n window.open(url, '_blank');\n}\n\nfunction minsecs(ts) {\n let m = Math.floor(Math.floor(ts % 3600) / 60);\n let s = Math.floor(ts % 60);\n return m + ':' + (s < 10 ? '0' : '') + s;\n}\n\nfunction onClickBufferedRange(event) {\n let canvas = $('#bufferedCanvas')[0];\n let v = $('#video')[0];\n let target = (event.clientX - canvas.offsetLeft) / canvas.width * v.duration;\n v.currentTime = target;\n}\n\nfunction updateLevelInfo() {\n\n if (!hls.levels) {\n return;\n }\n\n let button_template = '<button type=\"button\" class=\"btn btn-sm ';\n let button_enabled = 'btn-primary\" ';\n let button_disabled = 'btn-success\" ';\n\n let html1 = button_template;\n if(hls.autoLevelEnabled) {\n html1 += button_enabled;\n } else {\n html1 += button_disabled;\n }\n\n html1 += 'onclick=\"hls.currentLevel=-1\">auto</button>';\n\n let html2 = button_template;\n if(hls.autoLevelEnabled) {\n html2 += button_enabled;\n } else {\n html2 += button_disabled;\n }\n\n html2 += 'onclick=\"hls.loadLevel=-1\">auto</button>';\n\n let html3 = button_template;\n if(hls.autoLevelCapping === -1) {\n html3 += button_enabled;\n } else {\n html3 += button_disabled;\n }\n\n html3 += 'onclick=\"levelCapping=hls.autoLevelCapping=-1;updateLevelInfo();onDemoConfigChanged();\">auto</button>';\n\n let html4 = button_template;\n if(hls.autoLevelEnabled) {\n html4 += button_enabled;\n } else {\n html4 += button_disabled;\n }\n\n html4 += 'onclick=\"hls.nextLevel=-1\">auto</button>';\n\n for (let i=0; i < hls.levels.length; i++) {\n html1 += button_template;\n if(hls.currentLevel === i) {\n html1 += button_enabled;\n } else {\n html1 += button_disabled;\n }\n\n let levelName = i;\n let label = level2label(i);\n if(label) {\n levelName += ' (' + level2label(i) + 'p)';\n }\n\n html1 += 'onclick=\"hls.currentLevel=' + i + '\">' + levelName + '</button>';\n\n html2 += button_template;\n if(hls.loadLevel === i) {\n html2 += button_enabled;\n } else {\n html2 += button_disabled;\n }\n\n html2 += 'onclick=\"hls.loadLevel=' + i + '\">' + levelName + '</button>';\n\n html3 += button_template;\n if(hls.autoLevelCapping === i) {\n html3 += button_enabled;\n } else {\n html3 += button_disabled;\n }\n\n html3 += 'onclick=\"levelCapping=hls.autoLevelCapping=' + i + ';updateLevelInfo();onDemoConfigChanged();\">' + levelName + '</button>';\n\n html4 += button_template;\n if(hls.nextLevel === i) {\n html4 += button_enabled;\n } else {\n html4 += button_disabled;\n }\n\n html4 += 'onclick=\"hls.nextLevel=' + i + '\">' + levelName + '</button>';\n }\n\n let v = $('#video')[0];\n\n if(v.videoWidth && v.videoHeight) {\n $('#currentResolution').html(v.videoWidth + ' x ' + v.videoHeight);\n }\n\n if($('#currentLevelControl').html() != html1) {\n $('#currentLevelControl').html(html1);\n }\n\n if($('#loadLevelControl').html() != html2) {\n $('#loadLevelControl').html(html2);\n }\n\n if($('#levelCappingControl').html() != html3) {\n $('#levelCappingControl').html(html3);\n }\n\n if($('#nextLevelControl').html() != html4) {\n $('#nextLevelControl').html(html4);\n }\n}\n\nfunction updateAudioTrackInfo() {\n let button_template = '<button type=\"button\" class=\"btn btn-sm ';\n let button_enabled = 'btn-primary\" ';\n let button_disabled = 'btn-success\" ';\n let html1 = '';\n let audioTrackId = hls.audioTrack, len = hls.audioTracks.length;\n\n for (let i=0; i < len; i++) {\n html1 += button_template;\n if(audioTrackId === i) {\n html1 += button_enabled;\n } else {\n html1 += button_disabled;\n }\n\n html1 += 'onclick=\"hls.audioTrack=' + i + '\">' + hls.audioTracks[i].name + '</button>';\n }\n $('#audioTrackControl').html(html1);\n}\n\nfunction level2label(index) {\n if(hls && hls.levels.length-1 >= index) {\n let level = hls.levels[index];\n if (level.name) {\n return level.name;\n } else {\n if (level.height) {\n return(level.height + 'p / ' + Math.round(level.bitrate / 1024) + 'kb');\n } else {\n if(level.bitrate) {\n return(Math.round(level.bitrate / 1024) + 'kb');\n } else {\n return null;\n }\n }\n }\n }\n}\n\nfunction getDemoConfigPropOrDefault(propName, defaultVal) {\n return typeof demoConfig[propName] !== 'undefined' ? demoConfig[propName] : defaultVal;\n}\n\nfunction getURLParam(sParam, defaultValue) {\n let sPageURL = window.location.search.substring(1);\n let sURLVariables = sPageURL.split('&');\n for (let i = 0; i < sURLVariables.length; i++) {\n let sParameterName = sURLVariables[i].split('=');\n if (sParameterName[0] == sParam)\n {return 'undefined' == sParameterName[1] ? undefined : 'false' == sParameterName[1] ? false : sParameterName[1];}\n\n }\n return defaultValue;\n}\n\nfunction onDemoConfigChanged() {\n const url = $('#streamURL').val();\n\n demoConfig = {\n enableStreaming,\n autoRecoverError,\n enableWorker,\n dumpfMP4,\n levelCapping,\n limitMetrics,\n defaultAudioCodec,\n widevineLicenseUrl: escape(widevineLicenseUrl)\n }\n\n const serializedDemoConfig = btoa(JSON.stringify(demoConfig))\n\n const baseURL = document.URL.split('?')[0]\n const permalinkURL = baseURL + `?src=${encodeURIComponent(url)}&demoConfig=${serializedDemoConfig}`\n\n $('#StreamPermalink').html('<a href=\"' + permalinkURL + '\">' + permalinkURL + '</a>');\n}\n\nfunction createfMP4(type) {\n if (fmp4Data[type].length) {\n let blob = new Blob([arrayConcat(fmp4Data[type])], {\n type: 'application/octet-stream'\n });\n let filename = type + '-' + new Date().toISOString() + '.mp4';\n saveAs(blob, filename);\n //$('body').append('<a download=\"hlsjs-' + filename + '\" href=\"' + window.URL.createObjectURL(blob) + '\">Download ' + filename + ' track</a><br>');\n }\n}\n\nfunction arrayConcat(inputArray) {\n let totalLength = inputArray.reduce( function(prev, cur) { return prev+cur.length; }, 0);\n let result = new Uint8Array(totalLength);\n let offset = 0;\n inputArray.forEach(function(element) {\n result.set(element, offset);\n offset += element.length;\n });\n return result;\n}\n\nfunction hideAllTabs() {\n $('#playbackControlTab').hide();\n $('#qualityLevelControlTab').hide();\n $('#audioTrackControlTab').hide();\n $('#metricsDisplayTab').hide();\n $('#statsDisplayTab').hide();\n}\n\nfunction toggleTab(tabElId) {\n hideAllTabs();\n hideMetrics();\n $('#' + tabElId).show();\n}\n\nfunction appendLog(textElId, message) {\n const el = $('#' + textElId)\n let logText = el.text()\n if (logText.length) {\n logText += '\\n'\n }\n const timestamp = (Date.now() - startTime) / 1000\n const newMessage = timestamp + ' | ' + message\n logText += newMessage\n // update\n el.text(logText)\n}\n\nfunction logStatus(message) {\n appendLog('statusOut', message)\n}\n\nfunction logError(message) {\n appendLog('errorOut', message)\n}\n\n\n\n// WEBPACK FOOTER //\n// ./demo/main.js","export function sortObject(obj) {\n if(typeof obj !== 'object') {\n return obj;\n }\n let temp = {};\n let keys = [];\n for(let key in obj) {\n keys.push(key);\n }\n keys.sort();\n for(let index in keys) {\n temp[keys[index]] = sortObject(obj[keys[index]]);\n }\n return temp;\n}\n\nexport function copyTextToClipboard(text) {\n let textArea = document.createElement('textarea');\n textArea.value = text;\n document.body.appendChild(textArea);\n textArea.select();\n try {\n let successful = document.execCommand('copy');\n let msg = successful ? 'successful' : 'unsuccessful';\n console.log('Copying text command was ' + msg);\n } catch (err) {\n console.log('Oops, unable to copy');\n }\n document.body.removeChild(textArea);\n}\n\n\n\n\n// WEBPACK FOOTER //\n// ./demo/demo-utils.js","/**\n * Create test stream\n * @param {string} url\n * @param {string} description\n * @param {boolean} [live]\n * @param {boolean} [abr]\n * @param {string[]} [blacklist_ua]\n * @returns {{url: string, description: string, live: boolean, abr: boolean, blacklist_ua: string[]}}\n */\nfunction createTestStream (url, description, live = false, abr = true, blacklist_ua = []) {\n return {\n url,\n description,\n live,\n abr,\n blacklist_ua\n };\n}\n\n/**\n * @param {Object} target\n * @param {Object} [config]\n * @returns {{url: string, description: string, live: boolean, abr: boolean, blacklist_ua: string[]}}\n */\nfunction createTestStreamWithConfig (target, config) {\n if (typeof target !== 'object') {\n throw new Error('target should be object');\n }\n\n const testStream = createTestStream(target.url, target.description, target.live, target.abr, target.blacklist_ua);\n\n testStream.config = config;\n\n return testStream;\n}\n\nmodule.exports = {\n bbb: createTestStreamWithConfig({\n url: 'https://video-dev.github.io/streams/x36xhzz/x36xhzz.m3u8',\n description: 'Big Buck Bunny - adaptive qualities'\n },\n {\n // try to workaround test failing because of slow seek on Chrome/Win10\n nudgeMaxRetry: 5\n }\n ),\n bigBuckBunny480p: {\n 'url': 'https://video-dev.github.io/streams/x36xhzz/url_6/193039199_mp4_h264_aac_hq_7.m3u8',\n 'description': 'Big Buck Bunny - 480p only',\n 'live': false,\n 'abr': false,\n 'blacklist_ua': ['internet explorer']\n },\n arte: {\n 'url': 'https://video-dev.github.io/streams/test_001/stream.m3u8',\n 'description': 'ARTE China,ABR',\n 'live': false,\n 'abr': true\n },\n deltatreDAI: {\n 'url': 'https://video-dev.github.io/streams/dai-discontinuity-deltatre/manifest.m3u8',\n 'description': 'Ad-insertion in event stream',\n 'live': false,\n 'abr': false,\n 'blacklist_ua': ['internet explorer']\n },\n issue666: {\n 'url': 'https://video-dev.github.io/streams/issue666/playlists/cisq0gim60007xzvi505emlxx.m3u8',\n 'description': 'hls.js/issues/666',\n 'live': false,\n 'abr': false,\n 'blacklist_ua': ['internet explorer']\n },\n issue649: {\n 'url': 'http://cdn3.screen9.com/media/c/W/cW87csHkxsgu5TV1qs78aA_auto_hls.m3u8?auth=qlUjeCtbVdtkDfZYrtveTIVUXX1yuSqgF8wfWabzKpX72r-d5upW88-FHuyRRdnZA_1PKRTGAtTt_6Z-aj22kw',\n 'description': 'hls.js/issues/649',\n 'live': false,\n 'abr': false\n },\n closedCaptions: {\n 'url': 'http://playertest.longtailvideo.com/adaptive/captions/playlist.m3u8',\n 'description': 'CNN special report, with CC',\n 'live': false,\n 'abr': false,\n 'blacklist_ua': ['safari']\n },\n oceansAES: {\n 'url': 'http://playertest.longtailvideo.com/adaptive/oceans_aes/oceans_aes.m3u8',\n 'description': 'AES encrypted,ABR',\n 'live': false,\n 'abr': true\n },\n /*\n bbbAES: {\n 'url': 'https://video-dev.github.io/streams/bbbAES/playlists/sample_aes/index.m3u8',\n 'description': 'SAMPLE-AES encrypted',\n 'live': false,\n 'abr': false\n },\n */\n mp3Audio: {\n 'url': 'https://player.webvideocore.net/CL1olYogIrDWvwqiIKK7eLBkzvO18gwo9ERMzsyXzwt_t-ya8ygf2kQBZww38JJT/8i4vvznv8408.m3u8',\n 'description': 'MP3 VOD demo',\n 'live': false,\n 'abr': false,\n 'blacklist_ua': ['safari']\n },\n mpegAudioOnly: {\n 'url': 'https://pl.streamingvideoprovider.com/mp3-playlist/playlist.m3u8',\n 'description': 'MPEG Audio Only demo',\n 'live': false,\n 'abr': false,\n 'blacklist_ua': ['internet explorer', 'MicrosoftEdge', 'safari', 'firefox']\n },\n fmp4: {\n 'url': 'https://storage.googleapis.com/shaka-demo-assets/angel-one-hls/hls.m3u8',\n 'description': 'HLS fMP4 Angel-One multiple audio-tracks',\n 'live': false,\n 'abr': false,\n 'blacklist_ua': ['safari', 'internet explorer']\n },\n fmp4Bitmovin: {\n 'url': 'https://bitdash-a.akamaihd.net/content/MI201109210084_1/m3u8s-fmp4/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.m3u8',\n 'description': 'HLS fMP4 by Bitmovin',\n 'live': false,\n 'abr': true,\n 'blacklist_ua': ['safari', 'internet explorer']\n },\n offset_pts: {\n 'url': 'https://video-dev.github.io/streams/pts_shift/master.m3u8',\n 'description': 'DK Turntable, PTS shifted by 2.3s',\n 'live': false,\n 'abr': false\n },\n /*\n uspHLSAteam: createTestStream(\n 'http://demo.unified-streaming.com/video/ateam/ateam.ism/ateam.m3u8?session_id=27199',\n 'A-Team movie trailer - HLS by Unified Streaming Platform'\n ),\n */\n angelOneShakaWidevine: createTestStreamWithConfig({\n url: 'https://storage.googleapis.com/shaka-demo-assets/angel-one-widevine-hls/hls.m3u8',\n description: 'Shaka-packager Widevine DRM (EME) HLS-fMP4 - Angel One Demo',\n blacklist_ua: ['firefox', 'safari', 'internet explorer']\n },\n {\n widevineLicenseUrl: 'https://cwip-shaka-proxy.appspot.com/no_auth',\n emeEnabled: true\n }\n ),\n audioOnlyMultipleLevels: {\n 'url': 'https://s3.amazonaws.com/bob.jwplayer.com/~alex/121628/new_master.m3u8',\n 'description': 'Multiple non-alternate audio levels',\n 'live': false,\n 'abr': false\n },\n pdtDuplicate: {\n url: 'https://playertest.longtailvideo.com/adaptive/artbeats/manifest.m3u8',\n description: 'Stream with duplicate sequential PDT values'\n },\n pdtLargeGap: {\n url: 'https://playertest.longtailvideo.com/adaptive/boxee/playlist.m3u8',\n description: 'PDTs with large gaps following discontinuities'\n },\n pdtBadValues: {\n url: 'https://playertest.longtailvideo.com/adaptive/progdatime/playlist2.m3u8',\n description: 'PDTs with bad values'\n },\n pdtOneValue: {\n url: 'https://playertest.longtailvideo.com/adaptive/aviion/manifest.m3u8',\n description: 'One PDT, no discontinuities'\n }\n};\n\n\n\n// WEBPACK FOOTER //\n// ./tests/test-streams.js"],"sourceRoot":""}