@gcorevideo/player 2.22.4 → 2.22.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/level-selector/button.ejs +1 -1
- package/assets/level-selector/list.ejs +10 -4
- package/assets/level-selector/style.scss +8 -3
- package/assets/media-control/media-control.ejs +1 -2
- package/dist/core.js +2 -2
- package/dist/index.css +916 -912
- package/dist/index.js +452 -413
- package/dist/plugins/index.css +668 -664
- package/dist/plugins/index.js +514 -474
- package/lib/index.plugins.d.ts +2 -1
- package/lib/index.plugins.d.ts.map +1 -1
- package/lib/index.plugins.js +2 -1
- package/lib/playback/dash-playback/DashPlayback.d.ts.map +1 -1
- package/lib/playback/dash-playback/DashPlayback.js +1 -1
- package/lib/plugins/bottom-gear/BottomGear.d.ts.map +1 -1
- package/lib/plugins/bottom-gear/BottomGear.js +2 -2
- package/lib/plugins/level-selector/LevelSelector.d.ts +6 -5
- package/lib/plugins/level-selector/LevelSelector.d.ts.map +1 -1
- package/lib/plugins/level-selector/LevelSelector.js +11 -8
- package/lib/plugins/level-selector/QualityLevels.d.ts +112 -0
- package/lib/plugins/level-selector/QualityLevels.d.ts.map +1 -0
- package/lib/plugins/level-selector/QualityLevels.js +280 -0
- package/lib/plugins/media-control/MediaControl.d.ts +37 -6
- package/lib/plugins/media-control/MediaControl.d.ts.map +1 -1
- package/lib/plugins/media-control/MediaControl.js +54 -36
- package/lib/plugins/playback-rate/PlaybackRate.d.ts +5 -4
- package/lib/plugins/playback-rate/PlaybackRate.d.ts.map +1 -1
- package/lib/plugins/playback-rate/PlaybackRate.js +46 -24
- package/lib/plugins/subtitles/ClosedCaptions.js +1 -1
- package/lib/plugins/utils/fullscreen.d.ts +4 -0
- package/lib/plugins/utils/fullscreen.d.ts.map +1 -0
- package/lib/plugins/utils/fullscreen.js +30 -0
- package/lib/plugins/utils.d.ts +0 -1
- package/lib/plugins/utils.d.ts.map +1 -1
- package/lib/plugins/utils.js +0 -28
- package/lib/plugins/vast-ads/VastAds.d.ts +1 -0
- package/lib/plugins/vast-ads/VastAds.d.ts.map +1 -1
- package/lib/plugins/vast-ads/VastAds.js +6 -3
- package/lib/utils/fullscreen.d.ts +3 -0
- package/lib/utils/fullscreen.d.ts.map +1 -0
- package/lib/utils/fullscreen.js +2 -0
- package/package.json +1 -1
- package/src/index.plugins.ts +2 -1
- package/src/playback/dash-playback/DashPlayback.ts +1 -4
- package/src/plugins/bottom-gear/BottomGear.ts +2 -2
- package/src/plugins/bottom-gear/__tests__/BottomGear.test.ts +15 -3
- package/src/plugins/level-selector/{LevelSelector.ts → QualityLevels.ts} +19 -13
- package/src/plugins/level-selector/__tests__/{LevelSelector.test.ts → QualityLevels.test.ts} +20 -6
- package/src/plugins/level-selector/__tests__/__snapshots__/{LevelSelector.test.ts.snap → QualityLevels.test.ts.snap} +58 -25
- package/src/plugins/media-control/MediaControl.ts +111 -62
- package/src/plugins/media-control/__tests__/MediaControl.test.ts +118 -8
- package/src/plugins/media-control/__tests__/__snapshots__/MediaControl.test.ts.snap +149 -5
- package/src/plugins/playback-rate/PlaybackRate.ts +48 -26
- package/src/plugins/playback-rate/__tests__/PlaybackRate.test.ts +125 -55
- package/src/plugins/playback-rate/__tests__/__snapshots__/PlaybackRate.test.ts.snap +1 -1
- package/src/plugins/subtitles/ClosedCaptions.ts +1 -1
- package/src/plugins/utils/fullscreen.ts +34 -0
- package/src/plugins/utils.ts +0 -31
- package/src/plugins/vast-ads/VastAds.ts +8 -4
- package/tsconfig.tsbuildinfo +1 -1
package/src/plugins/utils.ts
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import { Browser } from '@clappr/core';
|
|
2
|
-
import { reportError } from '@gcorevideo/utils';
|
|
3
|
-
|
|
4
1
|
export function getLocation(href: string) {
|
|
5
2
|
const l = document.createElement('a');
|
|
6
3
|
|
|
@@ -36,34 +33,6 @@ export function strtimeToMiliseconds(str: string): number {
|
|
|
36
33
|
return (h + m + s);
|
|
37
34
|
}
|
|
38
35
|
|
|
39
|
-
// TODO refactor
|
|
40
|
-
export function isFullscreen(el: HTMLElement): boolean {
|
|
41
|
-
const video = el.nodeName === "video" ? el as HTMLVideoElement : el.querySelector('video');
|
|
42
|
-
if (!video) {
|
|
43
|
-
return false;
|
|
44
|
-
}
|
|
45
|
-
if (Browser.isiOS) {
|
|
46
|
-
return FullscreenIOS.isFullscreen(video);
|
|
47
|
-
}
|
|
48
|
-
return !!(document.fullscreenElement);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const FullscreenIOS = {
|
|
52
|
-
isFullscreen: function (el: HTMLVideoElement): boolean {
|
|
53
|
-
try {
|
|
54
|
-
// @ts-ignore
|
|
55
|
-
if (el.webkitDisplayingFullscreen !== undefined) {
|
|
56
|
-
// @ts-ignore
|
|
57
|
-
return !!(el.webkitDisplayingFullscreen);
|
|
58
|
-
}
|
|
59
|
-
} catch (e) {
|
|
60
|
-
reportError(e);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
return false;
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
|
|
67
36
|
export function getPageX(event: MouseEvent | TouchEvent): number {
|
|
68
37
|
if ((event as MouseEvent).pageX) {
|
|
69
38
|
return (event as MouseEvent).pageX;
|
|
@@ -223,7 +223,7 @@ export class VastAds extends UICorePlugin {
|
|
|
223
223
|
)
|
|
224
224
|
} else {
|
|
225
225
|
this.countRepeatableRoll = this.findCloserAdvertisement(
|
|
226
|
-
|
|
226
|
+
this.options.vastAds.repeatableroll,
|
|
227
227
|
'startTime',
|
|
228
228
|
this.countRepeatableRoll,
|
|
229
229
|
e,
|
|
@@ -519,8 +519,12 @@ export class VastAds extends UICorePlugin {
|
|
|
519
519
|
this.stopListening(this.playback, Events.PLAYBACK_PAUSE)
|
|
520
520
|
}
|
|
521
521
|
|
|
522
|
+
private get pluginOptions() {
|
|
523
|
+
return this.options.vastAds
|
|
524
|
+
}
|
|
525
|
+
|
|
522
526
|
private _pauserollListeners() {
|
|
523
|
-
if (!this._validateData(this.
|
|
527
|
+
if (!this._validateData(this.pluginOptions.pauseroll)) {
|
|
524
528
|
return
|
|
525
529
|
}
|
|
526
530
|
this._stopPauserollListeners()
|
|
@@ -781,12 +785,12 @@ export class VastAds extends UICorePlugin {
|
|
|
781
785
|
|
|
782
786
|
this.destroyRoll()
|
|
783
787
|
if (currentRoll === 'preroll') {
|
|
784
|
-
this.
|
|
788
|
+
this.pluginOptions[currentRoll] = []
|
|
785
789
|
}
|
|
786
790
|
|
|
787
791
|
this.currentState = ''
|
|
788
792
|
this.$el.hide()
|
|
789
|
-
if (!this.options.disableClickOnPause) {
|
|
793
|
+
if (!this.options.disableClickOnPause) { // TODO sort out
|
|
790
794
|
this._clickToPausePlugin?.enable()
|
|
791
795
|
}
|
|
792
796
|
|