@gcorevideo/player 2.8.2 → 2.10.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/README.md +39 -0
- package/api-extractor.json +454 -0
- package/dist/index.js +1032 -182
- package/dist/player.d.ts +407 -0
- package/docs/api/index.md +31 -0
- package/docs/api/player.dashsettings.md +16 -0
- package/docs/api/player.langtag.md +15 -0
- package/docs/api/player.md +295 -0
- package/docs/api/player.mediatransport.md +15 -0
- package/docs/api/player.playbackmodule.md +15 -0
- package/docs/api/player.playbacktype.md +16 -0
- package/docs/api/player.player._constructor_.md +50 -0
- package/docs/api/player.player.attachto.md +56 -0
- package/docs/api/player.player.configure.md +58 -0
- package/docs/api/player.player.destroy.md +20 -0
- package/docs/api/player.player.getcurrenttime.md +22 -0
- package/docs/api/player.player.getduration.md +22 -0
- package/docs/api/player.player.md +304 -0
- package/docs/api/player.player.mute.md +20 -0
- package/docs/api/player.player.off.md +72 -0
- package/docs/api/player.player.on.md +72 -0
- package/docs/api/player.player.pause.md +20 -0
- package/docs/api/player.player.play.md +20 -0
- package/docs/api/player.player.registerplugin.md +56 -0
- package/docs/api/player.player.resize.md +59 -0
- package/docs/api/player.player.seek.md +56 -0
- package/docs/api/player.player.stop.md +20 -0
- package/docs/api/player.player.unmute.md +20 -0
- package/docs/api/player.player.unregisterplugin.md +56 -0
- package/docs/api/player.playerconfig.autoplay.md +16 -0
- package/docs/api/player.playerconfig.dash.md +16 -0
- package/docs/api/player.playerconfig.debug.md +16 -0
- package/docs/api/player.playerconfig.language.md +16 -0
- package/docs/api/player.playerconfig.loop.md +16 -0
- package/docs/api/player.playerconfig.md +266 -0
- package/docs/api/player.playerconfig.mute.md +16 -0
- package/docs/api/player.playerconfig.playbacktype.md +16 -0
- package/docs/api/player.playerconfig.prioritytransport.md +16 -0
- package/docs/api/player.playerconfig.sources.md +16 -0
- package/docs/api/player.playerconfig.strings.md +16 -0
- package/docs/api/player.playerdebugsettings.md +20 -0
- package/docs/api/player.playerdebugtag.md +15 -0
- package/docs/api/player.playerevent.md +116 -0
- package/docs/api/player.playereventhandler.md +17 -0
- package/docs/api/player.playermediasource.md +18 -0
- package/docs/api/player.playermediasourcedesc.md +83 -0
- package/docs/api/player.playermediasourcedesc.mimetype.md +16 -0
- package/docs/api/player.playermediasourcedesc.source.md +16 -0
- package/docs/api/player.playerplugin.md +17 -0
- package/docs/api/player.qualitylevel.md +20 -0
- package/docs/api/player.translationkey.md +15 -0
- package/docs/api/player.translationsettings.md +35 -0
- package/docs/api/player.transportpreference.md +17 -0
- package/docs/api/player.version.md +27 -0
- package/lib/Player.d.ts +83 -5
- package/lib/Player.d.ts.map +1 -1
- package/lib/Player.js +99 -25
- package/lib/constants.d.ts +0 -18
- package/lib/constants.d.ts.map +1 -1
- package/lib/constants.js +1 -18
- package/lib/gcore.types.d.ts +84 -0
- package/lib/gcore.types.d.ts.map +1 -0
- package/lib/gcore.types.js +9 -0
- package/lib/index.d.ts +10 -5
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +10 -5
- package/lib/internal.types.d.ts +28 -11
- package/lib/internal.types.d.ts.map +1 -1
- package/lib/playback.types.d.ts +19 -5
- package/lib/playback.types.d.ts.map +1 -1
- package/lib/plugins/dash-playback/DashPlayback.js +1 -1
- package/lib/plugins/hls-playback/HlsPlayback.js +1 -1
- package/lib/tsdoc-metadata.json +11 -0
- package/lib/types.d.ts +179 -62
- package/lib/types.d.ts.map +1 -1
- package/lib/types.js +19 -0
- package/lib/utils/mediaSources.d.ts +1 -3
- package/lib/utils/mediaSources.d.ts.map +1 -1
- package/lib/utils/mediaSources.js +0 -9
- package/lib/version.d.ts +5 -0
- package/lib/version.d.ts.map +1 -1
- package/lib/version.js +5 -0
- package/package.json +6 -1
- package/src/Player.ts +113 -32
- package/src/index.ts +11 -5
- package/src/internal.types.ts +28 -15
- package/src/playback.types.ts +20 -6
- package/src/plugins/dash-playback/DashPlayback.ts +1 -1
- package/src/plugins/hls-playback/HlsPlayback.ts +1 -1
- package/src/types.ts +196 -74
- package/src/utils/mediaSources.ts +1 -15
- package/src/version.ts +5 -0
- package/temp/player.api.json +1950 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/src/constants.ts +0 -17
- package/src/plugins/dash-playback/_DashPlayback.js +0 -688
- package/src/trace/LogTracer.ts +0 -23
- package/src/trace/SentryTracer.ts +0 -21
- package/src/trace/Tracer.ts +0 -27
- package/src/trace/index.ts +0 -32
- package/src/trace/types.ts +0 -7
- package/src/typings/@clappr/plugins.d.ts +0 -23
- package/src/utils/Logger.ts +0 -107
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { TransportPreference } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* @alpha
|
|
4
|
+
*/
|
|
5
|
+
export type SrcProjectionType = 'regular' | '360' | 'vr180' | 'vr360tb';
|
|
6
|
+
/**
|
|
7
|
+
* @alpha
|
|
8
|
+
*/
|
|
9
|
+
export type ProjectionType = '360' | '180' | '360_TB';
|
|
10
|
+
/**
|
|
11
|
+
* Represents a media stream source with its associated metadata
|
|
12
|
+
* @beta
|
|
13
|
+
*/
|
|
14
|
+
export type GcoreStreamMediaSource = {
|
|
15
|
+
/**
|
|
16
|
+
* Human-readable description of the media
|
|
17
|
+
*/
|
|
18
|
+
description: string;
|
|
19
|
+
/**
|
|
20
|
+
* Whether the stream supports DVR (Digital Video Recording) functionality
|
|
21
|
+
*/
|
|
22
|
+
dvr: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* URL for HLS CMAF stream, if available
|
|
25
|
+
*/
|
|
26
|
+
hlsCmafUrl: string | null;
|
|
27
|
+
/**
|
|
28
|
+
* URL for HLS MPEG-TS stream, if available
|
|
29
|
+
*/
|
|
30
|
+
hlsMpegtsUrl: string | null;
|
|
31
|
+
/**
|
|
32
|
+
* Unique identifier for the media source
|
|
33
|
+
*/
|
|
34
|
+
id: number;
|
|
35
|
+
/**
|
|
36
|
+
* Whether this is a live stream
|
|
37
|
+
*/
|
|
38
|
+
live: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Preferred transport protocol for this source
|
|
41
|
+
*/
|
|
42
|
+
priorityTransport: TransportPreference;
|
|
43
|
+
/**
|
|
44
|
+
* URL to the poster image
|
|
45
|
+
*/
|
|
46
|
+
poster: string | null;
|
|
47
|
+
/**
|
|
48
|
+
* The projection type for the video
|
|
49
|
+
*/
|
|
50
|
+
projection: ProjectionType | null;
|
|
51
|
+
/**
|
|
52
|
+
* URL to a preview screenshot
|
|
53
|
+
*/
|
|
54
|
+
screenshot: string | null;
|
|
55
|
+
/**
|
|
56
|
+
* Primary source URL
|
|
57
|
+
*/
|
|
58
|
+
source: string | null;
|
|
59
|
+
/**
|
|
60
|
+
* DASH manifest URL
|
|
61
|
+
*/
|
|
62
|
+
sourceDash: string | null;
|
|
63
|
+
/**
|
|
64
|
+
* URL to the video preview sprite sheet
|
|
65
|
+
*/
|
|
66
|
+
sprite: string | null;
|
|
67
|
+
/**
|
|
68
|
+
* Title of the media
|
|
69
|
+
*/
|
|
70
|
+
title: string;
|
|
71
|
+
/**
|
|
72
|
+
* URL to the WebVTT subtitle file
|
|
73
|
+
*/
|
|
74
|
+
vtt: string | null;
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* @internal Gcore internal query params
|
|
78
|
+
*/
|
|
79
|
+
export declare enum _QueryParams {
|
|
80
|
+
DEBUG = "debug",
|
|
81
|
+
NO_LOW_LATENCY = "no_low_latency",
|
|
82
|
+
SUBTITLES_LANGUAGE = "sub_lang"
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=gcore.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gcore.types.d.ts","sourceRoot":"","sources":["../src/gcore.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAElD;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,KAAK,GAAG,OAAO,GAAG,SAAS,CAAA;AACvE;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,KAAK,GAAG,QAAQ,CAAA;AAErD;;;GAGG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACnC;;OAEG;IACH,WAAW,EAAE,MAAM,CAAA;IAEnB;;OAEG;IACH,GAAG,EAAE,OAAO,CAAA;IAEZ;;OAEG;IACH,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IAEzB;;OAEG;IACH,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;IAE3B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAA;IAEV;;OAEG;IACH,IAAI,EAAE,OAAO,CAAA;IAEb;;OAEG;IACH,iBAAiB,EAAE,mBAAmB,CAAA;IAEtC;;OAEG;IACH,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IAErB;;OAEG;IACH,UAAU,EAAE,cAAc,GAAG,IAAI,CAAA;IAEjC;;OAEG;IACH,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IAEzB;;OAEG;IACH,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IAErB;;OAEG;IACH,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IAEzB;;OAEG;IACH,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IAErB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAA;IAEb;;OAEG;IACH,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;CACnB,CAAA;AAED;;GAEG;AACH,oBAAY,YAAY;IACtB,KAAK,UAAU;IACf,cAAc,mBAAmB;IACjC,kBAAkB,aAAa;CAChC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @internal Gcore internal query params
|
|
3
|
+
*/
|
|
4
|
+
export var _QueryParams;
|
|
5
|
+
(function (_QueryParams) {
|
|
6
|
+
_QueryParams["DEBUG"] = "debug";
|
|
7
|
+
_QueryParams["NO_LOW_LATENCY"] = "no_low_latency";
|
|
8
|
+
_QueryParams["SUBTITLES_LANGUAGE"] = "sub_lang";
|
|
9
|
+
})(_QueryParams || (_QueryParams = {}));
|
package/lib/index.d.ts
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Video player for the GCore streaming platform
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* This package provides a video player for the GCore streaming platform.
|
|
6
|
+
* It is built on top of the Clappr library and provides a framework for building custom integrations.
|
|
7
|
+
*
|
|
8
|
+
* @packageDocumentation
|
|
9
|
+
*/
|
|
10
|
+
export { setTracer } from "@gcorevideo/utils";
|
|
1
11
|
export * from "./Player.js";
|
|
2
12
|
export * from "./playback.types.js";
|
|
3
|
-
export * from "./trace/LogTracer.js";
|
|
4
|
-
export * from "./trace/SentryTracer.js";
|
|
5
|
-
export * from "./trace/index.js";
|
|
6
|
-
export * from "./trace/types.js";
|
|
7
13
|
export * from "./types.js";
|
|
8
|
-
export * from "./utils/Logger.js";
|
|
9
14
|
export * from "./version.js";
|
|
10
15
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,cAAc,aAAa,CAAA;AAC3B,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Video player for the GCore streaming platform
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* This package provides a video player for the GCore streaming platform.
|
|
6
|
+
* It is built on top of the Clappr library and provides a framework for building custom integrations.
|
|
7
|
+
*
|
|
8
|
+
* @packageDocumentation
|
|
9
|
+
*/
|
|
10
|
+
export { setTracer } from "@gcorevideo/utils";
|
|
1
11
|
export * from "./Player.js";
|
|
2
12
|
export * from "./playback.types.js";
|
|
3
|
-
export * from "./trace/LogTracer.js";
|
|
4
|
-
export * from "./trace/SentryTracer.js";
|
|
5
|
-
export * from "./trace/index.js";
|
|
6
|
-
export * from "./trace/types.js";
|
|
7
13
|
export * from "./types.js";
|
|
8
|
-
export * from "./utils/Logger.js";
|
|
9
14
|
export * from "./version.js";
|
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 } from "./types";
|
|
2
|
+
import { PlaybackType, PlayerDebugTag, PlayerMediaSource } from "./types";
|
|
3
3
|
type ExternalTrack = {
|
|
4
4
|
kind?: "subtitles" | "captions";
|
|
5
5
|
src: string;
|
|
@@ -10,17 +10,20 @@ type MediacontrolStyles = {
|
|
|
10
10
|
seekbar?: string;
|
|
11
11
|
buttons?: string;
|
|
12
12
|
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
export type PlayerMediaSource = string | PlayerMediaSourceDesc;
|
|
13
|
+
/**
|
|
14
|
+
* HLS.js configuration options to use with the HlsPlayback plugin.
|
|
15
|
+
* @beta
|
|
16
|
+
*/
|
|
18
17
|
type HlsjsConfig = {
|
|
19
18
|
debug?: boolean;
|
|
20
19
|
startLevel?: number;
|
|
21
20
|
} & Record<string, unknown>;
|
|
22
21
|
type ShakaConfig = Record<string, unknown>;
|
|
23
|
-
|
|
22
|
+
/**
|
|
23
|
+
* @see {@link https://github.com/clappr/clappr-core?tab=readme-ov-file#playback-configuration | the Clappr playback settings}
|
|
24
|
+
* @beta
|
|
25
|
+
*/
|
|
26
|
+
export interface CorePlaybackConfig {
|
|
24
27
|
disableContextMenu?: boolean;
|
|
25
28
|
controls?: boolean;
|
|
26
29
|
crossOrigin?: 'anonymous' | 'use-credentials';
|
|
@@ -31,14 +34,20 @@ type CorePlaybackConfig = {
|
|
|
31
34
|
playInline: boolean;
|
|
32
35
|
preload?: 'metadata' | 'auto' | 'none';
|
|
33
36
|
shakaConfiguration?: ShakaConfig;
|
|
34
|
-
}
|
|
37
|
+
}
|
|
35
38
|
type ErrorLevel = "FATAL" | "WARN" | "INFO";
|
|
39
|
+
/**
|
|
40
|
+
* @internal
|
|
41
|
+
*/
|
|
36
42
|
export type PlaybackError = {
|
|
37
43
|
code?: number | string;
|
|
38
44
|
description: string;
|
|
39
45
|
raw?: MediaError;
|
|
40
46
|
level?: ErrorLevel;
|
|
41
47
|
};
|
|
48
|
+
/**
|
|
49
|
+
* @internal
|
|
50
|
+
*/
|
|
42
51
|
export type CorePlayerEvents = {
|
|
43
52
|
onReady?: () => void;
|
|
44
53
|
onResize?: (data: {
|
|
@@ -58,10 +67,14 @@ export type CorePlayerEvents = {
|
|
|
58
67
|
onVolumeUpdate?: (value: number) => void;
|
|
59
68
|
onSubtitleAvailable?: () => void;
|
|
60
69
|
};
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
70
|
+
/**
|
|
71
|
+
* @internal
|
|
72
|
+
*/
|
|
64
73
|
export type PlaybackPluginFactory = typeof ClapprPlayback;
|
|
74
|
+
/**
|
|
75
|
+
* For the plugin development
|
|
76
|
+
* @internal
|
|
77
|
+
*/
|
|
65
78
|
export type CorePluginOptions = {
|
|
66
79
|
core?: CorePlugin[];
|
|
67
80
|
container?: ContainerPlugin[];
|
|
@@ -69,6 +82,10 @@ export type CorePluginOptions = {
|
|
|
69
82
|
loadExternalPluginsFirst?: boolean;
|
|
70
83
|
loadExternalPlaybacksFirst?: boolean;
|
|
71
84
|
};
|
|
85
|
+
/**
|
|
86
|
+
* For the plugin development
|
|
87
|
+
* @internal
|
|
88
|
+
*/
|
|
72
89
|
export type CoreOptions = {
|
|
73
90
|
actualLiveTime?: boolean;
|
|
74
91
|
actualLiveServerTime?: string;
|
|
@@ -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;
|
|
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;AAEtB,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,iBAAiB,EAAE,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;;;GAGG;AACH,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;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IAEjC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,WAAW,GAAG,iBAAiB,CAAC;IAE9C,cAAc,CAAC,EA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AAO,CAAC;IACf,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,kBAAkB,CAAC;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,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"}
|
package/lib/playback.types.d.ts
CHANGED
|
@@ -1,19 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* For the plugin development
|
|
3
|
+
* @internal
|
|
4
|
+
*/
|
|
1
5
|
export type TimeValue = number;
|
|
6
|
+
/**
|
|
7
|
+
* For the plugin development
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
2
10
|
export type TimePosition = {
|
|
3
11
|
current: TimeValue;
|
|
4
12
|
total: TimeValue;
|
|
5
13
|
};
|
|
14
|
+
/**
|
|
15
|
+
* For the plugin development
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
6
18
|
export type TimeProgress = TimePosition & {
|
|
7
19
|
start: number;
|
|
8
20
|
};
|
|
21
|
+
/**
|
|
22
|
+
* For the plugin development
|
|
23
|
+
* @internal
|
|
24
|
+
*/
|
|
9
25
|
export type TimeUpdate = TimePosition & {
|
|
10
26
|
firstFragDateTime: number;
|
|
11
27
|
};
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
height: number;
|
|
16
|
-
};
|
|
28
|
+
/**
|
|
29
|
+
* @beta
|
|
30
|
+
*/
|
|
17
31
|
export type QualityLevel = {
|
|
18
32
|
level: number;
|
|
19
33
|
width: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playback.types.d.ts","sourceRoot":"","sources":["../src/playback.types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"playback.types.d.ts","sourceRoot":"","sources":["../src/playback.types.ts"],"names":[],"mappings":"AACA;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC;AAE/B;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,OAAO,EAAE,SAAS,CAAC;IACnB,KAAK,EAAE,SAAS,CAAC;CAClB,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,YAAY,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;CAAE,CAAC;AAE7D;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG,YAAY,GAAG;IACtC,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { Events, HTML5Video, Log, Playback, Utils } from '@clappr/core';
|
|
5
5
|
import assert from 'assert';
|
|
6
6
|
import DASHJS from 'dashjs';
|
|
7
|
-
import { trace } from '
|
|
7
|
+
import { trace } from '@gcorevideo/utils';
|
|
8
8
|
const AUTO = -1;
|
|
9
9
|
const { now } = Utils;
|
|
10
10
|
const T = 'DashPlayback';
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { Events, HTML5Video, Log, Playback, PlayerError, Utils } from '@clappr/core';
|
|
5
5
|
import assert from 'assert';
|
|
6
6
|
import HLSJS from 'hls.js';
|
|
7
|
-
import { trace } from '
|
|
7
|
+
import { trace } from '@gcorevideo/utils';
|
|
8
8
|
import { CLAPPR_VERSION } from "../../build.js";
|
|
9
9
|
const { now, listContainsIgnoreCase } = Utils;
|
|
10
10
|
const AUTO = -1;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// This file is read by tools that parse documentation comments conforming to the TSDoc standard.
|
|
2
|
+
// It should be published with your NPM package. It should not be tracked by Git.
|
|
3
|
+
{
|
|
4
|
+
"tsdocVersion": "0.12",
|
|
5
|
+
"toolPackages": [
|
|
6
|
+
{
|
|
7
|
+
"packageName": "@microsoft/api-extractor",
|
|
8
|
+
"packageVersion": "7.49.1"
|
|
9
|
+
}
|
|
10
|
+
]
|
|
11
|
+
}
|
package/lib/types.d.ts
CHANGED
|
@@ -1,90 +1,207 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Describes a media source with its MIME type and URL.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* When the MIME type is provided, it helps the player determine the appropriate playback engine.
|
|
6
|
+
* If omitted, the player will attempt to detect the type from the source URL extension.
|
|
7
|
+
* @beta
|
|
8
|
+
*/
|
|
9
|
+
export interface PlayerMediaSourceDesc {
|
|
10
|
+
/**
|
|
11
|
+
* The MIME type of the media source (e.g. "video/mp4", "application/x-mpegURL")
|
|
12
|
+
*/
|
|
13
|
+
mimeType?: string;
|
|
14
|
+
/**
|
|
15
|
+
* URL of the media source
|
|
16
|
+
*/
|
|
17
|
+
source: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* A media source to fetch the media data from
|
|
21
|
+
* @beta
|
|
22
|
+
*/
|
|
23
|
+
export type PlayerMediaSource = string | PlayerMediaSourceDesc;
|
|
24
|
+
/**
|
|
25
|
+
* @beta
|
|
26
|
+
*/
|
|
2
27
|
export type PlayerDebugTag = 'all' | 'clappr' | 'dash' | 'hls' | 'none';
|
|
28
|
+
/**
|
|
29
|
+
* @remarks true is equivalent to 'all', false is equivalent to 'none'
|
|
30
|
+
* @beta
|
|
31
|
+
*/
|
|
3
32
|
export type PlayerDebugSettings = PlayerDebugTag | boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Type of a stream playback
|
|
35
|
+
* @beta
|
|
36
|
+
*/
|
|
4
37
|
export type PlaybackType = 'live' | 'vod';
|
|
38
|
+
/**
|
|
39
|
+
* @beta
|
|
40
|
+
*/
|
|
5
41
|
export type MediaTransport = 'dash' | 'hls' | 'mpegts';
|
|
42
|
+
/**
|
|
43
|
+
* @beta
|
|
44
|
+
*/
|
|
6
45
|
export type TransportPreference = MediaTransport | 'auto';
|
|
46
|
+
/**
|
|
47
|
+
* @beta
|
|
48
|
+
* @see {@link https://clappr.github.io/classes/UIContainerPlugin.html}, {@link https://clappr.github.io/classes/ContainerPlugin.html}
|
|
49
|
+
*/
|
|
7
50
|
export type PlayerPlugin = {
|
|
8
51
|
new (...args: any[]): unknown;
|
|
9
|
-
type:
|
|
52
|
+
type: 'core' | 'container';
|
|
10
53
|
};
|
|
11
|
-
|
|
54
|
+
/**
|
|
55
|
+
* Configuration options for the player
|
|
56
|
+
*
|
|
57
|
+
* @remarks
|
|
58
|
+
* You can specify multiple sources, each in two forms: just a plain URL or a full object with `source` and `mimeType` fields {@link PlayerMediaSource}.
|
|
59
|
+
* The player will pick the first viable media source according to the source availability, and either the transport preference or standard transport selection order.
|
|
60
|
+
*
|
|
61
|
+
* `priorityTransport` is used to specify the preferred transport protocol
|
|
62
|
+
* when multiple sources are available.
|
|
63
|
+
* It will first try to use the transport specified if it's supported (by a playback engine) and the source is available.
|
|
64
|
+
* Otherwise it will try the other transports in the regular order (dash, hls, mpegts).
|
|
65
|
+
*
|
|
66
|
+
* The `autoPlay` option should be used together with the {@link PlayerConfig.mute | mute} to avoid issues with the browsers' autoplay policies.
|
|
67
|
+
*
|
|
68
|
+
* Note that the `playbackType` is specified explicitly in the examle below, but a playback engine might be able to detect the type of the stream automatically.
|
|
69
|
+
*
|
|
70
|
+
* A plugin options can be specified in the configuration object under a unique key, typically corresponding to the plugin name.
|
|
71
|
+
* The plugin object will have access to the internal normalized configuration object that contains all the custom options.
|
|
72
|
+
* in the examle below, the `poster` field is the `Poster` plugin configuration options.
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```ts
|
|
76
|
+
* {
|
|
77
|
+
* autoPlay: true,
|
|
78
|
+
* mute: true,
|
|
79
|
+
* playbackType: 'live',
|
|
80
|
+
* priorityTransport: 'dash',
|
|
81
|
+
* sources: [{
|
|
82
|
+
* source: 'https://example.com/myownair66.mpd',
|
|
83
|
+
* mimeType: 'application/dash+xml',
|
|
84
|
+
* }, {
|
|
85
|
+
* source: 'https://example.com/myownair66.m3u8',
|
|
86
|
+
* mimeType: 'application/x-mpegURL',
|
|
87
|
+
* }],
|
|
88
|
+
* poster: {
|
|
89
|
+
* url: settings.poster,
|
|
90
|
+
* },
|
|
91
|
+
* }
|
|
92
|
+
* ```
|
|
93
|
+
* @beta
|
|
94
|
+
*/
|
|
95
|
+
export interface PlayerConfig extends Record<string, unknown> {
|
|
96
|
+
/**
|
|
97
|
+
* Start playback automatically when the player is ready
|
|
98
|
+
* @defaultValue false
|
|
99
|
+
*/
|
|
12
100
|
autoPlay?: boolean;
|
|
101
|
+
/**
|
|
102
|
+
* Configuration settings for the DASH playback engine
|
|
103
|
+
* @defaultValue \{\}
|
|
104
|
+
* {@link https://cdn.dashjs.org/latest/jsdoc/module-Settings.html}
|
|
105
|
+
*/
|
|
13
106
|
dash?: DashSettings;
|
|
107
|
+
/**
|
|
108
|
+
* Controls the debug output level
|
|
109
|
+
* @defaultValue 'none'
|
|
110
|
+
*/
|
|
14
111
|
debug?: PlayerDebugSettings;
|
|
112
|
+
/**
|
|
113
|
+
* A language code for the player UI, for example, `es`. Must reference a key in the {@link PlayerConfig.strings | strings} record.
|
|
114
|
+
* @defaultValue 'en'
|
|
115
|
+
*/
|
|
15
116
|
language?: string;
|
|
117
|
+
/**
|
|
118
|
+
* Repeat playback when the media ends.
|
|
119
|
+
* Is used with the `vod` {@link PlayerConfig.playbackType | playbackType}
|
|
120
|
+
* @defaultValue false
|
|
121
|
+
*/
|
|
16
122
|
loop?: boolean;
|
|
123
|
+
/**
|
|
124
|
+
* Mute the audio output in order to comply with browsers' autoplay policy.
|
|
125
|
+
* @defaultValue false
|
|
126
|
+
*/
|
|
17
127
|
mute?: boolean;
|
|
128
|
+
/**
|
|
129
|
+
* The type of playback (live stream or video on demand).
|
|
130
|
+
*
|
|
131
|
+
* @defaultValue 'vod'
|
|
132
|
+
*/
|
|
18
133
|
playbackType?: PlaybackType;
|
|
19
|
-
|
|
20
|
-
|
|
134
|
+
/**
|
|
135
|
+
* Preferred transport protocol when multiple sources are available.
|
|
136
|
+
* @defaultValue 'auto'
|
|
137
|
+
*/
|
|
21
138
|
priorityTransport?: TransportPreference;
|
|
139
|
+
/**
|
|
140
|
+
* List of media sources, at least one is required.
|
|
141
|
+
*/
|
|
22
142
|
sources: PlayerMediaSource[];
|
|
143
|
+
/**
|
|
144
|
+
* Localization strings for the player UI.
|
|
145
|
+
*/
|
|
23
146
|
strings: TranslationSettings;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
type
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
export type ClipsPluginOptions = Record<string, unknown>;
|
|
38
|
-
export type PlaybackSettings = {
|
|
39
|
-
hlsjsConfig?: Record<string, unknown>;
|
|
40
|
-
playInline?: boolean;
|
|
41
|
-
preload?: 'auto' | 'metadata' | 'none';
|
|
42
|
-
triggerFatalErrorOnResourceDenied?: boolean;
|
|
43
|
-
};
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* @beta
|
|
150
|
+
*/
|
|
151
|
+
export type LangTag = string;
|
|
152
|
+
/**
|
|
153
|
+
* @beta
|
|
154
|
+
*/
|
|
155
|
+
export type TranslationKey = string;
|
|
156
|
+
/**
|
|
157
|
+
* @beta
|
|
158
|
+
* {@link https://cdn.dashjs.org/latest/jsdoc/module-Settings.html | DASH.js settings}
|
|
159
|
+
*/
|
|
44
160
|
export type DashSettings = Record<string, unknown>;
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
dvr: boolean;
|
|
65
|
-
hlsCmafUrl: string | null;
|
|
66
|
-
hlsMpegtsUrl: string | null;
|
|
67
|
-
id: number;
|
|
68
|
-
live: boolean;
|
|
69
|
-
priorityTransport: TransportPreference;
|
|
70
|
-
poster: string | null;
|
|
71
|
-
projection: ProjectionType | null;
|
|
72
|
-
screenshot: string | null;
|
|
73
|
-
source: string | null;
|
|
74
|
-
sourceDash: string | null;
|
|
75
|
-
sprite: string | null;
|
|
76
|
-
title: string;
|
|
77
|
-
vtt: string | null;
|
|
78
|
-
};
|
|
79
|
-
export type SrcProjectionType = 'regular' | '360' | 'vr180' | 'vr360tb';
|
|
80
|
-
export type ProjectionType = '360' | '180' | '360_TB';
|
|
161
|
+
/**
|
|
162
|
+
* [language][key] =\> string
|
|
163
|
+
* @example
|
|
164
|
+
* ```
|
|
165
|
+
* {
|
|
166
|
+
* en: {
|
|
167
|
+
* play: 'Play',
|
|
168
|
+
* ...
|
|
169
|
+
* },
|
|
170
|
+
* es: {
|
|
171
|
+
* play: 'Reproducir',
|
|
172
|
+
* ...
|
|
173
|
+
* },
|
|
174
|
+
* ...
|
|
175
|
+
* }
|
|
176
|
+
* ```
|
|
177
|
+
*
|
|
178
|
+
* @beta
|
|
179
|
+
*/
|
|
81
180
|
export type TranslationSettings = Partial<Record<LangTag, Record<TranslationKey, string>>>;
|
|
181
|
+
/**
|
|
182
|
+
* A top-level event on the player object
|
|
183
|
+
* @beta
|
|
184
|
+
*/
|
|
82
185
|
export declare enum PlayerEvent {
|
|
186
|
+
/**
|
|
187
|
+
* The player is ready to use.
|
|
188
|
+
*/
|
|
83
189
|
Ready = "ready",
|
|
190
|
+
/**
|
|
191
|
+
* Playback has started.
|
|
192
|
+
*/
|
|
84
193
|
Play = "play",
|
|
194
|
+
/**
|
|
195
|
+
* Playback has been paused.
|
|
196
|
+
*/
|
|
85
197
|
Pause = "pause",
|
|
198
|
+
/**
|
|
199
|
+
* Playback has been stopped.
|
|
200
|
+
*/
|
|
86
201
|
Stop = "stop",
|
|
202
|
+
/**
|
|
203
|
+
* Playback has reached the end of the media.
|
|
204
|
+
*/
|
|
87
205
|
Ended = "ended"
|
|
88
206
|
}
|
|
89
|
-
export {};
|
|
90
207
|
//# sourceMappingURL=types.d.ts.map
|
package/lib/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IAEjB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAA;CACf;AAED;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,qBAAqB,CAAA;AAE9D;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,QAAQ,GAA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AM,CAAA;AAEnC;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAElD;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,MAAM,mBAAmB,GAAG,OAAO,CACvC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC,CAChD,CAAA;AAED;;;GAGG;AACH,oBAAY,WAAW;IACrB;;OAEG;IACH,KAAK,UAAU;IACf;;OAEG;IACH,IAAI,SAAS;IACb;;OAEG;IACH,KAAK,UAAU;IACf;;OAEG;IACH,IAAI,SAAS;IACb;;OAEG;IACH,KAAK,UAAU;CAChB"}
|
package/lib/types.js
CHANGED
|
@@ -1,8 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A top-level event on the player object
|
|
3
|
+
* @beta
|
|
4
|
+
*/
|
|
1
5
|
export var PlayerEvent;
|
|
2
6
|
(function (PlayerEvent) {
|
|
7
|
+
/**
|
|
8
|
+
* The player is ready to use.
|
|
9
|
+
*/
|
|
3
10
|
PlayerEvent["Ready"] = "ready";
|
|
11
|
+
/**
|
|
12
|
+
* Playback has started.
|
|
13
|
+
*/
|
|
4
14
|
PlayerEvent["Play"] = "play";
|
|
15
|
+
/**
|
|
16
|
+
* Playback has been paused.
|
|
17
|
+
*/
|
|
5
18
|
PlayerEvent["Pause"] = "pause";
|
|
19
|
+
/**
|
|
20
|
+
* Playback has been stopped.
|
|
21
|
+
*/
|
|
6
22
|
PlayerEvent["Stop"] = "stop";
|
|
23
|
+
/**
|
|
24
|
+
* Playback has reached the end of the media.
|
|
25
|
+
*/
|
|
7
26
|
PlayerEvent["Ended"] = "ended";
|
|
8
27
|
})(PlayerEvent || (PlayerEvent = {}));
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { PlayerMediaSource } from '../
|
|
2
|
-
import { StreamMediaSource, TransportPreference } from '../types';
|
|
1
|
+
import type { PlayerMediaSource, TransportPreference } from '../types';
|
|
3
2
|
export type SourceVariants = {
|
|
4
3
|
dash: string | null;
|
|
5
4
|
master: string | null;
|
|
@@ -9,5 +8,4 @@ export type SourceVariants = {
|
|
|
9
8
|
export declare function buildSourcesSet(sources: PlayerMediaSource[]): SourceVariants;
|
|
10
9
|
export declare function buildSourcesPriorityList(sources: SourceVariants, priorityTransport?: TransportPreference): PlayerMediaSource[];
|
|
11
10
|
export declare function unwrapSource(s: PlayerMediaSource): string;
|
|
12
|
-
export declare function buildGcoreStreamSourcesList(ms: StreamMediaSource, priorityTransport: TransportPreference): PlayerMediaSource[];
|
|
13
11
|
//# sourceMappingURL=mediaSources.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mediaSources.d.ts","sourceRoot":"","sources":["../../src/utils/mediaSources.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mediaSources.d.ts","sourceRoot":"","sources":["../../src/utils/mediaSources.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AAEtE,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"}
|