@antmedia/web_player 2.11.1 → 2.11.10

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 (39) hide show
  1. package/.github/workflows/publish-release.yml +20 -3
  2. package/dist/browser/web_player.js +4 -6
  3. package/dist/es/{plugin-ca799d0d.js → plugin-06260ef3.js} +133 -143
  4. package/dist/es/videojs-webrtc-plugin-f56e1f9e.js +3 -0
  5. package/dist/es/{videojs-webrtc-plugin.es-bd0b1a6d.js → videojs-webrtc-plugin.es-a1f9d342.js} +1555 -1674
  6. package/dist/es/web_player.js +6 -8
  7. package/dist/index.d.ts +17 -1
  8. package/dist/{plugin-84ab2cdd.js → plugin-1270024e.js} +133 -143
  9. package/dist/videojs-webrtc-plugin-77a9860b.js +5 -0
  10. package/dist/{videojs-webrtc-plugin.es-72234e77.js → videojs-webrtc-plugin.es-e643c42a.js} +1555 -1674
  11. package/dist/web_player.js +6 -8
  12. package/package.json +3 -5
  13. package/rollup.config.module.cjs +6 -2
  14. package/src/web_player.js +4 -6
  15. package/test/embedded-player.test.js +1 -1
  16. package/tsconfig.json +0 -1
  17. package/dist/aframe-master-42bb78a9.js +0 -7139
  18. package/dist/dash.all.min-84806d51.js +0 -36
  19. package/dist/es/aframe-master-a6146619.js +0 -7137
  20. package/dist/es/dash.all.min-4a2772b6.js +0 -34
  21. package/dist/es/inheritsLoose-91dc2acc.js +0 -15
  22. package/dist/es/video-js.min-8b4dfe88.js +0 -3
  23. package/dist/es/video.es-22056625.js +0 -31061
  24. package/dist/es/videojs-contrib-quality-levels.es-1ea32822.js +0 -276
  25. package/dist/es/videojs-contrib-quality-levels.es-5f5b5f23.js +0 -287
  26. package/dist/es/videojs-hls-quality-selector.es-3c54e1cd.js +0 -391
  27. package/dist/es/videojs-webrtc-plugin-327afa5e.js +0 -3
  28. package/dist/es/videojs-webrtc-plugin-b9e4da27.js +0 -3
  29. package/dist/es/videojs-webrtc-plugin.es-f41400f7.js +0 -7649
  30. package/dist/inheritsLoose-281376c7.js +0 -17
  31. package/dist/video-js.min-7e4ae47a.js +0 -5
  32. package/dist/video.es-72122d04.js +0 -31067
  33. package/dist/videojs-contrib-quality-levels.es-6c3be3eb.js +0 -278
  34. package/dist/videojs-contrib-quality-levels.es-ef3cec9e.js +0 -289
  35. package/dist/videojs-hls-quality-selector.es-562309df.js +0 -393
  36. package/dist/videojs-webrtc-plugin-bdf9fa8b.js +0 -5
  37. package/dist/videojs-webrtc-plugin-d30c3e7a.js +0 -5
  38. package/dist/videojs-webrtc-plugin.es-ac81d249.js +0 -7651
  39. package/visual.code-workspace +0 -11
@@ -1,391 +0,0 @@
1
- import { v as videojs } from './video.es-22056625.js';
2
- import './_commonjsHelpers-7d1333e8.js';
3
-
4
- var version = "1.1.4";
5
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
6
- return typeof obj;
7
- } : function (obj) {
8
- return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
9
- };
10
- var classCallCheck = function (instance, Constructor) {
11
- if (!(instance instanceof Constructor)) {
12
- throw new TypeError("Cannot call a class as a function");
13
- }
14
- };
15
- var inherits = function (subClass, superClass) {
16
- if (typeof superClass !== "function" && superClass !== null) {
17
- throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
18
- }
19
- subClass.prototype = Object.create(superClass && superClass.prototype, {
20
- constructor: {
21
- value: subClass,
22
- enumerable: false,
23
- writable: true,
24
- configurable: true
25
- }
26
- });
27
- if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
28
- };
29
- var possibleConstructorReturn = function (self, call) {
30
- if (!self) {
31
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
32
- }
33
- return call && (typeof call === "object" || typeof call === "function") ? call : self;
34
- };
35
- var VideoJsButtonClass = videojs.getComponent('MenuButton');
36
- var VideoJsMenuClass = videojs.getComponent('Menu');
37
- var VideoJsComponent = videojs.getComponent('Component');
38
- var Dom = videojs.dom;
39
-
40
- /**
41
- * Convert string to title case.
42
- *
43
- * @param {string} string - the string to convert
44
- * @return {string} the returned titlecase string
45
- */
46
- function toTitleCase(string) {
47
- if (typeof string !== 'string') {
48
- return string;
49
- }
50
- return string.charAt(0).toUpperCase() + string.slice(1);
51
- }
52
-
53
- /**
54
- * Extend vjs button class for quality button.
55
- */
56
-
57
- var ConcreteButton = function (_VideoJsButtonClass) {
58
- inherits(ConcreteButton, _VideoJsButtonClass);
59
-
60
- /**
61
- * Button constructor.
62
- *
63
- * @param {Player} player - videojs player instance
64
- */
65
- function ConcreteButton(player) {
66
- classCallCheck(this, ConcreteButton);
67
- return possibleConstructorReturn(this, _VideoJsButtonClass.call(this, player, {
68
- title: player.localize('Quality'),
69
- name: 'QualityButton'
70
- }));
71
- }
72
-
73
- /**
74
- * Creates button items.
75
- *
76
- * @return {Array} - Button items
77
- */
78
-
79
- ConcreteButton.prototype.createItems = function createItems() {
80
- return [];
81
- };
82
-
83
- /**
84
- * Create the menu and add all items to it.
85
- *
86
- * @return {Menu}
87
- * The constructed menu
88
- */
89
-
90
- ConcreteButton.prototype.createMenu = function createMenu() {
91
- var menu = new VideoJsMenuClass(this.player_, {
92
- menuButton: this
93
- });
94
- this.hideThreshold_ = 0;
95
-
96
- // Add a title list item to the top
97
- if (this.options_.title) {
98
- var titleEl = Dom.createEl('li', {
99
- className: 'vjs-menu-title',
100
- innerHTML: toTitleCase(this.options_.title),
101
- tabIndex: -1
102
- });
103
- var titleComponent = new VideoJsComponent(this.player_, {
104
- el: titleEl
105
- });
106
- this.hideThreshold_ += 1;
107
- menu.addItem(titleComponent);
108
- }
109
- this.items = this.createItems();
110
- if (this.items) {
111
- // Add menu items to the menu
112
- for (var i = 0; i < this.items.length; i++) {
113
- menu.addItem(this.items[i]);
114
- }
115
- }
116
- return menu;
117
- };
118
- return ConcreteButton;
119
- }(VideoJsButtonClass);
120
-
121
- // Concrete classes
122
- var VideoJsMenuItemClass = videojs.getComponent('MenuItem');
123
-
124
- /**
125
- * Extend vjs menu item class.
126
- */
127
-
128
- var ConcreteMenuItem = function (_VideoJsMenuItemClass) {
129
- inherits(ConcreteMenuItem, _VideoJsMenuItemClass);
130
-
131
- /**
132
- * Menu item constructor.
133
- *
134
- * @param {Player} player - vjs player
135
- * @param {Object} item - Item object
136
- * @param {ConcreteButton} qualityButton - The containing button.
137
- * @param {HlsQualitySelectorPlugin} plugin - This plugin instance.
138
- */
139
- function ConcreteMenuItem(player, item, qualityButton, plugin) {
140
- classCallCheck(this, ConcreteMenuItem);
141
- var _this = possibleConstructorReturn(this, _VideoJsMenuItemClass.call(this, player, {
142
- label: item.label,
143
- selectable: true,
144
- selected: item.selected || false
145
- }));
146
- _this.item = item;
147
- _this.qualityButton = qualityButton;
148
- _this.plugin = plugin;
149
- return _this;
150
- }
151
-
152
- /**
153
- * Click event for menu item.
154
- */
155
-
156
- ConcreteMenuItem.prototype.handleClick = function handleClick() {
157
- // Reset other menu items selected status.
158
- for (var i = 0; i < this.qualityButton.items.length; ++i) {
159
- this.qualityButton.items[i].selected(false);
160
- }
161
-
162
- // Set this menu item to selected, and set quality.
163
- this.plugin.setQuality(this.item.value);
164
- this.selected(true);
165
- };
166
- return ConcreteMenuItem;
167
- }(VideoJsMenuItemClass);
168
-
169
- // Default options for the plugin.
170
- var defaults = {};
171
-
172
- // Cross-compatibility for Video.js 5 and 6.
173
- var registerPlugin = videojs.registerPlugin || videojs.plugin;
174
- // const dom = videojs.dom || videojs;
175
-
176
- /**
177
- * VideoJS HLS Quality Selector Plugin class.
178
- */
179
-
180
- var HlsQualitySelectorPlugin = function () {
181
- /**
182
- * Plugin Constructor.
183
- *
184
- * @param {Player} player - The videojs player instance.
185
- * @param {Object} options - The plugin options.
186
- */
187
- function HlsQualitySelectorPlugin(player, options) {
188
- classCallCheck(this, HlsQualitySelectorPlugin);
189
- this.player = player;
190
- this.config = options;
191
-
192
- // If there is quality levels plugin and the HLS tech exists
193
- // then continue.
194
- if (this.player.qualityLevels && this.getHls()) {
195
- // Create the quality button.
196
- this.createQualityButton();
197
- this.bindPlayerEvents();
198
- }
199
- }
200
-
201
- /**
202
- * Returns HLS Plugin
203
- *
204
- * @return {*} - videojs-hls-contrib plugin.
205
- */
206
-
207
- HlsQualitySelectorPlugin.prototype.getHls = function getHls() {
208
- return this.player.tech({
209
- IWillNotUseThisInPlugins: true
210
- }).hls;
211
- };
212
-
213
- /**
214
- * Binds listener for quality level changes.
215
- */
216
-
217
- HlsQualitySelectorPlugin.prototype.bindPlayerEvents = function bindPlayerEvents() {
218
- this.player.qualityLevels().on('addqualitylevel', this.onAddQualityLevel.bind(this));
219
- };
220
-
221
- /**
222
- * Adds the quality menu button to the player control bar.
223
- */
224
-
225
- HlsQualitySelectorPlugin.prototype.createQualityButton = function createQualityButton() {
226
- var player = this.player;
227
- this._qualityButton = new ConcreteButton(player);
228
- var placementIndex = player.controlBar.children().length - 2;
229
- var concreteButtonInstance = player.controlBar.addChild(this._qualityButton, {
230
- componentClass: 'qualitySelector'
231
- }, this.config.placementIndex || placementIndex);
232
- concreteButtonInstance.addClass('vjs-quality-selector');
233
- if (!this.config.displayCurrentQuality) {
234
- var icon = ' ' + (this.config.vjsIconClass || 'vjs-icon-hd');
235
- concreteButtonInstance.menuButton_.$('.vjs-icon-placeholder').className += icon;
236
- } else {
237
- this.setButtonInnerText('auto');
238
- }
239
- concreteButtonInstance.removeClass('vjs-hidden');
240
- };
241
-
242
- /**
243
- *Set inner button text.
244
- *
245
- * @param {string} text - the text to display in the button.
246
- */
247
-
248
- HlsQualitySelectorPlugin.prototype.setButtonInnerText = function setButtonInnerText(text) {
249
- this._qualityButton.menuButton_.$('.vjs-icon-placeholder').innerHTML = text;
250
- };
251
-
252
- /**
253
- * Builds individual quality menu items.
254
- *
255
- * @param {Object} item - Individual quality menu item.
256
- * @return {ConcreteMenuItem} - Menu item
257
- */
258
-
259
- HlsQualitySelectorPlugin.prototype.getQualityMenuItem = function getQualityMenuItem(item) {
260
- var player = this.player;
261
- return new ConcreteMenuItem(player, item, this._qualityButton, this);
262
- };
263
-
264
- /**
265
- * Executed when a quality level is added from HLS playlist.
266
- */
267
-
268
- HlsQualitySelectorPlugin.prototype.onAddQualityLevel = function onAddQualityLevel() {
269
- var _this = this;
270
- var player = this.player;
271
- var qualityList = player.qualityLevels();
272
- var levels = qualityList.levels_ || [];
273
- var levelItems = [];
274
- var _loop = function _loop(i) {
275
- if (!levelItems.filter(function (_existingItem) {
276
- return _existingItem.item && _existingItem.item.value === levels[i].height;
277
- }).length) {
278
- var levelItem = _this.getQualityMenuItem.call(_this, {
279
- label: levels[i].height + 'p',
280
- value: levels[i].height
281
- });
282
- levelItems.push(levelItem);
283
- }
284
- };
285
- for (var i = 0; i < levels.length; ++i) {
286
- _loop(i);
287
- }
288
- levelItems.sort(function (current, next) {
289
- if ((typeof current === 'undefined' ? 'undefined' : _typeof(current)) !== 'object' || (typeof next === 'undefined' ? 'undefined' : _typeof(next)) !== 'object') {
290
- return -1;
291
- }
292
- if (current.item.value < next.item.value) {
293
- return -1;
294
- }
295
- if (current.item.value > next.item.value) {
296
- return 1;
297
- }
298
- return 0;
299
- });
300
- levelItems.push(this.getQualityMenuItem.call(this, {
301
- label: player.localize('Auto'),
302
- value: 'auto',
303
- selected: true
304
- }));
305
- if (this._qualityButton) {
306
- this._qualityButton.createItems = function () {
307
- return levelItems;
308
- };
309
- this._qualityButton.update();
310
- }
311
- };
312
-
313
- /**
314
- * Sets quality (based on media height)
315
- *
316
- * @param {number} height - A number representing HLS playlist.
317
- */
318
-
319
- HlsQualitySelectorPlugin.prototype.setQuality = function setQuality(height) {
320
- var qualityList = this.player.qualityLevels();
321
-
322
- // Set quality on plugin
323
- this._currentQuality = height;
324
- if (this.config.displayCurrentQuality) {
325
- this.setButtonInnerText(height === 'auto' ? height : height + 'p');
326
- }
327
- for (var i = 0; i < qualityList.length; ++i) {
328
- var quality = qualityList[i];
329
- quality.enabled = quality.height === height || height === 'auto';
330
- }
331
- this._qualityButton.unpressButton();
332
- };
333
-
334
- /**
335
- * Return the current set quality or 'auto'
336
- *
337
- * @return {string} the currently set quality
338
- */
339
-
340
- HlsQualitySelectorPlugin.prototype.getCurrentQuality = function getCurrentQuality() {
341
- return this._currentQuality || 'auto';
342
- };
343
- return HlsQualitySelectorPlugin;
344
- }();
345
-
346
- /**
347
- * Function to invoke when the player is ready.
348
- *
349
- * This is a great place for your plugin to initialize itself. When this
350
- * function is called, the player will have its DOM and child components
351
- * in place.
352
- *
353
- * @function onPlayerReady
354
- * @param {Player} player
355
- * A Video.js player object.
356
- *
357
- * @param {Object} [options={}]
358
- * A plain object containing options for the plugin.
359
- */
360
-
361
- var onPlayerReady = function onPlayerReady(player, options) {
362
- player.addClass('vjs-hls-quality-selector');
363
- player.hlsQualitySelector = new HlsQualitySelectorPlugin(player, options);
364
- };
365
-
366
- /**
367
- * A video.js plugin.
368
- *
369
- * In the plugin function, the value of `this` is a video.js `Player`
370
- * instance. You cannot rely on the player being in a "ready" state here,
371
- * depending on how the plugin is invoked. This may or may not be important
372
- * to you; if not, remove the wait for "ready"!
373
- *
374
- * @function hlsQualitySelector
375
- * @param {Object} [options={}]
376
- * An object of options left to the plugin author to define.
377
- */
378
- var hlsQualitySelector = function hlsQualitySelector(options) {
379
- var _this2 = this;
380
- this.ready(function () {
381
- onPlayerReady(_this2, videojs.mergeOptions(defaults, options));
382
- });
383
- };
384
-
385
- // Register the plugin with video.js.
386
- registerPlugin('hlsQualitySelector', hlsQualitySelector);
387
-
388
- // Include the version number.
389
- hlsQualitySelector.VERSION = version;
390
-
391
- export { hlsQualitySelector as default };
@@ -1,3 +0,0 @@
1
- var videojsWebrtcPlugin = "/*! @name @antmedia/videojs-webrtc-plugin @version 1.3.0 @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}";
2
-
3
- export { videojsWebrtcPlugin as default };
@@ -1,3 +0,0 @@
1
- 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}";
2
-
3
- export { videojsWebrtcPlugin as default };