{"version":3,"sources":["webpack:///../WCC.UI/node_modules/@silvermine/videojs-quality-selector/dist/css/quality-selector.css?5bf6","webpack:///../WCC.UI/node_modules/@silvermine/videojs-quality-selector/src/js/components/QualityOption.js","webpack:///../WCC.UI/node_modules/@silvermine/videojs-quality-selector/src/js/components/QualitySelector.js","webpack:///../WCC.UI/node_modules/@silvermine/videojs-quality-selector/src/js/events.js","webpack:///../WCC.UI/node_modules/@silvermine/videojs-quality-selector/src/js/index.js","webpack:///../WCC.UI/node_modules/@silvermine/videojs-quality-selector/src/js/middleware/SourceInterceptor.js","webpack:///../WCC.UI/node_modules/@silvermine/videojs-quality-selector/src/js/util/SafeSeek.js","webpack:///../WCC.UI/node_modules/@silvermine/videojs-quality-selector/dist/css/quality-selector.css"],"names":[],"mappings":";;;;;AAAA,UAAU,mBAAO,CAAC,8EAAoE;AACtF,0BAA0B,mBAAO,CAAC,yIAA6D;;AAE/F;;AAEA;AACA,0BAA0B,QAAS;AACnC;;AAEA;;AAEA;AACA;;AAEA;;;;AAIA,sC;;;;;;;;AClBa;;AAEb,QAAQ,mBAAO,CAAC,wDAAY;AAC5B,aAAa,mBAAO,CAAC,8EAAW;;AAEhC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,UAAU;;AAEV;;AAEA;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;;AAEP,IAAI;AACJ;;;;;;;;;AC7Ca;;AAEb,QAAQ,mBAAO,CAAC,wDAAY;AAC5B,aAAa,mBAAO,CAAC,8EAAW;AAChC,2BAA2B,mBAAO,CAAC,gGAAiB;AACpD;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa;AACb,UAAU;;AAEV;AACA;AACA;AACA,UAAU;;AA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Ac;;AAElC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;;AAEJ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,IAAI;;AAEJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,IAAI;;AAEJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;;AAEJ;AACA;AACA;AACA;AACA,IAAI;;AAEJ;AACA;AACA,IAAI;;AAEJ;AACA;AACA;AACA;AACA,IAAI;AACJ,CAAC;;;;;;;;AC/ED;AACA,kCAAkC,mBAAO,CAAC,uDAA4C;AACtF;AACA;AACA,cAAc,QAAS,0CAA0C,SAAS,UAAU,YAAY,WAAW,4CAA4C,sBAAsB,mBAAmB,kBAAkB,oDAAoD,iBAAiB,2CAA2C,aAAa,uCAAuC,oBAAoB,qBAAqB,aAAa,mBAAmB,UAAU;AACzc;AACA","file":"npm.silvermine.241deef80ab94878d06b.js","sourcesContent":["var api = require(\"!../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\");\n var content = require(\"!!../../../../css-loader/dist/cjs.js!./quality-selector.css\");\n\n content = content.__esModule ? content.default : content;\n\n if (typeof content === 'string') {\n content = [[module.id, content, '']];\n }\n\nvar options = {};\n\noptions.insert = \"head\";\noptions.singleton = false;\n\nvar update = api(content, options);\n\n\n\nmodule.exports = content.locals || {};","'use strict';\n\nvar _ = require('underscore'),\n events = require('../events');\n\nmodule.exports = function(videojs) {\n var MenuItem = videojs.getComponent('MenuItem');\n\n /**\n * A MenuItem to represent a video resolution\n *\n * @class QualityOption\n * @extends videojs.MenuItem\n */\n return videojs.extend(MenuItem, {\n\n /**\n * @inheritdoc\n */\n constructor: function(player, options) {\n var source = options.source;\n\n if (!_.isObject(source)) {\n throw new Error('was not provided a \"source\" object, but rather: ' + (typeof source));\n }\n\n options = _.extend({\n selectable: true,\n label: source.label,\n }, options);\n\n MenuItem.call(this, player, options);\n\n this.source = source;\n },\n\n /**\n * @inheritdoc\n */\n handleClick: function(event) {\n MenuItem.prototype.handleClick.call(this, event);\n this.player().trigger(events.QUALITY_REQUESTED, this.source);\n },\n\n });\n};\n","'use strict';\n\nvar _ = require('underscore'),\n events = require('../events'),\n qualityOptionFactory = require('./QualityOption'),\n QUALITY_CHANGE_CLASS = 'vjs-quality-changing';\n\nmodule.exports = function(videojs) {\n var MenuButton = videojs.getComponent('MenuButton'),\n QualityOption = qualityOptionFactory(videojs),\n QualitySelector;\n\n /**\n * A component for changing video resolutions\n *\n * @class QualitySelector\n * @extends videojs.Button\n */\n QualitySelector = videojs.extend(MenuButton, {\n\n /**\n * @inheritdoc\n */\n constructor: function(player, options) {\n MenuButton.call(this, player, options);\n\n // Update interface instantly so the user's change is acknowledged\n player.on(events.QUALITY_REQUESTED, function(event, newSource) {\n this.setSelectedSource(newSource);\n player.addClass(QUALITY_CHANGE_CLASS);\n\n player.one('loadeddata', function() {\n player.removeClass(QUALITY_CHANGE_CLASS);\n });\n }.bind(this));\n\n // Update the list of menu items only when the list of sources change\n player.on(events.PLAYER_SOURCES_CHANGED, function() {\n this.update();\n }.bind(this));\n\n player.on(events.QUALITY_SELECTED, function(event, newSource) {\n // Update the selected source with the source that was actually selected\n this.setSelectedSource(newSource);\n }.bind(this));\n\n // Since it's possible for the player to get a source before the selector is\n // created, make sure to update once we get a \"ready\" signal.\n player.one('ready', function() {\n this.selectedSrc = player.src();\n this.update();\n }.bind(this));\n\n this.controlText('Open quality selector menu');\n },\n\n /**\n * Updates the source that is selected in the menu\n *\n * @param source {object} player source to display as selected\n */\n setSelectedSource: function(source) {\n var src = (source ? source.src : undefined);\n\n if (this.selectedSrc !== src) {\n this.selectedSrc = src;\n _.each(this.items, function(item) {\n item.selected(item.source.src === src);\n });\n }\n },\n\n /**\n * @inheritdoc\n */\n createItems: function() {\n var player = this.player(),\n sources = player.currentSources();\n\n if (!sources || sources.length < 2) {\n return [];\n }\n\n return _.map(sources, function(source) {\n return new QualityOption(player, {\n source: source,\n selected: source.src === this.selectedSrc,\n });\n }.bind(this));\n },\n\n /**\n * @inheritdoc\n */\n buildWrapperCSSClass: function() {\n return 'vjs-quality-selector ' + MenuButton.prototype.buildWrapperCSSClass.call(this);\n },\n\n });\n\n videojs.registerComponent('QualitySelector', QualitySelector);\n\n return QualitySelector;\n};\n","'use strict';\n\nmodule.exports = {\n\n QUALITY_REQUESTED: 'qualityRequested',\n QUALITY_SELECTED: 'qualitySelected',\n PLAYER_SOURCES_CHANGED: 'playerSourcesChanged',\n\n};\n","'use strict';\n\nvar _ = require('underscore'),\n events = require('./events'),\n qualitySelectorFactory = require('./components/QualitySelector'),\n sourceInterceptorFactory = require('./middleware/SourceInterceptor'),\n SafeSeek = require('./util/SafeSeek');\n\nmodule.exports = function(videojs) {\n videojs = videojs || window.videojs;\n\n qualitySelectorFactory(videojs);\n sourceInterceptorFactory(videojs);\n\n videojs.hook('setup', function(player) {\n function changeQuality(event, newSource) {\n var sources = player.currentSources(),\n currentTime = player.currentTime(),\n currentPlaybackRate = player.playbackRate(),\n isPaused = player.paused(),\n selectedSource;\n\n // Clear out any previously selected sources (see: #11)\n _.each(sources, function(source) {\n source.selected = false;\n });\n\n selectedSource = _.findWhere(sources, { src: newSource.src });\n // Note: `_.findWhere` returns a reference to an object. Thus the\n // following updates the original object in `sources`.\n selectedSource.selected = true;\n\n if (player._qualitySelectorSafeSeek) {\n player._qualitySelectorSafeSeek.onQualitySelectionChange();\n }\n\n player.src(sources);\n\n player.ready(function() {\n if (!player._qualitySelectorSafeSeek || player._qualitySelectorSafeSeek.hasFinished()) {\n // Either we don't have a pending seek action or the one that we have is no\n // longer applicable. This block must be within a `player.ready` callback\n // because the call to `player.src` above is asynchronous, and so not\n // having it within this `ready` callback would cause the SourceInterceptor\n // to execute after this block instead of before.\n //\n // We save the `currentTime` within the SafeSeek instance because if\n // multiple QUALITY_REQUESTED events are received before the SafeSeek\n // operation finishes, the player's `currentTime` will be `0` if the\n // player's `src` is updated but the player's `currentTime` has not yet\n // been set by the SafeSeek operation.\n player._qualitySelectorSafeSeek = new SafeSeek(player, currentTime);\n player.playbackRate(currentPlaybackRate);\n }\n\n if (!isPaused) {\n player.play();\n }\n });\n }\n\n // Add handler to switch sources when the user requests a change\n player.on(events.QUALITY_REQUESTED, changeQuality);\n });\n};\n\nmodule.exports.EVENTS = events;\n","'use strict';\n\nvar _ = require('underscore'),\n events = require('../events');\n\nmodule.exports = function(videojs) {\n\n videojs.use('*', function(player) {\n\n return {\n\n setSource: function(playerSelectedSource, next) {\n var sources = player.currentSources(),\n userSelectedSource, chosenSource;\n\n if (player._qualitySelectorSafeSeek) {\n player._qualitySelectorSafeSeek.onPlayerSourcesChange();\n }\n\n if (!_.isEqual(sources, player._qualitySelectorPreviousSources)) {\n player.trigger(events.PLAYER_SOURCES_CHANGED, sources);\n player._qualitySelectorPreviousSources = sources;\n }\n\n // There are generally two source options, the one that videojs\n // auto-selects and the one that a \"user\" of this plugin has\n // supplied via the `selected` property. `selected` can come from\n // either the `` tag or the list of sources passed to\n // videojs using `src()`.\n\n userSelectedSource = _.find(sources, function(source) {\n // Must check for boolean values as well as either the string 'true' or\n // 'selected'. When sources are set programmatically, the value will be a\n // boolean, but those coming from a `` tag will be a string.\n return source.selected === true || source.selected === 'true' || source.selected === 'selected';\n });\n\n chosenSource = userSelectedSource || playerSelectedSource;\n\n player.trigger(events.QUALITY_SELECTED, chosenSource);\n\n // Pass along the chosen source\n next(null, chosenSource);\n },\n\n };\n\n });\n\n};\n","'use strict';\n\nvar Class = require('class.extend');\n\nmodule.exports = Class.extend({\n init: function(player, seekToTime) {\n this._player = player;\n this._seekToTime = seekToTime;\n this._hasFinished = false;\n this._keepThisInstanceWhenPlayerSourcesChange = false;\n this._seekWhenSafe();\n },\n\n _seekWhenSafe: function() {\n var HAVE_FUTURE_DATA = 3;\n\n // `readyState` in Video.js is the same as the HTML5 Media element's `readyState`\n // property.\n //\n // `readyState` is an enum of 5 values (0-4), each of which represent a state of\n // readiness to play. The meaning of the values range from HAVE_NOTHING (0), meaning\n // no data is available to HAVE_ENOUGH_DATA (4), meaning all data is loaded and the\n // video can be played all the way through.\n //\n // In order to seek successfully, the `readyState` must be at least HAVE_FUTURE_DATA\n // (3).\n //\n // @see http://docs.videojs.com/player#readyState\n // @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/readyState\n // @see https://dev.w3.org/html5/spec-preview/media-elements.html#seek-the-media-controller\n if (this._player.readyState() < HAVE_FUTURE_DATA) {\n this._seekFn = this._seek.bind(this);\n // The `canplay` event means that the `readyState` is at least HAVE_FUTURE_DATA.\n this._player.one('canplay', this._seekFn);\n } else {\n this._seek();\n }\n },\n\n onPlayerSourcesChange: function() {\n if (this._keepThisInstanceWhenPlayerSourcesChange) {\n // By setting this to `false`, we know that if the player sources change again\n // the change did not originate from a quality selection change, the new sources\n // are likely different from the old sources, and so this pending seek no longer\n // applies.\n this._keepThisInstanceWhenPlayerSourcesChange = false;\n } else {\n this.cancel();\n }\n },\n\n onQualitySelectionChange: function() {\n // `onPlayerSourcesChange` will cancel this pending seek unless we tell it not to.\n // We need to reuse this same pending seek instance because when the player is\n // paused, the `preload` attribute is set to `none`, and the user selects one\n // quality option and then another, the player cannot seek until the player has\n // enough data to do so (and the `canplay` event is fired) and thus on the second\n // selection the player's `currentTime()` is `0` and when the video plays we would\n // seek to `0` instead of the correct time.\n if (!this.hasFinished()) {\n this._keepThisInstanceWhenPlayerSourcesChange = true;\n }\n },\n\n _seek: function() {\n this._player.currentTime(this._seekToTime);\n this._keepThisInstanceWhenPlayerSourcesChange = false;\n this._hasFinished = true;\n },\n\n hasFinished: function() {\n return this._hasFinished;\n },\n\n cancel: function() {\n this._player.off('canplay', this._seekFn);\n this._keepThisInstanceWhenPlayerSourcesChange = false;\n this._hasFinished = true;\n },\n});\n","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \".vjs-quality-selector .vjs-menu-button{margin:0;padding:0;height:100%;width:100%}.vjs-quality-selector .vjs-icon-placeholder{font-family:'VideoJS';font-weight:normal;font-style:normal}.vjs-quality-selector .vjs-icon-placeholder::before{content:'\\\\f110'}.vjs-quality-changing .vjs-big-play-button{display:none}.vjs-quality-changing .vjs-control-bar{display:-webkit-box;display:-webkit-flex;display:flex;visibility:visible;opacity:1}\\n\", \"\"]);\n// Exports\nmodule.exports = exports;\n"],"sourceRoot":""}