@mediakind/mkplayer 1.0.13 → 1.0.15
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 +17 -1
- package/dist/MKPlayer.d.ts +3 -0
- package/dist/MKPlayerConfiguration.d.ts +2 -0
- package/dist/MKStream.d.ts +13 -1
- package/dist/URLHelper.d.ts +4 -0
- package/dist/events/RequestType.d.ts +4 -0
- package/dist/lib/MKPlayer.d.ts +3 -0
- package/dist/lib/MKPlayer.js +71 -9
- package/dist/lib/MKPlayer.js.map +1 -1
- package/dist/lib/MKPlayerConfiguration.d.ts +2 -0
- package/dist/lib/MKStream.d.ts +13 -1
- package/dist/lib/MKStream.js +49 -1
- package/dist/lib/MKStream.js.map +1 -1
- package/dist/lib/URLHelper.d.ts +4 -0
- package/dist/lib/URLHelper.js +51 -0
- package/dist/lib/URLHelper.js.map +1 -0
- package/dist/lib/events/RequestType.d.ts +4 -0
- package/dist/lib/events/RequestType.js +9 -0
- package/dist/lib/events/RequestType.js.map +1 -0
- package/dist/lib-esm/MKPlayer.d.ts +3 -0
- package/dist/lib-esm/MKPlayer.js +71 -9
- package/dist/lib-esm/MKPlayer.js.map +1 -1
- package/dist/lib-esm/MKPlayerConfiguration.d.ts +2 -0
- package/dist/lib-esm/MKStream.d.ts +13 -1
- package/dist/lib-esm/MKStream.js +49 -1
- package/dist/lib-esm/MKStream.js.map +1 -1
- package/dist/lib-esm/URLHelper.d.ts +4 -0
- package/dist/lib-esm/URLHelper.js +48 -0
- package/dist/lib-esm/URLHelper.js.map +1 -0
- package/dist/lib-esm/events/RequestType.d.ts +4 -0
- package/dist/lib-esm/events/RequestType.js +6 -0
- package/dist/lib-esm/events/RequestType.js.map +1 -0
- package/dist/mkplayer.js +1 -1
- package/doc/assets/js/search.json +1 -1
- package/doc/classes/mkplayer.html +19 -22
- package/doc/enums/mkevent.html +0 -3
- package/doc/globals.html +0 -4
- package/doc/index.html +17 -4
- package/doc/interfaces/bufferlevel.html +0 -3
- package/doc/interfaces/mkplayereventcallback.html +0 -3
- package/doc/interfaces/subtitletrack.html +0 -3
- package/index.html +64 -17
- package/multi-camera.html +19 -19
- package/package.json +3 -3
- package/src/MKPlayer.ts +74 -15
- package/src/MKPlayerConfiguration.ts +7 -0
- package/src/MKStream.ts +55 -1
- package/src/URLHelper.ts +63 -0
- package/src/events/RequestType.ts +5 -0
- package/doc/interfaces/mkplayerconfiguration.html +0 -290
- package/mkplayer-ui.js +0 -12052
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mediakind/mkplayer",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.15",
|
|
4
4
|
"description": "MediaKind Web Player",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -23,13 +23,13 @@
|
|
|
23
23
|
"test": "jest",
|
|
24
24
|
"testWithCoverage": "jest --coverage",
|
|
25
25
|
"build:docs": "typedoc",
|
|
26
|
-
"deploy": "npm run build && npm run build:docs && azcopy copy --recursive dist 'https://mkplayer.blob.core.windows.net/$web?sp=racwdl&st=2020-10-23T03:41:09Z&se=2021-10-24T03:41:00Z&sv=2019-12-12&sr=c&sig=bSBP0oUHI6KzTwLwk195Jnrdnqh8GXEjqTAnAUmf4xA%3D' && azcopy copy --recursive doc 'https://mkplayer.blob.core.windows.net/$web?sp=racwdl&st=2020-10-23T03:41:09Z&se=2021-10-24T03:41:00Z&sv=2019-12-12&sr=c&sig=bSBP0oUHI6KzTwLwk195Jnrdnqh8GXEjqTAnAUmf4xA%3D' && azcopy copy index.html 'https://mkplayer.blob.core.windows.net/$web?sp=racwdl&st=2020-10-23T03:41:09Z&se=2021-10-24T03:41:00Z&sv=2019-12-12&sr=c&sig=bSBP0oUHI6KzTwLwk195Jnrdnqh8GXEjqTAnAUmf4xA%3D' && azcopy copy ../mkplayer-react/src/mkplayer-ui.min.css 'https://mkplayer.blob.core.windows.net/$web?sp=racwdl&st=2020-10-23T03:41:09Z&se=2021-10-24T03:41:00Z&sv=2019-12-12&sr=c&sig=bSBP0oUHI6KzTwLwk195Jnrdnqh8GXEjqTAnAUmf4xA%3D' && azcopy copy 'index.html' 'https://mkplayer.blob.core.windows.net/$web?sp=racwdl&st=2020-10-23T03:41:09Z&se=2021-10-24T03:41:00Z&sv=2019-12-12&sr=c&sig=bSBP0oUHI6KzTwLwk195Jnrdnqh8GXEjqTAnAUmf4xA%3D' && azcopy copy 'multi-camera.html' 'https://mkplayer.blob.core.windows.net/$web?sp=racwdl&st=2020-10-23T03:41:09Z&se=2021-10-24T03:41:00Z&sv=2019-12-12&sr=c&sig=bSBP0oUHI6KzTwLwk195Jnrdnqh8GXEjqTAnAUmf4xA%3D'
|
|
26
|
+
"deploy": "npm run build && npm run build:docs && azcopy copy --recursive dist 'https://mkplayer.blob.core.windows.net/$web?sp=racwdl&st=2020-10-23T03:41:09Z&se=2021-10-24T03:41:00Z&sv=2019-12-12&sr=c&sig=bSBP0oUHI6KzTwLwk195Jnrdnqh8GXEjqTAnAUmf4xA%3D' && azcopy copy --recursive doc 'https://mkplayer.blob.core.windows.net/$web?sp=racwdl&st=2020-10-23T03:41:09Z&se=2021-10-24T03:41:00Z&sv=2019-12-12&sr=c&sig=bSBP0oUHI6KzTwLwk195Jnrdnqh8GXEjqTAnAUmf4xA%3D' && azcopy copy index.html 'https://mkplayer.blob.core.windows.net/$web?sp=racwdl&st=2020-10-23T03:41:09Z&se=2021-10-24T03:41:00Z&sv=2019-12-12&sr=c&sig=bSBP0oUHI6KzTwLwk195Jnrdnqh8GXEjqTAnAUmf4xA%3D' && azcopy copy ../mkplayer-react/src/mkplayer-ui.min.css 'https://mkplayer.blob.core.windows.net/$web?sp=racwdl&st=2020-10-23T03:41:09Z&se=2021-10-24T03:41:00Z&sv=2019-12-12&sr=c&sig=bSBP0oUHI6KzTwLwk195Jnrdnqh8GXEjqTAnAUmf4xA%3D' && azcopy copy 'index.html' 'https://mkplayer.blob.core.windows.net/$web?sp=racwdl&st=2020-10-23T03:41:09Z&se=2021-10-24T03:41:00Z&sv=2019-12-12&sr=c&sig=bSBP0oUHI6KzTwLwk195Jnrdnqh8GXEjqTAnAUmf4xA%3D' && azcopy copy 'multi-camera.html' 'https://mkplayer.blob.core.windows.net/$web?sp=racwdl&st=2020-10-23T03:41:09Z&se=2021-10-24T03:41:00Z&sv=2019-12-12&sr=c&sig=bSBP0oUHI6KzTwLwk195Jnrdnqh8GXEjqTAnAUmf4xA%3D'"
|
|
27
27
|
},
|
|
28
28
|
"author": "MediaKind",
|
|
29
29
|
"license": "ISC",
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"bitmovin-player": "8.49.0",
|
|
32
|
-
"bitmovin-player-ui": "3.
|
|
32
|
+
"bitmovin-player-ui": "3.22.0",
|
|
33
33
|
"fast-safe-stringify": "^2.0.7"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
package/src/MKPlayer.ts
CHANGED
|
@@ -8,12 +8,16 @@ import { MKEvent } from './events/MKEvent';
|
|
|
8
8
|
import { BufferLevel } from './BufferLevel';
|
|
9
9
|
import { MKPlayerEventCallback } from './events/MKPlayerEventCallback';
|
|
10
10
|
import { Logger } from './Logger';
|
|
11
|
+
import { HttpRequest, HttpRequestType } from 'bitmovin-player/types/core/NetworkAPI';
|
|
12
|
+
import { RequestType } from './events/RequestType';
|
|
13
|
+
import { URLHelper } from './URLHelper';
|
|
11
14
|
|
|
12
15
|
/**
|
|
13
16
|
* MKPlayer is an HTML5 video player used for playback of HLS and DASH adaptive bitrate streams
|
|
14
17
|
*/
|
|
15
18
|
export class MKPlayer {
|
|
16
19
|
private player: PlayerAPI;
|
|
20
|
+
private stream: MKStream;
|
|
17
21
|
|
|
18
22
|
/**
|
|
19
23
|
* constructor used to create a new MKPlayer instance
|
|
@@ -31,20 +35,41 @@ export class MKPlayer {
|
|
|
31
35
|
analytics: {
|
|
32
36
|
key: '1c45ae9c-345e-4462-95e2-3e8faccd64f1',
|
|
33
37
|
},
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
ui_css: 'mkplayer-ui.min.css',
|
|
38
|
+
ui: {
|
|
39
|
+
disableAutoHideWhenHovered: true,
|
|
37
40
|
},
|
|
38
41
|
logs: {
|
|
39
42
|
level: LogLevel.OFF,
|
|
40
43
|
bitmovin: false,
|
|
41
44
|
},
|
|
45
|
+
network: {
|
|
46
|
+
preprocessHttpRequest: (type: HttpRequestType, request: HttpRequest) => {
|
|
47
|
+
if (type === 'manifest/hls/master') {
|
|
48
|
+
if (typeof mkPlayerConfiguration.refreshToken === 'function') {
|
|
49
|
+
let token = mkPlayerConfiguration.refreshToken(RequestType.Master);
|
|
50
|
+
console.log('[MKPlayer] Appending master token: ' + token);
|
|
51
|
+
request.url = this.appendToken(request.url, token);
|
|
52
|
+
}
|
|
53
|
+
} else if (type === 'manifest/hls/variant') {
|
|
54
|
+
if (typeof mkPlayerConfiguration.refreshToken === 'function') {
|
|
55
|
+
let token = mkPlayerConfiguration.refreshToken(RequestType.Variant);
|
|
56
|
+
console.log('[MKPlayer] Appending variant token: ' + token);
|
|
57
|
+
request.url = this.appendToken(request.url, token);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return Promise.resolve(request);
|
|
61
|
+
},
|
|
62
|
+
preprocessHttpResponse: (type, response) => {
|
|
63
|
+
if (type === 'manifest/hls/master') {
|
|
64
|
+
let body = this.manipulateMasterPlaylist((response.body as string));
|
|
65
|
+
// @ts-ignore
|
|
66
|
+
response.body = body;
|
|
67
|
+
}
|
|
68
|
+
return Promise.resolve(response);
|
|
69
|
+
},
|
|
70
|
+
},
|
|
42
71
|
};
|
|
43
72
|
|
|
44
|
-
if (mkPlayerConfiguration.ui === false) {
|
|
45
|
-
playerConfig.ui = false;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
73
|
if (mkPlayerConfiguration.targetLatency > 0) {
|
|
49
74
|
playerConfig.live = {
|
|
50
75
|
lowLatency: {
|
|
@@ -68,7 +93,7 @@ export class MKPlayer {
|
|
|
68
93
|
if (mkPlayerConfiguration.smallScreen) {
|
|
69
94
|
UIFactory.buildDefaultSmallScreenUI(player);
|
|
70
95
|
} else {
|
|
71
|
-
UIFactory.buildDefaultUI(player);
|
|
96
|
+
UIFactory.buildDefaultUI(player, playerConfig.ui);
|
|
72
97
|
}
|
|
73
98
|
}
|
|
74
99
|
|
|
@@ -76,9 +101,7 @@ export class MKPlayer {
|
|
|
76
101
|
Logger.enable();
|
|
77
102
|
}
|
|
78
103
|
|
|
79
|
-
|
|
80
104
|
this.player = player;
|
|
81
|
-
|
|
82
105
|
console.log('%c MKPlayer ' + this.version() + ' www.mediakind.com', 'color: blue');
|
|
83
106
|
}
|
|
84
107
|
|
|
@@ -110,6 +133,7 @@ export class MKPlayer {
|
|
|
110
133
|
*/
|
|
111
134
|
load(stream: MKStream): Promise<void> {
|
|
112
135
|
let playerSource: SourceConfig;
|
|
136
|
+
this.stream = stream;
|
|
113
137
|
let url: string = MKPlayer.selectUrl(stream);
|
|
114
138
|
|
|
115
139
|
if (url.includes('.m3u8')) {
|
|
@@ -133,10 +157,17 @@ export class MKPlayer {
|
|
|
133
157
|
if (stream.assetIdentifier) {
|
|
134
158
|
playerSource.analytics = {
|
|
135
159
|
videoId: stream.assetIdentifier,
|
|
160
|
+
userId: stream.userId,
|
|
161
|
+
customData1: stream.customData1,
|
|
162
|
+
customData2: stream.customData2,
|
|
163
|
+
customData3: stream.customData3,
|
|
164
|
+
customData4: stream.customData4,
|
|
165
|
+
customData5: stream.customData5,
|
|
166
|
+
customData6: this.version(),
|
|
136
167
|
};
|
|
137
168
|
}
|
|
138
169
|
|
|
139
|
-
if (stream.subtitleTracks) {
|
|
170
|
+
if (stream.subtitleTracks && !stream.subtitleTracks[0].url.includes('.m3u8')) {
|
|
140
171
|
playerSource.subtitleTracks = stream.subtitleTracks.map((track) => <SubtitleTrack>{
|
|
141
172
|
lang: track.language,
|
|
142
173
|
url: track.url,
|
|
@@ -169,7 +200,6 @@ export class MKPlayer {
|
|
|
169
200
|
*/
|
|
170
201
|
on(eventType: MKEvent, callback: MKPlayerEventCallback): void {
|
|
171
202
|
let playerEventType = MKPlayer.mapEvent(eventType);
|
|
172
|
-
|
|
173
203
|
return this.player.on(playerEventType, callback);
|
|
174
204
|
}
|
|
175
205
|
|
|
@@ -240,7 +270,6 @@ export class MKPlayer {
|
|
|
240
270
|
* sets the player's volume in the range of 0 (silent) to 100 (max volume)
|
|
241
271
|
*
|
|
242
272
|
* @param volume The volume to set between 0 and 100
|
|
243
|
-
|
|
244
273
|
*/
|
|
245
274
|
setVolume(volume: number): void {
|
|
246
275
|
this.player.setVolume(volume);
|
|
@@ -250,7 +279,7 @@ export class MKPlayer {
|
|
|
250
279
|
* returns the current player version
|
|
251
280
|
*/
|
|
252
281
|
version(): string {
|
|
253
|
-
return '1.0.
|
|
282
|
+
return '1.0.15';
|
|
254
283
|
}
|
|
255
284
|
|
|
256
285
|
private static selectUrl(source: MKStream): string {
|
|
@@ -324,7 +353,37 @@ export class MKPlayer {
|
|
|
324
353
|
playerEventType = PlayerEvent.MetadataParsed;
|
|
325
354
|
break;
|
|
326
355
|
}
|
|
327
|
-
|
|
328
356
|
return playerEventType;
|
|
329
357
|
}
|
|
358
|
+
|
|
359
|
+
private manipulateMasterPlaylist(response: string): string {
|
|
360
|
+
let body = (response as string);
|
|
361
|
+
if (this.stream.subtitleTracks && this.stream.subtitleTracks[0].url.includes('.m3u8')) {
|
|
362
|
+
this.stream.subtitleTracks.forEach((track) => {
|
|
363
|
+
body = body.concat('\n#EXT-X-MEDIA:TYPE=SUBTITLES,'
|
|
364
|
+
+ 'NAME="' + track.language + '",'
|
|
365
|
+
+ 'DEFAULT=YES,'
|
|
366
|
+
+ 'AUTOSELECT=YES,'
|
|
367
|
+
+ 'FORCED=NO,'
|
|
368
|
+
+ 'LANGUAGE="' + track.language + '",GROUP-ID="subs",'
|
|
369
|
+
+ 'URI="' + track.url + '"');
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
return body;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
private appendToken(url: string, token: string): string {
|
|
377
|
+
let splitted = token.split('=');
|
|
378
|
+
if (splitted && splitted.length >= 2) {
|
|
379
|
+
let key = splitted[0];
|
|
380
|
+
let value = splitted[1];
|
|
381
|
+
let params = new Map<string, string>();
|
|
382
|
+
params.set(key, value);
|
|
383
|
+
let updatedUrl = URLHelper.appendQueryParametersToUrl(url, params);
|
|
384
|
+
return updatedUrl;
|
|
385
|
+
} else {
|
|
386
|
+
return url;
|
|
387
|
+
}
|
|
388
|
+
}
|
|
330
389
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* MKPlayer's configuration interface
|
|
3
3
|
*/
|
|
4
|
+
import { RequestType } from './events/RequestType';
|
|
5
|
+
|
|
4
6
|
export interface MKPlayerConfiguration {
|
|
5
7
|
/**
|
|
6
8
|
* Toggles debug output logging
|
|
@@ -36,4 +38,9 @@ export interface MKPlayerConfiguration {
|
|
|
36
38
|
* license key for the video player
|
|
37
39
|
*/
|
|
38
40
|
key: string;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Refresh the CDN Token
|
|
44
|
+
*/
|
|
45
|
+
refreshToken?: (type: RequestType) => string;
|
|
39
46
|
}
|
package/src/MKStream.ts
CHANGED
|
@@ -10,6 +10,12 @@ export class MKStream {
|
|
|
10
10
|
private readonly _subtitleTracks: SubtitleTrack[];
|
|
11
11
|
private readonly _cdnFailoverPercent: number = 0;
|
|
12
12
|
private readonly _poster: string;
|
|
13
|
+
private readonly _userId: string;
|
|
14
|
+
private readonly _customData1: string;
|
|
15
|
+
private readonly _customData2: string;
|
|
16
|
+
private readonly _customData3: string;
|
|
17
|
+
private readonly _customData4: string;
|
|
18
|
+
private readonly _customData5: string;
|
|
13
19
|
|
|
14
20
|
/**
|
|
15
21
|
*
|
|
@@ -21,13 +27,19 @@ export class MKStream {
|
|
|
21
27
|
* the secondary url
|
|
22
28
|
* @param assetIdentifier - identifier for the current stream
|
|
23
29
|
*/
|
|
24
|
-
constructor(primaryUrl: string, assetIdentifier: string, subtitleTracks?: SubtitleTrack[], poster?: string, secondaryUrl?: string, cdnFailoverPercent?: number) {
|
|
30
|
+
constructor(primaryUrl: string, assetIdentifier: string, subtitleTracks?: SubtitleTrack[], poster?: string, secondaryUrl?: string, cdnFailoverPercent?: number, userId?: string, customData1?: string, customData2?: string, customData3?: string, customData4?: string, customData5?: string) {
|
|
25
31
|
this._cdnFailoverPercent = cdnFailoverPercent;
|
|
26
32
|
this._secondaryUrl = secondaryUrl;
|
|
27
33
|
this._primaryUrl = primaryUrl;
|
|
28
34
|
this._assetIdentifier = assetIdentifier;
|
|
29
35
|
this._subtitleTracks = subtitleTracks;
|
|
30
36
|
this._poster = poster;
|
|
37
|
+
this._userId = userId;
|
|
38
|
+
this._customData1 = customData1;
|
|
39
|
+
this._customData2 = customData2;
|
|
40
|
+
this._customData3 = customData3;
|
|
41
|
+
this._customData4 = customData4;
|
|
42
|
+
this._customData5 = customData5;
|
|
31
43
|
}
|
|
32
44
|
|
|
33
45
|
/**
|
|
@@ -71,4 +83,46 @@ export class MKStream {
|
|
|
71
83
|
public get poster(): string {
|
|
72
84
|
return this._poster;
|
|
73
85
|
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* customData1 field for the current stream
|
|
89
|
+
*/
|
|
90
|
+
public get customData1(): string {
|
|
91
|
+
return this._customData1;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* customData2 field for the current stream
|
|
96
|
+
*/
|
|
97
|
+
public get customData2(): string {
|
|
98
|
+
return this._customData2;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* customData3 field for the current stream
|
|
103
|
+
*/
|
|
104
|
+
public get customData3(): string {
|
|
105
|
+
return this._customData3;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* customData5 field for the current stream
|
|
110
|
+
*/
|
|
111
|
+
public get customData4(): string {
|
|
112
|
+
return this._customData4;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* customData5 field for the current stream
|
|
117
|
+
*/
|
|
118
|
+
public get customData5(): string {
|
|
119
|
+
return this._customData5;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* userId field for the current stream
|
|
124
|
+
*/
|
|
125
|
+
public get userId(): string {
|
|
126
|
+
return this._userId;
|
|
127
|
+
}
|
|
74
128
|
}
|
package/src/URLHelper.ts
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
export class URLHelper {
|
|
2
|
+
public static appendQueryParametersToUrl(url: string, parameters: Map<string, string>): string {
|
|
3
|
+
// See if our url still has a queryString
|
|
4
|
+
let queryString = '';
|
|
5
|
+
let queryStringHasStarted = url.indexOf('?') >= 0;
|
|
6
|
+
|
|
7
|
+
if (parameters) {
|
|
8
|
+
parameters.forEach((value, key) => {
|
|
9
|
+
// Add parameter separator
|
|
10
|
+
if (!queryStringHasStarted) {
|
|
11
|
+
// Query string is separated from URL with "?"
|
|
12
|
+
queryString += '?';
|
|
13
|
+
queryStringHasStarted = true;
|
|
14
|
+
} else {
|
|
15
|
+
// Parameters within the query string are concatenated by "&"
|
|
16
|
+
queryString += '&';
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// Add parameter name
|
|
20
|
+
queryString += key;
|
|
21
|
+
|
|
22
|
+
// Add optional parameter value
|
|
23
|
+
if (value != null) {
|
|
24
|
+
queryString += '=' + encodeURIComponent(value);
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
return url + queryString;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
public static removeUrlParameter(url: string, parameter: string) {
|
|
32
|
+
let urlParts: string[] = url.split('?');
|
|
33
|
+
|
|
34
|
+
if (urlParts.length >= 2) {
|
|
35
|
+
// Get first part, and remove from array
|
|
36
|
+
let urlBase: string = urlParts.shift();
|
|
37
|
+
|
|
38
|
+
// Join it back up
|
|
39
|
+
let queryString: string = urlParts.join('?');
|
|
40
|
+
|
|
41
|
+
let prefix: string = encodeURIComponent(parameter) + '=';
|
|
42
|
+
let parts: string[] = queryString.split(/[&;]/g);
|
|
43
|
+
|
|
44
|
+
// Reverse iteration as may be destructive
|
|
45
|
+
for (let i = parts.length; i-- > 0;) {
|
|
46
|
+
// Idiom for string.startsWith
|
|
47
|
+
if (parts[i].lastIndexOf(prefix, 0) !== -1) {
|
|
48
|
+
parts.splice(i, 1);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// Add back any url parameters that were not removed
|
|
53
|
+
if (parts.length > 0) {
|
|
54
|
+
url = urlBase + '?' + parts.join('&');
|
|
55
|
+
} else {
|
|
56
|
+
url = urlBase;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return url;
|
|
61
|
+
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -1,290 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html class="default no-js">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8">
|
|
5
|
-
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
6
|
-
<title>MKPlayerConfiguration | MKPlayer</title>
|
|
7
|
-
<meta name="description" content="Documentation for MKPlayer">
|
|
8
|
-
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
9
|
-
<link rel="stylesheet" href="../assets/css/main.css">
|
|
10
|
-
</head>
|
|
11
|
-
<body>
|
|
12
|
-
<header>
|
|
13
|
-
<div class="tsd-page-toolbar">
|
|
14
|
-
<div class="container">
|
|
15
|
-
<div class="table-wrap">
|
|
16
|
-
<div class="table-cell" id="tsd-search" data-index="../assets/js/search.json" data-base="..">
|
|
17
|
-
<div class="field">
|
|
18
|
-
<label for="tsd-search-field" class="tsd-widget search no-caption">Search</label>
|
|
19
|
-
<input id="tsd-search-field" type="text" />
|
|
20
|
-
</div>
|
|
21
|
-
<ul class="results">
|
|
22
|
-
<li class="state loading">Preparing search index...</li>
|
|
23
|
-
<li class="state failure">The search index is not available</li>
|
|
24
|
-
</ul>
|
|
25
|
-
<a href="../index.html" class="title">MKPlayer</a>
|
|
26
|
-
</div>
|
|
27
|
-
<div class="table-cell" id="tsd-widgets">
|
|
28
|
-
<div id="tsd-filter">
|
|
29
|
-
<a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a>
|
|
30
|
-
<div class="tsd-filter-group">
|
|
31
|
-
<div class="tsd-select" id="tsd-filter-visibility">
|
|
32
|
-
<span class="tsd-select-label">All</span>
|
|
33
|
-
<ul class="tsd-select-list">
|
|
34
|
-
<li data-value="public">Public</li>
|
|
35
|
-
<li data-value="protected">Public/Protected</li>
|
|
36
|
-
<li data-value="private" class="selected">All</li>
|
|
37
|
-
</ul>
|
|
38
|
-
</div>
|
|
39
|
-
<input type="checkbox" id="tsd-filter-inherited" checked />
|
|
40
|
-
<label class="tsd-widget" for="tsd-filter-inherited">Inherited</label>
|
|
41
|
-
<input type="checkbox" id="tsd-filter-externals" checked />
|
|
42
|
-
<label class="tsd-widget" for="tsd-filter-externals">Externals</label>
|
|
43
|
-
</div>
|
|
44
|
-
</div>
|
|
45
|
-
<a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a>
|
|
46
|
-
</div>
|
|
47
|
-
</div>
|
|
48
|
-
</div>
|
|
49
|
-
</div>
|
|
50
|
-
<div class="tsd-page-title">
|
|
51
|
-
<div class="container">
|
|
52
|
-
<ul class="tsd-breadcrumb">
|
|
53
|
-
<li>
|
|
54
|
-
<a href="../globals.html">Globals</a>
|
|
55
|
-
</li>
|
|
56
|
-
<li>
|
|
57
|
-
<a href="mkplayerconfiguration.html">MKPlayerConfiguration</a>
|
|
58
|
-
</li>
|
|
59
|
-
</ul>
|
|
60
|
-
<h1>Interface MKPlayerConfiguration</h1>
|
|
61
|
-
</div>
|
|
62
|
-
</div>
|
|
63
|
-
</header>
|
|
64
|
-
<div class="container container-main">
|
|
65
|
-
<div class="row">
|
|
66
|
-
<div class="col-8 col-content">
|
|
67
|
-
<section class="tsd-panel tsd-comment">
|
|
68
|
-
<div class="tsd-comment tsd-typography">
|
|
69
|
-
<div class="lead">
|
|
70
|
-
<p>MKPlayer's configuration interface</p>
|
|
71
|
-
</div>
|
|
72
|
-
</div>
|
|
73
|
-
</section>
|
|
74
|
-
<section class="tsd-panel tsd-hierarchy">
|
|
75
|
-
<h3>Hierarchy</h3>
|
|
76
|
-
<ul class="tsd-hierarchy">
|
|
77
|
-
<li>
|
|
78
|
-
<span class="target">MKPlayerConfiguration</span>
|
|
79
|
-
</li>
|
|
80
|
-
</ul>
|
|
81
|
-
</section>
|
|
82
|
-
<section class="tsd-panel-group tsd-index-group">
|
|
83
|
-
<h2>Index</h2>
|
|
84
|
-
<section class="tsd-panel tsd-index-panel">
|
|
85
|
-
<div class="tsd-index-content">
|
|
86
|
-
<section class="tsd-index-section ">
|
|
87
|
-
<h3>Properties</h3>
|
|
88
|
-
<ul class="tsd-index-list">
|
|
89
|
-
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="mkplayerconfiguration.html#autoplay" class="tsd-kind-icon">autoplay</a></li>
|
|
90
|
-
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="mkplayerconfiguration.html#debug" class="tsd-kind-icon">debug</a></li>
|
|
91
|
-
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="mkplayerconfiguration.html#key" class="tsd-kind-icon">key</a></li>
|
|
92
|
-
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="mkplayerconfiguration.html#muted" class="tsd-kind-icon">muted</a></li>
|
|
93
|
-
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="mkplayerconfiguration.html#smallscreen" class="tsd-kind-icon">small<wbr>Screen</a></li>
|
|
94
|
-
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="mkplayerconfiguration.html#targetlatency" class="tsd-kind-icon">target<wbr>Latency</a></li>
|
|
95
|
-
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="mkplayerconfiguration.html#ui" class="tsd-kind-icon">ui</a></li>
|
|
96
|
-
</ul>
|
|
97
|
-
</section>
|
|
98
|
-
</div>
|
|
99
|
-
</section>
|
|
100
|
-
</section>
|
|
101
|
-
<section class="tsd-panel-group tsd-member-group ">
|
|
102
|
-
<h2>Properties</h2>
|
|
103
|
-
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
|
|
104
|
-
<a name="autoplay" class="tsd-anchor"></a>
|
|
105
|
-
<h3>autoplay</h3>
|
|
106
|
-
<div class="tsd-signature tsd-kind-icon">autoplay<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div>
|
|
107
|
-
<aside class="tsd-sources">
|
|
108
|
-
<ul>
|
|
109
|
-
<li>Defined in MKPlayerConfiguration.ts:13</li>
|
|
110
|
-
</ul>
|
|
111
|
-
</aside>
|
|
112
|
-
<div class="tsd-comment tsd-typography">
|
|
113
|
-
<div class="lead">
|
|
114
|
-
<p>Option to enable the player to start playback after successfully loading a source</p>
|
|
115
|
-
</div>
|
|
116
|
-
</div>
|
|
117
|
-
</section>
|
|
118
|
-
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
|
|
119
|
-
<a name="debug" class="tsd-anchor"></a>
|
|
120
|
-
<h3>debug</h3>
|
|
121
|
-
<div class="tsd-signature tsd-kind-icon">debug<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div>
|
|
122
|
-
<aside class="tsd-sources">
|
|
123
|
-
<ul>
|
|
124
|
-
<li>Defined in MKPlayerConfiguration.ts:8</li>
|
|
125
|
-
</ul>
|
|
126
|
-
</aside>
|
|
127
|
-
<div class="tsd-comment tsd-typography">
|
|
128
|
-
<div class="lead">
|
|
129
|
-
<p>Toggles debug output logging</p>
|
|
130
|
-
</div>
|
|
131
|
-
</div>
|
|
132
|
-
</section>
|
|
133
|
-
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
|
|
134
|
-
<a name="key" class="tsd-anchor"></a>
|
|
135
|
-
<h3>key</h3>
|
|
136
|
-
<div class="tsd-signature tsd-kind-icon">key<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
|
|
137
|
-
<aside class="tsd-sources">
|
|
138
|
-
<ul>
|
|
139
|
-
<li>Defined in MKPlayerConfiguration.ts:38</li>
|
|
140
|
-
</ul>
|
|
141
|
-
</aside>
|
|
142
|
-
<div class="tsd-comment tsd-typography">
|
|
143
|
-
<div class="lead">
|
|
144
|
-
<p>license key for the video player</p>
|
|
145
|
-
</div>
|
|
146
|
-
</div>
|
|
147
|
-
</section>
|
|
148
|
-
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
|
|
149
|
-
<a name="muted" class="tsd-anchor"></a>
|
|
150
|
-
<h3>muted</h3>
|
|
151
|
-
<div class="tsd-signature tsd-kind-icon">muted<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div>
|
|
152
|
-
<aside class="tsd-sources">
|
|
153
|
-
<ul>
|
|
154
|
-
<li>Defined in MKPlayerConfiguration.ts:18</li>
|
|
155
|
-
</ul>
|
|
156
|
-
</aside>
|
|
157
|
-
<div class="tsd-comment tsd-typography">
|
|
158
|
-
<div class="lead">
|
|
159
|
-
<p>Option to enable the player to start in a muted state. The user is able to unmute via the UI or an API call through</p>
|
|
160
|
-
</div>
|
|
161
|
-
</div>
|
|
162
|
-
</section>
|
|
163
|
-
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
|
|
164
|
-
<a name="smallscreen" class="tsd-anchor"></a>
|
|
165
|
-
<h3>small<wbr>Screen</h3>
|
|
166
|
-
<div class="tsd-signature tsd-kind-icon">small<wbr>Screen<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div>
|
|
167
|
-
<aside class="tsd-sources">
|
|
168
|
-
<ul>
|
|
169
|
-
<li>Defined in MKPlayerConfiguration.ts:23</li>
|
|
170
|
-
</ul>
|
|
171
|
-
</aside>
|
|
172
|
-
<div class="tsd-comment tsd-typography">
|
|
173
|
-
<div class="lead">
|
|
174
|
-
<p>Boolean indicating if the player should load the small screen ui</p>
|
|
175
|
-
</div>
|
|
176
|
-
</div>
|
|
177
|
-
</section>
|
|
178
|
-
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
|
|
179
|
-
<a name="targetlatency" class="tsd-anchor"></a>
|
|
180
|
-
<h3>target<wbr>Latency</h3>
|
|
181
|
-
<div class="tsd-signature tsd-kind-icon">target<wbr>Latency<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
|
|
182
|
-
<aside class="tsd-sources">
|
|
183
|
-
<ul>
|
|
184
|
-
<li>Defined in MKPlayerConfiguration.ts:33</li>
|
|
185
|
-
</ul>
|
|
186
|
-
</aside>
|
|
187
|
-
<div class="tsd-comment tsd-typography">
|
|
188
|
-
<div class="lead">
|
|
189
|
-
<p>number of seconds the player attempts to stay behind the live point</p>
|
|
190
|
-
</div>
|
|
191
|
-
</div>
|
|
192
|
-
</section>
|
|
193
|
-
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
|
|
194
|
-
<a name="ui" class="tsd-anchor"></a>
|
|
195
|
-
<h3>ui</h3>
|
|
196
|
-
<div class="tsd-signature tsd-kind-icon">ui<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div>
|
|
197
|
-
<aside class="tsd-sources">
|
|
198
|
-
<ul>
|
|
199
|
-
<li>Defined in MKPlayerConfiguration.ts:28</li>
|
|
200
|
-
</ul>
|
|
201
|
-
</aside>
|
|
202
|
-
<div class="tsd-comment tsd-typography">
|
|
203
|
-
<div class="lead">
|
|
204
|
-
<p>Boolean to enable / disable ui</p>
|
|
205
|
-
</div>
|
|
206
|
-
</div>
|
|
207
|
-
</section>
|
|
208
|
-
</section>
|
|
209
|
-
</div>
|
|
210
|
-
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
|
|
211
|
-
<nav class="tsd-navigation primary">
|
|
212
|
-
<ul>
|
|
213
|
-
<li class="globals ">
|
|
214
|
-
<a href="../globals.html"><em>Globals</em></a>
|
|
215
|
-
</li>
|
|
216
|
-
</ul>
|
|
217
|
-
</nav>
|
|
218
|
-
<nav class="tsd-navigation secondary menu-sticky">
|
|
219
|
-
<ul class="before-current">
|
|
220
|
-
<li class=" tsd-kind-enum">
|
|
221
|
-
<a href="../enums/mkevent.html" class="tsd-kind-icon">MKEvent</a>
|
|
222
|
-
</li>
|
|
223
|
-
<li class=" tsd-kind-class">
|
|
224
|
-
<a href="../classes/mkplayer.html" class="tsd-kind-icon">MKPlayer</a>
|
|
225
|
-
</li>
|
|
226
|
-
<li class=" tsd-kind-interface">
|
|
227
|
-
<a href="bufferlevel.html" class="tsd-kind-icon">Buffer<wbr>Level</a>
|
|
228
|
-
</li>
|
|
229
|
-
</ul>
|
|
230
|
-
<ul class="current">
|
|
231
|
-
<li class="current tsd-kind-interface">
|
|
232
|
-
<a href="mkplayerconfiguration.html" class="tsd-kind-icon">MKPlayer<wbr>Configuration</a>
|
|
233
|
-
<ul>
|
|
234
|
-
<li class=" tsd-kind-property tsd-parent-kind-interface">
|
|
235
|
-
<a href="mkplayerconfiguration.html#autoplay" class="tsd-kind-icon">autoplay</a>
|
|
236
|
-
</li>
|
|
237
|
-
<li class=" tsd-kind-property tsd-parent-kind-interface">
|
|
238
|
-
<a href="mkplayerconfiguration.html#debug" class="tsd-kind-icon">debug</a>
|
|
239
|
-
</li>
|
|
240
|
-
<li class=" tsd-kind-property tsd-parent-kind-interface">
|
|
241
|
-
<a href="mkplayerconfiguration.html#key" class="tsd-kind-icon">key</a>
|
|
242
|
-
</li>
|
|
243
|
-
<li class=" tsd-kind-property tsd-parent-kind-interface">
|
|
244
|
-
<a href="mkplayerconfiguration.html#muted" class="tsd-kind-icon">muted</a>
|
|
245
|
-
</li>
|
|
246
|
-
<li class=" tsd-kind-property tsd-parent-kind-interface">
|
|
247
|
-
<a href="mkplayerconfiguration.html#smallscreen" class="tsd-kind-icon">small<wbr>Screen</a>
|
|
248
|
-
</li>
|
|
249
|
-
<li class=" tsd-kind-property tsd-parent-kind-interface">
|
|
250
|
-
<a href="mkplayerconfiguration.html#targetlatency" class="tsd-kind-icon">target<wbr>Latency</a>
|
|
251
|
-
</li>
|
|
252
|
-
<li class=" tsd-kind-property tsd-parent-kind-interface">
|
|
253
|
-
<a href="mkplayerconfiguration.html#ui" class="tsd-kind-icon">ui</a>
|
|
254
|
-
</li>
|
|
255
|
-
</ul>
|
|
256
|
-
</li>
|
|
257
|
-
</ul>
|
|
258
|
-
<ul class="after-current">
|
|
259
|
-
<li class=" tsd-kind-interface">
|
|
260
|
-
<a href="mkplayereventcallback.html" class="tsd-kind-icon">MKPlayer<wbr>Event<wbr>Callback</a>
|
|
261
|
-
</li>
|
|
262
|
-
<li class=" tsd-kind-interface">
|
|
263
|
-
<a href="subtitletrack.html" class="tsd-kind-icon">Subtitle<wbr>Track</a>
|
|
264
|
-
</li>
|
|
265
|
-
</ul>
|
|
266
|
-
</nav>
|
|
267
|
-
</div>
|
|
268
|
-
</div>
|
|
269
|
-
</div>
|
|
270
|
-
<footer class="with-border-bottom">
|
|
271
|
-
<div class="container">
|
|
272
|
-
<h2>Legend</h2>
|
|
273
|
-
<div class="tsd-legend-group">
|
|
274
|
-
<ul class="tsd-legend">
|
|
275
|
-
<li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li>
|
|
276
|
-
<li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li>
|
|
277
|
-
</ul>
|
|
278
|
-
<ul class="tsd-legend">
|
|
279
|
-
<li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li>
|
|
280
|
-
</ul>
|
|
281
|
-
</div>
|
|
282
|
-
</div>
|
|
283
|
-
</footer>
|
|
284
|
-
<div class="container tsd-generator">
|
|
285
|
-
<p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p>
|
|
286
|
-
</div>
|
|
287
|
-
<div class="overlay"></div>
|
|
288
|
-
<script src="../assets/js/main.js"></script>
|
|
289
|
-
</body>
|
|
290
|
-
</html>
|