@gcorevideo/player 2.3.0 → 2.4.0
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/index.js +101 -74
- package/lib/Player.d.ts +4 -4
- package/lib/Player.d.ts.map +1 -1
- package/lib/Player.js +27 -72
- package/lib/internal.types.d.ts +2 -3
- package/lib/internal.types.d.ts.map +1 -1
- package/lib/plugins/dash-playback/DashPlayback.js +1 -0
- package/lib/types.d.ts +5 -3
- package/lib/types.d.ts.map +1 -1
- package/lib/utils/mediaSources.d.ts +13 -0
- package/lib/utils/mediaSources.d.ts.map +1 -0
- package/lib/utils/mediaSources.js +82 -0
- package/package.json +1 -1
- package/src/Player.ts +33 -84
- package/src/internal.types.ts +2 -2
- package/src/plugins/dash-playback/DashPlayback.ts +1 -0
- package/src/types.ts +73 -69
- package/src/typings/@clappr/core/player.d.ts +58 -58
- package/src/utils/mediaSources.ts +104 -0
- package/tsconfig.tsbuildinfo +1 -1
package/dist/index.js
CHANGED
|
@@ -12850,6 +12850,7 @@ DashPlayback.canPlay = function (resource, mimeType) {
|
|
|
12850
12850
|
const resourceParts = resource.split('?')[0].match(/.*\.(.*)$/) || [];
|
|
12851
12851
|
const isDash = ((resourceParts.length > 1 && resourceParts[1].toLowerCase() === 'mpd') ||
|
|
12852
12852
|
mimeType === 'application/dash+xml' || mimeType === 'video/mp4');
|
|
12853
|
+
// TODO check
|
|
12853
12854
|
const ctor = window.MediaSource || ('WebKitMediaSource' in window ? window.WebKitMediaSource : undefined);
|
|
12854
12855
|
const hasSupport = typeof ctor === 'function';
|
|
12855
12856
|
trace(`${T$2} canPlay`, { hasSupport, isDash, resource });
|
|
@@ -42187,24 +42188,97 @@ HlsPlayback.canPlay = function (resource, mimeType) {
|
|
|
42187
42188
|
return !!(hasSupport && isHls);
|
|
42188
42189
|
};
|
|
42189
42190
|
|
|
42191
|
+
function buildSourcesSet(sources) {
|
|
42192
|
+
const sv = {
|
|
42193
|
+
dash: null,
|
|
42194
|
+
master: null,
|
|
42195
|
+
hls: null,
|
|
42196
|
+
mpegts: null,
|
|
42197
|
+
};
|
|
42198
|
+
sources.forEach((ps) => {
|
|
42199
|
+
const [s, t] = typeof ps === 'string' ? [ps, ''] : [ps.source, ps.mimeType];
|
|
42200
|
+
if (DashPlayback.canPlay(s, t)) {
|
|
42201
|
+
sv.dash = s;
|
|
42202
|
+
}
|
|
42203
|
+
else if (HlsPlayback.canPlay(s, t)) {
|
|
42204
|
+
sv.hls = s;
|
|
42205
|
+
}
|
|
42206
|
+
else {
|
|
42207
|
+
sv.master = s;
|
|
42208
|
+
}
|
|
42209
|
+
});
|
|
42210
|
+
return sv;
|
|
42211
|
+
}
|
|
42212
|
+
function buildSourcesPriorityList(sources, priorityTransport = 'auto') {
|
|
42213
|
+
const msl = [];
|
|
42214
|
+
switch (priorityTransport) {
|
|
42215
|
+
case 'dash':
|
|
42216
|
+
addDash();
|
|
42217
|
+
break;
|
|
42218
|
+
case 'hls':
|
|
42219
|
+
addHls();
|
|
42220
|
+
break;
|
|
42221
|
+
case 'mpegts':
|
|
42222
|
+
addMpegts();
|
|
42223
|
+
break;
|
|
42224
|
+
case 'auto':
|
|
42225
|
+
addDash();
|
|
42226
|
+
addHls();
|
|
42227
|
+
break;
|
|
42228
|
+
}
|
|
42229
|
+
Object.values(sources).forEach((s) => {
|
|
42230
|
+
if (s) {
|
|
42231
|
+
msl.push(s);
|
|
42232
|
+
}
|
|
42233
|
+
});
|
|
42234
|
+
return msl;
|
|
42235
|
+
function addMpegts() {
|
|
42236
|
+
if (sources.mpegts) {
|
|
42237
|
+
msl.push(sources.mpegts);
|
|
42238
|
+
sources.mpegts = null;
|
|
42239
|
+
}
|
|
42240
|
+
}
|
|
42241
|
+
function addHls() {
|
|
42242
|
+
if (sources.hls && HlsPlayback.canPlay(sources.hls)) {
|
|
42243
|
+
msl.push(sources.hls);
|
|
42244
|
+
sources.hls = null;
|
|
42245
|
+
}
|
|
42246
|
+
if (sources.master?.endsWith('.m3u8') &&
|
|
42247
|
+
HlsPlayback.canPlay(sources.master)) {
|
|
42248
|
+
msl.push(sources.master);
|
|
42249
|
+
sources.master = null;
|
|
42250
|
+
}
|
|
42251
|
+
}
|
|
42252
|
+
function addDash() {
|
|
42253
|
+
if (sources.dash && DashPlayback.canPlay(sources.dash)) {
|
|
42254
|
+
msl.push(sources.dash);
|
|
42255
|
+
sources.dash = null;
|
|
42256
|
+
}
|
|
42257
|
+
}
|
|
42258
|
+
}
|
|
42259
|
+
function unwrapSource(s) {
|
|
42260
|
+
return typeof s === 'string' ? s : s.source;
|
|
42261
|
+
}
|
|
42262
|
+
|
|
42190
42263
|
const T = 'GPlayer';
|
|
42191
42264
|
const DEFAULT_OPTIONS = {
|
|
42192
42265
|
autoPlay: false,
|
|
42193
|
-
|
|
42266
|
+
debug: 'none',
|
|
42194
42267
|
loop: false,
|
|
42268
|
+
mute: false,
|
|
42195
42269
|
multisources: [],
|
|
42196
42270
|
playbackType: 'vod',
|
|
42197
|
-
priorityTransport: 'dash',
|
|
42198
|
-
debug: 'none',
|
|
42199
42271
|
pluginSettings: {},
|
|
42200
|
-
strings: {},
|
|
42201
42272
|
poster: '',
|
|
42273
|
+
priorityTransport: 'dash',
|
|
42274
|
+
sources: [],
|
|
42275
|
+
strings: {},
|
|
42202
42276
|
};
|
|
42203
42277
|
/**
|
|
42204
42278
|
* @beta
|
|
42205
42279
|
*/
|
|
42206
42280
|
class Player {
|
|
42207
|
-
|
|
42281
|
+
qLevel = null;
|
|
42208
42282
|
config = DEFAULT_OPTIONS;
|
|
42209
42283
|
emitter = new EventLite();
|
|
42210
42284
|
player = null;
|
|
@@ -42232,7 +42306,7 @@ class Player {
|
|
|
42232
42306
|
return this.player.core.activePlayback.options.src;
|
|
42233
42307
|
}
|
|
42234
42308
|
get bitrate() {
|
|
42235
|
-
return this.
|
|
42309
|
+
return this.qLevel;
|
|
42236
42310
|
}
|
|
42237
42311
|
get hd() {
|
|
42238
42312
|
return this.player?.core.activePlayback?.isHighDefinitionInUse || false;
|
|
@@ -42291,7 +42365,7 @@ class Player {
|
|
|
42291
42365
|
clearTimeout(this.tuneInTimerId);
|
|
42292
42366
|
this.tuneInTimerId = null;
|
|
42293
42367
|
}
|
|
42294
|
-
this.
|
|
42368
|
+
this.qLevel = null;
|
|
42295
42369
|
}
|
|
42296
42370
|
pause() {
|
|
42297
42371
|
assert.ok(this.player, 'Player not initialized');
|
|
@@ -42353,7 +42427,6 @@ class Player {
|
|
|
42353
42427
|
this.bindBitrateChangeHandler();
|
|
42354
42428
|
}
|
|
42355
42429
|
player.core.on(Events$1.CORE_ACTIVE_CONTAINER_CHANGED, () => {
|
|
42356
|
-
// this.trigger(Events.ContainerChanged)
|
|
42357
42430
|
this.bindBitrateChangeHandler();
|
|
42358
42431
|
}, null);
|
|
42359
42432
|
if (Browser.isiOS && player.core.activePlayback) {
|
|
@@ -42455,15 +42528,19 @@ class Player {
|
|
|
42455
42528
|
},
|
|
42456
42529
|
};
|
|
42457
42530
|
buildCoreOptions(rootNode) {
|
|
42458
|
-
|
|
42459
|
-
const
|
|
42460
|
-
|
|
42461
|
-
|
|
42462
|
-
|
|
42463
|
-
|
|
42464
|
-
|
|
42531
|
+
// TODO extract
|
|
42532
|
+
// const multisources = this.config.multisources
|
|
42533
|
+
// const mainSource =
|
|
42534
|
+
// this.config.playbackType === 'live'
|
|
42535
|
+
// ? multisources.find((ms) => ms.live !== false)
|
|
42536
|
+
// : multisources[0]
|
|
42537
|
+
// const mediaSources = mainSource
|
|
42538
|
+
// ? this.buildMediaSourcesList(mainSource)
|
|
42539
|
+
// : []
|
|
42465
42540
|
// const mainSourceUrl = mediaSources[0];
|
|
42466
|
-
const poster = mainSource?.poster ?? this.config.poster
|
|
42541
|
+
// const poster = mainSource?.poster ?? this.config.poster
|
|
42542
|
+
const poster = this.config.poster;
|
|
42543
|
+
const source = this.selectMediaSource(); // TODO
|
|
42467
42544
|
this.rootNode = rootNode;
|
|
42468
42545
|
const coreOptions = {
|
|
42469
42546
|
...this.config.pluginSettings,
|
|
@@ -42473,7 +42550,6 @@ class Player {
|
|
|
42473
42550
|
events: this.events,
|
|
42474
42551
|
height: rootNode.clientHeight,
|
|
42475
42552
|
loop: this.config.loop,
|
|
42476
|
-
multisources,
|
|
42477
42553
|
mute: this.config.mute,
|
|
42478
42554
|
playback: {
|
|
42479
42555
|
controls: false,
|
|
@@ -42489,8 +42565,8 @@ class Player {
|
|
|
42489
42565
|
playbackType: this.config.playbackType,
|
|
42490
42566
|
poster,
|
|
42491
42567
|
width: rootNode.clientWidth,
|
|
42492
|
-
|
|
42493
|
-
sources: mediaSources,
|
|
42568
|
+
source: source ? unwrapSource(source) : undefined,
|
|
42569
|
+
// sources: mediaSources,
|
|
42494
42570
|
strings: this.config.strings,
|
|
42495
42571
|
};
|
|
42496
42572
|
return coreOptions;
|
|
@@ -42502,61 +42578,12 @@ class Player {
|
|
|
42502
42578
|
}
|
|
42503
42579
|
bindBitrateChangeHandler() {
|
|
42504
42580
|
this.player?.core.activeContainer.on(Events$1.CONTAINER_BITRATE, (bitrate) => {
|
|
42505
|
-
this.
|
|
42581
|
+
this.qLevel = bitrate;
|
|
42506
42582
|
});
|
|
42507
42583
|
}
|
|
42508
|
-
|
|
42509
|
-
|
|
42510
|
-
|
|
42511
|
-
dash: ms.sourceDash,
|
|
42512
|
-
master: ms.source,
|
|
42513
|
-
hls: ms.hlsCmafUrl,
|
|
42514
|
-
mpegts: ms.hlsMpegtsUrl,
|
|
42515
|
-
};
|
|
42516
|
-
switch (this.config.priorityTransport) {
|
|
42517
|
-
case 'dash':
|
|
42518
|
-
addDash();
|
|
42519
|
-
break;
|
|
42520
|
-
case 'hls':
|
|
42521
|
-
addHls();
|
|
42522
|
-
break;
|
|
42523
|
-
case 'mpegts':
|
|
42524
|
-
addMpegts();
|
|
42525
|
-
break;
|
|
42526
|
-
case 'auto':
|
|
42527
|
-
addDash();
|
|
42528
|
-
addHls();
|
|
42529
|
-
break;
|
|
42530
|
-
}
|
|
42531
|
-
Object.values(sources).forEach((s) => {
|
|
42532
|
-
if (s) {
|
|
42533
|
-
msl.push(s);
|
|
42534
|
-
}
|
|
42535
|
-
});
|
|
42536
|
-
return msl;
|
|
42537
|
-
function addMpegts() {
|
|
42538
|
-
if (sources.mpegts) {
|
|
42539
|
-
msl.push(sources.mpegts);
|
|
42540
|
-
sources.mpegts = null;
|
|
42541
|
-
}
|
|
42542
|
-
}
|
|
42543
|
-
function addHls() {
|
|
42544
|
-
if (sources.hls && HlsPlayback.canPlay(sources.hls)) {
|
|
42545
|
-
msl.push(sources.hls);
|
|
42546
|
-
sources.hls = null;
|
|
42547
|
-
}
|
|
42548
|
-
if (sources.master?.endsWith('.m3u8') &&
|
|
42549
|
-
HlsPlayback.canPlay(sources.master)) {
|
|
42550
|
-
msl.push(sources.master);
|
|
42551
|
-
sources.master = null;
|
|
42552
|
-
}
|
|
42553
|
-
}
|
|
42554
|
-
function addDash() {
|
|
42555
|
-
if (sources.dash && DashPlayback.canPlay(sources.dash)) {
|
|
42556
|
-
msl.push(sources.dash);
|
|
42557
|
-
sources.dash = null;
|
|
42558
|
-
}
|
|
42559
|
-
}
|
|
42584
|
+
// TODO select a single source to play according to the priority transport and the modules support
|
|
42585
|
+
selectMediaSource() {
|
|
42586
|
+
return buildSourcesPriorityList(buildSourcesSet(this.config.sources), this.config.priorityTransport)[0];
|
|
42560
42587
|
}
|
|
42561
42588
|
}
|
|
42562
42589
|
|
|
@@ -42682,12 +42709,12 @@ class SentryTracer {
|
|
|
42682
42709
|
}
|
|
42683
42710
|
}
|
|
42684
42711
|
|
|
42685
|
-
var version$1 = "2.
|
|
42712
|
+
var version$1 = "2.4.0";
|
|
42686
42713
|
|
|
42687
42714
|
var packages = {
|
|
42688
42715
|
"": {
|
|
42689
42716
|
name: "@gcorevideo/player",
|
|
42690
|
-
version: "2.
|
|
42717
|
+
version: "2.4.0",
|
|
42691
42718
|
license: "Apache-2.0",
|
|
42692
42719
|
dependencies: {
|
|
42693
42720
|
"@clappr/core": "^0.11.3",
|
package/lib/Player.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PlaybackType, PlayerPlugin, QualityLevelInfo } from './types.js';
|
|
2
2
|
import { PlayerConfig, PlayerEvent } from './types.js';
|
|
3
3
|
type PlayerEventHandler<T extends PlayerEvent> = () => void;
|
|
4
4
|
export type PlaybackModule = 'dash' | 'hls' | 'native';
|
|
@@ -6,7 +6,7 @@ export type PlaybackModule = 'dash' | 'hls' | 'native';
|
|
|
6
6
|
* @beta
|
|
7
7
|
*/
|
|
8
8
|
export declare class Player {
|
|
9
|
-
private
|
|
9
|
+
private qLevel;
|
|
10
10
|
private config;
|
|
11
11
|
private emitter;
|
|
12
12
|
private player;
|
|
@@ -16,7 +16,7 @@ export declare class Player {
|
|
|
16
16
|
private tunedIn;
|
|
17
17
|
get activePlayback(): PlaybackModule | null;
|
|
18
18
|
get activeSource(): string | null;
|
|
19
|
-
get bitrate():
|
|
19
|
+
get bitrate(): QualityLevelInfo | null;
|
|
20
20
|
get hd(): any;
|
|
21
21
|
get playbackType(): PlaybackType | undefined;
|
|
22
22
|
constructor(config: PlayerConfig);
|
|
@@ -38,7 +38,7 @@ export declare class Player {
|
|
|
38
38
|
private buildCoreOptions;
|
|
39
39
|
private configurePlaybacks;
|
|
40
40
|
private bindBitrateChangeHandler;
|
|
41
|
-
private
|
|
41
|
+
private selectMediaSource;
|
|
42
42
|
}
|
|
43
43
|
export {};
|
|
44
44
|
//# sourceMappingURL=Player.d.ts.map
|
package/lib/Player.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Player.d.ts","sourceRoot":"","sources":["../src/Player.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Player.d.ts","sourceRoot":"","sources":["../src/Player.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EACV,YAAY,EACZ,YAAY,EACZ,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Y;IAI1C,MAAM,CAAC,gBAAgB,CAAC,MAAM,EAAE,YAAY;IAI5C,OAAO,CAAC,UAAU;YAqBJ,MAAM;IA+EpB,OAAO,CAAC,MAAM,CAgDb;IAED,OAAO,CAAC,gBAAgB;IAgDxB,OAAO,CAAC,kBAAkB;IAM1B,OAAO,CAAC,wBAAwB;IAUhC,OAAO,CAAC,iBAAiB;CAG1B"}
|
package/lib/Player.js
CHANGED
|
@@ -5,24 +5,26 @@ import { reportError, trace } from './trace/index.js';
|
|
|
5
5
|
import { PlayerEvent } from './types.js';
|
|
6
6
|
import DashPlayback from './plugins/dash-playback/DashPlayback.js';
|
|
7
7
|
import HlsPlayback from './plugins/hls-playback/HlsPlayback.js';
|
|
8
|
+
import { buildSourcesPriorityList, buildSourcesSet, unwrapSource } from './utils/mediaSources.js';
|
|
8
9
|
const T = 'GPlayer';
|
|
9
10
|
const DEFAULT_OPTIONS = {
|
|
10
11
|
autoPlay: false,
|
|
11
|
-
|
|
12
|
+
debug: 'none',
|
|
12
13
|
loop: false,
|
|
14
|
+
mute: false,
|
|
13
15
|
multisources: [],
|
|
14
16
|
playbackType: 'vod',
|
|
15
|
-
priorityTransport: 'dash',
|
|
16
|
-
debug: 'none',
|
|
17
17
|
pluginSettings: {},
|
|
18
|
-
strings: {},
|
|
19
18
|
poster: '',
|
|
19
|
+
priorityTransport: 'dash',
|
|
20
|
+
sources: [],
|
|
21
|
+
strings: {},
|
|
20
22
|
};
|
|
21
23
|
/**
|
|
22
24
|
* @beta
|
|
23
25
|
*/
|
|
24
26
|
export class Player {
|
|
25
|
-
|
|
27
|
+
qLevel = null;
|
|
26
28
|
config = DEFAULT_OPTIONS;
|
|
27
29
|
emitter = new EventLite();
|
|
28
30
|
player = null;
|
|
@@ -50,7 +52,7 @@ export class Player {
|
|
|
50
52
|
return this.player.core.activePlayback.options.src;
|
|
51
53
|
}
|
|
52
54
|
get bitrate() {
|
|
53
|
-
return this.
|
|
55
|
+
return this.qLevel;
|
|
54
56
|
}
|
|
55
57
|
get hd() {
|
|
56
58
|
return this.player?.core.activePlayback?.isHighDefinitionInUse || false;
|
|
@@ -109,7 +111,7 @@ export class Player {
|
|
|
109
111
|
clearTimeout(this.tuneInTimerId);
|
|
110
112
|
this.tuneInTimerId = null;
|
|
111
113
|
}
|
|
112
|
-
this.
|
|
114
|
+
this.qLevel = null;
|
|
113
115
|
}
|
|
114
116
|
pause() {
|
|
115
117
|
assert.ok(this.player, 'Player not initialized');
|
|
@@ -171,7 +173,6 @@ export class Player {
|
|
|
171
173
|
this.bindBitrateChangeHandler();
|
|
172
174
|
}
|
|
173
175
|
player.core.on(ClapprEvents.CORE_ACTIVE_CONTAINER_CHANGED, () => {
|
|
174
|
-
// this.trigger(Events.ContainerChanged)
|
|
175
176
|
this.bindBitrateChangeHandler();
|
|
176
177
|
}, null);
|
|
177
178
|
if (Browser.isiOS && player.core.activePlayback) {
|
|
@@ -273,15 +274,19 @@ export class Player {
|
|
|
273
274
|
},
|
|
274
275
|
};
|
|
275
276
|
buildCoreOptions(rootNode) {
|
|
276
|
-
|
|
277
|
-
const
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
277
|
+
// TODO extract
|
|
278
|
+
// const multisources = this.config.multisources
|
|
279
|
+
// const mainSource =
|
|
280
|
+
// this.config.playbackType === 'live'
|
|
281
|
+
// ? multisources.find((ms) => ms.live !== false)
|
|
282
|
+
// : multisources[0]
|
|
283
|
+
// const mediaSources = mainSource
|
|
284
|
+
// ? this.buildMediaSourcesList(mainSource)
|
|
285
|
+
// : []
|
|
283
286
|
// const mainSourceUrl = mediaSources[0];
|
|
284
|
-
const poster = mainSource?.poster ?? this.config.poster
|
|
287
|
+
// const poster = mainSource?.poster ?? this.config.poster
|
|
288
|
+
const poster = this.config.poster;
|
|
289
|
+
const source = this.selectMediaSource(); // TODO
|
|
285
290
|
this.rootNode = rootNode;
|
|
286
291
|
const coreOptions = {
|
|
287
292
|
...this.config.pluginSettings,
|
|
@@ -291,7 +296,6 @@ export class Player {
|
|
|
291
296
|
events: this.events,
|
|
292
297
|
height: rootNode.clientHeight,
|
|
293
298
|
loop: this.config.loop,
|
|
294
|
-
multisources,
|
|
295
299
|
mute: this.config.mute,
|
|
296
300
|
playback: {
|
|
297
301
|
controls: false,
|
|
@@ -307,8 +311,8 @@ export class Player {
|
|
|
307
311
|
playbackType: this.config.playbackType,
|
|
308
312
|
poster,
|
|
309
313
|
width: rootNode.clientWidth,
|
|
310
|
-
|
|
311
|
-
sources: mediaSources,
|
|
314
|
+
source: source ? unwrapSource(source) : undefined,
|
|
315
|
+
// sources: mediaSources,
|
|
312
316
|
strings: this.config.strings,
|
|
313
317
|
};
|
|
314
318
|
return coreOptions;
|
|
@@ -320,60 +324,11 @@ export class Player {
|
|
|
320
324
|
}
|
|
321
325
|
bindBitrateChangeHandler() {
|
|
322
326
|
this.player?.core.activeContainer.on(ClapprEvents.CONTAINER_BITRATE, (bitrate) => {
|
|
323
|
-
this.
|
|
327
|
+
this.qLevel = bitrate;
|
|
324
328
|
});
|
|
325
329
|
}
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
dash: ms.sourceDash,
|
|
330
|
-
master: ms.source,
|
|
331
|
-
hls: ms.hlsCmafUrl,
|
|
332
|
-
mpegts: ms.hlsMpegtsUrl,
|
|
333
|
-
};
|
|
334
|
-
switch (this.config.priorityTransport) {
|
|
335
|
-
case 'dash':
|
|
336
|
-
addDash();
|
|
337
|
-
break;
|
|
338
|
-
case 'hls':
|
|
339
|
-
addHls();
|
|
340
|
-
break;
|
|
341
|
-
case 'mpegts':
|
|
342
|
-
addMpegts();
|
|
343
|
-
break;
|
|
344
|
-
case 'auto':
|
|
345
|
-
addDash();
|
|
346
|
-
addHls();
|
|
347
|
-
break;
|
|
348
|
-
}
|
|
349
|
-
Object.values(sources).forEach((s) => {
|
|
350
|
-
if (s) {
|
|
351
|
-
msl.push(s);
|
|
352
|
-
}
|
|
353
|
-
});
|
|
354
|
-
return msl;
|
|
355
|
-
function addMpegts() {
|
|
356
|
-
if (sources.mpegts) {
|
|
357
|
-
msl.push(sources.mpegts);
|
|
358
|
-
sources.mpegts = null;
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
function addHls() {
|
|
362
|
-
if (sources.hls && HlsPlayback.canPlay(sources.hls)) {
|
|
363
|
-
msl.push(sources.hls);
|
|
364
|
-
sources.hls = null;
|
|
365
|
-
}
|
|
366
|
-
if (sources.master?.endsWith('.m3u8') &&
|
|
367
|
-
HlsPlayback.canPlay(sources.master)) {
|
|
368
|
-
msl.push(sources.master);
|
|
369
|
-
sources.master = null;
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
function addDash() {
|
|
373
|
-
if (sources.dash && DashPlayback.canPlay(sources.dash)) {
|
|
374
|
-
msl.push(sources.dash);
|
|
375
|
-
sources.dash = null;
|
|
376
|
-
}
|
|
377
|
-
}
|
|
330
|
+
// TODO select a single source to play according to the priority transport and the modules support
|
|
331
|
+
selectMediaSource() {
|
|
332
|
+
return buildSourcesPriorityList(buildSourcesSet(this.config.sources), this.config.priorityTransport)[0];
|
|
378
333
|
}
|
|
379
334
|
}
|
package/lib/internal.types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CorePlugin, ContainerPlugin, Playback as ClapprPlayback } from "@clappr/core";
|
|
2
|
-
import { PlaybackType, PlayerDebugTag
|
|
2
|
+
import { PlaybackType, PlayerDebugTag } from "./types";
|
|
3
3
|
type ExternalTrack = {
|
|
4
4
|
kind?: "subtitles" | "captions";
|
|
5
5
|
src: string;
|
|
@@ -10,7 +10,7 @@ type MediacontrolStyles = {
|
|
|
10
10
|
seekbar?: string;
|
|
11
11
|
buttons?: string;
|
|
12
12
|
};
|
|
13
|
-
type PlayerMediaSourceDesc = {
|
|
13
|
+
export type PlayerMediaSourceDesc = {
|
|
14
14
|
mimeType?: string;
|
|
15
15
|
source: string;
|
|
16
16
|
};
|
|
@@ -92,7 +92,6 @@ export type CoreOptions = {
|
|
|
92
92
|
maxBufferLength?: number;
|
|
93
93
|
mediacontrol?: MediacontrolStyles;
|
|
94
94
|
mimeType?: string;
|
|
95
|
-
multisources: StreamMediaSource[];
|
|
96
95
|
mute?: boolean;
|
|
97
96
|
persistConfig?: boolean;
|
|
98
97
|
preload?: "auto" | "metadata" | "none";
|
|
@@ -1 +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,EAC3B,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,YAAY,EAAE,cAAc,
|
|
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,EAC3B,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,YAAY,EAAE,cAAc,EAAqB,MAAM,SAAS,CAAC;AAE1E,KAAK,aAAa,GAAG;IACnB,IAAI,CAAC,EAAE,WAAW,GAAG,UAAU,CAAC;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd,CAAA;AAED,KAAK,kBAAkB,GAAG;IAExB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG;IAClC,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,M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;IACrC,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,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;IAElB,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"}
|
|
@@ -639,6 +639,7 @@ DashPlayback.canPlay = function (resource, mimeType) {
|
|
|
639
639
|
const resourceParts = resource.split('?')[0].match(/.*\.(.*)$/) || [];
|
|
640
640
|
const isDash = ((resourceParts.length > 1 && resourceParts[1].toLowerCase() === 'mpd') ||
|
|
641
641
|
mimeType === 'application/dash+xml' || mimeType === 'video/mp4');
|
|
642
|
+
// TODO check
|
|
642
643
|
const ctor = window.MediaSource || ('WebKitMediaSource' in window ? window.WebKitMediaSource : undefined);
|
|
643
644
|
const hasSupport = typeof ctor === 'function';
|
|
644
645
|
trace(`${T} canPlay`, { hasSupport, isDash, resource });
|
package/lib/types.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { PlayerMediaSource } from "./internal.types";
|
|
1
2
|
export type PlayerDebugTag = 'all' | 'clappr' | 'dash' | 'hls' | 'none';
|
|
2
3
|
export type PlayerDebugSettings = PlayerDebugTag | boolean;
|
|
3
4
|
export type PlaybackType = 'live' | 'vod';
|
|
@@ -18,6 +19,7 @@ export type PlayerConfig = {
|
|
|
18
19
|
pluginSettings?: Record<string, unknown>;
|
|
19
20
|
poster?: string;
|
|
20
21
|
priorityTransport?: TransportPreference;
|
|
22
|
+
sources: PlayerMediaSource[];
|
|
21
23
|
strings: TranslationSettings;
|
|
22
24
|
};
|
|
23
25
|
export type PlayerOptionsThumbnails = {
|
|
@@ -77,11 +79,11 @@ export type StreamMediaSource = {
|
|
|
77
79
|
export type SrcProjectionType = 'regular' | '360' | 'vr180' | 'vr360tb';
|
|
78
80
|
export type ProjectionType = '360' | '180' | '360_TB';
|
|
79
81
|
export type TranslationSettings = Partial<Record<LangTag, Record<TranslationKey, string>>>;
|
|
80
|
-
export type
|
|
81
|
-
|
|
82
|
+
export type QualityLevelInfo = {
|
|
83
|
+
level: number;
|
|
82
84
|
width: number;
|
|
85
|
+
height: number;
|
|
83
86
|
bitrate: number;
|
|
84
|
-
level: number;
|
|
85
87
|
};
|
|
86
88
|
export declare enum PlayerEvent {
|
|
87
89
|
Ready = "ready",
|
package/lib/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,M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@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { PlayerMediaSource } from '../internal.types';
|
|
2
|
+
import { StreamMediaSource, TransportPreference } from '../types';
|
|
3
|
+
export type SourceVariants = {
|
|
4
|
+
dash: string | null;
|
|
5
|
+
master: string | null;
|
|
6
|
+
hls: string | null;
|
|
7
|
+
mpegts: string | null;
|
|
8
|
+
};
|
|
9
|
+
export declare function buildSourcesSet(sources: PlayerMediaSource[]): SourceVariants;
|
|
10
|
+
export declare function buildSourcesPriorityList(sources: SourceVariants, priorityTransport?: TransportPreference): PlayerMediaSource[];
|
|
11
|
+
export declare function unwrapSource(s: PlayerMediaSource): string;
|
|
12
|
+
export declare function buildGcoreStreamSourcesList(ms: StreamMediaSource, priorityTransport: TransportPreference): PlayerMediaSource[];
|
|
13
|
+
//# sourceMappingURL=mediaSources.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mediaSources.d.ts","sourceRoot":"","sources":["../../src/utils/mediaSources.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAGrD,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AAEjE,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;IACnB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;IAClB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;CACtB,CAAA;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,iBAAiB,EAAE,GAAG,cAAc,CAkB5E;AAED,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,cAAc,EACvB,iBAAiB,GAAE,mBAA4B,GAC9C,iBAAiB,EAAE,CAmDrB;AAED,wBAAgB,YAAY,CAAC,CAAC,EAAE,iBAAiB,GAAG,MAAM,CAEzD;AAED,wBAAgB,2BAA2B,CACzC,EAAE,EAAE,iBAAiB,EACrB,iBAAiB,EAAE,mBAAmB,GACrC,iBAAiB,EAAE,CAQrB"}
|