@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.
- package/.github/workflows/publish-release.yml +20 -3
- package/dist/browser/web_player.js +4 -6
- package/dist/es/{plugin-ca799d0d.js → plugin-06260ef3.js} +133 -143
- package/dist/es/videojs-webrtc-plugin-f56e1f9e.js +3 -0
- package/dist/es/{videojs-webrtc-plugin.es-bd0b1a6d.js → videojs-webrtc-plugin.es-a1f9d342.js} +1555 -1674
- package/dist/es/web_player.js +6 -8
- package/dist/index.d.ts +17 -1
- package/dist/{plugin-84ab2cdd.js → plugin-1270024e.js} +133 -143
- package/dist/videojs-webrtc-plugin-77a9860b.js +5 -0
- package/dist/{videojs-webrtc-plugin.es-72234e77.js → videojs-webrtc-plugin.es-e643c42a.js} +1555 -1674
- package/dist/web_player.js +6 -8
- package/package.json +3 -5
- package/rollup.config.module.cjs +6 -2
- package/src/web_player.js +4 -6
- package/test/embedded-player.test.js +1 -1
- package/tsconfig.json +0 -1
- package/dist/aframe-master-42bb78a9.js +0 -7139
- package/dist/dash.all.min-84806d51.js +0 -36
- package/dist/es/aframe-master-a6146619.js +0 -7137
- package/dist/es/dash.all.min-4a2772b6.js +0 -34
- package/dist/es/inheritsLoose-91dc2acc.js +0 -15
- package/dist/es/video-js.min-8b4dfe88.js +0 -3
- package/dist/es/video.es-22056625.js +0 -31061
- package/dist/es/videojs-contrib-quality-levels.es-1ea32822.js +0 -276
- package/dist/es/videojs-contrib-quality-levels.es-5f5b5f23.js +0 -287
- package/dist/es/videojs-hls-quality-selector.es-3c54e1cd.js +0 -391
- package/dist/es/videojs-webrtc-plugin-327afa5e.js +0 -3
- package/dist/es/videojs-webrtc-plugin-b9e4da27.js +0 -3
- package/dist/es/videojs-webrtc-plugin.es-f41400f7.js +0 -7649
- package/dist/inheritsLoose-281376c7.js +0 -17
- package/dist/video-js.min-7e4ae47a.js +0 -5
- package/dist/video.es-72122d04.js +0 -31067
- package/dist/videojs-contrib-quality-levels.es-6c3be3eb.js +0 -278
- package/dist/videojs-contrib-quality-levels.es-ef3cec9e.js +0 -289
- package/dist/videojs-hls-quality-selector.es-562309df.js +0 -393
- package/dist/videojs-webrtc-plugin-bdf9fa8b.js +0 -5
- package/dist/videojs-webrtc-plugin-d30c3e7a.js +0 -5
- package/dist/videojs-webrtc-plugin.es-ac81d249.js +0 -7651
- package/visual.code-workspace +0 -11
|
@@ -10,23 +10,40 @@ jobs:
|
|
|
10
10
|
runs-on: ubuntu-latest
|
|
11
11
|
steps:
|
|
12
12
|
- uses: actions/checkout@v3
|
|
13
|
+
|
|
13
14
|
- uses: actions/setup-node@v3
|
|
14
15
|
with:
|
|
15
16
|
node-version: '16.x'
|
|
16
|
-
# Setup .npmrc file to publish to npm
|
|
17
17
|
registry-url: 'https://registry.npmjs.org'
|
|
18
|
+
|
|
18
19
|
- uses: actions/setup-java@v3
|
|
19
20
|
with:
|
|
20
21
|
java-version: '11'
|
|
21
22
|
distribution: 'adopt'
|
|
23
|
+
|
|
22
24
|
- name: Get the version
|
|
23
25
|
id: get_version
|
|
24
26
|
run: echo "VERSION=$(echo ${GITHUB_REF##*/} | cut -d v -f 2)" >> $GITHUB_OUTPUT
|
|
27
|
+
|
|
25
28
|
- run: npm install
|
|
29
|
+
|
|
26
30
|
- run: npm run compile
|
|
31
|
+
|
|
27
32
|
- run: npm test
|
|
28
|
-
|
|
33
|
+
|
|
29
34
|
- run: npm publish
|
|
30
35
|
env:
|
|
31
|
-
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}
|
|
36
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
37
|
+
|
|
38
|
+
- name: Update Embedded Player
|
|
39
|
+
if: success()
|
|
40
|
+
run: |
|
|
41
|
+
curl -L \
|
|
42
|
+
-X POST \
|
|
43
|
+
-H "Accept: application/vnd.github.v3+json" \
|
|
44
|
+
-H "Authorization: Bearer ${{ secrets.REPO_COMMUNICATION }}" \
|
|
45
|
+
https://api.github.com/repos/ant-media/StreamApp/actions/workflows/update-embedded-player.yml/dispatches \
|
|
46
|
+
-d '{"ref":"master"}'
|
|
47
|
+
|
|
48
|
+
|
|
32
49
|
|
|
@@ -447,9 +447,7 @@
|
|
|
447
447
|
window.videojs = videojs.default;
|
|
448
448
|
this.videojsLoaded = true;
|
|
449
449
|
}).then(() => {
|
|
450
|
-
return import('videojs-
|
|
451
|
-
}).then(() => {
|
|
452
|
-
return import('videojs-hls-quality-selector');
|
|
450
|
+
return import('videojs-quality-selector-hls');
|
|
453
451
|
}).then(() => {
|
|
454
452
|
return this.loadWebRTCComponents();
|
|
455
453
|
});
|
|
@@ -512,7 +510,7 @@
|
|
|
512
510
|
this.videojsPlayer.pause();
|
|
513
511
|
setTimeout(() => {
|
|
514
512
|
this.videojsPlayer.play();
|
|
515
|
-
},
|
|
513
|
+
}, 2000);
|
|
516
514
|
}
|
|
517
515
|
}
|
|
518
516
|
|
|
@@ -639,8 +637,8 @@
|
|
|
639
637
|
};
|
|
640
638
|
this.videojsPlayer.ready(() => {
|
|
641
639
|
// If it's already added to player, no need to add again
|
|
642
|
-
if (typeof this.videojsPlayer.
|
|
643
|
-
this.videojsPlayer.
|
|
640
|
+
if (typeof this.videojsPlayer.qualitySelectorHls === "function") {
|
|
641
|
+
this.videojsPlayer.qualitySelectorHls({
|
|
644
642
|
displayCurrentQuality: true
|
|
645
643
|
});
|
|
646
644
|
}
|
|
@@ -1,151 +1,128 @@
|
|
|
1
|
-
import { _ as _inheritsLoose } from './inheritsLoose-91dc2acc.js';
|
|
2
1
|
import { v as videojs } from './video.es-0951ae41.js';
|
|
3
2
|
import './_commonjsHelpers-7d1333e8.js';
|
|
4
3
|
|
|
5
|
-
var version = "
|
|
4
|
+
var version = "1.1.1";
|
|
6
5
|
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
6
|
+
var VideoJsButtonClass = videojs.getComponent('MenuButton');
|
|
7
|
+
var VideoJsMenuClass = videojs.getComponent('Menu');
|
|
8
|
+
var VideoJsComponent = videojs.getComponent('Component');
|
|
10
9
|
var Dom = videojs.dom;
|
|
11
|
-
|
|
12
10
|
/**
|
|
13
11
|
* Convert string to title case.
|
|
14
12
|
*
|
|
15
13
|
* @param {string} string - the string to convert
|
|
16
14
|
* @return {string} the returned titlecase string
|
|
17
15
|
*/
|
|
16
|
+
|
|
18
17
|
function toTitleCase(string) {
|
|
19
18
|
if (typeof string !== 'string') {
|
|
20
19
|
return string;
|
|
21
20
|
}
|
|
22
21
|
return string.charAt(0).toUpperCase() + string.slice(1);
|
|
23
22
|
}
|
|
24
|
-
|
|
25
23
|
/**
|
|
26
|
-
*
|
|
24
|
+
* Convert string to title case.
|
|
25
|
+
*
|
|
26
|
+
* @param {Player} player - the string to convert
|
|
27
|
+
* @return {MenuButton} the returned titlecase string
|
|
27
28
|
*/
|
|
28
|
-
var ConcreteButton = /*#__PURE__*/function (_MenuButton) {
|
|
29
|
-
_inheritsLoose(ConcreteButton, _MenuButton);
|
|
30
|
-
/**
|
|
31
|
-
* Button constructor.
|
|
32
|
-
*
|
|
33
|
-
* @param {Player} player - videojs player instance
|
|
34
|
-
*/
|
|
35
|
-
function ConcreteButton(player) {
|
|
36
|
-
return _MenuButton.call(this, player, {
|
|
37
|
-
title: player.localize('Quality'),
|
|
38
|
-
name: 'QualityButton'
|
|
39
|
-
}) || this;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Creates button items.
|
|
44
|
-
*
|
|
45
|
-
* @return {Array} - Button items
|
|
46
|
-
*/
|
|
47
|
-
var _proto = ConcreteButton.prototype;
|
|
48
|
-
_proto.createItems = function createItems() {
|
|
49
|
-
return [];
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Create the menu and add all items to it.
|
|
54
|
-
*
|
|
55
|
-
* @return {Menu}
|
|
56
|
-
* The constructed menu
|
|
57
|
-
*/;
|
|
58
|
-
_proto.createMenu = function createMenu() {
|
|
59
|
-
var menu = new Menu(this.player_, {
|
|
60
|
-
menuButton: this
|
|
61
|
-
});
|
|
62
|
-
this.hideThreshold_ = 0;
|
|
63
29
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
30
|
+
function ConcreteButton(player) {
|
|
31
|
+
var _this = this;
|
|
32
|
+
var ConcreteButtonInit = new VideoJsButtonClass(player, {
|
|
33
|
+
title: player.localize('Quality'),
|
|
34
|
+
name: 'QualityButton',
|
|
35
|
+
createItems: function createItems() {
|
|
36
|
+
return [];
|
|
37
|
+
},
|
|
38
|
+
createMenu: function createMenu() {
|
|
39
|
+
var menu = new VideoJsMenuClass(_this.player_, {
|
|
40
|
+
menuButton: _this
|
|
70
41
|
});
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
42
|
+
_this.hideThreshold_ = 0; // Add a title list item to the top
|
|
43
|
+
|
|
44
|
+
if (_this.options_.title) {
|
|
45
|
+
var titleEl = Dom.createEl('li', {
|
|
46
|
+
className: 'vjs-menu-title',
|
|
47
|
+
innerHTML: toTitleCase(_this.options_.title),
|
|
48
|
+
tabIndex: -1
|
|
49
|
+
});
|
|
50
|
+
var titleComponent = new VideoJsComponent(_this.player_, {
|
|
51
|
+
el: titleEl
|
|
52
|
+
});
|
|
53
|
+
_this.hideThreshold_ += 1;
|
|
54
|
+
menu.addItem(titleComponent);
|
|
55
|
+
}
|
|
56
|
+
_this.items = _this.createItems();
|
|
57
|
+
if (_this.items) {
|
|
58
|
+
// Add menu items to the menu
|
|
59
|
+
for (var i = 0; i < _this.items.length; i++) {
|
|
60
|
+
menu.addItem(_this.items[i]);
|
|
61
|
+
}
|
|
82
62
|
}
|
|
63
|
+
return menu;
|
|
83
64
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}(MenuButton);
|
|
65
|
+
});
|
|
66
|
+
return ConcreteButtonInit;
|
|
67
|
+
}
|
|
88
68
|
|
|
89
|
-
// Concrete classes
|
|
90
69
|
var VideoJsMenuItemClass = videojs.getComponent('MenuItem');
|
|
91
|
-
|
|
92
70
|
/**
|
|
93
|
-
*
|
|
71
|
+
* Create a QualitySelectorHls plugin instance.
|
|
72
|
+
*
|
|
73
|
+
* @param {player} player
|
|
74
|
+
* A Video.js Player instance.
|
|
75
|
+
*
|
|
76
|
+
* @param {item} [item]
|
|
77
|
+
* The Item Quality Item
|
|
78
|
+
*
|
|
79
|
+
* @param {qualityButton} [qualityButton]
|
|
80
|
+
* ConcreteButton
|
|
81
|
+
*
|
|
82
|
+
* @param {plugin} plugin
|
|
83
|
+
* Plugin
|
|
84
|
+
*
|
|
85
|
+
* @return {MenuItem} MenuItem
|
|
86
|
+
* VideoJS Menu Item Class
|
|
94
87
|
*/
|
|
95
|
-
var ConcreteMenuItem = /*#__PURE__*/function (_VideoJsMenuItemClass) {
|
|
96
|
-
_inheritsLoose(ConcreteMenuItem, _VideoJsMenuItemClass);
|
|
97
|
-
/**
|
|
98
|
-
* Menu item constructor.
|
|
99
|
-
*
|
|
100
|
-
* @param {Player} player - vjs player
|
|
101
|
-
* @param {Object} item - Item object
|
|
102
|
-
* @param {ConcreteButton} qualityButton - The containing button.
|
|
103
|
-
* @param {HlsQualitySelector} plugin - This plugin instance.
|
|
104
|
-
*/
|
|
105
|
-
function ConcreteMenuItem(player, item, qualityButton, plugin) {
|
|
106
|
-
var _this;
|
|
107
|
-
_this = _VideoJsMenuItemClass.call(this, player, {
|
|
108
|
-
label: item.label,
|
|
109
|
-
selectable: true,
|
|
110
|
-
selected: item.selected || false
|
|
111
|
-
}) || this;
|
|
112
|
-
_this.item = item;
|
|
113
|
-
_this.qualityButton = qualityButton;
|
|
114
|
-
_this.plugin = plugin;
|
|
115
|
-
return _this;
|
|
116
|
-
}
|
|
117
88
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
89
|
+
function ConcreteMenuItem(player, item, qualityButton, plugin) {
|
|
90
|
+
var ConcreteMenuItemInit = new VideoJsMenuItemClass(player, {
|
|
91
|
+
label: item.label,
|
|
92
|
+
selectable: true,
|
|
93
|
+
selected: item.selected || false
|
|
94
|
+
});
|
|
95
|
+
ConcreteMenuItemInit.item = item;
|
|
96
|
+
ConcreteMenuItemInit.qualityButton = qualityButton;
|
|
97
|
+
ConcreteMenuItemInit.plugin = plugin;
|
|
98
|
+
ConcreteMenuItemInit.handleClick = function () {
|
|
123
99
|
// Reset other menu items selected status.
|
|
124
100
|
for (var i = 0; i < this.qualityButton.items.length; ++i) {
|
|
125
101
|
this.qualityButton.items[i].selected(false);
|
|
126
|
-
}
|
|
102
|
+
} // Set this menu item to selected, and set quality.
|
|
127
103
|
|
|
128
|
-
// Set this menu item to selected, and set quality.
|
|
129
104
|
this.plugin.setQuality(this.item.value);
|
|
130
105
|
this.selected(true);
|
|
131
106
|
};
|
|
132
|
-
return
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
var Plugin = videojs.getPlugin('plugin');
|
|
107
|
+
return ConcreteMenuItemInit;
|
|
108
|
+
}
|
|
136
109
|
|
|
137
110
|
// Default options for the plugin.
|
|
138
|
-
var defaults = {};
|
|
139
111
|
|
|
112
|
+
var defaults = {
|
|
113
|
+
vjsIconClass: 'vjs-icon-hd',
|
|
114
|
+
displayCurrentQuality: false,
|
|
115
|
+
placementIndex: 0
|
|
116
|
+
};
|
|
140
117
|
/**
|
|
141
118
|
* An advanced Video.js plugin. For more information on the API
|
|
142
119
|
*
|
|
143
120
|
* See: https://blog.videojs.com/feature-spotlight-advanced-plugins/
|
|
144
121
|
*/
|
|
145
|
-
|
|
146
|
-
|
|
122
|
+
|
|
123
|
+
var QualitySelectorHlsClass = /*#__PURE__*/function () {
|
|
147
124
|
/**
|
|
148
|
-
* Create a
|
|
125
|
+
* Create a QualitySelectorHls plugin instance.
|
|
149
126
|
*
|
|
150
127
|
* @param {Player} player
|
|
151
128
|
* A Video.js Player instance.
|
|
@@ -157,31 +134,39 @@ var HlsQualitySelector = /*#__PURE__*/function (_Plugin) {
|
|
|
157
134
|
* second argument of options is a convenient way to accept inputs
|
|
158
135
|
* from your plugin's caller.
|
|
159
136
|
*/
|
|
160
|
-
function
|
|
161
|
-
var _this;
|
|
137
|
+
function QualitySelectorHlsClass(player, options) {
|
|
138
|
+
var _this = this;
|
|
139
|
+
|
|
162
140
|
// the parent class will add player under this.player
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
141
|
+
this.player = player;
|
|
142
|
+
this.config = videojs.obj.merge(defaults, options);
|
|
143
|
+
player.ready(function () {
|
|
144
|
+
_this.player.addClass('vjs-quality-selector-hls');
|
|
167
145
|
if (_this.player.qualityLevels) {
|
|
168
|
-
_this.player.addClass('vjs-hls-quality-selector');
|
|
169
146
|
// Create the quality button.
|
|
170
147
|
_this.createQualityButton();
|
|
171
148
|
_this.bindPlayerEvents();
|
|
172
149
|
}
|
|
173
150
|
});
|
|
174
|
-
return _this;
|
|
175
151
|
}
|
|
152
|
+
/**
|
|
153
|
+
* Returns HLS Plugin
|
|
154
|
+
*
|
|
155
|
+
* @return {*} - videojs-hls-contrib plugin.
|
|
156
|
+
*/
|
|
176
157
|
|
|
158
|
+
var _proto = QualitySelectorHlsClass.prototype;
|
|
159
|
+
_proto.getHls = function getHls() {
|
|
160
|
+
return this.player.tech({
|
|
161
|
+
IWillNotUseThisInPlugins: true
|
|
162
|
+
}).hls;
|
|
163
|
+
}
|
|
177
164
|
/**
|
|
178
165
|
* Binds listener for quality level changes.
|
|
179
|
-
|
|
180
|
-
var _proto = HlsQualitySelector.prototype;
|
|
166
|
+
*/;
|
|
181
167
|
_proto.bindPlayerEvents = function bindPlayerEvents() {
|
|
182
168
|
this.player.qualityLevels().on('addqualitylevel', this.onAddQualityLevel.bind(this));
|
|
183
169
|
}
|
|
184
|
-
|
|
185
170
|
/**
|
|
186
171
|
* Adds the quality menu button to the player control bar.
|
|
187
172
|
*/;
|
|
@@ -191,26 +176,24 @@ var HlsQualitySelector = /*#__PURE__*/function (_Plugin) {
|
|
|
191
176
|
var placementIndex = player.controlBar.children().length - 2;
|
|
192
177
|
var concreteButtonInstance = player.controlBar.addChild(this._qualityButton, {
|
|
193
178
|
componentClass: 'qualitySelector'
|
|
194
|
-
}, this.
|
|
179
|
+
}, this.config.placementIndex || placementIndex);
|
|
195
180
|
concreteButtonInstance.addClass('vjs-quality-selector');
|
|
196
|
-
if (!this.
|
|
197
|
-
var icon = " " + (this.
|
|
181
|
+
if (!this.config.displayCurrentQuality) {
|
|
182
|
+
var icon = " " + (this.config.vjsIconClass || 'vjs-icon-hd');
|
|
198
183
|
concreteButtonInstance.menuButton_.$('.vjs-icon-placeholder').className += icon;
|
|
199
184
|
} else {
|
|
200
|
-
this.setButtonInnerText(
|
|
185
|
+
this.setButtonInnerText('auto');
|
|
201
186
|
}
|
|
202
187
|
concreteButtonInstance.removeClass('vjs-hidden');
|
|
203
188
|
}
|
|
204
|
-
|
|
205
189
|
/**
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
190
|
+
*Set inner button text.
|
|
191
|
+
*
|
|
192
|
+
* @param {string} text - the text to display in the button.
|
|
193
|
+
*/;
|
|
210
194
|
_proto.setButtonInnerText = function setButtonInnerText(text) {
|
|
211
195
|
this._qualityButton.menuButton_.$('.vjs-icon-placeholder').innerHTML = text;
|
|
212
196
|
}
|
|
213
|
-
|
|
214
197
|
/**
|
|
215
198
|
* Builds individual quality menu items.
|
|
216
199
|
*
|
|
@@ -219,9 +202,8 @@ var HlsQualitySelector = /*#__PURE__*/function (_Plugin) {
|
|
|
219
202
|
*/;
|
|
220
203
|
_proto.getQualityMenuItem = function getQualityMenuItem(item) {
|
|
221
204
|
var player = this.player;
|
|
222
|
-
return
|
|
205
|
+
return ConcreteMenuItem(player, item, this._qualityButton, this);
|
|
223
206
|
}
|
|
224
|
-
|
|
225
207
|
/**
|
|
226
208
|
* Executed when a quality level is added from HLS playlist.
|
|
227
209
|
*/;
|
|
@@ -231,13 +213,13 @@ var HlsQualitySelector = /*#__PURE__*/function (_Plugin) {
|
|
|
231
213
|
var qualityList = player.qualityLevels();
|
|
232
214
|
var levels = qualityList.levels_ || [];
|
|
233
215
|
var levelItems = [];
|
|
234
|
-
var _loop = function _loop() {
|
|
216
|
+
var _loop = function _loop(i) {
|
|
235
217
|
var _levels$i = levels[i],
|
|
236
218
|
width = _levels$i.width,
|
|
237
219
|
height = _levels$i.height;
|
|
238
220
|
var pixels = width > height ? height : width;
|
|
239
221
|
if (!pixels) {
|
|
240
|
-
return
|
|
222
|
+
return "continue";
|
|
241
223
|
}
|
|
242
224
|
if (!levelItems.filter(function (_existingItem) {
|
|
243
225
|
return _existingItem.item && _existingItem.item.value === pixels;
|
|
@@ -250,7 +232,8 @@ var HlsQualitySelector = /*#__PURE__*/function (_Plugin) {
|
|
|
250
232
|
}
|
|
251
233
|
};
|
|
252
234
|
for (var i = 0; i < levels.length; ++i) {
|
|
253
|
-
|
|
235
|
+
var _ret = _loop(i);
|
|
236
|
+
if (_ret === "continue") continue;
|
|
254
237
|
}
|
|
255
238
|
levelItems.sort(function (current, next) {
|
|
256
239
|
if (typeof current !== 'object' || typeof next !== 'object') {
|
|
@@ -265,7 +248,7 @@ var HlsQualitySelector = /*#__PURE__*/function (_Plugin) {
|
|
|
265
248
|
return 0;
|
|
266
249
|
});
|
|
267
250
|
levelItems.push(this.getQualityMenuItem.call(this, {
|
|
268
|
-
label:
|
|
251
|
+
label: player.localize('Auto'),
|
|
269
252
|
value: 'auto',
|
|
270
253
|
selected: true
|
|
271
254
|
}));
|
|
@@ -276,19 +259,17 @@ var HlsQualitySelector = /*#__PURE__*/function (_Plugin) {
|
|
|
276
259
|
this._qualityButton.update();
|
|
277
260
|
}
|
|
278
261
|
}
|
|
279
|
-
|
|
280
262
|
/**
|
|
281
263
|
* Sets quality (based on media short side)
|
|
282
264
|
*
|
|
283
265
|
* @param {number} quality - A number representing HLS playlist.
|
|
284
266
|
*/;
|
|
285
267
|
_proto.setQuality = function setQuality(quality) {
|
|
286
|
-
var qualityList = this.player.qualityLevels();
|
|
268
|
+
var qualityList = this.player.qualityLevels(); // Set quality on plugin
|
|
287
269
|
|
|
288
|
-
// Set quality on plugin
|
|
289
270
|
this._currentQuality = quality;
|
|
290
|
-
if (this.
|
|
291
|
-
this.setButtonInnerText(quality === 'auto' ?
|
|
271
|
+
if (this.config.displayCurrentQuality) {
|
|
272
|
+
this.setButtonInnerText(quality === 'auto' ? quality : quality + "p");
|
|
292
273
|
}
|
|
293
274
|
for (var i = 0; i < qualityList.length; ++i) {
|
|
294
275
|
var _qualityList$i = qualityList[i],
|
|
@@ -299,7 +280,6 @@ var HlsQualitySelector = /*#__PURE__*/function (_Plugin) {
|
|
|
299
280
|
}
|
|
300
281
|
this._qualityButton.unpressButton();
|
|
301
282
|
}
|
|
302
|
-
|
|
303
283
|
/**
|
|
304
284
|
* Return the current set quality or 'auto'
|
|
305
285
|
*
|
|
@@ -308,11 +288,21 @@ var HlsQualitySelector = /*#__PURE__*/function (_Plugin) {
|
|
|
308
288
|
_proto.getCurrentQuality = function getCurrentQuality() {
|
|
309
289
|
return this._currentQuality || 'auto';
|
|
310
290
|
};
|
|
311
|
-
return
|
|
312
|
-
}(
|
|
313
|
-
|
|
291
|
+
return QualitySelectorHlsClass;
|
|
292
|
+
}();
|
|
293
|
+
var initPlugin = function initPlugin(player, options) {
|
|
294
|
+
var QualitySelectorHls = new QualitySelectorHlsClass(player, options);
|
|
295
|
+
player.QualitySelectorHlsVjs = true; // Define default values for the plugin's `state` object here.
|
|
296
|
+
|
|
297
|
+
QualitySelectorHls.defaultState = {}; // Include the version number.
|
|
298
|
+
|
|
299
|
+
QualitySelectorHls.VERSION = version;
|
|
300
|
+
return QualitySelectorHls;
|
|
301
|
+
};
|
|
302
|
+
var QualitySelectorHls = function QualitySelectorHls(options) {
|
|
303
|
+
return initPlugin(this, videojs.obj.merge({}, options));
|
|
304
|
+
}; // Register the plugin with video.js.
|
|
314
305
|
|
|
315
|
-
|
|
316
|
-
videojs.registerPlugin('hlsQualitySelector', HlsQualitySelector);
|
|
306
|
+
videojs.registerPlugin('qualitySelectorHls', QualitySelectorHls);
|
|
317
307
|
|
|
318
|
-
export {
|
|
308
|
+
export { QualitySelectorHls as default };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var videojsWebrtcPlugin = "/*! @name @antmedia/videojs-webrtc-plugin @version 1.3.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;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 };
|