@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
package/lib/Player.js
ADDED
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
import { Browser, Log, Player as PlayerClappr, $, Loader, } from '@clappr/core';
|
|
2
|
+
import assert from 'assert';
|
|
3
|
+
import Hls from 'hls.js';
|
|
4
|
+
import EventLite from "event-lite";
|
|
5
|
+
import '../assets/style/main.scss'; // TODO check if needed
|
|
6
|
+
import { reportError, trace } from "./trace/index.js";
|
|
7
|
+
export var PlayerEvent;
|
|
8
|
+
(function (PlayerEvent) {
|
|
9
|
+
PlayerEvent["Ready"] = "ready";
|
|
10
|
+
PlayerEvent["Play"] = "play";
|
|
11
|
+
PlayerEvent["Pause"] = "pause";
|
|
12
|
+
PlayerEvent["Stop"] = "stop";
|
|
13
|
+
PlayerEvent["Ended"] = "ended";
|
|
14
|
+
})(PlayerEvent || (PlayerEvent = {}));
|
|
15
|
+
const T = "Player";
|
|
16
|
+
const DEFAULT_OPTIONS = {
|
|
17
|
+
autoPlay: false,
|
|
18
|
+
mute: false,
|
|
19
|
+
loop: false,
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* @beta
|
|
23
|
+
*/
|
|
24
|
+
export class Player {
|
|
25
|
+
emitter = new EventLite();
|
|
26
|
+
player = null;
|
|
27
|
+
pluginLoaders = [];
|
|
28
|
+
clapprReady = false;
|
|
29
|
+
timer = null;
|
|
30
|
+
tuneInEntered = false;
|
|
31
|
+
supportedMediaTransports = [];
|
|
32
|
+
config;
|
|
33
|
+
get playing() {
|
|
34
|
+
return this.player ? this.player.isPlaying() : false;
|
|
35
|
+
}
|
|
36
|
+
get ready() {
|
|
37
|
+
return this.clapprReady;
|
|
38
|
+
}
|
|
39
|
+
constructor(config) {
|
|
40
|
+
this.config = $.extend(true, {}, DEFAULT_OPTIONS, config);
|
|
41
|
+
}
|
|
42
|
+
on(event, handler) {
|
|
43
|
+
this.emitter.on(event, handler);
|
|
44
|
+
}
|
|
45
|
+
off(event, handler) {
|
|
46
|
+
this.emitter.off(event, handler);
|
|
47
|
+
}
|
|
48
|
+
async init(playerElement) {
|
|
49
|
+
assert.ok(!this.player, 'Player already initialized');
|
|
50
|
+
assert.ok(playerElement, 'Player element is required');
|
|
51
|
+
if (this.config.debug === 'all' ||
|
|
52
|
+
this.config.debug === 'clappr') {
|
|
53
|
+
Log.setLevel(0);
|
|
54
|
+
}
|
|
55
|
+
Log.debug('Config', this.config);
|
|
56
|
+
this.configurePlugins();
|
|
57
|
+
return this.loadPlugins().then(async () => {
|
|
58
|
+
const coreOpts = this.buildCoreOptions(playerElement);
|
|
59
|
+
const { core, container, } = Loader.registeredPlugins;
|
|
60
|
+
coreOpts.plugins = {
|
|
61
|
+
core: Object.values(core),
|
|
62
|
+
container: Object.values(container),
|
|
63
|
+
playback: Loader.registeredPlaybacks,
|
|
64
|
+
};
|
|
65
|
+
console.log('plugins', coreOpts.plugins);
|
|
66
|
+
return this.initPlayer(coreOpts);
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
destroy() {
|
|
70
|
+
trace(`${T} destroy`, { player: !!this.player });
|
|
71
|
+
if (this.player) {
|
|
72
|
+
this.player.destroy();
|
|
73
|
+
this.player = null;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
pause() {
|
|
77
|
+
assert.ok(this.player, 'Player not initialized');
|
|
78
|
+
this.player.pause();
|
|
79
|
+
}
|
|
80
|
+
play() {
|
|
81
|
+
assert.ok(this.player, 'Player not initialized');
|
|
82
|
+
this.player.play();
|
|
83
|
+
}
|
|
84
|
+
seekTo(time) {
|
|
85
|
+
assert.ok(this.player, 'Player not initialized');
|
|
86
|
+
this.player.seek(time);
|
|
87
|
+
}
|
|
88
|
+
stop() {
|
|
89
|
+
assert.ok(this.player, 'Player not initialized');
|
|
90
|
+
this.player.stop();
|
|
91
|
+
}
|
|
92
|
+
static registerPlugin(plugin) {
|
|
93
|
+
Loader.registerPlugin(plugin);
|
|
94
|
+
}
|
|
95
|
+
loadPlugins() {
|
|
96
|
+
return Promise.all(this.pluginLoaders.map((loader) => loader())).then(() => { });
|
|
97
|
+
}
|
|
98
|
+
initPlayer(coreOptions) {
|
|
99
|
+
assert.ok(!this.player, 'Player already initialized');
|
|
100
|
+
const player = new PlayerClappr(coreOptions);
|
|
101
|
+
this.player = player;
|
|
102
|
+
this.timer = globalThis.setTimeout(() => {
|
|
103
|
+
try {
|
|
104
|
+
if (!this.clapprReady &&
|
|
105
|
+
player.core &&
|
|
106
|
+
player.core
|
|
107
|
+
.activePlayback) {
|
|
108
|
+
this.tuneIn();
|
|
109
|
+
// player.onReady = null; // TODO ?
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
catch (e) {
|
|
113
|
+
reportError(e);
|
|
114
|
+
}
|
|
115
|
+
}, 4000);
|
|
116
|
+
}
|
|
117
|
+
// TODO sort this out
|
|
118
|
+
async tuneIn() {
|
|
119
|
+
assert.ok(this.player);
|
|
120
|
+
trace(`${T} tuneIn enter`, {
|
|
121
|
+
ready: this.clapprReady,
|
|
122
|
+
tuneInEntered: this.tuneInEntered,
|
|
123
|
+
});
|
|
124
|
+
if (this.tuneInEntered) {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
this.tuneInEntered = true;
|
|
128
|
+
const player = this.player;
|
|
129
|
+
if (Browser.isiOS &&
|
|
130
|
+
player.core.activePlayback) {
|
|
131
|
+
player.core.activePlayback.$el.on('webkitendfullscreen', () => {
|
|
132
|
+
try {
|
|
133
|
+
player.core.handleFullscreenChange();
|
|
134
|
+
}
|
|
135
|
+
catch (e) {
|
|
136
|
+
reportError(e);
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
configurePlugins() {
|
|
142
|
+
if (!Browser.isiOS && this.config.multisources.some((el) => el.sourceDash)) {
|
|
143
|
+
this.scheduleLoad(async () => {
|
|
144
|
+
const module = await import('./plugins/dash-playback/DashPlayback.js');
|
|
145
|
+
Loader.registerPlayback(module.default);
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
// TODO remove !isiOS?
|
|
149
|
+
// if (!Browser.isiOS && this.config.multisources.some((el) => el.hls_mpegts_url)) {
|
|
150
|
+
if (this.config.multisources.some((el) => el.hlsMpegtsUrl || el.hlsCmafUrl || el.source.endsWith('.m3u8'))) {
|
|
151
|
+
this.scheduleLoad(async () => {
|
|
152
|
+
const module = await import('./plugins/hls-playback/HlsPlayback.js');
|
|
153
|
+
Loader.registerPlayback(module.default);
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
events = {
|
|
158
|
+
onReady: () => {
|
|
159
|
+
if (this.clapprReady) {
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
this.clapprReady = true;
|
|
163
|
+
if (this.timer) {
|
|
164
|
+
clearTimeout(this.timer);
|
|
165
|
+
this.timer = null;
|
|
166
|
+
}
|
|
167
|
+
trace(`${T} onReady`);
|
|
168
|
+
setTimeout(() => this.tuneIn(), 0);
|
|
169
|
+
try {
|
|
170
|
+
this.emitter.emit(PlayerEvent.Ready);
|
|
171
|
+
}
|
|
172
|
+
catch (e) {
|
|
173
|
+
reportError(e);
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
onPlay: () => {
|
|
177
|
+
try {
|
|
178
|
+
this.emitter.emit(PlayerEvent.Play);
|
|
179
|
+
}
|
|
180
|
+
catch (e) {
|
|
181
|
+
reportError(e);
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
onPause: () => {
|
|
185
|
+
try {
|
|
186
|
+
this.emitter.emit(PlayerEvent.Pause);
|
|
187
|
+
}
|
|
188
|
+
catch (e) {
|
|
189
|
+
reportError(e);
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
onEnded: () => {
|
|
193
|
+
try {
|
|
194
|
+
this.emitter.emit(PlayerEvent.Ended);
|
|
195
|
+
}
|
|
196
|
+
catch (e) {
|
|
197
|
+
reportError(e);
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
onStop: () => {
|
|
201
|
+
try {
|
|
202
|
+
this.emitter.emit(PlayerEvent.Stop);
|
|
203
|
+
}
|
|
204
|
+
catch (e) {
|
|
205
|
+
reportError(e);
|
|
206
|
+
}
|
|
207
|
+
},
|
|
208
|
+
};
|
|
209
|
+
buildCoreOptions(playerElement) {
|
|
210
|
+
this.checkMediaTransportsSupport();
|
|
211
|
+
const multisources = this.processMultisources(this.config.priorityTransport);
|
|
212
|
+
const mediaSources = multisources.map(ms => ms.source);
|
|
213
|
+
const mainSource = this.findMainSource();
|
|
214
|
+
const mainSourceUrl = unwrapSource(mainSource ? this.selectMediaTransport(mainSource, this.config.priorityTransport) : undefined);
|
|
215
|
+
const poster = mainSource?.poster ?? this.config.poster;
|
|
216
|
+
const coreOptions = {
|
|
217
|
+
autoPlay: this.config.autoPlay,
|
|
218
|
+
debug: this.config.debug || 'none',
|
|
219
|
+
events: this.events,
|
|
220
|
+
multisources,
|
|
221
|
+
mute: this.config.mute,
|
|
222
|
+
...this.config.pluginSettings,
|
|
223
|
+
playback: {
|
|
224
|
+
controls: false,
|
|
225
|
+
preload: Browser.isiOS ? 'metadata' : 'none',
|
|
226
|
+
playInline: true,
|
|
227
|
+
crossOrigin: 'anonymous', // TODO
|
|
228
|
+
hlsjsConfig: {
|
|
229
|
+
debug: this.config.debug === 'all' || this.config.debug === 'hls',
|
|
230
|
+
},
|
|
231
|
+
},
|
|
232
|
+
parent: playerElement,
|
|
233
|
+
playbackType: this.config.playbackType,
|
|
234
|
+
poster,
|
|
235
|
+
width: playerElement.clientWidth,
|
|
236
|
+
height: playerElement.clientHeight,
|
|
237
|
+
loop: this.config.loop,
|
|
238
|
+
strings: this.config.strings,
|
|
239
|
+
source: mainSourceUrl,
|
|
240
|
+
sources: mediaSources,
|
|
241
|
+
};
|
|
242
|
+
trace(`${T} buildCoreOptions`, coreOptions);
|
|
243
|
+
return coreOptions;
|
|
244
|
+
}
|
|
245
|
+
findMainSource() {
|
|
246
|
+
return this.config.multisources.find(ms => ms.live !== false);
|
|
247
|
+
}
|
|
248
|
+
scheduleLoad(cb) {
|
|
249
|
+
this.pluginLoaders.push(cb);
|
|
250
|
+
}
|
|
251
|
+
selectMediaTransport(ms, priorityTransport = ms.priorityTransport) {
|
|
252
|
+
const cmafUrl = ms.hlsCmafUrl || ms.source; // source is default url for hls
|
|
253
|
+
const mpegtsUrl = ms.hlsMpegtsUrl; // no-low-latency HLS
|
|
254
|
+
const dashUrl = ms.sourceDash;
|
|
255
|
+
const masterSource = ms.source;
|
|
256
|
+
const mts = this.getAvailableTransportsPreference(priorityTransport);
|
|
257
|
+
for (const mt of mts) {
|
|
258
|
+
switch (mt) {
|
|
259
|
+
case 'dash':
|
|
260
|
+
if (dashUrl) {
|
|
261
|
+
return dashUrl;
|
|
262
|
+
}
|
|
263
|
+
break;
|
|
264
|
+
case 'hls':
|
|
265
|
+
if (cmafUrl) {
|
|
266
|
+
return cmafUrl;
|
|
267
|
+
}
|
|
268
|
+
break;
|
|
269
|
+
default:
|
|
270
|
+
return mpegtsUrl || masterSource;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
// no supported transport found
|
|
274
|
+
return '';
|
|
275
|
+
}
|
|
276
|
+
getAvailableTransportsPreference(priorityTransport) {
|
|
277
|
+
const mtp = [];
|
|
278
|
+
if (priorityTransport !== 'auto' && this.supportedMediaTransports.includes(priorityTransport)) {
|
|
279
|
+
mtp.push(priorityTransport);
|
|
280
|
+
}
|
|
281
|
+
for (const mt of this.supportedMediaTransports) {
|
|
282
|
+
if (mt !== priorityTransport) {
|
|
283
|
+
mtp.push(mt);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
return mtp;
|
|
287
|
+
}
|
|
288
|
+
checkMediaTransportsSupport() {
|
|
289
|
+
const isDashSupported = typeof (globalThis.MediaSource || globalThis.WebKitMediaSource) === 'function';
|
|
290
|
+
if (isDashSupported) {
|
|
291
|
+
this.supportedMediaTransports.push('dash');
|
|
292
|
+
}
|
|
293
|
+
if (Hls.isSupported()) {
|
|
294
|
+
this.supportedMediaTransports.push('hls');
|
|
295
|
+
}
|
|
296
|
+
this.supportedMediaTransports.push('mpegts');
|
|
297
|
+
}
|
|
298
|
+
processMultisources(transport) {
|
|
299
|
+
return this.config.multisources.map((ms) => ({
|
|
300
|
+
...ms,
|
|
301
|
+
source: this.selectMediaTransport(ms, transport),
|
|
302
|
+
})).filter((el) => !!el.source);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
function unwrapSource(s) {
|
|
306
|
+
if (!s) {
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
309
|
+
return typeof s === "string" ? s : s.source;
|
|
310
|
+
}
|
package/lib/backend.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backend.d.ts","sourceRoot":"","sources":["../src/backend.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAElE,wBAAgB,wBAAwB,CAAC,CAAC,EAAE,oBAAoB,GAAG,iBAAiB,CASnF"}
|
package/lib/backend.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated
|
|
3
|
+
*/
|
|
4
|
+
export declare const SentryLogLevel: {
|
|
5
|
+
FATAL: string;
|
|
6
|
+
ERROR: string;
|
|
7
|
+
WARNING: string;
|
|
8
|
+
LOG: string;
|
|
9
|
+
INFO: string;
|
|
10
|
+
DEBUG: string;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
// TODO
|
|
14
|
+
export declare enum QueryParams {
|
|
15
|
+
DEBUG = "debug",
|
|
16
|
+
NO_LOW_LATENCY = "no_low_latency",
|
|
17
|
+
SUBTITLES_LANGUAGE = "sub_lang"
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,cAAc;;;;;;;CAO1B,CAAC;AAEF,oBAAY,WAAW;IACrB,KAAK,UAAU;IACf,cAAc,mBAAmB;IACjC,kBAAkB,aAAa;CAChC"}
|
package/lib/constants.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated
|
|
3
|
+
*/
|
|
4
|
+
export const SentryLogLevel = {
|
|
5
|
+
FATAL: 'fatal',
|
|
6
|
+
ERROR: 'error',
|
|
7
|
+
WARNING: 'warning',
|
|
8
|
+
LOG: 'log',
|
|
9
|
+
INFO: 'info',
|
|
10
|
+
DEBUG: 'debug'
|
|
11
|
+
};
|
|
12
|
+
export var QueryParams;
|
|
13
|
+
(function (QueryParams) {
|
|
14
|
+
QueryParams["DEBUG"] = "debug";
|
|
15
|
+
QueryParams["NO_LOW_LATENCY"] = "no_low_latency";
|
|
16
|
+
QueryParams["SUBTITLES_LANGUAGE"] = "sub_lang";
|
|
17
|
+
})(QueryParams || (QueryParams = {}));
|
|
18
|
+
;
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from "./Player.js";
|
|
2
|
+
export * from "./backend.js";
|
|
3
|
+
export * from "./playback.types.js";
|
|
4
|
+
export * from "./trace/LogTracer.js";
|
|
5
|
+
export * from "./trace/SentryTracer.js";
|
|
6
|
+
export * from "./trace/index.js";
|
|
7
|
+
export * from "./trace/types.js";
|
|
8
|
+
export * from "./types.js";
|
|
9
|
+
export * from "./utils/Logger.js";
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC"}
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from "./Player.js";
|
|
2
|
+
export * from "./backend.js";
|
|
3
|
+
export * from "./playback.types.js";
|
|
4
|
+
export * from "./trace/LogTracer.js";
|
|
5
|
+
export * from "./trace/SentryTracer.js";
|
|
6
|
+
export * from "./trace/index.js";
|
|
7
|
+
export * from "./trace/types.js";
|
|
8
|
+
export * from "./types.js";
|
|
9
|
+
export * from "./utils/Logger.js";
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import type { CorePlugin, ContainerPlugin, Playback as PlaybackPlugin, ExternalTrack } from "@clappr/core";
|
|
2
|
+
import { PlaybackType, PlayerDebugTag, StreamMediaSource } from "./types";
|
|
3
|
+
type MediacontrolStyles = {
|
|
4
|
+
seekbar?: string;
|
|
5
|
+
buttons?: string;
|
|
6
|
+
};
|
|
7
|
+
type PlayerMediaSourceDesc = {
|
|
8
|
+
mimeType?: string;
|
|
9
|
+
source: string;
|
|
10
|
+
};
|
|
11
|
+
export type PlayerMediaSource = string | PlayerMediaSourceDesc;
|
|
12
|
+
type HlsjsConfig = {
|
|
13
|
+
debug?: boolean;
|
|
14
|
+
startLevel?: number;
|
|
15
|
+
} & Record<string, unknown>;
|
|
16
|
+
type ShakaConfig = Record<string, unknown>;
|
|
17
|
+
type CorePlaybackConfig = {
|
|
18
|
+
disableContextMenu?: boolean;
|
|
19
|
+
controls?: boolean;
|
|
20
|
+
crossOrigin?: 'anonymous' | 'use-credentials';
|
|
21
|
+
externalTracks?: ExternalTrack[];
|
|
22
|
+
hlsjsConfig?: HlsjsConfig;
|
|
23
|
+
minimumDvrSize?: number;
|
|
24
|
+
playInline: boolean;
|
|
25
|
+
preload?: 'metadata' | 'auto' | 'none';
|
|
26
|
+
shakaConfiguration?: ShakaConfig;
|
|
27
|
+
};
|
|
28
|
+
type ErrorLevel = "FATAL" | "WARN" | "INFO";
|
|
29
|
+
export type PlaybackError = {
|
|
30
|
+
code?: number | string;
|
|
31
|
+
description: string;
|
|
32
|
+
raw?: MediaError;
|
|
33
|
+
level?: ErrorLevel;
|
|
34
|
+
};
|
|
35
|
+
export type CorePlayerEvents = {
|
|
36
|
+
onReady?: () => void;
|
|
37
|
+
onResize?: (data: {
|
|
38
|
+
width: number;
|
|
39
|
+
height: number;
|
|
40
|
+
}) => void;
|
|
41
|
+
onPlay?: (metadata: unknown) => void;
|
|
42
|
+
onPause?: (metadata: unknown) => void;
|
|
43
|
+
onStop?: (metadata: unknown) => void;
|
|
44
|
+
onEnded?: () => void;
|
|
45
|
+
onSeek?: (currentTime: number) => void;
|
|
46
|
+
onError?: (err: PlaybackError) => void;
|
|
47
|
+
onTimeUpdate?: (timeProgress: {
|
|
48
|
+
current: number;
|
|
49
|
+
total: number;
|
|
50
|
+
}) => void;
|
|
51
|
+
onVolumeUpdate?: (value: number) => void;
|
|
52
|
+
onSubtitleAvailable?: () => void;
|
|
53
|
+
};
|
|
54
|
+
export type ClapprVersionSpec = {
|
|
55
|
+
min: string;
|
|
56
|
+
};
|
|
57
|
+
export type CorePluginOptions = {
|
|
58
|
+
core?: CorePlugin[];
|
|
59
|
+
container?: ContainerPlugin[];
|
|
60
|
+
playback?: PlaybackPlugin[];
|
|
61
|
+
loadExternalPluginsFirst?: boolean;
|
|
62
|
+
loadExternalPlaybacksFirst?: boolean;
|
|
63
|
+
};
|
|
64
|
+
export type CoreOptions = {
|
|
65
|
+
actualLiveTime?: boolean;
|
|
66
|
+
actualLiveServerTime?: string;
|
|
67
|
+
allowUserInteraction?: boolean;
|
|
68
|
+
autoPlay?: boolean;
|
|
69
|
+
autoSeekFromUrl?: boolean;
|
|
70
|
+
chromeless?: boolean;
|
|
71
|
+
debug?: PlayerDebugTag | boolean;
|
|
72
|
+
disableCanAutoPlay?: boolean;
|
|
73
|
+
disableKeyboardShortcuts?: boolean;
|
|
74
|
+
disableVideoTagContextMenu?: boolean;
|
|
75
|
+
events?: CorePlayerEvents;
|
|
76
|
+
exitFullscreenOnEnd?: boolean;
|
|
77
|
+
gaAccount?: string;
|
|
78
|
+
gaTrackerName?: string;
|
|
79
|
+
height?: number;
|
|
80
|
+
hideMediaControl?: boolean;
|
|
81
|
+
hideVolumeBar?: boolean;
|
|
82
|
+
language?: string;
|
|
83
|
+
loop?: boolean;
|
|
84
|
+
maxBufferLength?: number;
|
|
85
|
+
mediacontrol?: MediacontrolStyles;
|
|
86
|
+
mimeType?: string;
|
|
87
|
+
multisources: StreamMediaSource[];
|
|
88
|
+
mute?: boolean;
|
|
89
|
+
persistConfig?: boolean;
|
|
90
|
+
preload?: "auto" | "metadata" | "none";
|
|
91
|
+
parentId?: string;
|
|
92
|
+
parent?: HTMLElement;
|
|
93
|
+
playback?: CorePlaybackConfig;
|
|
94
|
+
playbackNotSupportedMessage?: string;
|
|
95
|
+
playbackType?: PlaybackType;
|
|
96
|
+
plugins?: CorePluginOptions | CorePlugin[];
|
|
97
|
+
poster?: string;
|
|
98
|
+
source?: string;
|
|
99
|
+
sources?: PlayerMediaSource[];
|
|
100
|
+
watermark?: string;
|
|
101
|
+
watermarkLink?: string;
|
|
102
|
+
width?: number;
|
|
103
|
+
};
|
|
104
|
+
export {};
|
|
105
|
+
//# sourceMappingURL=internal.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internal.types.d.ts","sourceRoot":"","sources":["../src/internal.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,eAAe,EACf,QAAQ,IAAI,cAAc,EAC1B,aAAa,EACd,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE1E,KAAK,kBAAkB,GAAG;IAExB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAA;AAED,KAAK,qBAAqB,GAAG;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,qBAAqB,CAAC;AAE/D,KAAK,WAAW,GAAG;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE5B,KAAK,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE3C,KAAK,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,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,kBAAkB,CAAC;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,iBAAiB,EAAE,CAAC;IAClC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,MAAM,CAAC;IACvC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAC9B,2BAA2B,CAAC,EAAE,MAAM,CAAC;IACrC,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,OAAO,CAAC,EAAE,iBAAiB,GAAG,UAAU,EAAE,CAAC;IAC3C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type Duration = number;
|
|
2
|
+
export type TimeValue = number;
|
|
3
|
+
export type TimePosition = {
|
|
4
|
+
current: number;
|
|
5
|
+
total: number;
|
|
6
|
+
};
|
|
7
|
+
export type TimeProgress = TimePosition & {
|
|
8
|
+
start: number;
|
|
9
|
+
};
|
|
10
|
+
export type TimeUpdate = TimePosition & {
|
|
11
|
+
firstFragDateTime: number;
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=playback.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"playback.types.d.ts","sourceRoot":"","sources":["../src/playback.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC;AAE9B,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC;AAE/B,MAAM,MAAM,YAAY,GAAG;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACf,CAAA;AAED,MAAM,MAAM,YAAY,GAAG,YAAY,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;CAAE,CAAC;AAE7D,MAAM,MAAM,UAAU,GAAG,YAAY,GAAG;IACtC,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { UICorePlugin } from '@clappr/core';
|
|
2
|
+
import { AudioTrackLoadedData, AudioTrackSwitchedData, HlsEvents } from 'hls.js';
|
|
3
|
+
import '../../../assets/plugins/audio-selector/style.scss';
|
|
4
|
+
export default class AudioSelector extends UICorePlugin {
|
|
5
|
+
private selectedTrackId;
|
|
6
|
+
private currentTrack;
|
|
7
|
+
private tracks;
|
|
8
|
+
get name(): string;
|
|
9
|
+
get supportedVersion(): {
|
|
10
|
+
min: string;
|
|
11
|
+
};
|
|
12
|
+
static get version(): string;
|
|
13
|
+
get template(): any;
|
|
14
|
+
get attributes(): {
|
|
15
|
+
class: string;
|
|
16
|
+
'data-track-selector': string;
|
|
17
|
+
};
|
|
18
|
+
get events(): {
|
|
19
|
+
'click [data-track-selector-select]': string;
|
|
20
|
+
'click [data-track-selector-button]': string;
|
|
21
|
+
};
|
|
22
|
+
bindEvents(): void;
|
|
23
|
+
unBindEvents(): void;
|
|
24
|
+
private bindPlaybackEvents;
|
|
25
|
+
private setupAudioTrackListeners;
|
|
26
|
+
private onStop;
|
|
27
|
+
reload(): void;
|
|
28
|
+
private shouldRender;
|
|
29
|
+
render(): this;
|
|
30
|
+
private fillTracks;
|
|
31
|
+
private findTrackBy;
|
|
32
|
+
private onTrackSelect;
|
|
33
|
+
private setIndexTrack;
|
|
34
|
+
onShowLevelSelectMenu(): void;
|
|
35
|
+
hideSelectTrackMenu(): void;
|
|
36
|
+
toggleContextMenu(): void;
|
|
37
|
+
private buttonElement;
|
|
38
|
+
private buttonElementText;
|
|
39
|
+
private trackElement;
|
|
40
|
+
private getTitle;
|
|
41
|
+
startTrackSwitch(): void;
|
|
42
|
+
private updateText;
|
|
43
|
+
updateCurrentTrack(e: HlsEvents.AUDIO_TRACK_SWITCHED, info: AudioTrackSwitchedData | AudioTrackLoadedData): void;
|
|
44
|
+
private updateCurrentTrackW3C;
|
|
45
|
+
private setCurrentTrack;
|
|
46
|
+
highlightCurrentTrack(): void;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=AudioSelector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AudioSelector.d.ts","sourceRoot":"","sources":["../../../src/plugins/audio-selector/AudioSelector.ts"],"names":[],"mappings":"AACA,OAAO,EAAU,YAAY,EAAY,MAAM,cAAc,CAAC;AAC9D,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EAEtB,SAAS,EACV,MAAM,QAAQ,CAAC;AAGhB,OAAO,mDAAmD,CAAC;AAgC3D,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,YAAY;IACrD,OAAO,CAAC,eAAe,CAAqB;IAE5C,OAAO,CAAC,YAAY,CAA+B;IAEnD,OAAO,CAAC,MAAM,CAAwB;IAEtC,IAAI,IAAI,WAEP;IAED,IAAI,gBAAgB;;MAEnB;IAED,MAAM,KAAK,OAAO,WAEjB;IAED,IAAI,QAAQ,QAEX;IAED,IAAI,UAAU;;;MAKb;IAMD,IAAI,MAAM;;;MAKT;IAED,UAAU;IAOV,YAAY;IAWZ,OAAO,CAAC,kBAAkB;IAU1B,OAA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