@gcorevideo/player 2.28.25 → 2.28.27
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 +166 -61
- package/dist/index.css +395 -395
- package/dist/index.embed.js +155 -66
- package/dist/index.js +355 -151
- 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 +3 -3
- package/src/Player.ts +10 -10
- package/src/__tests__/Player.test.ts +33 -10
- package/src/index.core.ts +10 -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
|
@@ -20,7 +20,7 @@ export default class Roll extends Events {
|
|
|
20
20
|
_adsManager;
|
|
21
21
|
url = '';
|
|
22
22
|
// _events: Record<string, Function>;
|
|
23
|
-
constructor({ core, $skipAd, $muteIcon, $areaClick, mute, volume, prevVolume }) {
|
|
23
|
+
constructor({ core, $skipAd, $muteIcon, $areaClick, mute, volume, prevVolume, }) {
|
|
24
24
|
super();
|
|
25
25
|
this.mute = mute;
|
|
26
26
|
this.core = core;
|
|
@@ -97,13 +97,14 @@ export default class Roll extends Events {
|
|
|
97
97
|
this.core.options.mute = !volume;
|
|
98
98
|
this.trigger('volume', {
|
|
99
99
|
volume,
|
|
100
|
-
mute: this.core.options.mute
|
|
100
|
+
mute: this.core.options.mute,
|
|
101
101
|
});
|
|
102
102
|
if (this.container.advertisement.type !== 'scteroll') {
|
|
103
103
|
this.core.mediaControl.setVolume(volume, true);
|
|
104
104
|
}
|
|
105
105
|
else {
|
|
106
106
|
if (volume) {
|
|
107
|
+
;
|
|
107
108
|
this.container.advertisement.isMuted = true;
|
|
108
109
|
}
|
|
109
110
|
else {
|
|
@@ -133,7 +134,7 @@ export default class Roll extends Events {
|
|
|
133
134
|
this.$muteIcon.css({ opacity: 1, visibility: 'visible' });
|
|
134
135
|
}
|
|
135
136
|
}
|
|
136
|
-
_requestAd({ xml, url, extension }) {
|
|
137
|
+
_requestAd({ xml, url, extension, }) {
|
|
137
138
|
this.extension = extension;
|
|
138
139
|
assert('google' in window, 'Google IMA SDK not found');
|
|
139
140
|
const adsLoader = new window.google.ima.AdsLoader(Roll._adDisplayContainer);
|
|
@@ -167,7 +168,8 @@ export default class Roll extends Events {
|
|
|
167
168
|
playerResize() {
|
|
168
169
|
assert(Roll._contentElement, 'content element not found');
|
|
169
170
|
assert('google' in window, 'Google IMA SDK not found');
|
|
170
|
-
this._adsManager &&
|
|
171
|
+
this._adsManager &&
|
|
172
|
+
this._adsManager.resize(Roll._contentElement.offsetWidth, Roll._contentElement.offsetHeight, window.google.ima.ViewMode.NORMAL);
|
|
171
173
|
}
|
|
172
174
|
_onAdsManagerLoaded(adsManagerLoadedEvent) {
|
|
173
175
|
assert('google' in window, 'Google IMA SDK not found');
|
|
@@ -187,7 +189,8 @@ export default class Roll extends Events {
|
|
|
187
189
|
});
|
|
188
190
|
this._adsManager.addEventListener(window.google.ima.AdErrorEvent.Type.AD_ERROR, (e) => {
|
|
189
191
|
const adType = this.container.advertisement.type;
|
|
190
|
-
if (!((adType === 'middleroll' || adType === 'repeatableroll') &&
|
|
192
|
+
if (!((adType === 'middleroll' || adType === 'repeatableroll') &&
|
|
193
|
+
!this._playback.isPlaying())) {
|
|
191
194
|
this._onAdError(e);
|
|
192
195
|
}
|
|
193
196
|
});
|
|
@@ -211,7 +214,8 @@ export default class Roll extends Events {
|
|
|
211
214
|
try {
|
|
212
215
|
assert(Roll._contentElement, 'content element not found');
|
|
213
216
|
assert('google' in window, 'Google IMA SDK not found');
|
|
214
|
-
this._adsManager &&
|
|
217
|
+
this._adsManager &&
|
|
218
|
+
this._adsManager.resize(Roll._contentElement.offsetWidth, Roll._contentElement.offsetHeight, window.google.ima.ViewMode.NORMAL);
|
|
215
219
|
}
|
|
216
220
|
catch (error) {
|
|
217
221
|
// LogManager.exception(error);
|
|
@@ -284,7 +288,7 @@ export default class Roll extends Events {
|
|
|
284
288
|
if (!this._isAdStartedTriggered) {
|
|
285
289
|
this._isAdStartedTriggered = true;
|
|
286
290
|
this.trigger('advertisement_started', {
|
|
287
|
-
url
|
|
291
|
+
url,
|
|
288
292
|
});
|
|
289
293
|
}
|
|
290
294
|
}
|
|
@@ -305,7 +309,8 @@ export default class Roll extends Events {
|
|
|
305
309
|
return;
|
|
306
310
|
}
|
|
307
311
|
this.$skipAd.show();
|
|
308
|
-
const offset = Math.round(this.extension.timeOffset -
|
|
312
|
+
const offset = Math.round(this.extension.timeOffset -
|
|
313
|
+
Math.abs(this.firstRemaininTime - remainingTime));
|
|
309
314
|
if (offset > 0) {
|
|
310
315
|
this.$skipAd.addClass('skip-ad-time');
|
|
311
316
|
this.$skipAd.text(this.core.i18n.t('you_can_skip_ad') + ' ' + offset);
|
|
@@ -326,7 +331,8 @@ export default class Roll extends Events {
|
|
|
326
331
|
this.trigger('continue_ad', { error });
|
|
327
332
|
}
|
|
328
333
|
_imaEvent(eventName, e) {
|
|
329
|
-
$.isFunction(this._events[eventName]) &&
|
|
334
|
+
$.isFunction(this._events[eventName]) &&
|
|
335
|
+
this._events[eventName](e);
|
|
330
336
|
}
|
|
331
337
|
changeIconVolume() {
|
|
332
338
|
if (!this._adsManager) {
|
|
@@ -356,7 +362,7 @@ export default class Roll extends Events {
|
|
|
356
362
|
this.$muteIcon.on('click', () => {
|
|
357
363
|
if (this._adsManager) {
|
|
358
364
|
if (this._adsManager.getVolume() === 0) {
|
|
359
|
-
this._setVolume(
|
|
365
|
+
this._setVolume(this._prevValueVolume ? this._prevValueVolume : this._volume);
|
|
360
366
|
}
|
|
361
367
|
else {
|
|
362
368
|
this._setVolume(0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rollmanager.d.ts","sourceRoot":"","sources":["../../../src/plugins/vast-ads/rollmanager.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"rollmanager.d.ts","sourceRoot":"","sources":["../../../src/plugins/vast-ads/rollmanager.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,IAAI,EACJ,MAAM,EAMP,MAAM,cAAc,CAAA;AAMrB,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,UAAU,EAAc,UAAU,EAAkB,MAAM,YAAY,CAAA;AAE/E,KAAK,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAI1C,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,MAAM;IAqC3C,OAAO,CAAC,IAAI;IACZ,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,SAAS;IACjB,OAAO,CAAC,UAAU;IAClB,OAAO,CAAC,YAAY;IACpB,OAAO,CAAC,IAAI;IACZ,OAAO,CAAC,SAAS;IACjB,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,UAAU;IA7CpB,OAAO,CAAC,cAAc,CAAQ;IAE9B,OAAO,CAAC,UAAU,CAAW;IAC7B,OAAO,CAAC,SAAS,CAAW;IAE5B,OAAO,CAAC,QAAQ,CAAa;IAE7B,OAAO,CAAC,cAAc,CAAgB;IAEtC,OAAO,CAAC,SAAS,CAAU;IAE3B,OAAO,CAAC,eAAe,CAAkB;IAEzC,OAAO,CAAC,aAAa,CAAmB;IAExC,OAAO,CAAC,mBAAmB,CAAiB;IAE5C,OAAO,CAAC,WAAW,CAA4B;IAI/C,OAAO,CAAC,SAAS,CAA6B;IAE9C,OAAO,CAAC,iBAAiB,CAAI;IAE7B,OAAO,CAAC,aAAa,CAA2B;IAEhD,OAAO,CAAC,SAAS,CAAQ;IAEzB,OAAO,CAAC,OAAO,CAAyB;IAExC,OAAO,CAAC,GAAG,CAAQ;IAEnB,OAAO,CAAC,IAAI,CAAoB;gBAGtB,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,WAAW,EACpB,SAAS,EAAE,WAAW,EACtB,UAAU,EAAE,WAAW,EACvB,YAAY,EAAE,WAAW,EACzB,IAAI,EAAE,UAAU,EAChB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM;IAqB5B,OAAO,CAAC,cAAc;IAqCtB,YAAY,CAAC,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE;IAMjD,OAAO,CAAC,WAAW;IAInB,UAAU;IAIV,OAAO,CAAC,eAAe;IAIvB,OAAO,CAAC,YAAY;IAUpB,mBAAmB;IAUnB,oBAAoB;IAOd,SAAS;IAkCT,OAAO,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU;IAmDhD,gBAAgB;IAOhB,OAAO,CAAC,UAAU;IAQlB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAsCxB,MAAM,CAAC,GAAG,EAAE,MAAM;IAgExB,UAAU,CAAC,YAAY,EAAE,GAAG;IAmB5B,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,CAAC,EAAE,GAAG;IAKnC;;;OAGG;IACG,iBAAiB,CAAC,IAAI,EAAE,GAAG;IAkBjC,iBAAiB;IAejB,WAAW;CASZ"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $, Browser, Events, HTML5Video, Log, Utils } from '@clappr/core';
|
|
1
|
+
import { $, Browser, Events, HTML5Video, Log, Utils, } from '@clappr/core';
|
|
2
2
|
import { reportError } from '@gcorevideo/utils';
|
|
3
3
|
import assert from 'assert';
|
|
4
4
|
import LoaderXML from './loaderxml.js';
|
|
@@ -61,7 +61,7 @@ export default class RollManager extends Events {
|
|
|
61
61
|
this._events = {};
|
|
62
62
|
this._pr = Math.floor(Math.random() * 1000000);
|
|
63
63
|
}
|
|
64
|
-
initializeRoll({ xml, url, extension }) {
|
|
64
|
+
initializeRoll({ xml, url, extension, }) {
|
|
65
65
|
try {
|
|
66
66
|
this.roll = new Roll({
|
|
67
67
|
core: this.core,
|
|
@@ -70,7 +70,7 @@ export default class RollManager extends Events {
|
|
|
70
70
|
$areaClick: this.$areaClick,
|
|
71
71
|
mute: !!this.options.mute,
|
|
72
72
|
volume: this.volume,
|
|
73
|
-
prevVolume: this.prevVolume
|
|
73
|
+
prevVolume: this.prevVolume,
|
|
74
74
|
});
|
|
75
75
|
// @ts-ignore
|
|
76
76
|
this.roll.on('volume', this.changeVolume.bind(this));
|
|
@@ -148,7 +148,10 @@ export default class RollManager extends Events {
|
|
|
148
148
|
});
|
|
149
149
|
}
|
|
150
150
|
if (this.type === 'middleroll' || this.type === 'repeatableroll') {
|
|
151
|
-
this.trigger('change_counter', {
|
|
151
|
+
this.trigger('change_counter', {
|
|
152
|
+
type: this.type,
|
|
153
|
+
value: this.countRoll + rollList.length,
|
|
154
|
+
});
|
|
152
155
|
}
|
|
153
156
|
await this.startAd(this.type, { data: rollList, oneByOne });
|
|
154
157
|
}
|
|
@@ -288,7 +291,11 @@ export default class RollManager extends Events {
|
|
|
288
291
|
reportError(error);
|
|
289
292
|
}
|
|
290
293
|
this.extension = data;
|
|
291
|
-
this.initializeRoll({
|
|
294
|
+
this.initializeRoll({
|
|
295
|
+
xml: data.config,
|
|
296
|
+
url: String(data.url || url),
|
|
297
|
+
extension: data,
|
|
298
|
+
});
|
|
292
299
|
}
|
|
293
300
|
_onAdError(adErrorEvent) {
|
|
294
301
|
try {
|
|
@@ -306,7 +313,8 @@ export default class RollManager extends Events {
|
|
|
306
313
|
this._cleverContinueAd(true);
|
|
307
314
|
}
|
|
308
315
|
_imaEvent(eventName, e) {
|
|
309
|
-
$.isFunction(this._events[eventName]) &&
|
|
316
|
+
$.isFunction(this._events[eventName]) &&
|
|
317
|
+
this._events[eventName](e);
|
|
310
318
|
}
|
|
311
319
|
/**
|
|
312
320
|
* определяет, что дальше будет запускаться реклама или контент
|
|
@@ -315,7 +323,9 @@ export default class RollManager extends Events {
|
|
|
315
323
|
async _cleverContinueAd(data) {
|
|
316
324
|
this.destroyRoll();
|
|
317
325
|
const error = data.error;
|
|
318
|
-
if ((this._allURLRequest || error) &&
|
|
326
|
+
if ((this._allURLRequest || error) &&
|
|
327
|
+
this.adTemplates &&
|
|
328
|
+
this.adTemplates.length > 0) {
|
|
319
329
|
const adTemplate = this.adTemplates.shift();
|
|
320
330
|
// @ts-ignore
|
|
321
331
|
await this.loadAd(adTemplate.url);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Events, Playback } from '@clappr/core';
|
|
2
2
|
import { Events as HlsEvents, FragChangedData } from 'hls.js';
|
|
3
3
|
type CueResult = {
|
|
4
|
-
kind?:
|
|
4
|
+
kind?: 'in' | 'out' | 'out_cont';
|
|
5
5
|
duration?: number;
|
|
6
6
|
};
|
|
7
7
|
export default class SCTEManager extends Events {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sctemanager.d.ts","sourceRoot":"","sources":["../../../src/plugins/vast-ads/sctemanager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"sctemanager.d.ts","sourceRoot":"","sources":["../../../src/plugins/vast-ads/sctemanager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAE,MAAM,IAAI,SAAS,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;AAM7D,KAAK,SAAS,GAAG;IAAE,IAAI,CAAC,EAAE,IAAI,GAAG,KAAK,GAAG,UAAU,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAExE,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,MAAM;IAC7C,OAAO,CAAC,SAAS,CAAwB;IAEzC,OAAO,CAAC,cAAc,CAAQ;IAE9B,IAAI,QAAQ,CAAC,KAAK,EAAE,QAAQ,EA6B3B;IAED,IAAI,QAAQ,IAAI,QAAQ,GAAG,IAAI,CAE9B;IAED,oBAAoB;IAgBpB,iBAAiB,CAAC,CAAC,EAAE,SAAS,CAAC,YAAY,EAAE,IAAI,EAAE,eAAe;IA2BlE,SAAS;IAOT,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,GAAG,SAAS;CAoDxC"}
|
|
@@ -45,7 +45,7 @@ export default class SCTEManager extends Events {
|
|
|
45
45
|
this._scteIsStarted = true;
|
|
46
46
|
console.warn('scteroll will be started');
|
|
47
47
|
this.trigger('startSCTERoll', {
|
|
48
|
-
duration: cue.duration
|
|
48
|
+
duration: cue.duration,
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
51
|
}
|
|
@@ -106,10 +106,11 @@ export default class SCTEManager extends Events {
|
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
});
|
|
109
|
-
kind &&
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
109
|
+
kind &&
|
|
110
|
+
(cueResult = {
|
|
111
|
+
kind,
|
|
112
|
+
duration,
|
|
113
|
+
});
|
|
113
114
|
}
|
|
114
115
|
return cueResult;
|
|
115
116
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/plugins/vast-ads/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/plugins/vast-ads/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAClB,SAAS,GACT,YAAY,GACZ,gBAAgB,GAChB,WAAW,GACX,UAAU,GACV,UAAU,CAAA;AAEd,MAAM,MAAM,UAAU,GAAG;IACvB,SAAS,EAAE,MAAM,CAAA;IACjB,gBAAgB,EAAE,MAAM,CAAA;IACxB,GAAG,EAAE,MAAM,CAAA;CACZ,CAAA;AAED,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,UAAU,EAAE,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"urlhandler.d.ts","sourceRoot":"","sources":["../../../src/plugins/vast-ads/urlhandler.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"urlhandler.d.ts","sourceRoot":"","sources":["../../../src/plugins/vast-ads/urlhandler.ts"],"names":[],"mappings":"AAOA,MAAM,CAAC,OAAO,OAAO,UAAU;IAC7B,MAAM,CAAC,GAAG,CACR,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,GAAG,EACZ,EAAE,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,EAAE,QAAQ,CAAC,EAAE,GAAG,KAAK,IAAI;CA8BjD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xmlhttprequest.d.ts","sourceRoot":"","sources":["../../../src/plugins/vast-ads/xmlhttprequest.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,OAAO,OAAO,aAAa;IAChC,MAAM,CAAC,SAAS,IAAI,cAAc,GAAG,KAAK;
|
|
1
|
+
{"version":3,"file":"xmlhttprequest.d.ts","sourceRoot":"","sources":["../../../src/plugins/vast-ads/xmlhttprequest.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,OAAO,OAAO,aAAa;IAChC,MAAM,CAAC,SAAS,IAAI,cAAc,GAAG,KAAK;IAW1C,MAAM,CAAC,SAAS;IAIhB,MAAM,CAAC,GAAG,CACR,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,GAAG,EACZ,EAAE,EAAE,CAAC,GAAG,EAAE,KAAK,GAAG,IAAI,EAAE,QAAQ,CAAC,EAAE,GAAG,KAAK,IAAI;CA0BlD"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { reportError } from '@gcorevideo/utils';
|
|
2
|
-
import assert from
|
|
2
|
+
import assert from 'assert';
|
|
3
3
|
export default class XHRURLHandler {
|
|
4
4
|
static xhrCreate() {
|
|
5
5
|
const xhr = new window.XMLHttpRequest();
|
|
6
|
-
if ('withCredentials' in xhr) {
|
|
6
|
+
if ('withCredentials' in xhr) {
|
|
7
|
+
// check CORS support
|
|
7
8
|
return xhr;
|
|
8
9
|
}
|
|
9
10
|
return false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xmlmerge.d.ts","sourceRoot":"","sources":["../../../src/plugins/vast-ads/xmlmerge.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,OAAO,OAAO,SAAS;IAC5B,OAAO,CAAC,QAAQ,
|
|
1
|
+
{"version":3,"file":"xmlmerge.d.ts","sourceRoot":"","sources":["../../../src/plugins/vast-ads/xmlmerge.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,OAAO,OAAO,SAAS;IAC5B,OAAO,CAAC,QAAQ,CAAU;IAC1B,OAAO,CAAC,SAAS,CAAU;IAE3B,OAAO,CAAC,SAAS,CAA2B;IAC5C,OAAO,CAAC,UAAU,CAA2B;gBAEjC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;IAOtC,KAAK;IAaL,SAAS,CACP,KAAK,EAAE,gBAAgB,CAAC,OAAO,CAAC,EAChC,MAAM,EAAE,gBAAgB,CAAC,OAAO,CAAC,EACjC,MAAM,CAAC,EAAE,OAAO,GACf,gBAAgB,CAAC,OAAO,CAAC;IAsC5B,aAAa,CACX,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,gBAAgB,CAAC,OAAO,CAAC,GAC7B,OAAO,GAAG,IAAI;IAcjB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ;CAgBpC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { reportError } from '@gcorevideo/utils';
|
|
2
|
-
import assert from
|
|
2
|
+
import assert from 'assert';
|
|
3
3
|
export default class MergeVast {
|
|
4
4
|
firstXML;
|
|
5
5
|
secondXML;
|
|
@@ -69,8 +69,9 @@ export default class MergeVast {
|
|
|
69
69
|
}
|
|
70
70
|
_stringToXML(val) {
|
|
71
71
|
let xmlDoc = null;
|
|
72
|
-
if (document.implementation &&
|
|
73
|
-
|
|
72
|
+
if (document.implementation &&
|
|
73
|
+
document.implementation.createDocument) {
|
|
74
|
+
return new DOMParser().parseFromString(val, 'application/xml');
|
|
74
75
|
}
|
|
75
76
|
else if ('ActiveXObject' in window) {
|
|
76
77
|
xmlDoc = new window.ActiveXObject('Microsoft.XMLDOM');
|
package/lib/types.d.ts
CHANGED
package/lib/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clickaway.d.ts","sourceRoot":"","sources":["../../src/utils/clickaway.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,
|
|
1
|
+
{"version":3,"file":"clickaway.d.ts","sourceRoot":"","sources":["../../src/utils/clickaway.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,IAGpC,MAAM,WAAW,GAAG,IAAI,UAajC;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,IAAI,UAK1C,WAAW,GAAG,IAAI,UAKjC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mediaSources.d.ts","sourceRoot":"","sources":["../../src/utils/mediaSources.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACpB,MAAM,UAAU,CAAA;AAIjB,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,qBAAqB,EAAE,EAChC,iBAAiB,GAAE,mBAA4B,GAC9C,qBAAqB,EAAE,
|
|
1
|
+
{"version":3,"file":"mediaSources.d.ts","sourceRoot":"","sources":["../../src/utils/mediaSources.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACpB,MAAM,UAAU,CAAA;AAIjB,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,qBAAqB,EAAE,EAChC,iBAAiB,GAAE,mBAA4B,GAC9C,qBAAqB,EAAE,CAqCzB;AAED,wBAAgB,YAAY,CAAC,CAAC,EAAE,iBAAiB,GAAG,MAAM,CAEzD;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,iBAAiB,GAAG,qBAAqB,CAEtE;AAYD,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,WAK7D;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,WAO5D"}
|
|
@@ -10,9 +10,7 @@ export function buildMediaSourcesList(sources, priorityTransport = 'dash') {
|
|
|
10
10
|
}
|
|
11
11
|
const [preferred, rest] = sources.reduce(([preferred, rest], item) => {
|
|
12
12
|
for (const p of playbacks) {
|
|
13
|
-
if ([
|
|
14
|
-
'html5_audio', 'html_img', 'no_op'
|
|
15
|
-
].includes(p.prototype.name)) {
|
|
13
|
+
if (['html5_audio', 'html_img', 'no_op'].includes(p.prototype.name)) {
|
|
16
14
|
continue;
|
|
17
15
|
}
|
|
18
16
|
const canPlay = p.canPlay(item.source, item.mimeType);
|
package/lib/utils/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/utils/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/utils/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAA"}
|
package/lib/version.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as pkg from '../package.json' with {
|
|
2
|
-
import * as lock from '../package-lock.json' with {
|
|
1
|
+
import * as pkg from '../package.json' with { type: 'json' };
|
|
2
|
+
import * as lock from '../package-lock.json' with { type: 'json' };
|
|
3
3
|
/**
|
|
4
4
|
* Version information about the gplayer and its main dependencies
|
|
5
5
|
* @returns Version information about the gplayer and its main dependencies
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gcorevideo/player",
|
|
3
|
-
"version": "2.28.
|
|
3
|
+
"version": "2.28.27",
|
|
4
4
|
"description": "Gcore JavaScript video player",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -59,10 +59,10 @@
|
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
61
|
"@clappr/core": "^0.13.0",
|
|
62
|
-
"@gcorevideo/utils": "^0.
|
|
62
|
+
"@gcorevideo/utils": "^0.7.1",
|
|
63
63
|
"@sentry/types": "^8.47.0",
|
|
64
64
|
"dashjs": "^4.7.4",
|
|
65
|
-
"hls.js": "^1.
|
|
65
|
+
"hls.js": "^1.6.15",
|
|
66
66
|
"human-format": "^1.2.1",
|
|
67
67
|
"mousetrap": "^1.6.5",
|
|
68
68
|
"videojs-vtt.js": "^0.15.5"
|
package/src/Player.ts
CHANGED
|
@@ -34,16 +34,16 @@ export type PlayerEventParams<E extends PlayerEvent> =
|
|
|
34
34
|
E extends PlayerEvent.Seek
|
|
35
35
|
? [number]
|
|
36
36
|
: E extends PlayerEvent.VolumeUpdate
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
37
|
+
? [number]
|
|
38
|
+
: E extends PlayerEvent.TimeUpdate
|
|
39
|
+
? [TimePosition]
|
|
40
|
+
: E extends PlayerEvent.Resize
|
|
41
|
+
? [{ width: number; height: number }]
|
|
42
|
+
: E extends PlayerEvent.Fullscreen
|
|
43
|
+
? [boolean]
|
|
44
|
+
: E extends PlayerEvent.Error
|
|
45
|
+
? [PlaybackError]
|
|
46
|
+
: []
|
|
47
47
|
|
|
48
48
|
/**
|
|
49
49
|
* Type of a listener callback function for a player event.
|
|
@@ -37,7 +37,10 @@ vi.mock('@clappr/core', async () => {
|
|
|
37
37
|
name: 'dash',
|
|
38
38
|
},
|
|
39
39
|
canPlay(source, mimeType) {
|
|
40
|
-
return
|
|
40
|
+
return (
|
|
41
|
+
this._supported &&
|
|
42
|
+
(mimeType === 'application/dash+xml' || source.endsWith('.mpd'))
|
|
43
|
+
)
|
|
41
44
|
},
|
|
42
45
|
}
|
|
43
46
|
const MockHlsPlayback = {
|
|
@@ -46,7 +49,13 @@ vi.mock('@clappr/core', async () => {
|
|
|
46
49
|
name: 'hls',
|
|
47
50
|
},
|
|
48
51
|
canPlay(source, mimeType) {
|
|
49
|
-
return
|
|
52
|
+
return (
|
|
53
|
+
this._supported &&
|
|
54
|
+
(['application/vnd.apple.mpegurl', 'application/x-mpegurl'].includes(
|
|
55
|
+
mimeType,
|
|
56
|
+
) ||
|
|
57
|
+
source.endsWith('.m3u8'))
|
|
58
|
+
)
|
|
50
59
|
},
|
|
51
60
|
}
|
|
52
61
|
const MockHTML5VideoPlayback = {
|
|
@@ -55,7 +64,10 @@ vi.mock('@clappr/core', async () => {
|
|
|
55
64
|
name: 'html5_video',
|
|
56
65
|
},
|
|
57
66
|
canPlay(source, mimeType) {
|
|
58
|
-
return
|
|
67
|
+
return (
|
|
68
|
+
this._supported &&
|
|
69
|
+
['video/mp4', 'application/vnd.apple.mpegurl'].includes(mimeType)
|
|
70
|
+
)
|
|
59
71
|
},
|
|
60
72
|
}
|
|
61
73
|
return {
|
|
@@ -73,7 +85,11 @@ vi.mock('@clappr/core', async () => {
|
|
|
73
85
|
Events: imported.Events,
|
|
74
86
|
Loader: {
|
|
75
87
|
registerPlugin: vi.fn(),
|
|
76
|
-
registeredPlaybacks: [
|
|
88
|
+
registeredPlaybacks: [
|
|
89
|
+
MockDashPlayback,
|
|
90
|
+
MockHlsPlayback,
|
|
91
|
+
MockHTML5VideoPlayback,
|
|
92
|
+
],
|
|
77
93
|
registeredPlugins: { core: [], container: [] },
|
|
78
94
|
unregisterPlugin: vi.fn(),
|
|
79
95
|
},
|
|
@@ -155,7 +171,7 @@ describe('Player', () => {
|
|
|
155
171
|
describe('autoPlay', () => {
|
|
156
172
|
describe('initially', () => {
|
|
157
173
|
it('should reset to false', () => {
|
|
158
|
-
const player = new Player({autoPlay: true, sources: []})
|
|
174
|
+
const player = new Player({ autoPlay: true, sources: [] })
|
|
159
175
|
const node = document.createElement('div')
|
|
160
176
|
player.attachTo(node)
|
|
161
177
|
expect(PlayerClappr).toHaveBeenCalledWith(
|
|
@@ -173,19 +189,26 @@ describe('Player', () => {
|
|
|
173
189
|
return 'media_control'
|
|
174
190
|
}
|
|
175
191
|
}
|
|
176
|
-
(MockMediaControl as any).type = 'core'
|
|
192
|
+
;(MockMediaControl as any).type = 'core'
|
|
177
193
|
class MockMediaControlButtonPlugin {
|
|
178
194
|
get name() {
|
|
179
195
|
return 'media_control_button'
|
|
180
196
|
}
|
|
181
197
|
}
|
|
182
|
-
(MockMediaControlButtonPlugin as any).type = 'core'
|
|
183
|
-
Player.registerPlugin(
|
|
184
|
-
|
|
198
|
+
;(MockMediaControlButtonPlugin as any).type = 'core'
|
|
199
|
+
Player.registerPlugin(
|
|
200
|
+
MockMediaControlButtonPlugin as unknown as CorePluginConstructor,
|
|
201
|
+
)
|
|
202
|
+
Player.registerPlugin(
|
|
203
|
+
MockMediaControl as unknown as CorePluginConstructor,
|
|
204
|
+
)
|
|
185
205
|
const player = new Player({ sources: [] })
|
|
186
206
|
player.attachTo(document.createElement('div'))
|
|
187
207
|
expect(Loader.registerPlugin).toHaveBeenNthCalledWith(1, MockMediaControl)
|
|
188
|
-
expect(Loader.registerPlugin).toHaveBeenNthCalledWith(
|
|
208
|
+
expect(Loader.registerPlugin).toHaveBeenNthCalledWith(
|
|
209
|
+
2,
|
|
210
|
+
MockMediaControlButtonPlugin,
|
|
211
|
+
)
|
|
189
212
|
})
|
|
190
213
|
})
|
|
191
214
|
})
|
package/src/index.core.ts
CHANGED
|
@@ -1,4 +1,13 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {
|
|
2
|
+
ChainedTracer,
|
|
3
|
+
LogTracer,
|
|
4
|
+
Logger,
|
|
5
|
+
RemoteTracer,
|
|
6
|
+
SentryTracer,
|
|
7
|
+
reportError,
|
|
8
|
+
setTracer,
|
|
9
|
+
trace,
|
|
10
|
+
} from '@gcorevideo/utils'
|
|
2
11
|
export * from './Player.js'
|
|
3
12
|
export * from './playback.types.js'
|
|
4
13
|
export * from './types.js'
|
package/src/index.plugins.ts
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import '../assets/style/main.scss'
|
|
1
|
+
import '../assets/style/main.scss'
|
|
2
2
|
|
|
3
|
-
export * from
|
|
4
|
-
export { AudioTracks as AudioSelector } from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
9
|
-
export * from
|
|
10
|
-
export { NerdStats as ClapprNerdStats } from
|
|
11
|
-
export * from
|
|
12
|
-
export * from
|
|
13
|
-
export * from
|
|
14
|
-
export * from
|
|
15
|
-
export * from
|
|
16
|
-
export * from
|
|
3
|
+
export * from './plugins/audio-selector/AudioTracks.js'
|
|
4
|
+
export { AudioTracks as AudioSelector } from './plugins/audio-selector/AudioTracks.js'
|
|
5
|
+
export * from './plugins/big-mute-button/BigMuteButton.js'
|
|
6
|
+
export * from './plugins/bottom-gear/BottomGear.js'
|
|
7
|
+
export * from './plugins/clappr-stats/ClapprStats.js'
|
|
8
|
+
export * from './plugins/cmcd-config/CmcdConfig.js'
|
|
9
|
+
export * from './plugins/clappr-nerd-stats/NerdStats.js'
|
|
10
|
+
export { NerdStats as ClapprNerdStats } from './plugins/clappr-nerd-stats/NerdStats.js'
|
|
11
|
+
export * from './plugins/click-to-pause/ClickToPause.js'
|
|
12
|
+
export * from './plugins/clips/Clips.js'
|
|
13
|
+
export * from './plugins/context-menu/ContextMenu.js'
|
|
14
|
+
export * from './plugins/dvr-controls/DvrControls.js'
|
|
15
|
+
export * from './plugins/error-screen/ErrorScreen.js'
|
|
16
|
+
export * from './plugins/favicon/Favicon.js'
|
|
17
17
|
// _ ga-events
|
|
18
|
-
export * from
|
|
19
|
-
export * from
|
|
20
|
-
export * from
|
|
21
|
-
export * from
|
|
22
|
-
export * from
|
|
23
|
-
export * from
|
|
24
|
-
export * from
|
|
25
|
-
export * from
|
|
26
|
-
export { QualityLevels as LevelSelector } from
|
|
27
|
-
export * from
|
|
28
|
-
export * from
|
|
29
|
-
export * from
|
|
30
|
-
export * from
|
|
31
|
-
export { SpinnerThreeBounce as Spinner } from
|
|
32
|
-
export * from
|
|
33
|
-
export * from
|
|
34
|
-
export { ClosedCaptions as Subtitles } from
|
|
35
|
-
export * from
|
|
36
|
-
export * from
|
|
18
|
+
export * from './plugins/google-analytics/GoogleAnalytics.js'
|
|
19
|
+
export * from './plugins/logo/Logo.js'
|
|
20
|
+
export * from './plugins/media-control/MediaControl.js'
|
|
21
|
+
export * from './plugins/multi-camera/MultiCamera.js'
|
|
22
|
+
export * from './plugins/picture-in-picture/PictureInPicture.js'
|
|
23
|
+
export * from './plugins/playback-rate/PlaybackRate.js'
|
|
24
|
+
export * from './plugins/poster/Poster.js'
|
|
25
|
+
export * from './plugins/level-selector/QualityLevels.js'
|
|
26
|
+
export { QualityLevels as LevelSelector } from './plugins/level-selector/QualityLevels.js'
|
|
27
|
+
export * from './plugins/seek-time/SeekTime.js'
|
|
28
|
+
export * from './plugins/share/Share.js'
|
|
29
|
+
export * from './plugins/skip-time/SkipTime.js'
|
|
30
|
+
export * from './plugins/spinner-three-bounce/SpinnerThreeBounce.js'
|
|
31
|
+
export { SpinnerThreeBounce as Spinner } from './plugins/spinner-three-bounce/SpinnerThreeBounce.js'
|
|
32
|
+
export * from './plugins/source-controller/SourceController.js'
|
|
33
|
+
export * from './plugins/subtitles/ClosedCaptions.js'
|
|
34
|
+
export { ClosedCaptions as Subtitles } from './plugins/subtitles/ClosedCaptions.js' // TODO remove in future versions
|
|
35
|
+
export * from './plugins/telemetry/Telemetry.js'
|
|
36
|
+
export * from './plugins/thumbnails/Thumbnails.js'
|
|
37
37
|
// _ vast-ads
|
|
38
38
|
// _ video360
|
|
39
|
-
export * from
|
|
39
|
+
export * from './plugins/volume-fade/VolumeFade.js'
|
|
@@ -42,7 +42,7 @@ export class BasePlayback extends HTML5Video {
|
|
|
42
42
|
* @param rate - The playback rate to set.
|
|
43
43
|
*/
|
|
44
44
|
setPlaybackRate(rate: number) {
|
|
45
|
-
;
|
|
45
|
+
;(this.el as HTMLMediaElement).playbackRate = rate
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
override _onPlaying() {
|
|
@@ -33,14 +33,20 @@ describe('HTML5Video', () => {
|
|
|
33
33
|
}
|
|
34
34
|
const html5Video = new HTML5Video({}, i18n, playerError)
|
|
35
35
|
html5Video.load('https://example.com/video.mp4')
|
|
36
|
-
vi.spyOn(
|
|
36
|
+
vi.spyOn(
|
|
37
|
+
html5Video.el as HTMLVideoElement,
|
|
38
|
+
'error',
|
|
39
|
+
'get',
|
|
40
|
+
).mockReturnValue({
|
|
37
41
|
code: MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED,
|
|
38
42
|
message: 'Media source not supported',
|
|
39
43
|
} as any)
|
|
40
44
|
html5Video.el.dispatchEvent(new Event('error', { bubbles: true }))
|
|
41
|
-
expect(playerError.createError).toHaveBeenCalledWith(
|
|
42
|
-
|
|
43
|
-
|
|
45
|
+
expect(playerError.createError).toHaveBeenCalledWith(
|
|
46
|
+
expect.objectContaining({
|
|
47
|
+
code: PlaybackErrorCode.MediaSourceUnavailable,
|
|
48
|
+
}),
|
|
49
|
+
)
|
|
44
50
|
})
|
|
45
51
|
})
|
|
46
52
|
})
|