@gcorevideo/player 0.0.1
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/icons/new/arrow-left.svg +5 -0
- package/assets/icons/new/arrow-right.svg +5 -0
- package/assets/icons/new/check.svg +5 -0
- package/assets/icons/new/close.svg +12 -0
- package/assets/icons/new/full.svg +8 -0
- package/assets/icons/new/fullscreen-off.svg +14 -0
- package/assets/icons/new/fullscreen-on.svg +14 -0
- package/assets/icons/new/gear-hd.svg +16 -0
- package/assets/icons/new/gear.svg +12 -0
- package/assets/icons/new/hd.svg +8 -0
- package/assets/icons/new/pause.svg +5 -0
- package/assets/icons/new/pip.svg +5 -0
- package/assets/icons/new/play.svg +10 -0
- package/assets/icons/new/replayleft.svg +5 -0
- package/assets/icons/new/replayright.svg +5 -0
- package/assets/icons/new/speed.svg +5 -0
- package/assets/icons/new/stats.svg +3 -0
- package/assets/icons/new/stop.svg +3 -0
- package/assets/icons/new/subtitles-off.svg +5 -0
- package/assets/icons/new/subtitles-on.svg +6 -0
- package/assets/icons/new/volume-max.svg +5 -0
- package/assets/icons/new/volume-min.svg +5 -0
- package/assets/icons/new/volume-off.svg +5 -0
- package/assets/icons/old/cardboard.svg +4 -0
- package/assets/icons/old/close-share.svg +13 -0
- package/assets/icons/old/close.svg +13 -0
- package/assets/icons/old/fb.svg +13 -0
- package/assets/icons/old/fullscreen.svg +12 -0
- package/assets/icons/old/language.svg +1 -0
- package/assets/icons/old/pause.svg +12 -0
- package/assets/icons/old/play.svg +12 -0
- package/assets/icons/old/quality-arrow.svg +13 -0
- package/assets/icons/old/reload.svg +4 -0
- package/assets/icons/old/share.svg +13 -0
- package/assets/icons/old/sound-off.svg +15 -0
- package/assets/icons/old/sound-on.svg +15 -0
- package/assets/icons/old/streams.svg +3 -0
- package/assets/icons/old/twitter.svg +13 -0
- package/assets/icons/old/wn.svg +15 -0
- package/assets/icons/standard/01-play.svg +3 -0
- package/assets/icons/standard/02-pause.svg +3 -0
- package/assets/icons/standard/03-stop.svg +3 -0
- package/assets/icons/standard/04-volume.svg +3 -0
- package/assets/icons/standard/05-mute.svg +3 -0
- package/assets/icons/standard/06-expand.svg +3 -0
- package/assets/icons/standard/07-shrink.svg +3 -0
- package/assets/icons/standard/08-hd.svg +3 -0
- package/assets/icons/standard/09-cc.svg +8 -0
- package/assets/icons/standard/10-reload.svg +4 -0
- package/assets/style/main.scss +50 -0
- package/assets/style/theme.scss +42 -0
- package/assets/style/variables.scss +7 -0
- package/dist/DashPlayback-6wKK0_pL.js +666 -0
- package/dist/DashPlayback-8U6_s4Jc.js +666 -0
- package/dist/DashPlayback-BeZz7mN9.js +663 -0
- package/dist/DashPlayback-CRdja67F.js +667 -0
- package/dist/DashPlayback-D0df6zGg.js +663 -0
- package/dist/DashPlayback-D7egS-CZ.js +664 -0
- package/dist/DashPlayback-DH5lZMRR.js +663 -0
- package/dist/DashPlayback-DZfIc9sK.js +665 -0
- package/dist/DashPlayback-VhCxbQhn.js +666 -0
- package/dist/HlsPlayback-Avwy8-0O.js +749 -0
- package/dist/index.css +125 -0
- package/dist/index.js +467 -0
- package/lib/Player.d.ts +50 -0
- package/lib/Player.d.ts.map +1 -0
- package/lib/Player.js +310 -0
- package/lib/backend.d.ts +3 -0
- package/lib/backend.d.ts.map +1 -0
- package/lib/backend.js +10 -0
- package/lib/constants.d.ts +19 -0
- package/lib/constants.d.ts.map +1 -0
- package/lib/constants.js +18 -0
- package/lib/index.d.ts +10 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +9 -0
- package/lib/internal.types.d.ts +105 -0
- package/lib/internal.types.d.ts.map +1 -0
- package/lib/internal.types.js +1 -0
- package/lib/playback.types.d.ts +13 -0
- package/lib/playback.types.d.ts.map +1 -0
- package/lib/playback.types.js +1 -0
- package/lib/plugins/audio-selector/AudioSelector.d.ts +48 -0
- package/lib/plugins/audio-selector/AudioSelector.d.ts.map +1 -0
- package/lib/plugins/audio-selector/AudioSelector.js +282 -0
- package/lib/plugins/big-mute-button/BigMuteButton.d.ts +33 -0
- package/lib/plugins/big-mute-button/BigMuteButton.d.ts.map +1 -0
- package/lib/plugins/big-mute-button/BigMuteButton.js +148 -0
- package/lib/plugins/bottom-gear/BottomGear.d.ts +30 -0
- package/lib/plugins/bottom-gear/BottomGear.d.ts.map +1 -0
- package/lib/plugins/bottom-gear/BottomGear.js +103 -0
- package/lib/plugins/click-to-pause/ClickToPause.d.ts +16 -0
- package/lib/plugins/click-to-pause/ClickToPause.d.ts.map +1 -0
- package/lib/plugins/click-to-pause/ClickToPause.js +73 -0
- package/lib/plugins/dash-playback/DashPlayback.d.ts +81 -0
- package/lib/plugins/dash-playback/DashPlayback.d.ts.map +1 -0
- package/lib/plugins/dash-playback/DashPlayback.js +658 -0
- package/lib/plugins/dash-plugin/DashPlayback.d.ts +86 -0
- package/lib/plugins/dash-plugin/DashPlayback.d.ts.map +1 -0
- package/lib/plugins/dash-plugin/DashPlayback.js +659 -0
- package/lib/plugins/disable-controls/DisableControls.d.ts +15 -0
- package/lib/plugins/disable-controls/DisableControls.d.ts.map +1 -0
- package/lib/plugins/disable-controls/DisableControls.js +69 -0
- package/lib/plugins/dvr-controls/DVRControls.d.ts +27 -0
- package/lib/plugins/dvr-controls/DVRControls.d.ts.map +1 -0
- package/lib/plugins/dvr-controls/DVRControls.js +110 -0
- package/lib/plugins/hls-playback/HlsPlayback.d.ts +102 -0
- package/lib/plugins/hls-playback/HlsPlayback.d.ts.map +1 -0
- package/lib/plugins/hls-playback/HlsPlayback.js +747 -0
- package/lib/plugins/level-selector/LevelSelector.d.ts +48 -0
- package/lib/plugins/level-selector/LevelSelector.d.ts.map +1 -0
- package/lib/plugins/level-selector/LevelSelector.js +287 -0
- package/lib/plugins/media-control/MediaControl.d.ts +186 -0
- package/lib/plugins/media-control/MediaControl.d.ts.map +1 -0
- package/lib/plugins/media-control/MediaControl.js +1000 -0
- package/lib/plugins/poster/Poster.d.ts +41 -0
- package/lib/plugins/poster/Poster.d.ts.map +1 -0
- package/lib/plugins/poster/Poster.js +186 -0
- package/lib/trace/LogTracer.d.ts +12 -0
- package/lib/trace/LogTracer.d.ts.map +1 -0
- package/lib/trace/LogTracer.js +17 -0
- package/lib/trace/SentryTracer.d.ts +11 -0
- package/lib/trace/SentryTracer.d.ts.map +1 -0
- package/lib/trace/SentryTracer.js +18 -0
- package/lib/trace/Tracer.d.ts +13 -0
- package/lib/trace/Tracer.d.ts.map +1 -0
- package/lib/trace/Tracer.js +15 -0
- package/lib/trace/index.d.ts +18 -0
- package/lib/trace/index.d.ts.map +1 -0
- package/lib/trace/index.js +27 -0
- package/lib/trace/types.d.ts +8 -0
- package/lib/trace/types.d.ts.map +1 -0
- package/lib/trace/types.js +1 -0
- package/lib/types.d.ts +82 -0
- package/lib/types.d.ts.map +1 -0
- package/lib/types.js +1 -0
- package/lib/utils/Logger.d.ts +23 -0
- package/lib/utils/Logger.d.ts.map +1 -0
- package/lib/utils/Logger.js +81 -0
- package/lib/utils/canAutoplay.d.ts +6 -0
- package/lib/utils/canAutoplay.d.ts.map +1 -0
- package/lib/utils/canAutoplay.js +30 -0
- package/lib/utils/errors.d.ts +2 -0
- package/lib/utils/errors.d.ts.map +1 -0
- package/lib/utils/errors.js +6 -0
- package/lib/utils/queryParams.d.ts +2 -0
- package/lib/utils/queryParams.d.ts.map +1 -0
- package/lib/utils/queryParams.js +4 -0
- package/lib/utils/scripts-load.d.ts +2 -0
- package/lib/utils/scripts-load.d.ts.map +1 -0
- package/lib/utils/scripts-load.js +20 -0
- package/lib/utils/types.d.ts +4 -0
- package/lib/utils/types.d.ts.map +1 -0
- package/lib/utils/types.js +1 -0
- package/lib/utils/utils.d.ts +7 -0
- package/lib/utils/utils.d.ts.map +1 -0
- package/lib/utils/utils.js +57 -0
- package/package.json +57 -0
- package/rollup.config.js +34 -0
- package/src/Player.ts +390 -0
- package/src/backend.ts +12 -0
- package/src/constants.ts +17 -0
- package/src/index.ts +9 -0
- package/src/internal.types.ts +126 -0
- package/src/playback.types.ts +15 -0
- package/src/plugins/dash-playback/DashPlayback.ts +808 -0
- package/src/plugins/dash-playback/_DashPlayback.js +688 -0
- package/src/plugins/hls-playback/HlsPlayback.ts +909 -0
- package/src/plugins/hls-playback/hls.js +706 -0
- package/src/trace/LogTracer.ts +23 -0
- package/src/trace/SentryTracer.ts +18 -0
- package/src/trace/Tracer.ts +27 -0
- package/src/trace/index.ts +32 -0
- package/src/trace/types.ts +7 -0
- package/src/types.ts +100 -0
- package/src/typings/@clappr/core/error_mixin.d.ts +15 -0
- package/src/typings/@clappr/core/events.d.ts +7 -0
- package/src/typings/@clappr/core/html5_video.d.ts +28 -0
- package/src/typings/@clappr/core/playback.d.ts +5 -0
- package/src/typings/@clappr/core/player.d.ts +83 -0
- package/src/typings/@clappr/plugins.d.ts +29 -0
- package/src/typings/clappr-zepto.xd.xts +44 -0
- package/src/typings/globals.d.ts +8 -0
- package/src/utils/Logger.ts +107 -0
- package/src/utils/canAutoplay.ts +39 -0
- package/src/utils/errors.ts +6 -0
- package/src/utils/queryParams.ts +5 -0
- package/src/utils/scripts-load.ts +26 -0
- package/src/utils/types.ts +5 -0
- package/src/utils/utils.ts +64 -0
- package/tsconfig.json +43 -0
- package/tsconfig.tsbuildinfo +1 -0
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
CorePlugin,
|
|
3
|
+
ContainerPlugin,
|
|
4
|
+
Playback as PlaybackPlugin,
|
|
5
|
+
ExternalTrack,
|
|
6
|
+
} from "@clappr/core";
|
|
7
|
+
import { PlaybackType, PlayerDebugTag, StreamMediaSource } from "./types";
|
|
8
|
+
|
|
9
|
+
type MediacontrolStyles = {
|
|
10
|
+
// TODO
|
|
11
|
+
seekbar?: string;
|
|
12
|
+
buttons?: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
type PlayerMediaSourceDesc = {
|
|
16
|
+
mimeType?: string;
|
|
17
|
+
source: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export type PlayerMediaSource = string | PlayerMediaSourceDesc;
|
|
21
|
+
|
|
22
|
+
type HlsjsConfig = {
|
|
23
|
+
debug?: boolean;
|
|
24
|
+
startLevel?: number;
|
|
25
|
+
} & Record<string, unknown>;
|
|
26
|
+
|
|
27
|
+
type ShakaConfig = Record<string, unknown>;
|
|
28
|
+
|
|
29
|
+
type CorePlaybackConfig = {
|
|
30
|
+
// audioOnly: boolean;
|
|
31
|
+
disableContextMenu?: boolean;
|
|
32
|
+
controls?: boolean;
|
|
33
|
+
crossOrigin?: 'anonymous' | 'use-credentials';
|
|
34
|
+
// enableAutomaticABR?: boolean;
|
|
35
|
+
externalTracks?: ExternalTrack[];
|
|
36
|
+
hlsjsConfig?: HlsjsConfig;
|
|
37
|
+
// initialBandwidthEstimate?: number;
|
|
38
|
+
// maxBufferLength?: number;
|
|
39
|
+
// maxBackBufferLength?: number;
|
|
40
|
+
// minBufferLength?: number;
|
|
41
|
+
minimumDvrSize?: number; // TODO ?
|
|
42
|
+
// maxAdaptiveBitrate?: number;
|
|
43
|
+
// maxAdaptiveVideoDimensions?: unknown; // TODO
|
|
44
|
+
playInline: boolean;
|
|
45
|
+
preload?: 'metadata' | 'auto' | 'none';
|
|
46
|
+
// preferredAudioLanguage?: string;
|
|
47
|
+
shakaConfiguration?: ShakaConfig;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
type ErrorLevel = "FATAL" | "WARN" | "INFO";
|
|
51
|
+
|
|
52
|
+
export type PlaybackError = {
|
|
53
|
+
code?: number | string;
|
|
54
|
+
description: string;
|
|
55
|
+
raw?: MediaError;
|
|
56
|
+
level?: ErrorLevel;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export type CorePlayerEvents = {
|
|
60
|
+
// TODO event arguments types
|
|
61
|
+
onReady?: () => void;
|
|
62
|
+
onResize?: (data: { width: number; height: number }) => void;
|
|
63
|
+
onPlay?: (metadata: unknown) => void;
|
|
64
|
+
onPause?: (metadata: unknown) => void;
|
|
65
|
+
onStop?: (metadata: unknown) => void;
|
|
66
|
+
onEnded?: () => void;
|
|
67
|
+
onSeek?: (currentTime: number) => void;
|
|
68
|
+
onError?: (err: PlaybackError) => void;
|
|
69
|
+
onTimeUpdate?: (timeProgress: { current: number; total: number }) => void;
|
|
70
|
+
onVolumeUpdate?: (value: number) => void;
|
|
71
|
+
onSubtitleAvailable?: () => void;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export type ClapprVersionSpec = {
|
|
75
|
+
min: string;
|
|
76
|
+
// TODO
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export type CorePluginOptions = {
|
|
80
|
+
core?: CorePlugin[];
|
|
81
|
+
container?: ContainerPlugin[];
|
|
82
|
+
playback?: PlaybackPlugin[];
|
|
83
|
+
loadExternalPluginsFirst?: boolean;
|
|
84
|
+
loadExternalPlaybacksFirst?: boolean;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export type CoreOptions = {
|
|
88
|
+
actualLiveTime?: boolean;
|
|
89
|
+
actualLiveServerTime?: string;
|
|
90
|
+
allowUserInteraction?: boolean;
|
|
91
|
+
autoPlay?: boolean;
|
|
92
|
+
autoSeekFromUrl?: boolean;
|
|
93
|
+
chromeless?: boolean;
|
|
94
|
+
debug?: PlayerDebugTag | boolean;
|
|
95
|
+
disableCanAutoPlay?: boolean; // custom, for reconfiguration
|
|
96
|
+
disableKeyboardShortcuts?: boolean;
|
|
97
|
+
disableVideoTagContextMenu?: boolean;
|
|
98
|
+
events?: CorePlayerEvents;
|
|
99
|
+
exitFullscreenOnEnd?: boolean;
|
|
100
|
+
gaAccount?: string;
|
|
101
|
+
gaTrackerName?: string;
|
|
102
|
+
height?: number;
|
|
103
|
+
hideMediaControl?: boolean;
|
|
104
|
+
hideVolumeBar?: boolean;
|
|
105
|
+
language?: string;
|
|
106
|
+
loop?: boolean;
|
|
107
|
+
maxBufferLength?: number;
|
|
108
|
+
mediacontrol?: MediacontrolStyles;
|
|
109
|
+
mimeType?: string;
|
|
110
|
+
multisources: StreamMediaSource[];
|
|
111
|
+
mute?: boolean;
|
|
112
|
+
persistConfig?: boolean;
|
|
113
|
+
preload?: "auto" | "metadata" | "none";
|
|
114
|
+
parentId?: string;
|
|
115
|
+
parent?: HTMLElement;
|
|
116
|
+
playback?: CorePlaybackConfig;
|
|
117
|
+
playbackNotSupportedMessage?: string;
|
|
118
|
+
playbackType?: PlaybackType;
|
|
119
|
+
plugins?: CorePluginOptions | CorePlugin[];
|
|
120
|
+
poster?: string;
|
|
121
|
+
source?: string;
|
|
122
|
+
sources?: PlayerMediaSource[];
|
|
123
|
+
watermark?: string;
|
|
124
|
+
watermarkLink?: string;
|
|
125
|
+
width?: number;
|
|
126
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type Duration = number;
|
|
2
|
+
|
|
3
|
+
export type TimeValue = number;
|
|
4
|
+
|
|
5
|
+
export type TimePosition = {
|
|
6
|
+
current: number;
|
|
7
|
+
total: number;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export type TimeProgress = TimePosition & { start: number; };
|
|
11
|
+
|
|
12
|
+
export type TimeUpdate = TimePosition & {
|
|
13
|
+
firstFragDateTime: number;
|
|
14
|
+
};
|
|
15
|
+
|