@vidispine/vdt-videojs 23.2.0-pre.1 → 23.2.0

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/src/player.scss DELETED
@@ -1,667 +0,0 @@
1
- @import '~video.js/dist/video-js.css';
2
-
3
- $red: #f00;
4
- $dark-translucent: rgba(28, 28, 28, 0.9);
5
- $dark-gray: #333;
6
- $light-translucent: rgba(255, 255, 255, 0.2);
7
- $large-icon-size: 90px;
8
- $controls-height: 50px;
9
- $mid-opacity: 0.6;
10
- $mid-radius: 7px;
11
-
12
- //remove safari's and other webkit browser's blue glow on tab selection
13
- textarea,
14
- select,
15
- input,
16
- button,
17
- video {
18
- outline: none;
19
- }
20
- button:focus,
21
- .video-js .vjs-menu-item {
22
- outline: initial;
23
- }
24
-
25
- .video-js {
26
- max-width: 100%;
27
- overflow: hidden;
28
-
29
- &.init {
30
- height: 0px !important;
31
- display: none;
32
- }
33
-
34
- video {
35
- transform: translate3d(0px, 0px, 0px);
36
- -webkit-transform: translate3d(0px, 0px, 0px);
37
- display: block;
38
- }
39
-
40
- .vjs-poster {
41
- background-size: cover;
42
- }
43
-
44
- .vjs-control-bar {
45
- height: $controls-height;
46
- padding-top: 6px;
47
- display: flex;
48
- /* Permalink - use to edit and share this gradient: https://colorzilla.com/gradient-editor/#000000+0,000000+100&0+15,0.3+100 */
49
- background: -moz-linear-gradient(
50
- top,
51
- rgba(0, 0, 0, 0) 0%,
52
- rgba(0, 0, 0, 0) 15%,
53
- rgba(0, 0, 0, 0.3) 100%
54
- ); /* FF3.6-15 */
55
- background: -webkit-linear-gradient(
56
- top,
57
- rgba(0, 0, 0, 0) 0%,
58
- rgba(0, 0, 0, 0) 15%,
59
- rgba(0, 0, 0, 0.3) 100%
60
- ); /* Chrome10-25,Safari5.1-6 */
61
- background: linear-gradient(
62
- to bottom,
63
- rgba(0, 0, 0, 0) 0%,
64
- rgba(0, 0, 0, 0) 15%,
65
- rgba(0, 0, 0, 0.3) 100%
66
- ); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
67
- filter: progid:DXImageTransform.Microsoft.gradient( startColorstr="#00000000", endColorstr="#4d000000",GradientType=0 ); /* IE6-9 */
68
-
69
- transform: translate3d(0px, 0px, 0px);
70
- -webkit-transform: translate3d(0px, 0px, 0px);
71
- z-index: 2;
72
-
73
- .vdt-seekbar-wrapper {
74
- top: 0px;
75
- left: 0px;
76
- height: 10px;
77
- width: 100%;
78
- position: absolute;
79
- margin: 0 auto;
80
- }
81
- }
82
-
83
- .vjs-big-play-button {
84
- font-size: $large-icon-size;
85
- border: 0px;
86
- background-color: transparent;
87
- text-shadow: 1px 2px 40px rgba(0, 0, 0, 0.4);
88
- z-index: 2;
89
-
90
- .vjs-icon-placeholder:before {
91
- padding-top: 5px; // play button offset correction
92
- }
93
- }
94
-
95
- &:hover {
96
- .vjs-big-play-button,
97
- .vjs-big-play-button:focus {
98
- background-color: transparent;
99
- }
100
- }
101
-
102
- //control bar
103
- .vjs-progress-control {
104
- top: 0px;
105
- left: 0px;
106
- position: absolute;
107
- display: block;
108
- width: 100%;
109
- height: 10px;
110
-
111
- .vjs-load-progress {
112
- background: $light-translucent;
113
- }
114
-
115
- &:hover .vjs-play-progress .vjs-time-tooltip,
116
- .vjs-play-progress .vjs-time-tooltip {
117
- display: none;
118
- }
119
- }
120
-
121
- // push everything after time display to the right side
122
- .vjs-time-control {
123
- &.duration,
124
- &.vjs-duration {
125
- margin-right: auto;
126
- }
127
- }
128
-
129
- .vjs-subs-caps-button,
130
- .vdt-screenshot-button {
131
- .vjs-icon-placeholder {
132
- opacity: 0.6;
133
- }
134
- }
135
-
136
- &.has-vdt-menu .vjs-subs-caps-button {
137
- display: none;
138
- }
139
-
140
- &.subtitles-active {
141
- .vjs-subs-caps-button .vjs-icon-placeholder {
142
- opacity: 1;
143
- }
144
- }
145
-
146
- .vjs-control {
147
- font-size: 14px;
148
- }
149
-
150
- .vjs-play-progress.vjs-slider-bar {
151
- background-color: $red;
152
- }
153
-
154
- .vjs-current-time,
155
- .vjs-time-control,
156
- .vjs-no-flex .vjs-current-time {
157
- display: block;
158
- }
159
-
160
- .vjs-time-control {
161
- font-size: 14px;
162
- padding: 0px;
163
- min-width: 14px;
164
- text-align: center;
165
- }
166
-
167
- .vjs-volume-panel {
168
- // margin-right: 20px;
169
- width: 3em;
170
- .vjs-mute-control {
171
- width: 3em;
172
- }
173
- }
174
-
175
- .vjs-menu-button-popup .vjs-menu {
176
- bottom: 20px;
177
- .vjs-menu-content {
178
- background-color: $dark-translucent;
179
- border-radius: $mid-radius;
180
- }
181
-
182
- li.vjs-menu-item:focus:not(.vjs-selected) {
183
- background-color: transparent;
184
- }
185
-
186
- li.vjs-menu-item:hover:not(.vjs-selected) {
187
- background-color: $light-translucent;
188
- }
189
-
190
- .vjs-menu-item-text {
191
- color: white;
192
- }
193
-
194
- .vjs-menu-item.vjs-selected .vjs-menu-item-text {
195
- color: #333;
196
- }
197
- }
198
-
199
- //our special osd (hosts custom play button and other features in the future, has css vertical centering)
200
- .vdt-player-osd {
201
- pointer-events: none;
202
- position: absolute;
203
- top: 0px;
204
- left: 0px;
205
- height: 100%;
206
- width: 100%;
207
- opacity: 0;
208
- z-index: 4;
209
- -webkit-transform: translate3d(0px, 0px, 0px) scale3d(0.5, 0.5, 0.5);
210
- -webkit-backface-visibility: hidden;
211
- backface-visibility: hidden;
212
- transform: translate3d(0px, 0px, 0px) scale3d(0.5, 0.5, 0.5);
213
- transition: 200ms ease-out all;
214
- // animation-fill-mode: backwards;
215
-
216
- &.active {
217
- opacity: 1;
218
- -webkit-transform: scale3d(1, 1, 1);
219
- transform: scale3d(1, 1, 1);
220
- }
221
-
222
- table {
223
- width: 100%;
224
- height: 100%;
225
- td {
226
- vertical-align: middle;
227
- text-align: center;
228
- .osd-feedback-icon {
229
- &:before {
230
- font-family: VideoJS;
231
- content: '\f101';
232
- font-size: 50px;
233
- padding: 15px;
234
- display: inline-block;
235
- height: 80px; //20 + 20 + 60
236
- width: 80px;
237
- text-align: center;
238
- background: rgba(0, 0, 0, 0.2);
239
- border-radius: 100%;
240
- }
241
- }
242
- .pause:before {
243
- content: '\f103';
244
- }
245
-
246
- .volchange.high:before {
247
- content: '\f107';
248
- }
249
-
250
- .volchange.mid:before {
251
- content: '\f106';
252
- }
253
-
254
- .volchange.low:before {
255
- content: '\f105';
256
- }
257
-
258
- .mute:before,
259
- .volchange.null:before {
260
- content: '\f104';
261
- }
262
-
263
- .unmute:before {
264
- content: '\f107';
265
- }
266
-
267
- .forward-jump:before,
268
- .backward-jump:before {
269
- content: '\f101\f101';
270
- letter-spacing: -38px;
271
- padding-left: 0px;
272
- padding-right: 34px;
273
- }
274
-
275
- .backward-jump:before {
276
- -webkit-transform: scaleX(-1);
277
- transform: scaleX(-1);
278
- }
279
- }
280
- }
281
- }
282
-
283
- //spinner / loader customizations
284
- @keyframes vjs-spinner-fade {
285
- 0% {
286
- border-top-color: rgba(255, 255, 255, 0.6);
287
- }
288
- 35% {
289
- border-top-color: white;
290
- }
291
- 100% {
292
- border-top-color: rgba(255, 255, 255, 0.6);
293
- }
294
- }
295
-
296
- .vjs-loading-spinner {
297
- &:after,
298
- &:before {
299
- margin: -5px;
300
- }
301
-
302
- margin: -40px 0 0 -40px;
303
- opacity: 0.85;
304
- border: 5px solid rgba(255, 255, 255, 0.7);
305
- width: 80px;
306
- height: 80px;
307
- border-radius: 100px;
308
- z-index: 5;
309
- }
310
-
311
- //css relating to subtitles
312
- .vjs-text-track-display,
313
- &.vjs-user-inactive.vjs-playing .vjs-text-track-display {
314
- bottom: 0px;
315
- transition: transform 300ms ease-out;
316
- -webkit-transform: translate3d(0px, 0px, 0px);
317
- -webkit-backface-visibility: hidden;
318
- backface-visibility: hidden;
319
- > div {
320
- display: table;
321
- width: 100%;
322
- height: 100%;
323
- margin: 0px !important;
324
- }
325
-
326
- .vjs-text-track-cue {
327
- //needs !important to override video.js inline styles
328
- width: 100% !important;
329
- bottom: 0px !important;
330
- top: initial !important;
331
- left: initial !important;
332
- right: initial !important;
333
- font-size: 18px !important;
334
- height: auto !important;
335
- padding-bottom: 1.5%;
336
- display: table-cell;
337
-
338
- > div {
339
- padding: 2px 4px 2px 4px;
340
- line-height: 1.25;
341
- border-radius: 2px;
342
- }
343
- }
344
- }
345
-
346
- // applies to fullscreen
347
- &.vjs-fullscreen,
348
- &.vjs-user-inactive.vjs-playing.vjs-fullscreen {
349
- .vjs-text-track-display .vjs-text-track-cue {
350
- -webkit-backface-visibility: hidden;
351
- backface-visibility: hidden;
352
- font-size: 24px !important;
353
- }
354
- }
355
-
356
- // control bar animation
357
- &.vjs-has-started.vjs-user-inactive.vjs-playing:not(.vjs-fullscreen), // prevent controls staying shown in fs
358
- &div,
359
- &.vjs-controls-enabled.vjs-user-active,
360
- &.vjs-has-started.vjs-user-inactive.vjs-paused {
361
- .vjs-control-bar {
362
- opacity: 1;
363
- }
364
- }
365
-
366
- &.vjs-has-started.vjs-user-inactive.vjs-playing:not(.controls-below-player) .vjs-control-bar,
367
- &:not(.controls-below-player) .vjs-control-bar {
368
- -webkit-backface-visibility: hidden;
369
- backface-visibility: hidden;
370
- transform: translate3d(0px, $controls-height, 0px);
371
- transition: transform 300ms ease-in-out;
372
- }
373
-
374
- &.vjs-controls-enabled.vjs-user-active:not(.controls-below-player),
375
- &.vjs-has-started.vjs-user-inactive.vjs-paused:not(.controls-below-player) {
376
- .vjs-control-bar {
377
- transform: translate3d(0px, 0px, 0px);
378
- -webkit-transform: translate3d(0px, 0px, 0px);
379
- }
380
-
381
- &:not(.vjs-controls-disabled) .vjs-text-track-display {
382
- transform: translate3d(0px, -$controls-height, 0px);
383
- }
384
- }
385
-
386
- //timecode
387
- .vdt-timecode {
388
- display: inline;
389
- font-family: 'monospace', sans-serif;
390
- margin-left: 20px;
391
-
392
- input,
393
- span {
394
- font-size: 16px;
395
- }
396
-
397
- span {
398
- text-align: center;
399
- display: inline-block;
400
- }
401
-
402
- input {
403
- display: inline-block;
404
- width: auto;
405
- border: 0px;
406
- background: transparent;
407
- color: inherit;
408
- width: 21px;
409
- }
410
-
411
- @media all and (max-width: 640px) {
412
- flex-grow: 3;
413
- }
414
- }
415
-
416
- .vdt-timecode.duration {
417
- // read-only duration display timecode
418
- margin-left: 0px;
419
- margin-right: auto;
420
- span {
421
- cursor: default;
422
- }
423
- &:before {
424
- content: '/';
425
- display: inline-block;
426
- margin: 0px 5px;
427
- font-size: 16px;
428
- }
429
-
430
- @media all and (max-width: 640px) {
431
- // gets too cramped on mobile devices
432
- display: none;
433
- }
434
- }
435
-
436
- // buttons
437
- .vdt-cinema-button,
438
- .vdt-settings-menu-button,
439
- .vdt-screenshot-button {
440
- cursor: pointer;
441
- &:after {
442
- content: '\f10b';
443
- font-family: VideoJS;
444
- font-size: 22px;
445
- }
446
-
447
- &:active,
448
- &:focus {
449
- opacity: $mid-opacity;
450
- }
451
- }
452
-
453
- .vdt-cinema-button:after {
454
- content: '\f10a';
455
- }
456
-
457
- .vdt-settings-menu-button:after {
458
- content: '\f110';
459
- }
460
-
461
- // waveform visualisation
462
- .vdt-waveform-visual,
463
- .vdt-help-overlay {
464
- position: absolute;
465
- top: 0px;
466
- left: 0px;
467
- background: #888;
468
- height: 100%;
469
- width: 100%;
470
- display: none;
471
-
472
- /* Permalink - use to edit and share this gradient: https://colorzilla.com/gradient-editor/#88bfe8+0,71a1c4+100 */
473
- background: rgb(136, 191, 232); /* Old browsers */
474
- background: -moz-linear-gradient(
475
- top,
476
- rgba(136, 191, 232, 1) 0%,
477
- rgba(113, 161, 196, 1) 100%
478
- ); /* FF3.6-15 */
479
- background: -webkit-linear-gradient(
480
- top,
481
- rgba(136, 191, 232, 1) 0%,
482
- rgba(113, 161, 196, 1) 100%
483
- ); /* Chrome10-25,Safari5.1-6 */
484
- background: linear-gradient(
485
- to bottom,
486
- rgba(136, 191, 232, 1) 0%,
487
- rgba(113, 161, 196, 1) 100%
488
- ); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
489
- filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#88bfe8', endColorstr='#71a1c4',GradientType=0 ); /* IE6-9 */
490
-
491
- canvas {
492
- height: 100%;
493
- width: 100%;
494
- }
495
- }
496
-
497
- &.vjs-has-started .vdt-waveform-visual {
498
- display: block;
499
- }
500
-
501
- // help overlay
502
- .vdt-help-overlay {
503
- // cascade unwanted css
504
- font-size: 15px;
505
- background: transparent;
506
- z-index: 2;
507
- transition: opacity 1s ease-in-out;
508
- opacity: 0;
509
- padding-bottom: 12px;
510
- > table {
511
- height: 100%;
512
- margin: 0 auto;
513
-
514
- td.vdt-help-contents {
515
- table {
516
- border-radius: $mid-radius;
517
- max-height: 400px;
518
- -webkit-backdrop-filter: blur(10px);
519
- background: rgba(0, 0, 0, $mid-opacity);
520
-
521
- td {
522
- padding: 6px 6px;
523
- } // inside table
524
-
525
- td:nth-child(2),
526
- td td:nth-child(4) {
527
- padding: 4px 9px;
528
- }
529
-
530
- td:nth-child(2) {
531
- padding-right: 32px;
532
- }
533
-
534
- td:first-child,
535
- td:nth-child(3) {
536
- div {
537
- // key icon
538
- text-align: center;
539
- padding: 3px;
540
- border: 1px solid white;
541
- border-radius: 2px;
542
- background: rgba(255, 255, 255, 0.1);
543
- font-size: 13px;
544
- min-width: 21px;
545
- }
546
- }
547
-
548
- // a way to do padding for table sides
549
- td:first-child {
550
- padding-left: 16px;
551
- }
552
- td:last-child {
553
- padding-right: 16px;
554
- }
555
- tr:first-child td {
556
- padding-top: 16px;
557
- }
558
- tr:last-child td {
559
- padding-bottom: 16px;
560
- }
561
- }
562
- }
563
-
564
- td {
565
- vertical-align: middle;
566
- }
567
- }
568
-
569
- &.active {
570
- display: block;
571
- opacity: 1;
572
- }
573
- }
574
-
575
- &.controls-below-player:not(.vjs-controls-disabled).vjs-fullscreen {
576
- &.vjs-user-inactive.vjs-playing .vjs-text-track-display,
577
- .vjs-text-track-display {
578
- bottom: $controls-height + 10px;
579
- }
580
- }
581
-
582
- &.controls-below-player:not(.vjs-fullscreen):not(.vjs-controls-disabled) {
583
- overflow: visible;
584
- // position: relative;
585
- width: auto;
586
- height: auto;
587
- background-color: transparent;
588
- margin-bottom: $controls-height + 20px;
589
-
590
- video {
591
- position: relative;
592
- }
593
-
594
- // .vjs-big-play-button, .vdt-help-overlay{
595
- // transform: translateY(- $controls-height / 2);
596
- // }
597
-
598
- // .vjs-loading-spinner{
599
- // transform: translateY(-$controls-height / 2);
600
- // }
601
-
602
- // .vjs-menu-button-popup .vjs-menu{
603
- // bottom: 30px;
604
- // }
605
-
606
- .vjs-control-bar {
607
- transform: translate3d(0px, $controls-height + 10px, 0px);
608
- transition: all 300ms ease-in-out;
609
- background: transparent;
610
-
611
- .vjs-button,
612
- .vdt-timecode {
613
- &:not(.vjs-menu-item-text) {
614
- color: #333;
615
- }
616
- }
617
- }
618
-
619
- // when on dark bg
620
- &.on-dark .vjs-control-bar {
621
- .vjs-button,
622
- .vdt-timecode {
623
- &:not(.vjs-menu-item-text) {
624
- color: #efefef;
625
- }
626
- }
627
- }
628
-
629
- .vjs-progress-holder {
630
- margin: 0 auto;
631
- }
632
-
633
- .vjs-menu {
634
- bottom: 35px;
635
- }
636
-
637
- .vjs-poster {
638
- height: initial;
639
- }
640
- // .vjs-poster{
641
- // bottom: $controls-height + 10px;
642
- // }
643
-
644
- // .vdt-player-osd{
645
- // top: initial;
646
- // bottom: ($controls-height + 10px) / 2;
647
- // }
648
-
649
- // .vjs-text-track-display{
650
- // bottom: $controls-height + 10px;
651
- // }
652
-
653
- // &.vjs-user-inactive.vjs-playing .vjs-text-track-display{
654
- // bottom: $controls-height + 10px;
655
- // }
656
- }
657
-
658
- //remove these from display, best to find options that prevent inserting them in them first place
659
- .vjs-play-progress:before,
660
- .vjs-remaining-time,
661
- .vjs-picture-in-picture-control,
662
- .vjs-progress-control:hover .vjs-time-tooltips,
663
- .vjs-play-progress .vjs-time-tooltip,
664
- .vjs-progress-control:hover .vjs-progress-holder:focus .vjs-time-tooltip {
665
- display: none;
666
- }
667
- }
@@ -1,62 +0,0 @@
1
- import { Meta } from '@storybook/addon-docs';
2
-
3
- import { docsParameters } from '@vidispine/vdt-storybook';
4
-
5
- <Meta title="vdt-videojs/Player/Example usage" parameters={docsParameters} />
6
-
7
- ## Example Usage
8
-
9
- Here's an example how to use the Player class in a pure js way in your project:
10
-
11
- ```js
12
- import { Player } from '@vidispine/vdt-videojs';
13
-
14
- const playerReference = new Player({
15
- target: document.getElementById('player-node'), // HTML mount point
16
-
17
- sources: [
18
- { src: 'https://some.domain/video-file.mp4', type: 'video/mp4' },
19
- { src: 'https://some.domain/video-file.webm', type: 'video/webm' },
20
- ],
21
-
22
- posterUrl: 'https://some.domain/poster-image.jpg', // optional
23
- color: '#e84393', // optional - replaces primary color
24
-
25
- subtitles: [
26
- // optional
27
- {
28
- src: 'https://some.domain/video-subtitles.vvt',
29
- lang: 'en',
30
- label: 'English',
31
- },
32
- {
33
- src: 'https://some.domain/video-subtitles-es.vvt',
34
- lang: 'es',
35
- label: 'Spanish',
36
- },
37
- {
38
- // or use the Blob constructor with file string contents
39
- src: new Blob(['WEBVTT\n\n\n00:00:00.500(...)'], 'text/plain'),
40
- lang: 'dk',
41
- label: 'Danish',
42
- },
43
- ],
44
-
45
- timecode: false, // optional - replaces time display with SMPTE timecode
46
- frameRate: 24000 / 1001, // optional - use together with timecode option
47
-
48
- onReady: () => {
49
- // optional
50
- // invoke methods after player has done initializing
51
- },
52
-
53
- /*
54
- optional - will add a screenshot button to player
55
- control bar and invoke method callback on click with player's
56
- current time in seconds as an argument (from start)
57
- */
58
- onScreenshot: (currentTime) => {
59
- console.log(currentTime); // -> 0.1280 (current position in s)
60
- },
61
- });
62
- ```