@gcorevideo/player 2.28.25 → 2.28.26
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/dist/core.js +38 -32
- package/dist/index.css +223 -223
- package/dist/index.embed.js +95 -38
- package/dist/index.js +227 -122
- package/lib/Player.d.ts.map +1 -1
- package/lib/index.core.d.ts +1 -1
- package/lib/index.core.d.ts.map +1 -1
- package/lib/index.core.js +1 -1
- package/lib/index.plugins.d.ts +34 -34
- package/lib/index.plugins.d.ts.map +1 -1
- package/lib/index.plugins.js +34 -34
- package/lib/playback/types.d.ts.map +1 -1
- package/lib/plugins/bottom-gear/BottomGear.d.ts.map +1 -1
- package/lib/plugins/bottom-gear/BottomGear.js +3 -1
- package/lib/plugins/clappr-nerd-stats/speedtest/index.d.ts.map +1 -1
- package/lib/plugins/clappr-nerd-stats/speedtest/index.js +9 -5
- package/lib/plugins/clappr-nerd-stats/speedtest/types.d.ts.map +1 -1
- package/lib/plugins/clappr-nerd-stats/utils.d.ts +2 -2
- package/lib/plugins/clips/utils.d.ts.map +1 -1
- package/lib/plugins/cmcd-config/CmcdConfig.js +1 -1
- package/lib/plugins/favicon/Favicon.d.ts.map +1 -1
- package/lib/plugins/google-analytics/GoogleAnalytics.d.ts.map +1 -1
- package/lib/plugins/google-analytics/GoogleAnalytics.js +10 -3
- package/lib/plugins/kibo/index.d.ts.map +1 -1
- package/lib/plugins/kibo/index.js +69 -20
- package/lib/plugins/level-selector/QualityLevels.js +2 -2
- package/lib/plugins/logo/Logo.d.ts.map +1 -1
- package/lib/plugins/logo/Logo.js +19 -15
- package/lib/plugins/logo/utils/index.d.ts.map +1 -1
- package/lib/plugins/logo/utils/index.js +11 -7
- package/lib/plugins/media-control/MediaControl.d.ts.map +1 -1
- package/lib/plugins/multi-camera/MultiCamera.d.ts.map +1 -1
- package/lib/plugins/multi-camera/MultiCamera.js +42 -20
- package/lib/plugins/picture-in-picture/PictureInPicture.d.ts.map +1 -1
- package/lib/plugins/picture-in-picture/PictureInPicture.js +3 -2
- package/lib/plugins/share/Share.d.ts.map +1 -1
- package/lib/plugins/share/Share.js +17 -12
- package/lib/plugins/skip-time/SkipTime.d.ts.map +1 -1
- package/lib/plugins/spinner-three-bounce/SpinnerThreeBounce.d.ts.map +1 -1
- package/lib/plugins/subtitles/ClosedCaptions.d.ts.map +1 -1
- package/lib/plugins/subtitles/ClosedCaptions.js +4 -3
- package/lib/plugins/thumbnails/Thumbnails.js +2 -3
- package/lib/plugins/thumbnails/utils.d.ts.map +1 -1
- package/lib/plugins/utils/fullscreen.d.ts.map +1 -1
- package/lib/plugins/utils.d.ts.map +1 -1
- package/lib/plugins/utils.js +1 -1
- package/lib/plugins/vast-ads/VastAds.d.ts.map +1 -1
- package/lib/plugins/vast-ads/VastAds.js +2 -1
- package/lib/plugins/vast-ads/loaderxml.d.ts.map +1 -1
- package/lib/plugins/vast-ads/loaderxml.js +8 -5
- package/lib/plugins/vast-ads/roll.d.ts +2 -2
- package/lib/plugins/vast-ads/roll.d.ts.map +1 -1
- package/lib/plugins/vast-ads/roll.js +16 -10
- package/lib/plugins/vast-ads/rollmanager.d.ts.map +1 -1
- package/lib/plugins/vast-ads/rollmanager.js +17 -7
- package/lib/plugins/vast-ads/sctemanager.d.ts +1 -1
- package/lib/plugins/vast-ads/sctemanager.d.ts.map +1 -1
- package/lib/plugins/vast-ads/sctemanager.js +6 -5
- package/lib/plugins/vast-ads/types.d.ts.map +1 -1
- package/lib/plugins/vast-ads/urlhandler.d.ts.map +1 -1
- package/lib/plugins/vast-ads/xmlhttprequest.d.ts.map +1 -1
- package/lib/plugins/vast-ads/xmlhttprequest.js +3 -2
- package/lib/plugins/vast-ads/xmlmerge.d.ts.map +1 -1
- package/lib/plugins/vast-ads/xmlmerge.js +4 -3
- package/lib/types.d.ts +1 -1
- package/lib/types.d.ts.map +1 -1
- package/lib/utils/clickaway.d.ts.map +1 -1
- package/lib/utils/mediaSources.d.ts.map +1 -1
- package/lib/utils/mediaSources.js +1 -3
- package/lib/utils/types.d.ts.map +1 -1
- package/lib/version.js +2 -2
- package/package.json +2 -2
- package/src/Player.ts +10 -10
- package/src/__tests__/Player.test.ts +33 -10
- package/src/index.core.ts +9 -1
- package/src/index.plugins.ts +35 -35
- package/src/playback/BasePlayback.ts +1 -1
- package/src/playback/__tests__/HTML5Video.test.ts +10 -4
- package/src/playback/dash-playback/__tests__/DashPlayback.test.ts +10 -38
- package/src/playback/hls-playback/__tests__/HlsPlayback.test.ts +12 -45
- package/src/playback/types.ts +0 -1
- package/src/playback.types.ts +1 -2
- package/src/plugins/audio-selector/AudioTracks.ts +1 -1
- package/src/plugins/audio-selector/__tests__/AudioTracks.test.ts +30 -11
- package/src/plugins/bottom-gear/BottomGear.ts +3 -2
- package/src/plugins/clappr-nerd-stats/NerdStats.ts +1 -1
- package/src/plugins/clappr-nerd-stats/speedtest/index.ts +104 -82
- package/src/plugins/clappr-nerd-stats/speedtest/types.ts +3 -3
- package/src/plugins/clappr-nerd-stats/utils.ts +2 -2
- package/src/plugins/clappr-stats/__tests__/ClapprStats.test.ts +30 -18
- package/src/plugins/clips/utils.ts +5 -1
- package/src/plugins/cmcd-config/CmcdConfig.ts +1 -1
- package/src/plugins/error-screen/__tests__/ErrorScreen.test.ts +21 -15
- package/src/plugins/favicon/Favicon.ts +73 -49
- package/src/plugins/google-analytics/GoogleAnalytics.ts +93 -58
- package/src/plugins/kibo/index.ts +183 -109
- package/src/plugins/level-selector/QualityLevels.ts +2 -2
- package/src/plugins/logo/Logo.ts +134 -105
- package/src/plugins/logo/utils/index.ts +27 -20
- package/src/plugins/media-control/MediaControl.ts +12 -6
- package/src/plugins/multi-camera/MultiCamera.ts +218 -157
- package/src/plugins/picture-in-picture/PictureInPicture.ts +41 -37
- package/src/plugins/playback-rate/__tests__/PlaybackRate.test.ts +25 -11
- package/src/plugins/poster/__tests__/Poster.test.ts +8 -9
- package/src/plugins/share/Share.ts +85 -60
- package/src/plugins/skip-time/SkipTime.ts +5 -1
- package/src/plugins/spinner-three-bounce/SpinnerThreeBounce.ts +8 -5
- package/src/plugins/subtitles/ClosedCaptions.ts +7 -5
- package/src/plugins/subtitles/__tests__/ClosedCaptions.test.ts +0 -1
- package/src/plugins/thumbnails/Thumbnails.ts +22 -21
- package/src/plugins/thumbnails/__tests__/Thumbnails.test.ts +14 -7
- package/src/plugins/thumbnails/utils.ts +3 -1
- package/src/plugins/typings/globals.d.ts +7 -7
- package/src/plugins/typings/workers.d.ts +3 -3
- package/src/plugins/utils/fullscreen.ts +2 -2
- package/src/plugins/utils.ts +17 -13
- package/src/plugins/vast-ads/VastAds.ts +4 -5
- package/src/plugins/vast-ads/loaderxml.ts +142 -101
- package/src/plugins/vast-ads/roll.ts +381 -284
- package/src/plugins/vast-ads/rollmanager.ts +214 -170
- package/src/plugins/vast-ads/sctemanager.ts +66 -48
- package/src/plugins/vast-ads/types.ts +15 -9
- package/src/plugins/vast-ads/urlhandler.ts +18 -13
- package/src/plugins/vast-ads/xmlhttprequest.ts +25 -20
- package/src/plugins/vast-ads/xmlmerge.ts +42 -32
- package/src/plugins/video360/VRControls.js +50 -42
- package/src/plugins/video360/VREffect.js +298 -206
- package/src/plugins/video360/Video360.js +553 -423
- package/src/plugins/video360/orbit-oriention-controls.js +526 -421
- package/src/plugins/video360/utils.js +18 -18
- package/src/types.ts +5 -3
- package/src/typings/@clappr/core/error_mixin.d.ts +9 -9
- package/src/typings/@clappr/core/index.d.ts +1 -3
- package/src/typings/@clappr/core/playback.d.ts +3 -3
- package/src/typings/@clappr/index.d.ts +1 -1
- package/src/typings/globals.d.ts +15 -15
- package/src/utils/__tests__/mediaSources.test.ts +42 -26
- package/src/utils/clickaway.ts +24 -24
- package/src/utils/errors.ts +2 -2
- package/src/utils/mediaSources.ts +5 -4
- package/src/utils/types.ts +1 -1
- package/src/version.ts +2 -2
- package/tsconfig.tsbuildinfo +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const APP_NAME =
|
|
1
|
+
const APP_NAME = '_';
|
|
2
2
|
class DebuggerWrapper {
|
|
3
3
|
writer;
|
|
4
4
|
namespace;
|
|
@@ -15,19 +15,19 @@ class DebuggerWrapper {
|
|
|
15
15
|
this.currentWriter = nullWriter;
|
|
16
16
|
}
|
|
17
17
|
write = (m, ...args) => {
|
|
18
|
-
const tokens = args.map((_) =>
|
|
19
|
-
if (typeof m ===
|
|
20
|
-
tokens.unshift(
|
|
18
|
+
const tokens = args.map((_) => '%s');
|
|
19
|
+
if (typeof m === 'string' || args.length > 0) {
|
|
20
|
+
tokens.unshift('%s');
|
|
21
21
|
}
|
|
22
|
-
this.currentWriter(`${this.namespace}: ${tokens.join(' ')}`, m, ...args.map(a => JSON.stringify(a)));
|
|
22
|
+
this.currentWriter(`${this.namespace}: ${tokens.join(' ')}`, m, ...args.map((a) => JSON.stringify(a)));
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
25
|
const currentPatterns = [];
|
|
26
26
|
function parsePattern(pattern) {
|
|
27
|
-
if (pattern ===
|
|
27
|
+
if (pattern === '*') {
|
|
28
28
|
return /.?/;
|
|
29
29
|
}
|
|
30
|
-
return new RegExp(
|
|
30
|
+
return new RegExp('^' + pattern.replace(/\*/g, '[@\\w-]+'), 'i');
|
|
31
31
|
}
|
|
32
32
|
function pass(namespace) {
|
|
33
33
|
return currentPatterns.some((p) => p.test(namespace));
|
|
@@ -43,8 +43,8 @@ let Logger$1 = class Logger {
|
|
|
43
43
|
error;
|
|
44
44
|
debug;
|
|
45
45
|
static items = [];
|
|
46
|
-
constructor(
|
|
47
|
-
const ns = namespace ? `:${namespace}` :
|
|
46
|
+
constructor(appName = APP_NAME, namespace = '') {
|
|
47
|
+
const ns = namespace ? `:${namespace}` : '';
|
|
48
48
|
const info = new DebuggerWrapper(console.info.bind(console), `${appName}:INFO${ns}`, pass(namespace));
|
|
49
49
|
this.info = info.write;
|
|
50
50
|
const warn = new DebuggerWrapper(console.warn.bind(console), `${appName}:WARN${ns}`, pass(namespace));
|
|
@@ -62,7 +62,7 @@ let Logger$1 = class Logger {
|
|
|
62
62
|
* @param patterns - comma-separated list of patterns, can contain '*' as a wildcard
|
|
63
63
|
*/
|
|
64
64
|
static enable(patterns) {
|
|
65
|
-
currentPatterns.splice(0, currentPatterns.length, ...patterns.split(
|
|
65
|
+
currentPatterns.splice(0, currentPatterns.length, ...patterns.split(',').filter(Boolean).map(parsePattern));
|
|
66
66
|
Logger.toggleItems();
|
|
67
67
|
}
|
|
68
68
|
static disable() {
|
|
@@ -80,14 +80,35 @@ let Logger$1 = class Logger {
|
|
|
80
80
|
}
|
|
81
81
|
};
|
|
82
82
|
|
|
83
|
+
/**
|
|
84
|
+
* A tracer that pushes a record through a chain of tracers
|
|
85
|
+
* @beta
|
|
86
|
+
*/
|
|
87
|
+
class ChainedTracer {
|
|
88
|
+
tracers;
|
|
89
|
+
constructor(tracers) {
|
|
90
|
+
this.tracers = tracers;
|
|
91
|
+
}
|
|
92
|
+
reportError(e) {
|
|
93
|
+
for (const tracer of this.tracers) {
|
|
94
|
+
tracer.reportError(e);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
trace(msg, data) {
|
|
98
|
+
for (const tracer of this.tracers) {
|
|
99
|
+
tracer.trace(msg, data);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
83
104
|
/**
|
|
84
105
|
* A tracer that logs to the console
|
|
85
106
|
* @public
|
|
86
107
|
*/
|
|
87
108
|
class LogTracer {
|
|
88
109
|
logger;
|
|
89
|
-
constructor(
|
|
90
|
-
this.logger = new Logger$1(
|
|
110
|
+
constructor(appName = '') {
|
|
111
|
+
this.logger = new Logger$1(appName);
|
|
91
112
|
}
|
|
92
113
|
reportError(e) {
|
|
93
114
|
this.logger.error(e);
|
|
@@ -96,19 +117,6 @@ class LogTracer {
|
|
|
96
117
|
this.logger.debug(msg, data);
|
|
97
118
|
}
|
|
98
119
|
}
|
|
99
|
-
// export class LogTracer implements Tracer {
|
|
100
|
-
// private tags: Record<string, TagValue> = {};
|
|
101
|
-
// reportError(e: Error) {
|
|
102
|
-
// logger.error(e, this.tags);
|
|
103
|
-
// }
|
|
104
|
-
// setTag(name: string, value: TagValue) {
|
|
105
|
-
// this.tags[name] = value;
|
|
106
|
-
// }
|
|
107
|
-
// trace(msg: string, data?: Record<string, unknown>) {
|
|
108
|
-
// const fullData = Object.assign({}, this.tags, data);
|
|
109
|
-
// logger.debug(msg, fullData);
|
|
110
|
-
// }
|
|
111
|
-
// }
|
|
112
120
|
|
|
113
121
|
/**
|
|
114
122
|
* @beta
|
|
@@ -125,8 +133,8 @@ class SentryTracer {
|
|
|
125
133
|
}
|
|
126
134
|
trace(message, data) {
|
|
127
135
|
this.scope.addBreadcrumb({
|
|
128
|
-
type:
|
|
129
|
-
level:
|
|
136
|
+
type: 'default',
|
|
137
|
+
level: 'info',
|
|
130
138
|
message,
|
|
131
139
|
data,
|
|
132
140
|
});
|
|
@@ -12713,9 +12721,7 @@ function buildMediaSourcesList(sources, priorityTransport = 'dash') {
|
|
|
12713
12721
|
}
|
|
12714
12722
|
const [preferred, rest] = sources.reduce(([preferred, rest], item) => {
|
|
12715
12723
|
for (const p of playbacks) {
|
|
12716
|
-
if ([
|
|
12717
|
-
'html5_audio', 'html_img', 'no_op'
|
|
12718
|
-
].includes(p.prototype.name)) {
|
|
12724
|
+
if (['html5_audio', 'html_img', 'no_op'].includes(p.prototype.name)) {
|
|
12719
12725
|
continue;
|
|
12720
12726
|
}
|
|
12721
12727
|
const canPlay = p.canPlay(item.source, item.mimeType);
|
|
@@ -51418,7 +51424,7 @@ class Player {
|
|
|
51418
51424
|
}
|
|
51419
51425
|
}
|
|
51420
51426
|
|
|
51421
|
-
var version$1 = "2.28.
|
|
51427
|
+
var version$1 = "2.28.26";
|
|
51422
51428
|
|
|
51423
51429
|
var packages = {
|
|
51424
51430
|
"node_modules/@clappr/core": {
|
|
@@ -51479,7 +51485,8 @@ class Kibo {
|
|
|
51479
51485
|
return (e) => {
|
|
51480
51486
|
this.lastKeyCode = e.keyCode; // TODO
|
|
51481
51487
|
for (const mod of MODIFIERS) {
|
|
51482
|
-
this.lastModifiers[mod] =
|
|
51488
|
+
this.lastModifiers[mod] =
|
|
51489
|
+
e[(mod + 'Key')];
|
|
51483
51490
|
}
|
|
51484
51491
|
// for (i = 0; i < Kibo.MODIFIERS.length; i++) {
|
|
51485
51492
|
// that.lastModifiers[Kibo.MODIFIERS[i]] = e[Kibo.MODIFIERS[i] + 'Key'];
|
|
@@ -51506,7 +51513,7 @@ class Kibo {
|
|
|
51506
51513
|
const lastModifiersAndKey = this.lastModifiersAndKey();
|
|
51507
51514
|
if (regKeys[lastModifiersAndKey]) {
|
|
51508
51515
|
for (const h of regKeys[lastModifiersAndKey]) {
|
|
51509
|
-
if (
|
|
51516
|
+
if (h(e) === false && e.preventDefault) {
|
|
51510
51517
|
e.preventDefault();
|
|
51511
51518
|
}
|
|
51512
51519
|
// for (i = 0; i < registeredKeys[lastModifiersAndKey].length; i++) {
|
|
@@ -51519,7 +51526,7 @@ class Kibo {
|
|
|
51519
51526
|
}
|
|
51520
51527
|
registerKeys(upOrDown, newKeys, func) {
|
|
51521
51528
|
const registeredKeys = upOrDown === 'up' ? this.keysUp : this.keysDown;
|
|
51522
|
-
const normKeys = typeof newKeys ===
|
|
51529
|
+
const normKeys = typeof newKeys === 'string' ? [newKeys] : newKeys;
|
|
51523
51530
|
// for (i = 0; i < newKeys.length; i++) {
|
|
51524
51531
|
// // keys = newKeys[i];
|
|
51525
51532
|
// keys = modifiersAndKey(keys + '');
|
|
@@ -51542,7 +51549,7 @@ class Kibo {
|
|
|
51542
51549
|
}
|
|
51543
51550
|
unregisterKeys(upOrDown, newKeys, func = null) {
|
|
51544
51551
|
const registeredKeys = upOrDown === 'up' ? this.keysUp : this.keysDown;
|
|
51545
|
-
const normKeys = typeof newKeys ===
|
|
51552
|
+
const normKeys = typeof newKeys === 'string' ? [newKeys] : newKeys;
|
|
51546
51553
|
for (const k of normKeys) {
|
|
51547
51554
|
const keys = modifiersAndKey(k);
|
|
51548
51555
|
if (func === null) {
|
|
@@ -51563,7 +51570,7 @@ class Kibo {
|
|
|
51563
51570
|
return this.unregisterKeys('down', keys, null);
|
|
51564
51571
|
}
|
|
51565
51572
|
delegate(upOrDown, keys, func) {
|
|
51566
|
-
return
|
|
51573
|
+
return func !== null && func !== undefined
|
|
51567
51574
|
? this.registerKeys(upOrDown, keys, func)
|
|
51568
51575
|
: this.unregisterKeys(upOrDown, keys, func);
|
|
51569
51576
|
}
|
|
@@ -51580,14 +51587,13 @@ class Kibo {
|
|
|
51580
51587
|
return this.lastModifiers[modifier];
|
|
51581
51588
|
}
|
|
51582
51589
|
lastModifiersAndKey() {
|
|
51583
|
-
const result = MODIFIERS.filter(m => this.lastKey(m));
|
|
51590
|
+
const result = MODIFIERS.filter((m) => this.lastKey(m));
|
|
51584
51591
|
const lastKey = keyName(this.lastKeyCode);
|
|
51585
51592
|
if (lastKey && !result.includes(lastKey)) {
|
|
51586
51593
|
result.push(lastKey);
|
|
51587
51594
|
}
|
|
51588
51595
|
return result.join(' ');
|
|
51589
51596
|
}
|
|
51590
|
-
;
|
|
51591
51597
|
}
|
|
51592
51598
|
function registerEvent(element, eventName, func) {
|
|
51593
51599
|
element.addEventListener(eventName, func, false);
|
|
@@ -51596,17 +51602,67 @@ function unregisterEvent(element, eventName, func) {
|
|
|
51596
51602
|
element.removeEventListener(eventName, func, false);
|
|
51597
51603
|
}
|
|
51598
51604
|
const KEY_NAMES_BY_CODE = {
|
|
51599
|
-
8: 'backspace',
|
|
51600
|
-
|
|
51605
|
+
8: 'backspace',
|
|
51606
|
+
9: 'tab',
|
|
51607
|
+
13: 'enter',
|
|
51608
|
+
16: 'shift',
|
|
51609
|
+
17: 'ctrl',
|
|
51610
|
+
18: 'alt',
|
|
51601
51611
|
20: 'caps_lock',
|
|
51602
51612
|
27: 'esc',
|
|
51603
51613
|
32: 'space',
|
|
51604
|
-
37: 'left',
|
|
51605
|
-
|
|
51606
|
-
|
|
51607
|
-
|
|
51608
|
-
|
|
51609
|
-
|
|
51614
|
+
37: 'left',
|
|
51615
|
+
38: 'up',
|
|
51616
|
+
39: 'right',
|
|
51617
|
+
40: 'down',
|
|
51618
|
+
48: '0',
|
|
51619
|
+
49: '1',
|
|
51620
|
+
50: '2',
|
|
51621
|
+
51: '3',
|
|
51622
|
+
52: '4',
|
|
51623
|
+
53: '5',
|
|
51624
|
+
54: '6',
|
|
51625
|
+
55: '7',
|
|
51626
|
+
56: '8',
|
|
51627
|
+
57: '9',
|
|
51628
|
+
65: 'a',
|
|
51629
|
+
66: 'b',
|
|
51630
|
+
67: 'c',
|
|
51631
|
+
68: 'd',
|
|
51632
|
+
69: 'e',
|
|
51633
|
+
70: 'f',
|
|
51634
|
+
71: 'g',
|
|
51635
|
+
72: 'h',
|
|
51636
|
+
73: 'i',
|
|
51637
|
+
74: 'j',
|
|
51638
|
+
75: 'k',
|
|
51639
|
+
76: 'l',
|
|
51640
|
+
77: 'm',
|
|
51641
|
+
78: 'n',
|
|
51642
|
+
79: 'o',
|
|
51643
|
+
80: 'p',
|
|
51644
|
+
81: 'q',
|
|
51645
|
+
82: 'r',
|
|
51646
|
+
83: 's',
|
|
51647
|
+
84: 't',
|
|
51648
|
+
85: 'u',
|
|
51649
|
+
86: 'v',
|
|
51650
|
+
87: 'w',
|
|
51651
|
+
88: 'x',
|
|
51652
|
+
89: 'y',
|
|
51653
|
+
90: 'z',
|
|
51654
|
+
112: 'f1',
|
|
51655
|
+
113: 'f2',
|
|
51656
|
+
114: 'f3',
|
|
51657
|
+
115: 'f4',
|
|
51658
|
+
116: 'f5',
|
|
51659
|
+
117: 'f6',
|
|
51660
|
+
118: 'f7',
|
|
51661
|
+
119: 'f8',
|
|
51662
|
+
120: 'f9',
|
|
51663
|
+
121: 'f10',
|
|
51664
|
+
122: 'f11',
|
|
51665
|
+
123: 'f12',
|
|
51610
51666
|
};
|
|
51611
51667
|
(function () {
|
|
51612
51668
|
Object.entries(KEY_NAMES_BY_CODE).forEach(([key, name]) => {
|
|
@@ -51620,10 +51676,12 @@ function neatString(string) {
|
|
|
51620
51676
|
return string.replace(/^\s+|\s+$/g, '').replace(/\s+/g, ' ');
|
|
51621
51677
|
}
|
|
51622
51678
|
function extractModifiers(keyCombination) {
|
|
51623
|
-
return MODIFIERS.filter(m => keyCombination.includes(m));
|
|
51679
|
+
return MODIFIERS.filter((m) => keyCombination.includes(m));
|
|
51624
51680
|
}
|
|
51625
51681
|
function extractKey(keyCombination) {
|
|
51626
|
-
return neatString(keyCombination)
|
|
51682
|
+
return neatString(keyCombination)
|
|
51683
|
+
.split(' ')
|
|
51684
|
+
.find((key) => !MODIFIERS.includes(key));
|
|
51627
51685
|
}
|
|
51628
51686
|
function modifiersAndKey(keyCombination) {
|
|
51629
51687
|
var result, key;
|
|
@@ -51664,7 +51722,7 @@ function parseClipTime(str) {
|
|
|
51664
51722
|
if (arr.length >= 1) {
|
|
51665
51723
|
s = parseInt(arr[arr.length - 1]);
|
|
51666
51724
|
}
|
|
51667
|
-
return
|
|
51725
|
+
return h + m + s;
|
|
51668
51726
|
}
|
|
51669
51727
|
function getPageX(event) {
|
|
51670
51728
|
if (event.pageX) {
|
|
@@ -53664,7 +53722,9 @@ class BottomGear extends UICorePlugin {
|
|
|
53664
53722
|
mediaControl.slot('gear', this.$el);
|
|
53665
53723
|
}
|
|
53666
53724
|
clampPopup($subMenu) {
|
|
53667
|
-
const availableHeight = this.core
|
|
53725
|
+
const availableHeight = this.core
|
|
53726
|
+
.getPlugin('media_control')
|
|
53727
|
+
.getAvailablePopupHeight();
|
|
53668
53728
|
$subMenu.css('max-height', `${availableHeight}px`);
|
|
53669
53729
|
$subMenu
|
|
53670
53730
|
.find('.gear-sub-menu')
|
|
@@ -54133,7 +54193,7 @@ class CmcdConfig extends CorePlugin {
|
|
|
54133
54193
|
}
|
|
54134
54194
|
generateContentId() {
|
|
54135
54195
|
const src = this.core.options.source ??
|
|
54136
|
-
(typeof this.core.options.sources[0]
|
|
54196
|
+
(typeof this.core.options.sources[0] === 'string'
|
|
54137
54197
|
? this.core.options.sources[0]
|
|
54138
54198
|
: this.core.options.sources[0].source);
|
|
54139
54199
|
return new URL(src).pathname.slice(0, 64);
|
|
@@ -56096,7 +56156,9 @@ const initSpeedTest = (customMetrics) => {
|
|
|
56096
56156
|
// const data = await response.json();
|
|
56097
56157
|
// SPEEDTEST_SERVERS[0].server = `http://${data.Server}.fe.gc.onl/speedtest/`;
|
|
56098
56158
|
speedTest.onupdate = function (data) {
|
|
56099
|
-
|
|
56159
|
+
//callback to update data in UI
|
|
56160
|
+
if (![0, 1].includes(data.testState) &&
|
|
56161
|
+
typeof data.dlStatus === 'number') {
|
|
56100
56162
|
const dlSpeed = limitDigits(data.dlStatus);
|
|
56101
56163
|
const el = getElementById('dlText');
|
|
56102
56164
|
if (el) {
|
|
@@ -56133,7 +56195,9 @@ const initSpeedTest = (customMetrics) => {
|
|
|
56133
56195
|
drawSpeedTestResults();
|
|
56134
56196
|
};
|
|
56135
56197
|
speedTest.onend = function (aborted) {
|
|
56136
|
-
|
|
56198
|
+
//callback for test ended/aborted
|
|
56199
|
+
if (aborted) {
|
|
56200
|
+
//if the test was aborted, clear the UI and prepare for new test
|
|
56137
56201
|
// TODO: fix
|
|
56138
56202
|
const el = getElementById('dlText');
|
|
56139
56203
|
if (el) {
|
|
@@ -56144,11 +56208,11 @@ const initSpeedTest = (customMetrics) => {
|
|
|
56144
56208
|
const myinfoUrl = 'https://gcore.com/.well-known/cdn-debug/json';
|
|
56145
56209
|
// await fetch('https://iam.gcdn.co/info/json')
|
|
56146
56210
|
await fetch(myinfoUrl)
|
|
56147
|
-
.then(r => r.json())
|
|
56148
|
-
.then(data => {
|
|
56211
|
+
.then((r) => r.json())
|
|
56212
|
+
.then((data) => {
|
|
56149
56213
|
// const country = data['Server Country code'].toLowerCase();
|
|
56150
56214
|
const country = getCountryCodeFromClientHeaders(data.client_headers);
|
|
56151
|
-
const server = serversList.find(s => s.country === country) || serversList[0];
|
|
56215
|
+
const server = serversList.find((s) => s.country === country) || serversList[0];
|
|
56152
56216
|
if (!server) {
|
|
56153
56217
|
throw new Error('Failed to select a server');
|
|
56154
56218
|
}
|
|
@@ -57424,13 +57488,16 @@ class GoogleAnalytics extends ContainerPlugin {
|
|
|
57424
57488
|
super(container);
|
|
57425
57489
|
if (this.container.options.gaAccount) {
|
|
57426
57490
|
this.account = this.container.options.gaAccount;
|
|
57427
|
-
this.trackerName =
|
|
57491
|
+
this.trackerName = this.container.options.gaTrackerName
|
|
57492
|
+
? this.container.options.gaTrackerName + '.'
|
|
57493
|
+
: 'Player.';
|
|
57428
57494
|
this.domainName = this.container.options.gaDomainName;
|
|
57429
57495
|
this.embedScript();
|
|
57430
57496
|
}
|
|
57431
57497
|
}
|
|
57432
57498
|
embedScript() {
|
|
57433
|
-
if (!('_gat' in window)) {
|
|
57499
|
+
if (!('_gat' in window)) {
|
|
57500
|
+
// TODO
|
|
57434
57501
|
const script = document.createElement('script');
|
|
57435
57502
|
script.setAttribute('type', 'text/javascript');
|
|
57436
57503
|
script.setAttribute('async', 'async');
|
|
@@ -57494,7 +57561,11 @@ class GoogleAnalytics extends ContainerPlugin {
|
|
|
57494
57561
|
}
|
|
57495
57562
|
onPlaybackChanged(playbackState) {
|
|
57496
57563
|
if (playbackState.type !== null) {
|
|
57497
|
-
this.push([
|
|
57564
|
+
this.push([
|
|
57565
|
+
'Video',
|
|
57566
|
+
'Playback Type - ' + playbackState.type,
|
|
57567
|
+
this.container.playback.src,
|
|
57568
|
+
]);
|
|
57498
57569
|
}
|
|
57499
57570
|
}
|
|
57500
57571
|
onDVR(dvrInUse) {
|
|
@@ -57523,20 +57594,24 @@ function calculateSize(original) {
|
|
|
57523
57594
|
const transformed = {
|
|
57524
57595
|
media: {
|
|
57525
57596
|
width: 0,
|
|
57526
|
-
height: 0
|
|
57597
|
+
height: 0,
|
|
57527
57598
|
},
|
|
57528
57599
|
letterboxing: {
|
|
57529
57600
|
horizontal: 0,
|
|
57530
|
-
vertical: 0
|
|
57531
|
-
}
|
|
57601
|
+
vertical: 0,
|
|
57602
|
+
},
|
|
57532
57603
|
};
|
|
57533
57604
|
// Freeze viewport height and scale video to fit vertically
|
|
57534
|
-
transformed.media.width =
|
|
57535
|
-
|
|
57605
|
+
transformed.media.width =
|
|
57606
|
+
(original.media.width * original.dom.height) / original.media.height;
|
|
57607
|
+
transformed.media.height =
|
|
57608
|
+
(original.media.height * transformed.media.width) / original.media.width;
|
|
57536
57609
|
// If it didnt't fit, freeze viewport width and scale video to fit horizontally
|
|
57537
57610
|
if (transformed.media.width > original.dom.width) {
|
|
57538
|
-
transformed.media.height =
|
|
57539
|
-
|
|
57611
|
+
transformed.media.height =
|
|
57612
|
+
(original.media.height * original.dom.width) / original.media.width;
|
|
57613
|
+
transformed.media.width =
|
|
57614
|
+
(original.media.width * transformed.media.height) / original.media.height;
|
|
57540
57615
|
}
|
|
57541
57616
|
// Calculate paddings for vertical or horizontal letterboxing
|
|
57542
57617
|
if (transformed.media.width < original.dom.width) {
|
|
@@ -57572,8 +57647,8 @@ class Logo extends UIContainerPlugin {
|
|
|
57572
57647
|
}
|
|
57573
57648
|
get attributes() {
|
|
57574
57649
|
return {
|
|
57575
|
-
|
|
57576
|
-
'data-logo': ''
|
|
57650
|
+
class: 'player-logo',
|
|
57651
|
+
'data-logo': '',
|
|
57577
57652
|
};
|
|
57578
57653
|
}
|
|
57579
57654
|
get shouldRender() {
|
|
@@ -57631,16 +57706,16 @@ class Logo extends UIContainerPlugin {
|
|
|
57631
57706
|
return this;
|
|
57632
57707
|
}
|
|
57633
57708
|
setLogoImgAttrs() {
|
|
57634
|
-
const { logo: { path: imgUrl, width = 60, height = 60 } } = this.options;
|
|
57709
|
+
const { logo: { path: imgUrl, width = 60, height = 60 }, } = this.options;
|
|
57635
57710
|
this.$logoContainer = this.$el.find('.clappr-logo');
|
|
57636
57711
|
const $logo = this.$logoContainer.find('.clappr-logo-img');
|
|
57637
57712
|
$logo.attr({
|
|
57638
|
-
|
|
57639
|
-
|
|
57713
|
+
src: `${imgUrl}`,
|
|
57714
|
+
style: `width: ${width}px;height: ${height}px;`,
|
|
57640
57715
|
});
|
|
57641
57716
|
}
|
|
57642
57717
|
setLogoWidth(size) {
|
|
57643
|
-
let { logo: { width = 60, height = 60, objectFit = 'contain' } } = this.options;
|
|
57718
|
+
let { logo: { width = 60, height = 60, objectFit = 'contain' }, } = this.options;
|
|
57644
57719
|
const $logo = this.$logoContainer.find('.clappr-logo-img');
|
|
57645
57720
|
// TODO size must always be defined
|
|
57646
57721
|
if (size) {
|
|
@@ -57649,7 +57724,8 @@ class Logo extends UIContainerPlugin {
|
|
|
57649
57724
|
if (logoHeightTimes < 4) {
|
|
57650
57725
|
let maxTimes = logoHeightTimes;
|
|
57651
57726
|
if (logoWidthTimes < 4) {
|
|
57652
|
-
maxTimes =
|
|
57727
|
+
maxTimes =
|
|
57728
|
+
logoWidthTimes < logoHeightTimes ? logoWidthTimes : logoHeightTimes;
|
|
57653
57729
|
}
|
|
57654
57730
|
switch (maxTimes) {
|
|
57655
57731
|
case 0:
|
|
@@ -57687,7 +57763,7 @@ class Logo extends UIContainerPlugin {
|
|
|
57687
57763
|
}
|
|
57688
57764
|
}
|
|
57689
57765
|
$logo.attr({
|
|
57690
|
-
|
|
57766
|
+
style: `width: ${width}px;height: ${height}px;object-fit: ${objectFit}`,
|
|
57691
57767
|
});
|
|
57692
57768
|
}
|
|
57693
57769
|
setPosition() {
|
|
@@ -57704,17 +57780,20 @@ class Logo extends UIContainerPlugin {
|
|
|
57704
57780
|
const dimensions = calculateSize({
|
|
57705
57781
|
dom: {
|
|
57706
57782
|
width: targetRect.width,
|
|
57707
|
-
height: targetRect.height
|
|
57783
|
+
height: targetRect.height,
|
|
57708
57784
|
},
|
|
57709
57785
|
media: {
|
|
57710
57786
|
width: videoWidth,
|
|
57711
|
-
height: videoHeight
|
|
57712
|
-
}
|
|
57787
|
+
height: videoHeight,
|
|
57788
|
+
},
|
|
57713
57789
|
});
|
|
57714
57790
|
const { logo } = this.options;
|
|
57715
|
-
const { letterboxing: { vertical, horizontal } } = dimensions;
|
|
57791
|
+
const { letterboxing: { vertical, horizontal }, } = dimensions;
|
|
57716
57792
|
if (dimensions.media && dimensions.media.width && dimensions.media.height) {
|
|
57717
|
-
this.setLogoWidth({
|
|
57793
|
+
this.setLogoWidth({
|
|
57794
|
+
width: dimensions.media.width,
|
|
57795
|
+
height: dimensions.media.height,
|
|
57796
|
+
});
|
|
57718
57797
|
}
|
|
57719
57798
|
const el = this.$logoContainer.get(0);
|
|
57720
57799
|
this.setStyles(logo, ['top', 'bottom'], el, vertical);
|
|
@@ -57722,7 +57801,7 @@ class Logo extends UIContainerPlugin {
|
|
|
57722
57801
|
this.update();
|
|
57723
57802
|
}
|
|
57724
57803
|
setStyles(opts, props, el, value) {
|
|
57725
|
-
props.forEach(p => this.setStyle(opts, p, el, value));
|
|
57804
|
+
props.forEach((p) => this.setStyle(opts, p, el, value));
|
|
57726
57805
|
}
|
|
57727
57806
|
setStyle(opts, p, el, value) {
|
|
57728
57807
|
if (opts[p]) {
|
|
@@ -57765,19 +57844,20 @@ class MultiCamera extends UICorePlugin {
|
|
|
57765
57844
|
}
|
|
57766
57845
|
get attributes() {
|
|
57767
57846
|
return {
|
|
57768
|
-
|
|
57769
|
-
'data-multicamera': ''
|
|
57847
|
+
class: this.name,
|
|
57848
|
+
'data-multicamera': '',
|
|
57770
57849
|
};
|
|
57771
57850
|
}
|
|
57772
57851
|
get events() {
|
|
57773
57852
|
return {
|
|
57774
57853
|
'click [data-multicamera-selector-select]': 'onCameraSelect',
|
|
57775
|
-
'click [data-multicamera-button]': 'onShowLevelSelectMenu'
|
|
57854
|
+
'click [data-multicamera-button]': 'onShowLevelSelectMenu',
|
|
57776
57855
|
};
|
|
57777
57856
|
}
|
|
57778
57857
|
constructor(core) {
|
|
57779
57858
|
super(core);
|
|
57780
|
-
if (!this.options.multisources ||
|
|
57859
|
+
if (!this.options.multisources ||
|
|
57860
|
+
!Array.isArray(this.options.multisources)) {
|
|
57781
57861
|
this.destroy();
|
|
57782
57862
|
return;
|
|
57783
57863
|
}
|
|
@@ -57852,10 +57932,13 @@ class MultiCamera extends UICorePlugin {
|
|
|
57852
57932
|
// }
|
|
57853
57933
|
}
|
|
57854
57934
|
// TODO current source
|
|
57855
|
-
this.$el
|
|
57856
|
-
|
|
57857
|
-
|
|
57858
|
-
|
|
57935
|
+
this.$el.html(this.template({
|
|
57936
|
+
streams: this.multicamera,
|
|
57937
|
+
multisources_mode: this.options.multisourcesMode,
|
|
57938
|
+
}));
|
|
57939
|
+
if ((numActiveSources <= 1 &&
|
|
57940
|
+
this.options.multisourcesMode !== 'show_all') ||
|
|
57941
|
+
this.options.multisourcesMode === 'one_first') {
|
|
57859
57942
|
this.$el.hide();
|
|
57860
57943
|
}
|
|
57861
57944
|
else {
|
|
@@ -57871,13 +57954,19 @@ class MultiCamera extends UICorePlugin {
|
|
|
57871
57954
|
if (Object.prototype.hasOwnProperty.call(this.core.mediaControl, '$multiCameraSelector') &&
|
|
57872
57955
|
this.core.mediaControl.$multiCameraSelector.find('span.multicamera-icon').length > 0) {
|
|
57873
57956
|
if (~window.location.href.indexOf('whitenights.gcdn.co')) {
|
|
57874
|
-
this.core.mediaControl.$multiCameraSelector
|
|
57957
|
+
this.core.mediaControl.$multiCameraSelector
|
|
57958
|
+
.find('span.multicamera-icon')
|
|
57959
|
+
.append(streamsWhiteNightsIcon);
|
|
57875
57960
|
}
|
|
57876
57961
|
else if (~window.location.href.indexOf('momentosolutions.gcdn.co')) {
|
|
57877
|
-
this.core.mediaControl.$multiCameraSelector
|
|
57962
|
+
this.core.mediaControl.$multiCameraSelector
|
|
57963
|
+
.find('span.multicamera-icon')
|
|
57964
|
+
.append(streamsMomentoIcon);
|
|
57878
57965
|
}
|
|
57879
57966
|
else {
|
|
57880
|
-
this.core.mediaControl.$multiCameraSelector
|
|
57967
|
+
this.core.mediaControl.$multiCameraSelector
|
|
57968
|
+
.find('span.multicamera-icon')
|
|
57969
|
+
.append(streamsIcon);
|
|
57881
57970
|
}
|
|
57882
57971
|
}
|
|
57883
57972
|
this.highlightCurrentLevel();
|
|
@@ -57885,7 +57974,8 @@ class MultiCamera extends UICorePlugin {
|
|
|
57885
57974
|
return this;
|
|
57886
57975
|
}
|
|
57887
57976
|
onCameraSelect(event) {
|
|
57888
|
-
const value = event.currentTarget.dataset
|
|
57977
|
+
const value = event.currentTarget.dataset
|
|
57978
|
+
.multicameraSelectorSelect;
|
|
57889
57979
|
trace(`${T$7} onCameraSelect`, { value });
|
|
57890
57980
|
if (value !== undefined) {
|
|
57891
57981
|
this.changeById(parseInt(value, 10));
|
|
@@ -57902,13 +57992,13 @@ class MultiCamera extends UICorePlugin {
|
|
|
57902
57992
|
return;
|
|
57903
57993
|
}
|
|
57904
57994
|
if (this.currentCamera) {
|
|
57905
|
-
if (this.options.multisourcesMode ===
|
|
57995
|
+
if (this.options.multisourcesMode === 'only_live') {
|
|
57906
57996
|
this.behaviorLive(id, active);
|
|
57907
57997
|
}
|
|
57908
|
-
if (this.options.multisourcesMode ===
|
|
57998
|
+
if (this.options.multisourcesMode === 'one_first') {
|
|
57909
57999
|
this.behaviorOne(id, active);
|
|
57910
58000
|
}
|
|
57911
|
-
if (this.options.multisourcesMode ===
|
|
58001
|
+
if (this.options.multisourcesMode === 'show_all') {
|
|
57912
58002
|
this.behaviorAll(id, active);
|
|
57913
58003
|
}
|
|
57914
58004
|
}
|
|
@@ -58018,7 +58108,11 @@ class MultiCamera extends UICorePlugin {
|
|
|
58018
58108
|
// TODO figure out what this does
|
|
58019
58109
|
playbackOptions.recycleVideo = Browser.isMobile;
|
|
58020
58110
|
this.currentCamera = this.findElementById(id) ?? null;
|
|
58021
|
-
trace(`${T$7} changeById`, {
|
|
58111
|
+
trace(`${T$7} changeById`, {
|
|
58112
|
+
id,
|
|
58113
|
+
currentCamera: this.currentCamera,
|
|
58114
|
+
multicamera: this.multicamera,
|
|
58115
|
+
});
|
|
58022
58116
|
if (!this.currentCamera) {
|
|
58023
58117
|
return;
|
|
58024
58118
|
}
|
|
@@ -58041,11 +58135,12 @@ class MultiCamera extends UICorePlugin {
|
|
|
58041
58135
|
playback: playbackOptions,
|
|
58042
58136
|
source: this.currentCamera.source, // TODO ensure that the preferred transport is used
|
|
58043
58137
|
video360: {
|
|
58138
|
+
// TODO
|
|
58044
58139
|
projection: this.currentCamera.projection,
|
|
58045
58140
|
},
|
|
58046
58141
|
fullscreenDisable,
|
|
58047
58142
|
autoPlay: this.playing,
|
|
58048
|
-
disableCanAutoPlay: true
|
|
58143
|
+
disableCanAutoPlay: true,
|
|
58049
58144
|
});
|
|
58050
58145
|
this.core.activeContainer.mediaControlDisabled = false;
|
|
58051
58146
|
});
|
|
@@ -58079,12 +58174,16 @@ class MultiCamera extends UICorePlugin {
|
|
|
58079
58174
|
// return this.$('.multicamera button .quality-text');
|
|
58080
58175
|
// }
|
|
58081
58176
|
levelElement(id) {
|
|
58082
|
-
return this.$('.multicamera ul li > div' +
|
|
58177
|
+
return this.$('.multicamera ul li > div' +
|
|
58178
|
+
(id !== undefined
|
|
58179
|
+
? '[data-multicamera-selector-select="' + id + '"]'
|
|
58180
|
+
: ''));
|
|
58083
58181
|
}
|
|
58084
58182
|
highlightCurrentLevel() {
|
|
58085
58183
|
this.levelElement().removeClass('current');
|
|
58086
58184
|
this.levelElement().removeClass('multicamera-active');
|
|
58087
|
-
this.currentCamera &&
|
|
58185
|
+
this.currentCamera &&
|
|
58186
|
+
this.levelElement(this.currentCamera.id).addClass('multicamera-active');
|
|
58088
58187
|
}
|
|
58089
58188
|
}
|
|
58090
58189
|
|
|
@@ -58134,7 +58233,7 @@ class PictureInPicture extends UICorePlugin {
|
|
|
58134
58233
|
}
|
|
58135
58234
|
get attributes() {
|
|
58136
58235
|
return {
|
|
58137
|
-
|
|
58236
|
+
class: 'media-control-pip',
|
|
58138
58237
|
};
|
|
58139
58238
|
}
|
|
58140
58239
|
get videoElement() {
|
|
@@ -58155,7 +58254,8 @@ class PictureInPicture extends UICorePlugin {
|
|
|
58155
58254
|
pictureInPictureEnabled: !!document.pictureInPictureEnabled,
|
|
58156
58255
|
requestPictureInPicture: !!HTMLVideoElement.prototype.requestPictureInPicture,
|
|
58157
58256
|
});
|
|
58158
|
-
return document.pictureInPictureEnabled &&
|
|
58257
|
+
return (document.pictureInPictureEnabled &&
|
|
58258
|
+
!!HTMLVideoElement.prototype.requestPictureInPicture);
|
|
58159
58259
|
}
|
|
58160
58260
|
/**
|
|
58161
58261
|
* @internal
|
|
@@ -58895,8 +58995,8 @@ class QualityLevels extends UICorePlugin {
|
|
|
58895
58995
|
get maxLevel() {
|
|
58896
58996
|
const maxRes = this.pluginOptions.restrictResolution;
|
|
58897
58997
|
return maxRes
|
|
58898
|
-
? this.levels.find((level) => (level.height > level.width ? level.width : level.height) ===
|
|
58899
|
-
maxRes)?.level ?? -1
|
|
58998
|
+
? (this.levels.find((level) => (level.height > level.width ? level.width : level.height) ===
|
|
58999
|
+
maxRes)?.level ?? -1)
|
|
58900
59000
|
: -1;
|
|
58901
59001
|
}
|
|
58902
59002
|
onLevelsAvailable(levels) {
|
|
@@ -59151,8 +59251,8 @@ class Share extends UICorePlugin {
|
|
|
59151
59251
|
}
|
|
59152
59252
|
get attributes() {
|
|
59153
59253
|
return {
|
|
59154
|
-
|
|
59155
|
-
'data-share': ''
|
|
59254
|
+
class: this.name + '_plugin',
|
|
59255
|
+
'data-share': '',
|
|
59156
59256
|
};
|
|
59157
59257
|
}
|
|
59158
59258
|
get events() {
|
|
@@ -59162,7 +59262,7 @@ class Share extends UICorePlugin {
|
|
|
59162
59262
|
'click [data-share-fb]': 'onShareFB',
|
|
59163
59263
|
'click [data-share-tw]': 'onShareTW',
|
|
59164
59264
|
'click [data-share-link]': 'onShareLinkClick',
|
|
59165
|
-
'click [data-share-embed]': 'onShareEmbedClick'
|
|
59265
|
+
'click [data-share-embed]': 'onShareEmbedClick',
|
|
59166
59266
|
};
|
|
59167
59267
|
}
|
|
59168
59268
|
bindEvents() {
|
|
@@ -59197,12 +59297,12 @@ class Share extends UICorePlugin {
|
|
|
59197
59297
|
}
|
|
59198
59298
|
render() {
|
|
59199
59299
|
this.$el.html(this.template({
|
|
59200
|
-
|
|
59201
|
-
|
|
59202
|
-
|
|
59203
|
-
|
|
59204
|
-
|
|
59205
|
-
|
|
59300
|
+
url: this.options.shareURL,
|
|
59301
|
+
embed: this.options.embed,
|
|
59302
|
+
embed_title: this.core.i18n.t('embed_title'),
|
|
59303
|
+
share_title: this.core.i18n.t('share_title'),
|
|
59304
|
+
link_title: this.core.i18n.t('link_title'),
|
|
59305
|
+
social_title: this.core.i18n.t('social_title'),
|
|
59206
59306
|
}));
|
|
59207
59307
|
this.core.mediaControl.$el.append(this.el);
|
|
59208
59308
|
this.$el.find('.share-container').hide();
|
|
@@ -59219,7 +59319,8 @@ class Share extends UICorePlugin {
|
|
|
59219
59319
|
this.$el.removeClass('share-hide');
|
|
59220
59320
|
}
|
|
59221
59321
|
initializeIcons() {
|
|
59222
|
-
this.$el
|
|
59322
|
+
this.$el
|
|
59323
|
+
.find('button.media-control-button[data-share-button]')
|
|
59223
59324
|
.addClass('gcore-skin-button-color')
|
|
59224
59325
|
.append(shareIcon);
|
|
59225
59326
|
this.$el.find('div.share-container-header--close').append(closeIcon);
|
|
@@ -59245,10 +59346,14 @@ class Share extends UICorePlugin {
|
|
|
59245
59346
|
}
|
|
59246
59347
|
}
|
|
59247
59348
|
onShareLinkClick() {
|
|
59248
|
-
this.$el
|
|
59349
|
+
this.$el
|
|
59350
|
+
.find('.share-container-header--link')[0]
|
|
59351
|
+
.setSelectionRange(0, this.options.shareURL.length);
|
|
59249
59352
|
}
|
|
59250
59353
|
onShareEmbedClick() {
|
|
59251
|
-
this.$el
|
|
59354
|
+
this.$el
|
|
59355
|
+
.find('.share-container-header--embed')[0]
|
|
59356
|
+
.setSelectionRange(0, this.options.embed.length);
|
|
59252
59357
|
}
|
|
59253
59358
|
}
|
|
59254
59359
|
|
|
@@ -59856,8 +59961,7 @@ class ClosedCaptions extends UICorePlugin {
|
|
|
59856
59961
|
};
|
|
59857
59962
|
}
|
|
59858
59963
|
get preselectedLanguage() {
|
|
59859
|
-
return (this.core.options.cc?.language ??
|
|
59860
|
-
this.core.options.subtitles?.language);
|
|
59964
|
+
return (this.core.options.cc?.language ?? this.core.options.subtitles?.language);
|
|
59861
59965
|
}
|
|
59862
59966
|
isPreselectedLanguage(language) {
|
|
59863
59967
|
if (!this.preselectedLanguage) {
|
|
@@ -60211,7 +60315,9 @@ class ClosedCaptions extends UICorePlugin {
|
|
|
60211
60315
|
if (this.core.activePlayback?.name === 'dash') {
|
|
60212
60316
|
return true;
|
|
60213
60317
|
}
|
|
60214
|
-
const mode = this.core.options.cc?.mode ??
|
|
60318
|
+
const mode = this.core.options.cc?.mode ??
|
|
60319
|
+
this.core.options.subtitles?.mode ??
|
|
60320
|
+
'custom';
|
|
60215
60321
|
// TODO or Safari? or iOS?
|
|
60216
60322
|
return mode === 'native';
|
|
60217
60323
|
}
|
|
@@ -63385,8 +63491,7 @@ class Thumbnails extends UICorePlugin {
|
|
|
63385
63491
|
}
|
|
63386
63492
|
}
|
|
63387
63493
|
function parseVTT(vtt) {
|
|
63388
|
-
const correctedVTT = (vtt.startsWith('WEBVTT') ? vtt : 'WEBVTT\n\n' + vtt)
|
|
63389
|
-
.replace(/(\d+:\d+:\d+),(\d+)/g, '$1.$2');
|
|
63494
|
+
const correctedVTT = (vtt.startsWith('WEBVTT') ? vtt : 'WEBVTT\n\n' + vtt).replace(/(\d+:\d+:\d+),(\d+)/g, '$1.$2');
|
|
63390
63495
|
const parser = new browserIndexExports.WebVTT.Parser(window);
|
|
63391
63496
|
const cues = [];
|
|
63392
63497
|
parser.oncue = (cue) => {
|
|
@@ -63394,7 +63499,7 @@ function parseVTT(vtt) {
|
|
|
63394
63499
|
id: cue.id,
|
|
63395
63500
|
start: cue.startTime,
|
|
63396
63501
|
end: cue.endTime,
|
|
63397
|
-
text: cue.text
|
|
63502
|
+
text: cue.text,
|
|
63398
63503
|
});
|
|
63399
63504
|
};
|
|
63400
63505
|
parser.onparsingerror = reportError;
|
|
@@ -63515,4 +63620,4 @@ class VolumeFade extends UICorePlugin {
|
|
|
63515
63620
|
}
|
|
63516
63621
|
}
|
|
63517
63622
|
|
|
63518
|
-
export { AudioTracks as AudioSelector, AudioTracks, BigMuteButton, BottomGear, NerdStats as ClapprNerdStats, ClapprStats, ClapprStatsChronograph, ClapprStatsCounter, ClapprStatsEvents, ClickToPause, Clips, ClosedCaptions, CmcdConfig, ContextMenu, DvrControls, ErrorScreen, ExtendedEvents, Favicon, GearEvents, GoogleAnalytics, QualityLevels as LevelSelector, LogTracer, Logger$1 as Logger, Logo, MediaControl, MultiCamera, NerdStats, PictureInPicture, PlaybackErrorCode, PlaybackRate, Player, PlayerEvent, Poster, QualityLevels, SeekTime, SentryTracer, Share, SkipTime, SourceController, SpinnerThreeBounce as Spinner, SpinnerEvents, SpinnerThreeBounce, ClosedCaptions as Subtitles, Telemetry, TelemetryEvent, Thumbnails, VolumeFade, VolumeFadeEvents, reportError, setTracer, trace, version };
|
|
63623
|
+
export { AudioTracks as AudioSelector, AudioTracks, BigMuteButton, BottomGear, ChainedTracer, NerdStats as ClapprNerdStats, ClapprStats, ClapprStatsChronograph, ClapprStatsCounter, ClapprStatsEvents, ClickToPause, Clips, ClosedCaptions, CmcdConfig, ContextMenu, DvrControls, ErrorScreen, ExtendedEvents, Favicon, GearEvents, GoogleAnalytics, QualityLevels as LevelSelector, LogTracer, Logger$1 as Logger, Logo, MediaControl, MultiCamera, NerdStats, PictureInPicture, PlaybackErrorCode, PlaybackRate, Player, PlayerEvent, Poster, QualityLevels, SeekTime, SentryTracer, Share, SkipTime, SourceController, SpinnerThreeBounce as Spinner, SpinnerEvents, SpinnerThreeBounce, ClosedCaptions as Subtitles, Telemetry, TelemetryEvent, Thumbnails, VolumeFade, VolumeFadeEvents, reportError, setTracer, trace, version };
|