@viewlift/player-backup 1.0.4-lighteningjs → 1.0.4

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 (130) hide show
  1. package/cjs/autoNextVideo-823821e8.js +1 -0
  2. package/cjs/bundle.css +657 -0
  3. package/cjs/caption-settings-67212c17.js +1 -0
  4. package/cjs/caption-settings-d42c056e.js +1 -0
  5. package/cjs/debugSelection-cbfdabb7.js +1 -0
  6. package/cjs/dvr_skin-f7f770ae.js +1 -0
  7. package/cjs/error-26d5a3c3.js +1 -0
  8. package/cjs/features-dfe03404.js +1 -0
  9. package/cjs/generic-8b99b151.js +1 -0
  10. package/cjs/icons-7afb9c13.js +1 -0
  11. package/cjs/index-1f8b5f12.js +1 -0
  12. package/cjs/index-2b74e462.js +1 -0
  13. package/cjs/index.js +1 -0
  14. package/cjs/keyboardShortcuts-cfd998c2.js +1 -0
  15. package/cjs/loader-393b838a.js +1 -0
  16. package/cjs/multicam-21c9a90b.js +1 -0
  17. package/cjs/multicam-a41fe4a6.js +1 -0
  18. package/cjs/multicamv2-76d8530b.js +1 -0
  19. package/cjs/multicamv2-c148fa24.js +1 -0
  20. package/cjs/mwebPotrait-3c11d7cf.js +1 -0
  21. package/cjs/mwebPotraitTray-b9d5d45a.js +1 -0
  22. package/cjs/nextEpisodeButton-300afadc.js +1 -0
  23. package/cjs/nextEpisodeButton-b6e6586f.js +1 -0
  24. package/cjs/nondvr_skin-ef2cb3b2.js +1 -0
  25. package/cjs/playlist-925f808b.js +1 -0
  26. package/cjs/playlist-df87ca90.js +1 -0
  27. package/cjs/renditions-bc841552.js +1 -0
  28. package/cjs/resolution-6a9adf54.js +1 -0
  29. package/cjs/series-82ec79d3.js +1 -0
  30. package/cjs/series-9c237975.js +1 -0
  31. package/cjs/series-v2-70137d8c.js +1 -0
  32. package/cjs/series-v2-7f4e41fd.js +1 -0
  33. package/cjs/settings-icon-a63f46fc.js +1 -0
  34. package/cjs/settings-icon-e6a8feee.js +1 -0
  35. package/cjs/skin-1eb7077c.js +1 -0
  36. package/cjs/skin-225252ff.js +1 -0
  37. package/cjs/skin-786d5e26.js +1 -0
  38. package/cjs/skin-84083352.js +1 -0
  39. package/cjs/skin-983a2ea7.js +1 -0
  40. package/cjs/skin-a01e3768.js +1 -0
  41. package/cjs/skin-afbec6d7.js +1 -0
  42. package/cjs/skin-c0b074fe.js +1 -0
  43. package/cjs/skin-e06fd04c.js +1 -0
  44. package/cjs/skin-f225a42e.js +1 -0
  45. package/cjs/util-fa21734a.js +1 -0
  46. package/cjs/videoSelector-4a02b437.js +1 -0
  47. package/cjs/videoSelector-fcdf11eb.js +1 -0
  48. package/esm/autoNextVideo-4aee2ee0.js +1 -0
  49. package/esm/bundle.css +657 -0
  50. package/esm/caption-settings-2e47813b.js +1 -0
  51. package/esm/caption-settings-f0f1945a.js +1 -0
  52. package/esm/debugSelection-2601b8b3.js +1 -0
  53. package/esm/dvr_skin-9cc1b144.js +1 -0
  54. package/esm/error-2395864b.js +1 -0
  55. package/esm/features-ba25c46d.js +1 -0
  56. package/esm/generic-6b0be7a7.js +1 -0
  57. package/esm/icons-c18c70b7.js +1 -0
  58. package/esm/index-57452e02.js +1 -0
  59. package/esm/index-c5a34630.js +1 -0
  60. package/esm/index.js +1 -0
  61. package/esm/keyboardShortcuts-5ecdd493.js +1 -0
  62. package/esm/loader-580278fe.js +1 -0
  63. package/esm/multicam-36c57c1e.js +1 -0
  64. package/esm/multicam-de741974.js +1 -0
  65. package/esm/multicamv2-8f58aca8.js +1 -0
  66. package/esm/multicamv2-d006cffa.js +1 -0
  67. package/esm/mwebPotrait-3c1805d8.js +1 -0
  68. package/esm/mwebPotraitTray-2229862a.js +1 -0
  69. package/esm/nextEpisodeButton-5f3b245a.js +1 -0
  70. package/esm/nextEpisodeButton-a1556cdf.js +1 -0
  71. package/esm/nondvr_skin-64be70e5.js +1 -0
  72. package/esm/playlist-75d710d0.js +1 -0
  73. package/esm/playlist-7ecf432a.js +1 -0
  74. package/esm/renditions-ddb320bd.js +1 -0
  75. package/esm/resolution-06ae4756.js +1 -0
  76. package/esm/series-041152aa.js +1 -0
  77. package/esm/series-9f68ec00.js +1 -0
  78. package/esm/series-v2-0727ee8c.js +1 -0
  79. package/esm/series-v2-72198a6e.js +1 -0
  80. package/esm/settings-icon-0125bffd.js +1 -0
  81. package/esm/settings-icon-52517438.js +1 -0
  82. package/esm/skin-0bb6f716.js +1 -0
  83. package/esm/skin-2c638dc1.js +1 -0
  84. package/esm/skin-31221b73.js +1 -0
  85. package/esm/skin-665ec17e.js +1 -0
  86. package/esm/skin-93e320fc.js +1 -0
  87. package/esm/skin-c16bc29b.js +1 -0
  88. package/esm/skin-cd537931.js +1 -0
  89. package/esm/skin-d5510f70.js +1 -0
  90. package/esm/skin-d66cd4fd.js +1 -0
  91. package/esm/skin-d6a8f25f.js +1 -0
  92. package/esm/util-f62bec40.js +1 -0
  93. package/esm/videoSelector-2689b3b6.js +1 -0
  94. package/esm/videoSelector-8e258d45.js +1 -0
  95. package/package.json +15 -33
  96. package/.babelrc +0 -8
  97. package/README.md +0 -29
  98. package/babel.config.json +0 -8
  99. package/dist/38afc79c94e0bcf0.png +0 -0
  100. package/dist/3bc8b7ff04e98d37.png +0 -0
  101. package/dist/522ea7c76ac4fd33.png +0 -0
  102. package/dist/a74cd46ed4277568.png +0 -0
  103. package/dist/b739faec1fde1346.png +0 -0
  104. package/dist/bundle.css +0 -2
  105. package/dist/bundle.css.map +0 -1
  106. package/dist/bundle.js +0 -38
  107. package/dist/bundle.js.map +0 -1
  108. package/dist/ed3d0a4d9de91460.png +0 -0
  109. package/index.html +0 -49
  110. package/jsconfig.json +0 -9
  111. package/rollup.config.mjs +0 -39
  112. package/src/ads-manager/ads-manager.js +0 -120
  113. package/src/assets/checkIcon.png +0 -0
  114. package/src/assets/pauseIcon.png +0 -0
  115. package/src/assets/pauseIconFocus.png +0 -0
  116. package/src/assets/playIcon.png +0 -0
  117. package/src/assets/playIconFocus.png +0 -0
  118. package/src/assets/settingsIcon.png +0 -0
  119. package/src/index.js +0 -13
  120. package/src/player-components/player-buttons/playerButtons.js +0 -106
  121. package/src/player-components/player-seekbar/playerSeekbar.js +0 -223
  122. package/src/player-components/player-setting-option-wrapper/player-setting-option-one-wrapper.js +0 -82
  123. package/src/player-components/player-setting-option-wrapper/player-setting-option-two-wrapper.js +0 -84
  124. package/src/player-components/player-sidebar/player-sidebar.js +0 -188
  125. package/src/player-components/player-title/playerTitle.js +0 -56
  126. package/src/player-ui/player-ui.js +0 -564
  127. package/src/playerControls/playerControls.css +0 -10
  128. package/src/playerControls/playerControls.js +0 -501
  129. package/src/styles/index.css +0 -204
  130. package/src/utilities/utilities.js +0 -79
@@ -1,501 +0,0 @@
1
- import { Button } from '../player-components/player-buttons/playerButtons.js';
2
- import { PlayerSeekbar } from '../player-components/player-seekbar/playerSeekbar.js';
3
- import { TextContent } from '../player-components/player-title/playerTitle.js';
4
- import { Sidebar } from '../player-components/player-sidebar/player-sidebar.js';
5
- import playIcon from '../assets/playIcon.png';
6
- import pauseIcon from '../assets/pauseIcon.png';
7
- import playIconFocus from '../assets/playIconFocus.png';
8
- import pauseIconFocus from '../assets/pauseIconFocus.png';
9
- import settingsIcon from '../assets/settingsIcon.png';
10
- import './playerControls.css';
11
- class PlayerControls {
12
- constructor(entitlementResponse) {
13
- this.container = document.createElement('div');
14
- this.container.id = 'playerControlsContainer';
15
- this.container.className = 'video-player-ui';
16
- this.rightSideContainer = document.createElement('div');
17
- this.rightSideContainer.className = 'right-side-container';
18
- this.leftSideContainer = document.createElement('div');
19
- this.leftSideContainer.className = 'left-side-container';
20
- this.container.appendChild(this.rightSideContainer);
21
- this.container.appendChild(this.leftSideContainer);
22
- this.createControls();
23
- }
24
-
25
- createControls() {
26
- this.createPlayPauseBtn();
27
- this.createSeekbar();
28
- this.createSettingsBtn();
29
- this.createRestartVideoBtn();
30
- this.createTextContent();
31
- this.addEventListeners();
32
-
33
- // Attach the video element
34
- this.container.appendChild(this.player.video);
35
- }
36
-
37
- createPlayPauseBtn() {
38
- this.playPauseBtn = new Button({
39
- imgSrc: playIconFocus,
40
- imgAltText: 'Play/Pause',
41
- buttonText: 'Play',
42
- width: 70,
43
- height: 70,
44
- klassname: 'play-pause-btn',
45
- focused: false,
46
- disabled: false,
47
- handleClick: () => {
48
- if (this.player.video.paused) {
49
- this.player.play();
50
- if (this.playPauseBtn && this.playPauseBtn.buttonElement && this.playPauseBtn.buttonElement.querySelector('img')) {
51
- this.playPauseBtn.buttonElement.querySelector('img').setAttribute('src', pauseIconFocus);
52
- } else if (this.playPauseBtn && this.playPauseBtn.buttonElement) {
53
- this.playPauseBtn.buttonElement.textContent = 'Pause';
54
- }
55
- } else {
56
- this.player.pause();
57
- if (this.playPauseBtn && this.playPauseBtn.buttonElement) {
58
- this.playPauseBtn.buttonElement.querySelector('img').setAttribute('src', playIconFocus);
59
- } else if (this.playPauseBtn && this.playPauseBtn.buttonElement) {
60
- this.playPauseBtn.buttonElement.textContent = 'Play';
61
- }
62
- }
63
- }
64
- });
65
- this.playPauseBtn.mount(this.container);
66
-
67
- requestAnimationFrame(() => {
68
- if (this.playPauseBtn) this.playPauseBtn.focus();
69
- });
70
-
71
- this.createPlayPauseBtnEventListeners();
72
- }
73
-
74
- createPlayPauseBtnEventListeners() {
75
- if (!this.playPauseBtn || !this.playPauseBtn.buttonElement) return;
76
-
77
- this.playPauseBtn.buttonElement.addEventListener('focus', () => {
78
- if (this.playPauseBtn && this.playPauseBtn.buttonElement && this.playPauseBtn.buttonElement.querySelector('img')) {
79
- const iconSrc = this.player.video.paused ? playIconFocus : pauseIconFocus;
80
- this.playPauseBtn.buttonElement.querySelector('img').setAttribute('src', iconSrc);
81
- this.playPauseBtn.buttonElement.style.backgroundColor = 'rgba(255, 255, 255)';
82
- }
83
- });
84
-
85
- this.playPauseBtn.buttonElement.addEventListener('blur', () => {
86
- if (this.playPauseBtn && this.playPauseBtn.buttonElement && this.playPauseBtn.buttonElement.querySelector('img')) {
87
- const iconSrc = this.player.video.paused ? playIcon : pauseIcon;
88
- this.playPauseBtn.buttonElement.querySelector('img').setAttribute('src', iconSrc);
89
- this.playPauseBtn.buttonElement.style.backgroundColor = 'rgba(255, 255, 255, 0.5)';
90
- }
91
- });
92
- }
93
-
94
- updatePlayPauseButton() {
95
- if (this.playPauseBtn && this.playPauseBtn.buttonElement && this.seekbar.focused) {
96
- const iconSrc = this.player.video.paused ? playIcon : pauseIcon;
97
- this.playPauseBtn.buttonElement.querySelector('img').setAttribute('src', iconSrc);
98
- }
99
- }
100
-
101
- createSeekbar() {
102
- if (!this.player.video) return;
103
-
104
- this.seekbar = new PlayerSeekbar(this.player.video);
105
- this.seekbar.mount(this.container);
106
-
107
- this.player.video.addEventListener('play', () => this.updatePlayPauseButton());
108
- this.player.video.addEventListener('pause', () => this.updatePlayPauseButton());
109
- }
110
-
111
- addEventListeners() {
112
- if (!this.playPauseBtn || !this.playPauseBtn.buttonElement) return;
113
-
114
- this.playPauseBtn.buttonElement.addEventListener('keydown', (e) => {
115
- if (e.key === 'ArrowDown') {
116
- e.preventDefault();
117
- e.stopPropagation();
118
-
119
- if (this.settingsBtn) this.settingsBtn.focus();
120
- else if (this.restartVideoBtn) this.restartVideoBtn.focus();
121
- else if (this.seekbar) this.seekbar.focus();
122
- }
123
- });
124
-
125
- if (this.settingsBtn && this.settingsBtn.buttonElement) {
126
- this.settingsBtn.buttonElement.addEventListener('keydown', (e) => {
127
- if (e.key === 'ArrowDown') {
128
- e.preventDefault();
129
- e.stopPropagation();
130
- if (this.seekbar) this.seekbar.focus();
131
- } else if (e.key === 'ArrowUp') {
132
- e.preventDefault();
133
- e.stopPropagation();
134
- if (this.playPauseBtn) this.playPauseBtn.focus();
135
- } else if (e.key === 'ArrowRight') {
136
- e.preventDefault();
137
- e.stopPropagation();
138
- if (this.restartVideoBtn) this.restartVideoBtn.focus();
139
- }
140
- });
141
- }
142
-
143
- if (this.restartVideoBtn && this.restartVideoBtn.buttonElement) {
144
- this.restartVideoBtn.buttonElement.addEventListener('keydown', (e) => {
145
- if (e.key === 'ArrowDown') {
146
- e.preventDefault();
147
- e.stopPropagation();
148
- if (this.seekbar) this.seekbar.focus();
149
- } else if (e.key === 'ArrowUp') {
150
- e.preventDefault();
151
- e.stopPropagation();
152
- if (this.playPauseBtn) this.playPauseBtn.focus();
153
- } else if (e.key === 'ArrowLeft') {
154
- e.preventDefault();
155
- e.stopPropagation();
156
- if (this.settingsBtn) this.settingsBtn.focus();
157
- }
158
- });
159
- }
160
-
161
- const seekbarElement = this.seekbar.getElement && this.seekbar.getElement();
162
- if (seekbarElement) {
163
- seekbarElement.addEventListener('keydown', (e) => {
164
- if (e.key === 'ArrowUp') {
165
- e.preventDefault();
166
- e.stopPropagation();
167
-
168
- if (this.settingsBtn) this.settingsBtn.focus();
169
- else if (this.restartVideoBtn) this.restartVideoBtn.focus();
170
- else if (this.playPauseBtn) this.playPauseBtn.focus();
171
- }
172
- });
173
- }
174
- }
175
-
176
- createSettingsBtn() {
177
- this.settingsBtn = new Button({
178
- imgSrc: settingsIcon,
179
- imgAltText: 'Settings',
180
- buttonText: 'Settings',
181
- width: 40,
182
- height: 40,
183
- klassname: 'settings-btn',
184
- focused: false,
185
- disabled: false,
186
- handleClick: () => {
187
- this.createSideBar();
188
- }
189
- });
190
- this.settingsBtn.mount(this.rightSideContainer);
191
- }
192
-
193
- createRestartVideoBtn() {
194
- this.restartVideoBtn = new Button({
195
- imgSrc: '',
196
- imgAltText: 'Start From Beginning',
197
- buttonText: 'Start From Beginning',
198
- width: 150,
199
- height: 35,
200
- klassname: 'restart-btn',
201
- focused: false,
202
- disabled: false,
203
- handleClick: () => {
204
- if (this.player.video) {
205
- this.player.video.currentTime = 0;
206
- }
207
- }
208
- });
209
- this.restartVideoBtn.mount(this.rightSideContainer);
210
- }
211
-
212
- createTextContent() {
213
- this.textContent = new TextContent({
214
- text: this.videoTitleConfig.text,
215
- fontSize: this.videoTitleConfig.fontSize,
216
- color: this.videoTitleConfig.color,
217
- fontWeight: this.videoTitleConfig.bold,
218
- });
219
- this.textContent.mount(this.leftSideContainer);
220
- }
221
-
222
- changePlayBackQuality(id) {
223
- this.selectedPlaybackQuality = id;
224
- let videoLevels = this.player.videoResolutions();
225
-
226
- if (!videoLevels || videoLevels.length === 0) {
227
- console.warn('No video resolutions available to change playback quality.');
228
- return;
229
- }
230
-
231
- if (id == "auto") {
232
- this.selectedVideoQuality = "auto";
233
- if (this.drmEnabled) {
234
-
235
- } else {
236
- this.player.playerInstance.currentLevel = -1;
237
- }
238
- } else {
239
- for (let i = 0; i < videoLevels?.length; i++) {
240
- if (videoLevels[i].height == id) {
241
- this.selectedVideoQuality = videoLevels[i].height;
242
- if (this.drmEnabled) {
243
- this.player.playerInstance.setQualityFor('video', i);
244
- } else {
245
- this.player.playerInstance.currentLevel = i;
246
- }
247
- break;
248
- }
249
- }
250
- }
251
- }
252
-
253
- changePlaybackCaptions(id) {
254
- let textTracks = this.player.captionsOptions();
255
-
256
- if (!textTracks || textTracks.length === 0) {
257
- console.warn('No text tracks available to change playback captions.');
258
- return;
259
- }
260
- const validTextTracksType = ['captions', 'subtitles', 'caption', 'subtitle'];
261
-
262
- for (let i = 0; i < textTracks.length; i++) {
263
- if(validTextTracksType.includes(textTracks[i].kind.toLowerCase())){
264
- if (textTracks[i].language === id) {
265
- this.selectedPlaybackCaption = id;
266
- textTracks[i].mode = 'showing';
267
- } else {
268
- textTracks[i].mode = 'disabled';
269
- }
270
- }
271
- }
272
- }
273
-
274
-
275
- changePlaybackAudio(id){
276
- let audioTracks = this.player.audioTracks();
277
-
278
- if (!audioTracks || audioTracks.length === 0) {
279
- console.warn('No audio tracks available to change playback audio.');
280
- return;
281
- }
282
-
283
- for (let i = 0; i < audioTracks.length; i++) {
284
- if (audioTracks[i].id == id || audioTracks[i].lang == id) {
285
- this.selectedAudioQuality = id;
286
- if(this.drmEnabled){
287
- this.player.playerInstance.setCurrentTrack(audioTracks[i]);
288
- } else{
289
- this.player.playerInstance.audioTrack = i;
290
- }
291
- break;
292
- }
293
- }
294
- }
295
-
296
- videoQualitySelector() {
297
- if (!this.mainSidebar) return;
298
-
299
- const resolutions = this.player.videoResolutions();
300
- const currentQuality = this.selectedVideoQuality;
301
-
302
- const items = [
303
- {
304
- text: 'Auto',
305
- id: 'auto',
306
- isSelected: currentQuality === 'auto',
307
- callback: () => {
308
- this.mainSidebar.currentFocusedOption.focus();
309
- this.sidebar.unmount();
310
- }
311
- },
312
- ...resolutions.map(resolution => ({
313
- text: `${resolution.height}p`,
314
- id: resolution.height,
315
- isSelected: currentQuality === resolution.height,
316
- callback: () => {
317
- this.mainSidebar.currentFocusedOption.focus();
318
- this.sidebar.unmount();
319
- }
320
- }))
321
- ];
322
-
323
-
324
- this.sidebar = new Sidebar({
325
- title: 'Video Quality',
326
- items: items,
327
- klassname: 'default-sidebar',
328
- lastFocusedElement: this.mainSidebar.currentFocusedOption,
329
- type: 'selection',
330
- focused: true,
331
- onselect: (data) => {
332
- this.changePlayBackQuality(data.id);
333
- },
334
- callback: () => {
335
- if (this.mainSidebar.sidebarElement) {
336
- this.mainSidebar.sidebarElement.style.visibility = 'visible';
337
- }
338
- }
339
- });
340
- this.sidebar.mount(this.container);
341
- }
342
-
343
- audioLanguageSelector() {
344
- if (!this.mainSidebar) return;
345
- const audioTracks = this.player.audioTracks();
346
- const currentAudioQuality = this.selectedAudioQuality;
347
-
348
- this.sidebar = new Sidebar({
349
- title: 'Audio Language',
350
- items: audioTracks.map((audio, idx) => ({
351
- id: audio.id || audio.lang,
352
- text: audio.name || audio.lang,
353
- isSelected: (audioTracks.length === 1) || (currentAudioQuality ? currentAudioQuality === audio.id : audio.default),
354
- callback: () => {
355
- this.mainSidebar.currentFocusedOption.focus();
356
- this.sidebar.unmount();
357
- }
358
- })),
359
- klassname: 'default-sidebar',
360
- lastFocusedElement: this.mainSidebar.currentFocusedOption,
361
- type: 'selection',
362
- focused: true,
363
- onselect: (data) => {
364
- this.changePlaybackAudio(data.id);
365
- },
366
- callback: () => {
367
- if (this.mainSidebar.sidebarElement) {
368
- this.mainSidebar.sidebarElement.style.visibility = 'visible';
369
- }
370
- }
371
- });
372
- this.sidebar.mount(this.container);
373
- }
374
-
375
- subtitlesSelector() {
376
- if (!this.mainSidebar) return;
377
-
378
- const captions = this.player.captionsOptions();
379
- const currentCaption = this.selectedPlaybackCaption;
380
-
381
-
382
- const items = [
383
- {
384
- id: 'off',
385
- text: 'Off',
386
- isSelected: currentCaption === 'off', // You can enhance this by checking if all tracks are disabled
387
- callback: () => {
388
- this.mainSidebar.currentFocusedOption.focus();
389
- this.sidebar.unmount();
390
- }
391
- },
392
- ...captions.map(subtitle => ({
393
- id: subtitle.language,
394
- text: subtitle.label,
395
- isSelected: currentCaption === subtitle.language || subtitle.mode === 'showing',
396
- callback: () => {
397
- this.mainSidebar.currentFocusedOption.focus();
398
- this.sidebar.unmount();
399
- }
400
- }))
401
- ];
402
-
403
-
404
- this.sidebar = new Sidebar({
405
- title: 'Subtitles',
406
- items: items,
407
- klassname: 'default-sidebar',
408
- lastFocusedElement: this.mainSidebar.currentFocusedOption,
409
- type: 'selection',
410
- focused: true,
411
- callback: () => {
412
- if (this.mainSidebar.sidebarElement) {
413
- this.mainSidebar.sidebarElement.style.visibility = 'visible';
414
- }
415
- },
416
- onselect: (data) => {
417
- this.changePlaybackCaptions(data.id);
418
- }
419
- });
420
- this.sidebar.mount(this.container);
421
- }
422
-
423
- createSideBar() {
424
- let items = [
425
- {
426
- text: 'Video Quality', isSelected: true, callback: () => {
427
- if (this.mainSidebar.sidebarElement) {
428
- this.mainSidebar.sidebarElement.style.visibility = 'hidden';
429
- }
430
- this.videoQualitySelector();
431
- }
432
- }
433
- ]
434
-
435
- if (this.player.audioTracks() && this.player.audioTracks().length > 0) {
436
- items.push(
437
- {
438
- text: 'Audio Language', isSelected: false, callback: () => {
439
- if (this.mainSidebar.sidebarElement) {
440
- this.mainSidebar.sidebarElement.style.visibility = 'hidden';
441
- }
442
- this.audioLanguageSelector();
443
- }
444
- }
445
- )
446
- }
447
-
448
- if (this.player.captionsOptions() && this.player.captionsOptions().length > 0) {
449
- items.push(
450
- {
451
- text: 'Subtitles', isSelected: false, callback: () => {
452
- if (this.mainSidebar.sidebarElement) {
453
- this.mainSidebar.sidebarElement.style.visibility = 'hidden';
454
- }
455
- this.subtitlesSelector();
456
- }
457
- }
458
- )
459
- }
460
-
461
- this.mainSidebar = new Sidebar({
462
- title: 'Settings',
463
- items: items,
464
- klassname: 'default-sidebar',
465
- lastFocusedElement: this.settingsBtn.buttonElement,
466
- type: 'navigation',
467
- focused: true
468
- });
469
- this.mainSidebar.mount(this.container);
470
- }
471
-
472
- attachTo(parent) {
473
- if (!parent || !(parent instanceof HTMLElement)) {
474
- throw new Error('VideoPlayerUI: parent must be a valid DOM element');
475
- }
476
- parent.appendChild(this.container);
477
- }
478
-
479
- getElement() {
480
- return this.container;
481
- }
482
-
483
- unmount() {
484
- if (this.playPauseBtn && this.playPauseBtn.buttonElement) {
485
- this.playPauseBtn.buttonElement.removeEventListener('focus', this.updatePlayPauseButton);
486
- this.playPauseBtn.buttonElement.removeEventListener('blur', this.updatePlayPauseButton);
487
- this.playPauseBtn.buttonElement.removeEventListener('keydown', this.handlePlayPauseKeydown);
488
- }
489
-
490
- if (this.player.video) {
491
- this.player.video.removeEventListener('play', this.updatePlayPauseButton);
492
- this.player.video.removeEventListener('pause', this.updatePlayPauseButton);
493
- }
494
-
495
- if (this.container) {
496
- this.container.remove();
497
- }
498
- }
499
- }
500
-
501
- export default VideoPlayerUI;
@@ -1,204 +0,0 @@
1
- /*************** playerSeekbar.css ***************/
2
- body {
3
- margin: 0;
4
- padding: 0;
5
- box-sizing: border-box;
6
- background-color: #000;
7
- }
8
- .vl-player-container .seekbar-container {
9
- position: absolute;
10
- left: 50%;
11
- transform: translateX(-50%);
12
- bottom: 50px;
13
- height: 12px;
14
- background: #444;
15
- width: 90%;
16
- cursor: pointer;
17
- border-radius: 6px;
18
- margin: 0;
19
- user-select: none;
20
- z-index: 20;
21
- }
22
-
23
- .vl-player-container .seekbar-buffer {
24
- position: absolute;
25
- height: 100%;
26
- background: #888;
27
- width: 0;
28
- border-radius: 6px;
29
- z-index: 1;
30
- }
31
-
32
- .vl-player-container .seekbar-progress {
33
- position: absolute;
34
- height: 100%;
35
- background: rgba(254, 253, 255, 0.7);
36
- width: 0;
37
- border-radius: 6px;
38
- z-index: 2;
39
- transition: width 0.1s linear;
40
- }
41
-
42
- .vl-player-container .seekbar-thumb {
43
- position: absolute;
44
- top: 50%;
45
- transform: translate(-50%, -50%);
46
- width: 16px;
47
- height: 16px;
48
- background: #fff;
49
- border-radius: 50%;
50
- /* border: 2px solid #4169E1; */
51
- z-index: 3;
52
- box-shadow: 0 2px 8px rgba(0,0,0,0.2);
53
- cursor: pointer;
54
- transition: background 0.2s;
55
- }
56
- .vl-player-container .seekbar-thumb:hover {
57
- background: #ffeaea;
58
- }
59
-
60
- .vl-player-container .seekbar-tooltip {
61
- position: absolute;
62
- bottom: 24px;
63
- left: 0;
64
- transform: translateX(-50%);
65
- background: #222;
66
- color: #fff;
67
- padding: 2px 8px;
68
- border-radius: 4px;
69
- font-size: 12px;
70
- white-space: nowrap;
71
- pointer-events: none;
72
- z-index: 10;
73
- }
74
-
75
- .vl-player-container .seekbar-time-label, .vl-player-container .seekbar-duration-label {
76
- position: relative;
77
- top: 18px;
78
- font-size: 13px;
79
- color: #eee;
80
- margin-right: 4px;
81
- z-index: 5;
82
- }
83
-
84
-
85
-
86
-
87
- /*************** playerButtons.css ***************/
88
-
89
- .vl-player-container .play-pause-btn {
90
- position: absolute !important;
91
- left: 50%;
92
- top: 50%;
93
- transform: translate(-50%, -50%);
94
- z-index: 20;
95
- width: 70px;
96
- height: 70px;
97
- border-radius: 50%;
98
- background: rgba(255,255,255, .5);
99
- cursor: pointer;
100
- }
101
-
102
- .vl-player-container .play-pause-btn img {
103
- position: absolute !important;
104
- left: 50%;
105
- top: 50%;
106
- transform: translate(-50%, -50%);
107
- height: 50px;
108
- }
109
-
110
-
111
- .vl-player-container .left-side-container {
112
- position: absolute !important;
113
- display: flex;
114
- left: 5%;
115
- bottom: 77px;
116
- }
117
-
118
- .vl-player-container .right-side-container {
119
- position: absolute !important;
120
- display: flex;
121
- right: 5%;
122
- bottom: 77px;
123
- }
124
-
125
- .vl-player-container .settings-btn {
126
- border-radius: 5px;
127
- padding: 5px;
128
- bottom: 100px;
129
- width: 50px;
130
- height: 40px;
131
- margin: 0 5px;
132
- background: rgba(255,255,255, 0.5);
133
- cursor: pointer;
134
- z-index: 20;
135
- }
136
-
137
- .vl-player-container .settings-btn img{
138
- height: 100%;
139
- }
140
-
141
- .vl-player-container .restart-btn {
142
- right: 2%;
143
- border-radius: 8px;
144
- padding: 5px;
145
- bottom: 100px;
146
- border: 2px solid #fff;
147
- color: #fff;
148
- font-size: 20px;
149
- font-weight: 700;
150
- display: flex;
151
- flex-direction: column;
152
- justify-content: center;
153
- margin: 0 5px;
154
- cursor: pointer;
155
- z-index: 20;
156
- }
157
-
158
-
159
- /*************** player-setting-option-wrapper ***************/
160
- .vl-player-container .default-option-wrapper {
161
- display: flex;
162
- justify-content: space-between;
163
- align-items: center;
164
- width: 95%;
165
- height: 50px;
166
- background: #525760;
167
- color: #fff;
168
- padding: 5px 10px;
169
- font-weight: 700;
170
- font-size: 18px;
171
- border-radius: 2px;
172
- box-shadow: 0 10px 15px rgba(0, 0, 0, .1);
173
- margin: 20px 0px;
174
- text-transform: capitalize;
175
- cursor: pointer;
176
- }
177
- .vl-player-container .default-option-wrapper span {
178
- height: 40px;
179
- }
180
-
181
- .vl-player-container .default-option-wrapper span > img{
182
- height: 100%;
183
- }
184
-
185
-
186
- .vl-player-container .default-sidebar {
187
- position: absolute;
188
- top: 0;
189
- color: #fff;
190
- display: flex;
191
- flex-direction: column;
192
- background-color: rgba(30, 30, 30, .75);
193
- height: 100%;
194
- min-height: 720px;
195
- width: 400px;
196
- padding: 50px 20px 0 20px;
197
- right: 0px;
198
- z-index: 30;
199
- /* right: -450px; */
200
- }
201
-
202
- .vl-player-container .focused{
203
- outline: 2px solid #ffffff;
204
- }