@gcorevideo/player 2.25.5 → 2.25.7

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 (30) hide show
  1. package/assets/audio-tracks/template.ejs +5 -4
  2. package/assets/bottom-gear/gear.scss +40 -39
  3. package/assets/media-control/media-control.scss +343 -284
  4. package/assets/media-control/width270.scss +2 -10
  5. package/assets/media-control/width370.scss +3 -41
  6. package/assets/multi-camera/style.scss +9 -19
  7. package/assets/picture-in-picture/style.scss +13 -0
  8. package/assets/subtitles/style.scss +108 -68
  9. package/dist/core.js +1 -1
  10. package/dist/index.css +1346 -1422
  11. package/dist/index.embed.js +47 -28
  12. package/dist/index.js +85 -66
  13. package/lib/plugins/audio-selector/AudioTracks.d.ts +4 -3
  14. package/lib/plugins/audio-selector/AudioTracks.d.ts.map +1 -1
  15. package/lib/plugins/audio-selector/AudioTracks.js +41 -23
  16. package/lib/plugins/media-control/MediaControl.js +1 -1
  17. package/lib/plugins/picture-in-picture/PictureInPicture.d.ts +1 -1
  18. package/lib/plugins/picture-in-picture/PictureInPicture.d.ts.map +1 -1
  19. package/lib/plugins/picture-in-picture/PictureInPicture.js +1 -1
  20. package/package.json +1 -1
  21. package/src/plugins/audio-selector/AudioTracks.ts +53 -29
  22. package/src/plugins/audio-selector/__tests__/AudioTracks.test.ts +60 -45
  23. package/src/plugins/audio-selector/__tests__/__snapshots__/AudioSelector.test.ts.snap +24 -24
  24. package/src/plugins/audio-selector/__tests__/__snapshots__/AudioTracks.test.ts.snap +21 -18
  25. package/src/plugins/media-control/MediaControl.ts +1 -1
  26. package/src/plugins/media-control/__tests__/__snapshots__/MediaControl.test.ts.snap +6 -6
  27. package/src/plugins/picture-in-picture/PictureInPicture.ts +1 -1
  28. package/tsconfig.tsbuildinfo +1 -1
  29. package/assets/audio-tracks/style.scss +0 -124
  30. package/assets/picture-in-picture/button.scss +0 -12
@@ -6,14 +6,18 @@
6
6
  :root {
7
7
  --font-size-media-controls: 14px;
8
8
  --font-size-media-controls-dropdown: 16px;
9
+ --gplayer-mc-font-size-dropdown: 16px;
9
10
  --player-vod-color: #005aff;
10
11
  --player-dvr-color: #fff;
11
12
  --player-live-color: #ff0101;
12
13
  --player-seekbar-current-color: #ff5700;
13
14
  --player-seekbar-buffer-color: #fff;
15
+ --gplayer-mc-text-color: #fff;
16
+ --gplayer-mc-popup-border-color: rgb(255 255 255 / 10%);
17
+ --gplayer-mc-popup-bg: rgb(74 74 74 / 60%);
14
18
  }
15
19
 
16
- .media-control-skin-1[data-media-control-skin-1] {
20
+ .media-control-skin-1 {
17
21
  position: absolute;
18
22
  width: 100%;
19
23
  height: 100%;
@@ -37,7 +41,7 @@
37
41
  line-height: 0;
38
42
  letter-spacing: 0;
39
43
  speak: none;
40
- color: #fff;
44
+ color: var(--gplayer-mc-text-color);
41
45
  vertical-align: middle;
42
46
  text-align: left;
43
47
  transition: all 0.1s ease;
@@ -73,375 +77,435 @@
73
77
  display: flex;
74
78
  justify-content: space-between;
75
79
 
76
- .media-control-left-panel {
77
- display: flex;
78
- align-items: center;
80
+ }
81
+
82
+ .media-control-left-panel {
83
+ display: flex;
84
+ align-items: center;
85
+ gap: 0.5rem;
86
+ justify-content: flex-start;
87
+ }
88
+
89
+ .media-control-button,
90
+ .media-control-indicator,
91
+ .media-control-item {
92
+ order: 50;
93
+ }
94
+
95
+ .media-control-item {
96
+ display: flex;
97
+ align-items: center;
98
+ }
99
+
100
+ [data-playpause],
101
+ [data-playstop] {
102
+ order: 1;
103
+ }
104
+
105
+ [data-volume] {
106
+ order: 2;
107
+ }
108
+
109
+ [data-position] {
110
+ order: 3;
111
+ }
112
+
113
+ [data-duration] {
114
+ order: 3;
115
+ }
116
+
117
+ .media-control-center-panel {
118
+ height: 100%;
119
+ text-align: center;
120
+ line-height: var(--bottom-panel);
121
+ }
122
+
123
+ .media-control-right-panel {
124
+ display: flex;
125
+ align-items: center;
126
+ gap: 1rem;
127
+ justify-content: flex-end;
128
+
129
+ @media (max-width: 420px) {
79
130
  gap: 0.5rem;
80
- justify-content: flex-start;
81
131
  }
132
+ }
82
133
 
83
- .media-control-button,
84
- .media-control-indicator,
85
- .gplayer-mc-panel-item {
86
- order: 10;
87
- }
134
+ button.media-control-button {
135
+ background-color: transparent;
136
+ border: 0;
137
+ padding: 0;
138
+ cursor: pointer;
139
+ display: inline-block;
140
+ height: 20px;
141
+ width: 24px;
88
142
 
89
- [data-playpause],
90
- [data-playstop] {
91
- order: 1;
92
- }
143
+ svg {
144
+ height: 20px;
93
145
 
94
- [data-volume] {
95
- order: 2;
146
+ path {
147
+ fill: white;
148
+ }
96
149
  }
97
150
 
98
- [data-position] {
99
- order: 3;
151
+ &:focus {
152
+ outline: none;
100
153
  }
101
154
 
102
- [data-duration] {
103
- order: 3;
155
+ &[data-play] {
156
+ float: left;
157
+ height: 100%;
104
158
  }
105
159
 
106
- .media-control-center-panel {
160
+ &[data-pause] {
161
+ float: left;
107
162
  height: 100%;
108
- text-align: center;
109
- line-height: var(--bottom-panel);
110
163
  }
111
164
 
112
- .media-control-right-panel {
113
- display: flex;
114
- align-items: center;
115
- gap: 1rem;
116
- justify-content: flex-end;
165
+ &[data-stop] {
166
+ float: left;
167
+ height: 100%;
168
+ }
117
169
 
118
- @media (max-width: 420px) {
119
- gap: 0.5rem;
120
- overflow: hidden;
121
- }
170
+ &[data-fullscreen] {
171
+ order: 100;
172
+ background-color: transparent;
173
+ border: 0;
174
+ height: 40px;
122
175
  }
123
176
 
124
- button.media-control-button {
177
+ &[data-hd-indicator] {
125
178
  background-color: transparent;
126
179
  border: 0;
127
- padding: 0;
128
- cursor: pointer;
129
- display: inline-block;
130
- height: 20px;
131
- width: 24px;
180
+ cursor: default;
181
+ display: none !important;
182
+ float: right;
183
+ height: 100%;
184
+ }
185
+ }
132
186
 
133
- svg {
134
- height: 20px;
187
+ .media-control-indicator {
135
188
 
136
- path {
137
- fill: white;
138
- }
139
- }
189
+ &[data-position],
190
+ &[data-duration] {
191
+ display: flex;
192
+ color: white;
193
+ cursor: default;
194
+ line-height: var(--bottom-panel);
195
+ position: relative;
196
+ }
140
197
 
141
- &:focus {
142
- outline: none;
143
- }
198
+ &[data-position] {
199
+ margin: 1px 0 0 7px;
200
+ }
144
201
 
145
- &[data-play] {
146
- float: left;
147
- height: 100%;
202
+ &[data-duration] {
203
+ &::before {
204
+ content: "|";
205
+ margin-right: 7px;
148
206
  }
149
207
 
150
- &[data-pause] {
151
- float: left;
208
+ color: rgb(255 255 255);
209
+ opacity: 0.5;
210
+ margin-top: 1px;
211
+ margin-right: 6px;
212
+ }
213
+ }
214
+
215
+ .bar-container[data-seekbar] {
216
+ position: absolute;
217
+ top: -11px;
218
+ left: 0;
219
+ display: inline-block;
220
+ vertical-align: middle;
221
+ width: 100%;
222
+ height: 20px;
223
+ cursor: pointer;
224
+
225
+ .bar-background[data-seekbar] {
226
+ width: 100%;
227
+ height: 3px;
228
+ position: relative;
229
+ top: 8px;
230
+ background-color: #666;
231
+
232
+ .bar-fill-1[data-seekbar] {
233
+ position: absolute;
234
+ top: 0;
235
+ left: 0;
236
+ width: 0;
152
237
  height: 100%;
238
+ background-color: var(--player-seekbar-buffer-color);
239
+ transition: all 0.1s ease-out;
153
240
  }
154
241
 
155
- &[data-stop] {
156
- float: left;
242
+ .bar-fill-2[data-seekbar] {
243
+ position: absolute;
244
+ top: 0;
245
+ left: 0;
246
+ width: 0;
157
247
  height: 100%;
248
+ background-color: var(--player-seekbar-current-color);
249
+ transition: all 0.1s ease-out;
158
250
  }
251
+ }
159
252
 
160
- &[data-fullscreen] {
161
- order: 100;
162
- background-color: transparent;
163
- border: 0;
164
- height: 40px;
165
- }
253
+ &.seek-disabled {
254
+ cursor: default;
255
+ display: none;
256
+ }
257
+ }
166
258
 
167
- &[data-hd-indicator] {
168
- background-color: transparent;
169
- border: 0;
170
- cursor: default;
171
- display: none !important;
172
- float: right;
173
- height: 100%;
174
- }
259
+ .bar-container[data-seekbar].seek-disabled+.bar-scrubber[data-seekbar] {
260
+ cursor: default;
261
+ display: none;
262
+ }
263
+
264
+ .bar-scrubber[data-seekbar] {
265
+ position: absolute;
266
+ transform: translateX(-50%);
267
+ top: -11.5px;
268
+ left: 0;
269
+ width: 20px;
270
+ height: 20px;
271
+ opacity: 1;
272
+ transition: all 0.1s ease-out;
273
+
274
+ .bar-scrubber-icon[data-seekbar] {
275
+ position: absolute;
276
+ left: 4.5px;
277
+ top: 4.5px;
278
+ width: 11px;
279
+ height: 11px;
280
+ border-radius: 50%;
281
+ background-color: white;
175
282
  }
283
+ }
176
284
 
177
- .media-control-indicator {
285
+ .drawer-container[data-volume] {
286
+ display: flex;
287
+ justify-content: flex-start;
288
+ height: var(--bottom-panel);
289
+ cursor: pointer;
290
+ box-sizing: border-box;
178
291
 
179
- &[data-position],
180
- &[data-duration] {
181
- display: flex;
182
- color: white;
183
- cursor: default;
184
- line-height: var(--bottom-panel);
185
- position: relative;
186
- }
292
+ .drawer-icon-container[data-volume] {
293
+ bottom: 0;
187
294
 
188
- &[data-position] {
189
- margin: 1px 0 0 7px;
190
- }
295
+ .drawer-icon[data-volume] {
296
+ background-color: transparent;
297
+ border: 0;
298
+ box-sizing: content-box;
299
+ height: var(--bottom-panel);
300
+ width: 20px;
191
301
 
192
- &[data-duration] {
193
- &::before {
194
- content: "|";
195
- margin-right: 7px;
302
+ svg {
303
+ height: 20px;
304
+ position: relative;
305
+ top: 3px;
306
+ margin-top: 7px;
307
+
308
+ path {
309
+ fill: white;
310
+ }
196
311
  }
197
312
 
198
- color: rgb(255 255 255);
199
- opacity: 0.5;
200
- margin-top: 1px;
201
- margin-right: 6px;
313
+ &.muted svg {
314
+ margin-left: 2px;
315
+ }
202
316
  }
203
317
  }
204
318
 
205
- .bar-container[data-seekbar] {
206
- position: absolute;
207
- top: -11px;
208
- left: 0;
209
- display: inline-block;
210
- vertical-align: middle;
211
- width: 100%;
212
- height: 20px;
213
- cursor: pointer;
319
+ .bar-container[data-volume] {
320
+ position: relative;
321
+ margin-left: 10px;
322
+ top: 8px;
323
+ width: 80px;
324
+ height: 23px;
325
+ padding: 3px 0;
326
+ transition: width 0.2s ease-out;
214
327
 
215
- .bar-background[data-seekbar] {
216
- width: 100%;
328
+ .bar-background[data-volume] {
217
329
  height: 3px;
330
+ border-radius: 100px;
218
331
  position: relative;
219
- top: 8px;
332
+ top: 7px;
220
333
  background-color: #666;
221
334
 
222
- .bar-fill-1[data-seekbar] {
335
+ .bar-fill-1[data-volume] {
223
336
  position: absolute;
224
337
  top: 0;
225
338
  left: 0;
226
339
  width: 0;
227
340
  height: 100%;
228
- background-color: var(--player-seekbar-buffer-color);
341
+ border-radius: 100px;
342
+ background-color: white;
229
343
  transition: all 0.1s ease-out;
230
344
  }
231
345
 
232
- .bar-fill-2[data-seekbar] {
346
+ .bar-fill-2[data-volume] {
233
347
  position: absolute;
234
348
  top: 0;
235
349
  left: 0;
236
350
  width: 0;
237
351
  height: 100%;
238
- background-color: var(--player-seekbar-current-color);
352
+ background-color: var(--player-vod-color);
239
353
  transition: all 0.1s ease-out;
240
354
  }
241
355
  }
242
356
 
243
- &.seek-disabled {
244
- cursor: default;
245
- display: none;
246
- }
247
- }
248
-
249
- .bar-container[data-seekbar].seek-disabled+.bar-scrubber[data-seekbar] {
250
- cursor: default;
251
- display: none;
252
- }
253
-
254
- .bar-scrubber[data-seekbar] {
255
- position: absolute;
256
- transform: translateX(-50%);
257
- top: -11.5px;
258
- left: 0;
259
- width: 20px;
260
- height: 20px;
261
- opacity: 1;
262
- transition: all 0.1s ease-out;
263
-
264
- .bar-scrubber-icon[data-seekbar] {
357
+ .bar-scrubber[data-volume] {
265
358
  position: absolute;
266
- left: 4.5px;
267
- top: 4.5px;
268
- width: 11px;
269
- height: 11px;
270
- border-radius: 50%;
271
- background-color: white;
272
- }
273
- }
274
-
275
- .drawer-container[data-volume] {
276
- display: flex;
277
- justify-content: flex-start;
278
- height: var(--bottom-panel);
279
- cursor: pointer;
280
- box-sizing: border-box;
281
-
282
- .drawer-icon-container[data-volume] {
283
- bottom: 0;
284
-
285
- .drawer-icon[data-volume] {
286
- background-color: transparent;
287
- border: 0;
288
- box-sizing: content-box;
289
- height: var(--bottom-panel);
290
- width: 20px;
291
-
292
- svg {
293
- height: 20px;
294
- position: relative;
295
- top: 3px;
296
- margin-top: 7px;
297
-
298
- path {
299
- fill: white;
300
- }
301
- }
302
-
303
- &.muted svg {
304
- margin-left: 2px;
305
- }
359
+ transform: translateX(-50%);
360
+ top: 3px;
361
+ margin-left: 3px;
362
+ width: 16px;
363
+ height: 16px;
364
+ opacity: 1;
365
+ transition: all 0.1s ease-out;
366
+
367
+ .bar-scrubber-icon[data-volume] {
368
+ position: absolute;
369
+ left: 3px;
370
+ top: 5px;
371
+ width: 7px;
372
+ height: 7px;
373
+ border-radius: 50%;
374
+ background-color: white;
306
375
  }
307
376
  }
308
377
 
309
- .bar-container[data-volume] {
310
- position: relative;
311
- margin-left: 10px;
312
- top: 8px;
313
- width: 80px;
314
- height: 23px;
315
- padding: 3px 0;
316
- transition: width 0.2s ease-out;
317
-
318
- .bar-background[data-volume] {
319
- height: 3px;
320
- border-radius: 100px;
321
- position: relative;
322
- top: 7px;
323
- background-color: #666;
324
-
325
- .bar-fill-1[data-volume] {
326
- position: absolute;
327
- top: 0;
328
- left: 0;
329
- width: 0;
330
- height: 100%;
331
- border-radius: 100px;
332
- background-color: white;
333
- transition: all 0.1s ease-out;
334
- }
335
-
336
- .bar-fill-2[data-volume] {
337
- position: absolute;
338
- top: 0;
339
- left: 0;
340
- width: 0;
341
- height: 100%;
342
- background-color: var(--player-vod-color);
343
- transition: all 0.1s ease-out;
344
- }
345
- }
378
+ .segmented-bar-element[data-volume] {
379
+ float: left;
380
+ width: 4px;
381
+ padding-left: 2px;
382
+ height: 12px;
383
+ opacity: 0.5;
384
+ box-shadow: inset 2px 0 0 white;
385
+ transition: transform 0.2s ease-out;
346
386
 
347
- .bar-scrubber[data-volume] {
348
- position: absolute;
349
- transform: translateX(-50%);
350
- top: 3px;
351
- margin-left: 3px;
352
- width: 16px;
353
- height: 16px;
387
+ &.fill {
388
+ box-shadow: inset 2px 0 0 #fff;
354
389
  opacity: 1;
355
- transition: all 0.1s ease-out;
356
-
357
- .bar-scrubber-icon[data-volume] {
358
- position: absolute;
359
- left: 3px;
360
- top: 5px;
361
- width: 7px;
362
- height: 7px;
363
- border-radius: 50%;
364
- background-color: white;
365
- }
366
390
  }
367
391
 
368
- .segmented-bar-element[data-volume] {
369
- float: left;
370
- width: 4px;
371
- padding-left: 2px;
372
- height: 12px;
373
- opacity: 0.5;
374
- box-shadow: inset 2px 0 0 white;
375
- transition: transform 0.2s ease-out;
376
-
377
- &.fill {
378
- box-shadow: inset 2px 0 0 #fff;
379
- opacity: 1;
380
- }
381
-
382
- &:nth-of-type(1) {
383
- padding-left: 0;
384
- }
392
+ &:nth-of-type(1) {
393
+ padding-left: 0;
394
+ }
385
395
 
386
- &:hover {
387
- transform: scaleY(1.5);
388
- }
396
+ &:hover {
397
+ transform: scaleY(1.5);
389
398
  }
390
399
  }
391
400
  }
392
401
  }
393
- }
402
+ .seek-time {
403
+ height: 26px;
404
+ line-height: 26px;
405
+ bottom: 52px;
406
+ border-radius: 3px;
407
+ background-color: rgb(74 74 74 / 70%);
394
408
 
395
- /* TODO distribute between plugins' styles */
396
- .media-control-skin-1[data-media-control-skin-1] {
397
- .media-control-cc {
398
- button[data-cc-button] {
399
- display: flex;
400
- justify-content: center;
401
- padding: 0;
402
- align-items: center;
409
+ span {
410
+ letter-spacing: 0.8px;
411
+ font-size: 14px;
412
+ font-family: Roboto, "Open Sans", Arial, sans-serif;
413
+ }
403
414
 
404
- &:hover {
405
- color: white;
406
- }
415
+ .seek-time__pos {
416
+ padding-left: 8px;
417
+ padding-right: 8px;
418
+ }
419
+ }
420
+
421
+ .media-control-dd {
422
+ display: flex;
423
+ height: 32px;
424
+ line-height: 32px;
425
+ align-items: baseline;
426
+ gap: 4px;
427
+ vertical-align: baseline;
428
+ padding: 0;
429
+
430
+ background-color: transparent;
431
+ color: var(--gplayer-mc-text-color);
432
+ -webkit-font-smoothing: antialiased;
433
+ border: none;
434
+ cursor: pointer;
435
+
436
+ &__text {
437
+ text-overflow: ellipsis;
438
+ overflow: hidden;
439
+ white-space: nowrap;
440
+ max-width: 100px;
441
+ }
442
+
443
+ &.changing {
444
+ animation: pulse 0.5s infinite alternate;
445
+ }
446
+
447
+ &__arrow {
448
+ width: 9px;
449
+ height: 6px;
450
+ // margin-left: 5px;
451
+ }
452
+
453
+ &__wrap {
454
+ position: relative; // for menu positioning
407
455
  }
408
456
 
409
- ul {
410
- // TODO extract common styles
411
- background-color: rgb(74 74 74 / 60%);
457
+ &__popup {
458
+ max-width: 114px;
459
+ list-style-type: none;
460
+ position: absolute;
461
+ box-shadow: 0 0 1px 1px var(--gplayer-mc-popup-border-color);
412
462
  border: none;
413
- width: auto;
463
+ min-width: 60px;
414
464
  border-radius: 4px;
415
- bottom: 52px;
416
- margin-left: -28px;
465
+ bottom: 40px;
466
+ right: -2px;
467
+ overflow: hidden;
417
468
 
418
469
  li {
419
- font-size: 16px;
420
- text-align: center;
421
- white-space: nowrap;
470
+ font-size: var(--gplayer-mc-font-size-dropdown);
471
+ text-align: right;
422
472
  height: 30px;
423
-
473
+
474
+ &[data-title] {
475
+ background-color: #c3c2c2;
476
+ padding: 5px;
477
+ }
478
+
424
479
  a {
480
+ display: block;
481
+ text-decoration: none;
482
+ text-overflow: ellipsis;
483
+ overflow: hidden;
484
+ white-space: nowrap;
485
+
425
486
  height: 30px;
426
487
  padding: 5px 10px;
488
+ line-height: 20px;
427
489
  color: #fffffe;
428
-
490
+
429
491
  &:hover {
492
+ text-decoration: none;
430
493
  background-color: rgb(0 0 0 / 40%);
494
+ color: white;
431
495
  }
432
496
  }
433
-
497
+
434
498
  &.current a {
435
- background-color: rgb(0 0 0 / 40%);
499
+ color: #f00;
436
500
  }
437
-
501
+
438
502
  &:first-child {
439
503
  a {
440
504
  border-bottom-left-radius: 4px;
441
505
  border-bottom-right-radius: 4px;
442
506
  }
443
507
  }
444
-
508
+
445
509
  &:last-child {
446
510
  a {
447
511
  border-top-left-radius: 4px;
@@ -451,23 +515,18 @@
451
515
  }
452
516
  }
453
517
  }
518
+ }
454
519
 
455
- .seek-time {
456
- height: 26px;
457
- line-height: 26px;
458
- bottom: 52px;
459
- border-radius: 3px;
460
- background-color: rgb(74 74 74 / 70%);
520
+ @keyframes pulse {
521
+ 0% {
522
+ color: #fff;
523
+ }
461
524
 
462
- span {
463
- letter-spacing: 0.8px;
464
- font-size: 14px;
465
- font-family: Roboto, "Open Sans", Arial, sans-serif;
466
- }
525
+ 50% {
526
+ color: #ff0101
527
+ }
467
528
 
468
- .seek-time__pos {
469
- padding-left: 8px;
470
- padding-right: 8px;
471
- }
529
+ 100% {
530
+ color: #B80000;
472
531
  }
473
532
  }