@antmedia/web_player 2.8.0-SNAPSHOT

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/.project +17 -0
  2. package/.settings/.jsdtscope +7 -0
  3. package/.settings/org.eclipse.wst.jsdt.ui.superType.container +1 -0
  4. package/.settings/org.eclipse.wst.jsdt.ui.superType.name +1 -0
  5. package/LICENSE +201 -0
  6. package/README.md +1 -0
  7. package/api-extractor.json +38 -0
  8. package/codecov.yml +6 -0
  9. package/dist/_commonjsHelpers-ed042b00.js +10 -0
  10. package/dist/aframe-master-42bb78a9.js +7139 -0
  11. package/dist/browser/web_player.js +976 -0
  12. package/dist/dash.all.min-84806d51.js +36 -0
  13. package/dist/es/_commonjsHelpers-7d1333e8.js +7 -0
  14. package/dist/es/aframe-master-a6146619.js +7137 -0
  15. package/dist/es/dash.all.min-4a2772b6.js +34 -0
  16. package/dist/es/index.d.ts +227 -0
  17. package/dist/es/index.js +1 -0
  18. package/dist/es/video-js.min-8b4dfe88.js +3 -0
  19. package/dist/es/video.es-22056625.js +31061 -0
  20. package/dist/es/videojs-contrib-quality-levels.es-5f5b5f23.js +287 -0
  21. package/dist/es/videojs-hls-quality-selector.es-3c54e1cd.js +391 -0
  22. package/dist/es/videojs-webrtc-plugin-b9e4da27.js +3 -0
  23. package/dist/es/videojs-webrtc-plugin.es-f41400f7.js +7649 -0
  24. package/dist/es/web_player.js +1262 -0
  25. package/dist/index.d.ts +227 -0
  26. package/dist/index.js +7 -0
  27. package/dist/video-js.min-7e4ae47a.js +5 -0
  28. package/dist/video.es-72122d04.js +31067 -0
  29. package/dist/videojs-contrib-quality-levels.es-ef3cec9e.js +289 -0
  30. package/dist/videojs-hls-quality-selector.es-562309df.js +393 -0
  31. package/dist/videojs-webrtc-plugin-d30c3e7a.js +5 -0
  32. package/dist/videojs-webrtc-plugin.es-ac81d249.js +7651 -0
  33. package/dist/web_player.js +1265 -0
  34. package/karma.conf.cjs +74 -0
  35. package/package.json +68 -0
  36. package/rollup.config.browser.cjs +16 -0
  37. package/rollup.config.module.cjs +42 -0
  38. package/src/index.js +1 -0
  39. package/src/web_player.js +1133 -0
  40. package/test/embedded-player.test.js +864 -0
  41. package/tsconfig.json +24 -0
@@ -0,0 +1,289 @@
1
+ 'use strict';
2
+
3
+ var video_es = require('./video.es-72122d04.js');
4
+ require('./_commonjsHelpers-ed042b00.js');
5
+
6
+ /*! @name videojs-contrib-quality-levels @version 2.2.1 @license Apache-2.0 */
7
+ function _inheritsLoose(subClass, superClass) {
8
+ subClass.prototype = Object.create(superClass.prototype);
9
+ subClass.prototype.constructor = subClass;
10
+ subClass.__proto__ = superClass;
11
+ }
12
+ function _assertThisInitialized(self) {
13
+ if (self === void 0) {
14
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
15
+ }
16
+ return self;
17
+ }
18
+
19
+ /**
20
+ * A single QualityLevel.
21
+ *
22
+ * interface QualityLevel {
23
+ * readonly attribute DOMString id;
24
+ * attribute DOMString label;
25
+ * readonly attribute long width;
26
+ * readonly attribute long height;
27
+ * readonly attribute long bitrate;
28
+ * attribute boolean enabled;
29
+ * };
30
+ *
31
+ * @class QualityLevel
32
+ */
33
+ var QualityLevel =
34
+ /**
35
+ * Creates a QualityLevel
36
+ *
37
+ * @param {Representation|Object} representation The representation of the quality level
38
+ * @param {string} representation.id Unique id of the QualityLevel
39
+ * @param {number=} representation.width Resolution width of the QualityLevel
40
+ * @param {number=} representation.height Resolution height of the QualityLevel
41
+ * @param {number} representation.bandwidth Bitrate of the QualityLevel
42
+ * @param {number=} representation.frameRate Frame-rate of the QualityLevel
43
+ * @param {Function} representation.enabled Callback to enable/disable QualityLevel
44
+ */
45
+ function QualityLevel(representation) {
46
+ var level = this; // eslint-disable-line
47
+
48
+ level.id = representation.id;
49
+ level.label = level.id;
50
+ level.width = representation.width;
51
+ level.height = representation.height;
52
+ level.bitrate = representation.bandwidth;
53
+ level.frameRate = representation.frameRate;
54
+ level.enabled_ = representation.enabled;
55
+ Object.defineProperty(level, 'enabled', {
56
+ /**
57
+ * Get whether the QualityLevel is enabled.
58
+ *
59
+ * @return {boolean} True if the QualityLevel is enabled.
60
+ */
61
+ get: function get() {
62
+ return level.enabled_();
63
+ },
64
+ /**
65
+ * Enable or disable the QualityLevel.
66
+ *
67
+ * @param {boolean} enable true to enable QualityLevel, false to disable.
68
+ */
69
+ set: function set(enable) {
70
+ level.enabled_(enable);
71
+ }
72
+ });
73
+ return level;
74
+ };
75
+
76
+ /**
77
+ * A list of QualityLevels.
78
+ *
79
+ * interface QualityLevelList : EventTarget {
80
+ * getter QualityLevel (unsigned long index);
81
+ * readonly attribute unsigned long length;
82
+ * readonly attribute long selectedIndex;
83
+ *
84
+ * void addQualityLevel(QualityLevel qualityLevel)
85
+ * void removeQualityLevel(QualityLevel remove)
86
+ * QualityLevel? getQualityLevelById(DOMString id);
87
+ *
88
+ * attribute EventHandler onchange;
89
+ * attribute EventHandler onaddqualitylevel;
90
+ * attribute EventHandler onremovequalitylevel;
91
+ * };
92
+ *
93
+ * @extends videojs.EventTarget
94
+ * @class QualityLevelList
95
+ */
96
+
97
+ var QualityLevelList = /*#__PURE__*/
98
+ function (_videojs$EventTarget) {
99
+ _inheritsLoose(QualityLevelList, _videojs$EventTarget);
100
+ function QualityLevelList() {
101
+ var _this;
102
+ _this = _videojs$EventTarget.call(this) || this;
103
+ var list = _assertThisInitialized(_assertThisInitialized(_this)); // eslint-disable-line
104
+
105
+ list.levels_ = [];
106
+ list.selectedIndex_ = -1;
107
+ /**
108
+ * Get the index of the currently selected QualityLevel.
109
+ *
110
+ * @returns {number} The index of the selected QualityLevel. -1 if none selected.
111
+ * @readonly
112
+ */
113
+
114
+ Object.defineProperty(list, 'selectedIndex', {
115
+ get: function get() {
116
+ return list.selectedIndex_;
117
+ }
118
+ });
119
+ /**
120
+ * Get the length of the list of QualityLevels.
121
+ *
122
+ * @returns {number} The length of the list.
123
+ * @readonly
124
+ */
125
+
126
+ Object.defineProperty(list, 'length', {
127
+ get: function get() {
128
+ return list.levels_.length;
129
+ }
130
+ });
131
+ return list || _assertThisInitialized(_this);
132
+ }
133
+ /**
134
+ * Adds a quality level to the list.
135
+ *
136
+ * @param {Representation|Object} representation The representation of the quality level
137
+ * @param {string} representation.id Unique id of the QualityLevel
138
+ * @param {number=} representation.width Resolution width of the QualityLevel
139
+ * @param {number=} representation.height Resolution height of the QualityLevel
140
+ * @param {number} representation.bandwidth Bitrate of the QualityLevel
141
+ * @param {number=} representation.frameRate Frame-rate of the QualityLevel
142
+ * @param {Function} representation.enabled Callback to enable/disable QualityLevel
143
+ * @return {QualityLevel} the QualityLevel added to the list
144
+ * @method addQualityLevel
145
+ */
146
+
147
+ var _proto = QualityLevelList.prototype;
148
+ _proto.addQualityLevel = function addQualityLevel(representation) {
149
+ var qualityLevel = this.getQualityLevelById(representation.id); // Do not add duplicate quality levels
150
+
151
+ if (qualityLevel) {
152
+ return qualityLevel;
153
+ }
154
+ var index = this.levels_.length;
155
+ qualityLevel = new QualityLevel(representation);
156
+ if (!('' + index in this)) {
157
+ Object.defineProperty(this, index, {
158
+ get: function get() {
159
+ return this.levels_[index];
160
+ }
161
+ });
162
+ }
163
+ this.levels_.push(qualityLevel);
164
+ this.trigger({
165
+ qualityLevel: qualityLevel,
166
+ type: 'addqualitylevel'
167
+ });
168
+ return qualityLevel;
169
+ };
170
+ /**
171
+ * Removes a quality level from the list.
172
+ *
173
+ * @param {QualityLevel} remove QualityLevel to remove to the list.
174
+ * @return {QualityLevel|null} the QualityLevel removed or null if nothing removed
175
+ * @method removeQualityLevel
176
+ */
177
+
178
+ _proto.removeQualityLevel = function removeQualityLevel(qualityLevel) {
179
+ var removed = null;
180
+ for (var i = 0, l = this.length; i < l; i++) {
181
+ if (this[i] === qualityLevel) {
182
+ removed = this.levels_.splice(i, 1)[0];
183
+ if (this.selectedIndex_ === i) {
184
+ this.selectedIndex_ = -1;
185
+ } else if (this.selectedIndex_ > i) {
186
+ this.selectedIndex_--;
187
+ }
188
+ break;
189
+ }
190
+ }
191
+ if (removed) {
192
+ this.trigger({
193
+ qualityLevel: qualityLevel,
194
+ type: 'removequalitylevel'
195
+ });
196
+ }
197
+ return removed;
198
+ };
199
+ /**
200
+ * Searches for a QualityLevel with the given id.
201
+ *
202
+ * @param {string} id The id of the QualityLevel to find.
203
+ * @return {QualityLevel|null} The QualityLevel with id, or null if not found.
204
+ * @method getQualityLevelById
205
+ */
206
+
207
+ _proto.getQualityLevelById = function getQualityLevelById(id) {
208
+ for (var i = 0, l = this.length; i < l; i++) {
209
+ var level = this[i];
210
+ if (level.id === id) {
211
+ return level;
212
+ }
213
+ }
214
+ return null;
215
+ };
216
+ /**
217
+ * Resets the list of QualityLevels to empty
218
+ *
219
+ * @method dispose
220
+ */
221
+
222
+ _proto.dispose = function dispose() {
223
+ this.selectedIndex_ = -1;
224
+ this.levels_.length = 0;
225
+ };
226
+ return QualityLevelList;
227
+ }(video_es.videojs.EventTarget);
228
+ /**
229
+ * change - The selected QualityLevel has changed.
230
+ * addqualitylevel - A QualityLevel has been added to the QualityLevelList.
231
+ * removequalitylevel - A QualityLevel has been removed from the QualityLevelList.
232
+ */
233
+
234
+ QualityLevelList.prototype.allowedEvents_ = {
235
+ change: 'change',
236
+ addqualitylevel: 'addqualitylevel',
237
+ removequalitylevel: 'removequalitylevel'
238
+ }; // emulate attribute EventHandler support to allow for feature detection
239
+
240
+ for (var event in QualityLevelList.prototype.allowedEvents_) {
241
+ QualityLevelList.prototype['on' + event] = null;
242
+ }
243
+ var version = "2.2.1";
244
+ var registerPlugin = video_es.videojs.registerPlugin || video_es.videojs.plugin;
245
+ /**
246
+ * Initialization function for the qualityLevels plugin. Sets up the QualityLevelList and
247
+ * event handlers.
248
+ *
249
+ * @param {Player} player Player object.
250
+ * @param {Object} options Plugin options object.
251
+ * @function initPlugin
252
+ */
253
+
254
+ var initPlugin = function initPlugin(player, options) {
255
+ var originalPluginFn = player.qualityLevels;
256
+ var qualityLevelList = new QualityLevelList();
257
+ var disposeHandler = function disposeHandler() {
258
+ qualityLevelList.dispose();
259
+ player.qualityLevels = originalPluginFn;
260
+ player.off('dispose', disposeHandler);
261
+ };
262
+ player.on('dispose', disposeHandler);
263
+ player.qualityLevels = function () {
264
+ return qualityLevelList;
265
+ };
266
+ player.qualityLevels.VERSION = version;
267
+ return qualityLevelList;
268
+ };
269
+ /**
270
+ * A video.js plugin.
271
+ *
272
+ * In the plugin function, the value of `this` is a video.js `Player`
273
+ * instance. You cannot rely on the player being in a "ready" state here,
274
+ * depending on how the plugin is invoked. This may or may not be important
275
+ * to you; if not, remove the wait for "ready"!
276
+ *
277
+ * @param {Object} options Plugin options object
278
+ * @function qualityLevels
279
+ */
280
+
281
+ var qualityLevels = function qualityLevels(options) {
282
+ return initPlugin(this, video_es.videojs.mergeOptions({}, options));
283
+ }; // Register the plugin with video.js.
284
+
285
+ registerPlugin('qualityLevels', qualityLevels); // Include the version number.
286
+
287
+ qualityLevels.VERSION = version;
288
+
289
+ exports.default = qualityLevels;
@@ -0,0 +1,393 @@
1
+ 'use strict';
2
+
3
+ var video_es = require('./video.es-72122d04.js');
4
+ require('./_commonjsHelpers-ed042b00.js');
5
+
6
+ var version = "1.1.4";
7
+ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
8
+ return typeof obj;
9
+ } : function (obj) {
10
+ return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
11
+ };
12
+ var classCallCheck = function (instance, Constructor) {
13
+ if (!(instance instanceof Constructor)) {
14
+ throw new TypeError("Cannot call a class as a function");
15
+ }
16
+ };
17
+ var inherits = function (subClass, superClass) {
18
+ if (typeof superClass !== "function" && superClass !== null) {
19
+ throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
20
+ }
21
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
22
+ constructor: {
23
+ value: subClass,
24
+ enumerable: false,
25
+ writable: true,
26
+ configurable: true
27
+ }
28
+ });
29
+ if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
30
+ };
31
+ var possibleConstructorReturn = function (self, call) {
32
+ if (!self) {
33
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
34
+ }
35
+ return call && (typeof call === "object" || typeof call === "function") ? call : self;
36
+ };
37
+ var VideoJsButtonClass = video_es.videojs.getComponent('MenuButton');
38
+ var VideoJsMenuClass = video_es.videojs.getComponent('Menu');
39
+ var VideoJsComponent = video_es.videojs.getComponent('Component');
40
+ var Dom = video_es.videojs.dom;
41
+
42
+ /**
43
+ * Convert string to title case.
44
+ *
45
+ * @param {string} string - the string to convert
46
+ * @return {string} the returned titlecase string
47
+ */
48
+ function toTitleCase(string) {
49
+ if (typeof string !== 'string') {
50
+ return string;
51
+ }
52
+ return string.charAt(0).toUpperCase() + string.slice(1);
53
+ }
54
+
55
+ /**
56
+ * Extend vjs button class for quality button.
57
+ */
58
+
59
+ var ConcreteButton = function (_VideoJsButtonClass) {
60
+ inherits(ConcreteButton, _VideoJsButtonClass);
61
+
62
+ /**
63
+ * Button constructor.
64
+ *
65
+ * @param {Player} player - videojs player instance
66
+ */
67
+ function ConcreteButton(player) {
68
+ classCallCheck(this, ConcreteButton);
69
+ return possibleConstructorReturn(this, _VideoJsButtonClass.call(this, player, {
70
+ title: player.localize('Quality'),
71
+ name: 'QualityButton'
72
+ }));
73
+ }
74
+
75
+ /**
76
+ * Creates button items.
77
+ *
78
+ * @return {Array} - Button items
79
+ */
80
+
81
+ ConcreteButton.prototype.createItems = function createItems() {
82
+ return [];
83
+ };
84
+
85
+ /**
86
+ * Create the menu and add all items to it.
87
+ *
88
+ * @return {Menu}
89
+ * The constructed menu
90
+ */
91
+
92
+ ConcreteButton.prototype.createMenu = function createMenu() {
93
+ var menu = new VideoJsMenuClass(this.player_, {
94
+ menuButton: this
95
+ });
96
+ this.hideThreshold_ = 0;
97
+
98
+ // Add a title list item to the top
99
+ if (this.options_.title) {
100
+ var titleEl = Dom.createEl('li', {
101
+ className: 'vjs-menu-title',
102
+ innerHTML: toTitleCase(this.options_.title),
103
+ tabIndex: -1
104
+ });
105
+ var titleComponent = new VideoJsComponent(this.player_, {
106
+ el: titleEl
107
+ });
108
+ this.hideThreshold_ += 1;
109
+ menu.addItem(titleComponent);
110
+ }
111
+ this.items = this.createItems();
112
+ if (this.items) {
113
+ // Add menu items to the menu
114
+ for (var i = 0; i < this.items.length; i++) {
115
+ menu.addItem(this.items[i]);
116
+ }
117
+ }
118
+ return menu;
119
+ };
120
+ return ConcreteButton;
121
+ }(VideoJsButtonClass);
122
+
123
+ // Concrete classes
124
+ var VideoJsMenuItemClass = video_es.videojs.getComponent('MenuItem');
125
+
126
+ /**
127
+ * Extend vjs menu item class.
128
+ */
129
+
130
+ var ConcreteMenuItem = function (_VideoJsMenuItemClass) {
131
+ inherits(ConcreteMenuItem, _VideoJsMenuItemClass);
132
+
133
+ /**
134
+ * Menu item constructor.
135
+ *
136
+ * @param {Player} player - vjs player
137
+ * @param {Object} item - Item object
138
+ * @param {ConcreteButton} qualityButton - The containing button.
139
+ * @param {HlsQualitySelectorPlugin} plugin - This plugin instance.
140
+ */
141
+ function ConcreteMenuItem(player, item, qualityButton, plugin) {
142
+ classCallCheck(this, ConcreteMenuItem);
143
+ var _this = possibleConstructorReturn(this, _VideoJsMenuItemClass.call(this, player, {
144
+ label: item.label,
145
+ selectable: true,
146
+ selected: item.selected || false
147
+ }));
148
+ _this.item = item;
149
+ _this.qualityButton = qualityButton;
150
+ _this.plugin = plugin;
151
+ return _this;
152
+ }
153
+
154
+ /**
155
+ * Click event for menu item.
156
+ */
157
+
158
+ ConcreteMenuItem.prototype.handleClick = function handleClick() {
159
+ // Reset other menu items selected status.
160
+ for (var i = 0; i < this.qualityButton.items.length; ++i) {
161
+ this.qualityButton.items[i].selected(false);
162
+ }
163
+
164
+ // Set this menu item to selected, and set quality.
165
+ this.plugin.setQuality(this.item.value);
166
+ this.selected(true);
167
+ };
168
+ return ConcreteMenuItem;
169
+ }(VideoJsMenuItemClass);
170
+
171
+ // Default options for the plugin.
172
+ var defaults = {};
173
+
174
+ // Cross-compatibility for Video.js 5 and 6.
175
+ var registerPlugin = video_es.videojs.registerPlugin || video_es.videojs.plugin;
176
+ // const dom = videojs.dom || videojs;
177
+
178
+ /**
179
+ * VideoJS HLS Quality Selector Plugin class.
180
+ */
181
+
182
+ var HlsQualitySelectorPlugin = function () {
183
+ /**
184
+ * Plugin Constructor.
185
+ *
186
+ * @param {Player} player - The videojs player instance.
187
+ * @param {Object} options - The plugin options.
188
+ */
189
+ function HlsQualitySelectorPlugin(player, options) {
190
+ classCallCheck(this, HlsQualitySelectorPlugin);
191
+ this.player = player;
192
+ this.config = options;
193
+
194
+ // If there is quality levels plugin and the HLS tech exists
195
+ // then continue.
196
+ if (this.player.qualityLevels && this.getHls()) {
197
+ // Create the quality button.
198
+ this.createQualityButton();
199
+ this.bindPlayerEvents();
200
+ }
201
+ }
202
+
203
+ /**
204
+ * Returns HLS Plugin
205
+ *
206
+ * @return {*} - videojs-hls-contrib plugin.
207
+ */
208
+
209
+ HlsQualitySelectorPlugin.prototype.getHls = function getHls() {
210
+ return this.player.tech({
211
+ IWillNotUseThisInPlugins: true
212
+ }).hls;
213
+ };
214
+
215
+ /**
216
+ * Binds listener for quality level changes.
217
+ */
218
+
219
+ HlsQualitySelectorPlugin.prototype.bindPlayerEvents = function bindPlayerEvents() {
220
+ this.player.qualityLevels().on('addqualitylevel', this.onAddQualityLevel.bind(this));
221
+ };
222
+
223
+ /**
224
+ * Adds the quality menu button to the player control bar.
225
+ */
226
+
227
+ HlsQualitySelectorPlugin.prototype.createQualityButton = function createQualityButton() {
228
+ var player = this.player;
229
+ this._qualityButton = new ConcreteButton(player);
230
+ var placementIndex = player.controlBar.children().length - 2;
231
+ var concreteButtonInstance = player.controlBar.addChild(this._qualityButton, {
232
+ componentClass: 'qualitySelector'
233
+ }, this.config.placementIndex || placementIndex);
234
+ concreteButtonInstance.addClass('vjs-quality-selector');
235
+ if (!this.config.displayCurrentQuality) {
236
+ var icon = ' ' + (this.config.vjsIconClass || 'vjs-icon-hd');
237
+ concreteButtonInstance.menuButton_.$('.vjs-icon-placeholder').className += icon;
238
+ } else {
239
+ this.setButtonInnerText('auto');
240
+ }
241
+ concreteButtonInstance.removeClass('vjs-hidden');
242
+ };
243
+
244
+ /**
245
+ *Set inner button text.
246
+ *
247
+ * @param {string} text - the text to display in the button.
248
+ */
249
+
250
+ HlsQualitySelectorPlugin.prototype.setButtonInnerText = function setButtonInnerText(text) {
251
+ this._qualityButton.menuButton_.$('.vjs-icon-placeholder').innerHTML = text;
252
+ };
253
+
254
+ /**
255
+ * Builds individual quality menu items.
256
+ *
257
+ * @param {Object} item - Individual quality menu item.
258
+ * @return {ConcreteMenuItem} - Menu item
259
+ */
260
+
261
+ HlsQualitySelectorPlugin.prototype.getQualityMenuItem = function getQualityMenuItem(item) {
262
+ var player = this.player;
263
+ return new ConcreteMenuItem(player, item, this._qualityButton, this);
264
+ };
265
+
266
+ /**
267
+ * Executed when a quality level is added from HLS playlist.
268
+ */
269
+
270
+ HlsQualitySelectorPlugin.prototype.onAddQualityLevel = function onAddQualityLevel() {
271
+ var _this = this;
272
+ var player = this.player;
273
+ var qualityList = player.qualityLevels();
274
+ var levels = qualityList.levels_ || [];
275
+ var levelItems = [];
276
+ var _loop = function _loop(i) {
277
+ if (!levelItems.filter(function (_existingItem) {
278
+ return _existingItem.item && _existingItem.item.value === levels[i].height;
279
+ }).length) {
280
+ var levelItem = _this.getQualityMenuItem.call(_this, {
281
+ label: levels[i].height + 'p',
282
+ value: levels[i].height
283
+ });
284
+ levelItems.push(levelItem);
285
+ }
286
+ };
287
+ for (var i = 0; i < levels.length; ++i) {
288
+ _loop(i);
289
+ }
290
+ levelItems.sort(function (current, next) {
291
+ if ((typeof current === 'undefined' ? 'undefined' : _typeof(current)) !== 'object' || (typeof next === 'undefined' ? 'undefined' : _typeof(next)) !== 'object') {
292
+ return -1;
293
+ }
294
+ if (current.item.value < next.item.value) {
295
+ return -1;
296
+ }
297
+ if (current.item.value > next.item.value) {
298
+ return 1;
299
+ }
300
+ return 0;
301
+ });
302
+ levelItems.push(this.getQualityMenuItem.call(this, {
303
+ label: player.localize('Auto'),
304
+ value: 'auto',
305
+ selected: true
306
+ }));
307
+ if (this._qualityButton) {
308
+ this._qualityButton.createItems = function () {
309
+ return levelItems;
310
+ };
311
+ this._qualityButton.update();
312
+ }
313
+ };
314
+
315
+ /**
316
+ * Sets quality (based on media height)
317
+ *
318
+ * @param {number} height - A number representing HLS playlist.
319
+ */
320
+
321
+ HlsQualitySelectorPlugin.prototype.setQuality = function setQuality(height) {
322
+ var qualityList = this.player.qualityLevels();
323
+
324
+ // Set quality on plugin
325
+ this._currentQuality = height;
326
+ if (this.config.displayCurrentQuality) {
327
+ this.setButtonInnerText(height === 'auto' ? height : height + 'p');
328
+ }
329
+ for (var i = 0; i < qualityList.length; ++i) {
330
+ var quality = qualityList[i];
331
+ quality.enabled = quality.height === height || height === 'auto';
332
+ }
333
+ this._qualityButton.unpressButton();
334
+ };
335
+
336
+ /**
337
+ * Return the current set quality or 'auto'
338
+ *
339
+ * @return {string} the currently set quality
340
+ */
341
+
342
+ HlsQualitySelectorPlugin.prototype.getCurrentQuality = function getCurrentQuality() {
343
+ return this._currentQuality || 'auto';
344
+ };
345
+ return HlsQualitySelectorPlugin;
346
+ }();
347
+
348
+ /**
349
+ * Function to invoke when the player is ready.
350
+ *
351
+ * This is a great place for your plugin to initialize itself. When this
352
+ * function is called, the player will have its DOM and child components
353
+ * in place.
354
+ *
355
+ * @function onPlayerReady
356
+ * @param {Player} player
357
+ * A Video.js player object.
358
+ *
359
+ * @param {Object} [options={}]
360
+ * A plain object containing options for the plugin.
361
+ */
362
+
363
+ var onPlayerReady = function onPlayerReady(player, options) {
364
+ player.addClass('vjs-hls-quality-selector');
365
+ player.hlsQualitySelector = new HlsQualitySelectorPlugin(player, options);
366
+ };
367
+
368
+ /**
369
+ * A video.js plugin.
370
+ *
371
+ * In the plugin function, the value of `this` is a video.js `Player`
372
+ * instance. You cannot rely on the player being in a "ready" state here,
373
+ * depending on how the plugin is invoked. This may or may not be important
374
+ * to you; if not, remove the wait for "ready"!
375
+ *
376
+ * @function hlsQualitySelector
377
+ * @param {Object} [options={}]
378
+ * An object of options left to the plugin author to define.
379
+ */
380
+ var hlsQualitySelector = function hlsQualitySelector(options) {
381
+ var _this2 = this;
382
+ this.ready(function () {
383
+ onPlayerReady(_this2, video_es.videojs.mergeOptions(defaults, options));
384
+ });
385
+ };
386
+
387
+ // Register the plugin with video.js.
388
+ registerPlugin('hlsQualitySelector', hlsQualitySelector);
389
+
390
+ // Include the version number.
391
+ hlsQualitySelector.VERSION = version;
392
+
393
+ exports.default = hlsQualitySelector;
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+
3
+ var videojsWebrtcPlugin = "/*! @name @antmedia/videojs-webrtc-plugin @version 1.2.1 @license MIT */\n.vjs-custom-spinner{position:absolute;top:50%;transform:translateY(-50%) translateX(-50%);left:50%;width:80px;height:80px}.vjs-custom-spinner:after{content:\" \";display:block;width:64px;height:64px;margin:8px;border-radius:50%;border:6px solid #fff;border-color:#fff transparent;-webkit-animation:vjs-spinner-spin 1.1s cubic-bezier(.6,.2,0,.8) infinite,vjs-spinner-fade 1.1s linear infinite;animation:vjs-spinner-spin 1.1s cubic-bezier(.6,.2,0,.8) infinite,vjs-spinner-fade 1.1s linear infinite}";
4
+
5
+ exports.default = videojsWebrtcPlugin;