mirror of
https://github.com/iv-org/invidious.git
synced 2024-10-01 01:25:56 -04:00
3 lines
9.9 KiB
JavaScript
3 lines
9.9 KiB
JavaScript
|
/*! videojs-contrib-dash - v2.8.2 - 2018-09-24
|
||
|
* Copyright (c) 2018 Brightcove */
|
||
|
!function(){function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c||a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}return a}()({1:[function(a,b,c){"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d=function(a,b){var c={};return c.id=a.qualityIndex+"",c.width=a.width,c.height=a.height,c.bandwidth=a.bitrate,c.isEnabled_=!0,c.enabled=function(a){return void 0===a?c.isEnabled_:void(a!==c.isEnabled_&&(a!==!0&&a!==!1||(c.isEnabled_=a,b())))},c},e=function(a){var b=[],c=function(){var c=b.filter(function(a){return a.enabled()});if(c.length===b.length||0===c.length)return a.setMinAllowedBitrateFor("video",NaN),void a.setMaxAllowedBitrateFor("video",NaN);c.sort(function(a,b){return a.bandwidth-b.bandwidth});var d=c[0].bandwidth,e=c[c.length-1].bandwidth;a.setMinAllowedBitrateFor("video",d/1e3),a.setMaxAllowedBitrateFor("video",e/1e3)};return function(){return b=b.length?b:a.getBitrateInfoListFor("video").map(function(a){return d(a,c)})}};c.default=e},{}],2:[function(a,b,c){(function(a){"use strict";function b(a){return a&&a.__esModule?a:{default:a}}function d(a,b){function c(a){return"dash-audio-"+a}function d(a,b){return a.find(function(a){var d=a.index;return c(d)===b.id})}var e=a.dash.mediaPlayer,f=e.getTracksFor("audio"),g=a.audioTracks();g.length&&b.clearTracks(["audio"]);var h=e.getCurrentTrackFor("audio");f.forEach(function(a){var b=a.lang;a.roles&&a.roles.length&&(b+=" ("+a.roles.join(", ")+")"),g.addTrack(new i.default.AudioTrack({enabled:a===h,id:c(a.index),kind:a.kind||"main",label:b,language:a.lang}))}),g.addEventListener("change",function(){for(var a=0;a<g.length;a++){var b=g[a];if(b.enabled){var c=d(f,b);e.setCurrentTrack(c)}else;}})}function e(a,b){a.dash.mediaPlayer.on(g.default.MediaPlayer.events.PLAYBACK_METADATA_LOADED,d.bind(null,a,b))}Object.defineProperty(c,"__esModule",{value:!0}),c.default=e;var f="undefined"!=typeof window?window.dashjs:"undefined"!=typeof a?a.dashjs:null,g=b(f),h="undefined"!=typeof window?window.videojs:"undefined"!=typeof a?a.videojs:null,i=b(h)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],3:[function(a,b,c){"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d=function(a,b){if(a.dash&&a.dash.representations&&a.qualityLevels){var c=a.qualityLevels();c.dispose();var d=function(){a.dash.representations().forEach(c.addQualityLevel.bind(c))},e=function(a){"video"===a.mediaType&&(c.selectedIndex_=a.newQuality,c.trigger("change"))};b.on("playbackMetaDataLoaded",d),b.on("qualityChangeRendered",e)}};c.default=d},{}],4:[function(a,b,c){(function(a){"use strict";function b(a){return a&&a.__esModule?a:{default:a}}function d(a,b,c){function d(){for(var b=a.dash.mediaPlayer,d=a.textTracks(),f=-1,g=function(a){var b=d[a];if("showing"===b.mode){var g=e.find(function(a){var c=a.textTrack;return c===b}),h=g?g.dashTrack:null;h&&(f=c.indexOf(h))}},h=0;h<d.length;h+=1)g(h);f!==b.getCurrentTextTrackIndex()&&b.setTextTrack(f)}var e=[],f=c.map(function(a){return{dashTrack:a,trackConfig:{default:a.defaultTrack,kind:a.kind,label:a.lang,language:a.lang,srclang:a.lang}}}).map(function(b){var c=b.trackConfig,d=b.dashTrack,f=a.addRemoteTextTrack(c,!0);return e.push({textTrack:f.track,dashTrack:d}),f});a.textTracks().on("change",d),a.one("loadstart",function(){a.textTracks().off("change",d)});for(var g=a.textTracks(),h=0;h<g.length;h+=1){var i=g[h];"subtitles"!==i.kind&&"captions"!==i.kind||(i.mode=i.default?"showing":"hidden")}return d(),f}function e(a,b,c){function e(){j.forEach(a.removeRemoteTextTrack.bind(a)),j=[]}function f(h){var i=(h.index,h.tracks);k.off(g.default.MediaPlayer.events.TEXT_TRACKS_ADDED,f),e(),i.length&&(j=d(a,b,i,c))}function h(){k.off(g.default.MediaPlayer.event
|