@antmedia/web_player 2.11.1 → 2.11.2

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/dist/browser/web_player.js +4 -6
  2. package/dist/es/{plugin-ca799d0d.js → plugin-50e1316e.js} +134 -144
  3. package/dist/es/{video.es-0951ae41.js → video.es-be70c095.js} +36 -41
  4. package/dist/es/{videojs-webrtc-plugin-327afa5e.js → videojs-webrtc-plugin-7054aa21.js} +1 -1
  5. package/dist/es/videojs-webrtc-plugin-f56e1f9e.js +3 -0
  6. package/dist/es/{video.es-22056625.js → videojs-webrtc-plugin.es-2a0dfc29.js} +14968 -5052
  7. package/dist/es/videojs-webrtc-plugin.es-333788d9.js +7673 -0
  8. package/dist/es/{videojs-webrtc-plugin.es-f41400f7.js → videojs-webrtc-plugin.es-777bf41a.js} +1747 -1697
  9. package/dist/es/{videojs-webrtc-plugin.es-bd0b1a6d.js → videojs-webrtc-plugin.es-9544f6e0.js} +1563 -1672
  10. package/dist/es/web_player.js +7 -9
  11. package/dist/index.d.ts +17 -1
  12. package/dist/{plugin-84ab2cdd.js → plugin-bec9dc4a.js} +136 -146
  13. package/dist/{video.es-474303e7.js → video.es-df9af03d.js} +36 -43
  14. package/dist/{videojs-webrtc-plugin-bdf9fa8b.js → videojs-webrtc-plugin-3becde8c.js} +1 -1
  15. package/dist/videojs-webrtc-plugin-77a9860b.js +5 -0
  16. package/dist/{videojs-webrtc-plugin.es-72234e77.js → videojs-webrtc-plugin.es-0787d11e.js} +1575 -1684
  17. package/dist/{video.es-72122d04.js → videojs-webrtc-plugin.es-493b195e.js} +14964 -5052
  18. package/dist/videojs-webrtc-plugin.es-8f4ea4e4.js +7675 -0
  19. package/dist/{videojs-webrtc-plugin.es-ac81d249.js → videojs-webrtc-plugin.es-ee6d0333.js} +1757 -1707
  20. package/dist/web_player.js +7 -9
  21. package/package.json +3 -5
  22. package/rollup.config.module.cjs +6 -2
  23. package/src/web_player.js +4 -6
  24. package/test/embedded-player.test.js +1 -1
  25. package/tsconfig.json +0 -1
  26. package/dist/aframe-master-42bb78a9.js +0 -7139
  27. package/dist/dash.all.min-84806d51.js +0 -36
  28. package/dist/es/aframe-master-a6146619.js +0 -7137
  29. package/dist/es/dash.all.min-4a2772b6.js +0 -34
  30. package/dist/es/inheritsLoose-91dc2acc.js +0 -15
  31. package/dist/es/video-js.min-8b4dfe88.js +0 -3
  32. package/dist/es/videojs-contrib-quality-levels.es-1ea32822.js +0 -276
  33. package/dist/es/videojs-contrib-quality-levels.es-5f5b5f23.js +0 -287
  34. package/dist/es/videojs-hls-quality-selector.es-3c54e1cd.js +0 -391
  35. package/dist/es/videojs-webrtc-plugin-b9e4da27.js +0 -3
  36. package/dist/inheritsLoose-281376c7.js +0 -17
  37. package/dist/video-js.min-7e4ae47a.js +0 -5
  38. package/dist/videojs-contrib-quality-levels.es-6c3be3eb.js +0 -278
  39. package/dist/videojs-contrib-quality-levels.es-ef3cec9e.js +0 -289
  40. package/dist/videojs-hls-quality-selector.es-562309df.js +0 -393
  41. package/dist/videojs-webrtc-plugin-d30c3e7a.js +0 -5
@@ -1,393 +0,0 @@
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;
@@ -1,5 +0,0 @@
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;