@gcorevideo/player 2.22.5 → 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/media-control/media-control.ejs +1 -2
- package/dist/core.js +2 -2
- package/dist/index.css +1432 -1432
- package/dist/index.js +127 -91
- package/dist/plugins/index.css +1495 -1495
- package/dist/plugins/index.js +123 -86
- 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/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/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/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/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/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;
|