@mediakind/mkplayer 1.0.13 → 1.0.14

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.
@@ -191,7 +191,7 @@
191
191
  <li class="tsd-description">
192
192
  <aside class="tsd-sources">
193
193
  <ul>
194
- <li>Defined in MKPlayer.ts:195</li>
194
+ <li>Defined in MKPlayer.ts:202</li>
195
195
  </ul>
196
196
  </aside>
197
197
  <div class="tsd-comment tsd-typography">
@@ -213,7 +213,7 @@
213
213
  <li class="tsd-description">
214
214
  <aside class="tsd-sources">
215
215
  <ul>
216
- <li>Defined in MKPlayer.ts:186</li>
216
+ <li>Defined in MKPlayer.ts:193</li>
217
217
  </ul>
218
218
  </aside>
219
219
  <div class="tsd-comment tsd-typography">
@@ -235,7 +235,7 @@
235
235
  <li class="tsd-description">
236
236
  <aside class="tsd-sources">
237
237
  <ul>
238
- <li>Defined in MKPlayer.ts:214</li>
238
+ <li>Defined in MKPlayer.ts:221</li>
239
239
  </ul>
240
240
  </aside>
241
241
  <div class="tsd-comment tsd-typography">
@@ -288,7 +288,7 @@
288
288
  <li class="tsd-description">
289
289
  <aside class="tsd-sources">
290
290
  <ul>
291
- <li>Defined in MKPlayer.ts:221</li>
291
+ <li>Defined in MKPlayer.ts:228</li>
292
292
  </ul>
293
293
  </aside>
294
294
  <div class="tsd-comment tsd-typography">
@@ -310,7 +310,7 @@
310
310
  <li class="tsd-description">
311
311
  <aside class="tsd-sources">
312
312
  <ul>
313
- <li>Defined in MKPlayer.ts:158</li>
313
+ <li>Defined in MKPlayer.ts:165</li>
314
314
  </ul>
315
315
  </aside>
316
316
  <div class="tsd-comment tsd-typography">
@@ -343,7 +343,7 @@
343
343
  <li class="tsd-description">
344
344
  <aside class="tsd-sources">
345
345
  <ul>
346
- <li>Defined in MKPlayer.ts:170</li>
346
+ <li>Defined in MKPlayer.ts:177</li>
347
347
  </ul>
348
348
  </aside>
349
349
  <div class="tsd-comment tsd-typography">
@@ -420,7 +420,7 @@
420
420
  <li class="tsd-description">
421
421
  <aside class="tsd-sources">
422
422
  <ul>
423
- <li>Defined in MKPlayer.ts:228</li>
423
+ <li>Defined in MKPlayer.ts:235</li>
424
424
  </ul>
425
425
  </aside>
426
426
  <div class="tsd-comment tsd-typography">
@@ -442,7 +442,7 @@
442
442
  <li class="tsd-description">
443
443
  <aside class="tsd-sources">
444
444
  <ul>
445
- <li>Defined in MKPlayer.ts:206</li>
445
+ <li>Defined in MKPlayer.ts:213</li>
446
446
  </ul>
447
447
  </aside>
448
448
  <div class="tsd-comment tsd-typography">
@@ -472,7 +472,7 @@
472
472
  <li class="tsd-description">
473
473
  <aside class="tsd-sources">
474
474
  <ul>
475
- <li>Defined in MKPlayer.ts:245</li>
475
+ <li>Defined in MKPlayer.ts:252</li>
476
476
  </ul>
477
477
  </aside>
478
478
  <div class="tsd-comment tsd-typography">
@@ -503,7 +503,7 @@
503
503
  <li class="tsd-description">
504
504
  <aside class="tsd-sources">
505
505
  <ul>
506
- <li>Defined in MKPlayer.ts:179</li>
506
+ <li>Defined in MKPlayer.ts:186</li>
507
507
  </ul>
508
508
  </aside>
509
509
  <div class="tsd-comment tsd-typography">
@@ -525,7 +525,7 @@
525
525
  <li class="tsd-description">
526
526
  <aside class="tsd-sources">
527
527
  <ul>
528
- <li>Defined in MKPlayer.ts:235</li>
528
+ <li>Defined in MKPlayer.ts:242</li>
529
529
  </ul>
530
530
  </aside>
531
531
  <div class="tsd-comment tsd-typography">
@@ -547,7 +547,7 @@
547
547
  <li class="tsd-description">
548
548
  <aside class="tsd-sources">
549
549
  <ul>
550
- <li>Defined in MKPlayer.ts:252</li>
550
+ <li>Defined in MKPlayer.ts:259</li>
551
551
  </ul>
552
552
  </aside>
553
553
  <div class="tsd-comment tsd-typography">
package/doc/index.html CHANGED
@@ -92,6 +92,14 @@ mkPlayer = <span class="hljs-keyword">new</span> mkplayer.MKPlayer(playerContain
92
92
  <span class="hljs-attr">cdnFailoverPercent</span>: <span class="hljs-number">10</span>, <span class="hljs-comment">//10 percent of streams will start with the secondary url</span>
93
93
  <span class="hljs-attr">assetIdentifier</span>: <span class="hljs-string">&#x27;Your Asset Id&#x27;</span>,
94
94
  <span class="hljs-attr">poster</span>: <span class="hljs-string">&#x27;https://your-cdn.com/poster.png&#x27;</span>
95
+
96
+ <span class="hljs-comment">// optional analytics information</span>
97
+ <span class="hljs-attr">userId</span>: <span class="hljs-string">&#x27;badge2&#x27;</span>,
98
+ <span class="hljs-attr">customData1</span>: <span class="hljs-string">&#x27;customData1&#x27;</span>,
99
+ <span class="hljs-attr">customData2</span>: <span class="hljs-string">&#x27;customData2&#x27;</span>,
100
+ <span class="hljs-attr">customData3</span>: <span class="hljs-string">&#x27;customData3&#x27;</span>,
101
+ <span class="hljs-attr">customData4</span>: <span class="hljs-string">&#x27;customData4&#x27;</span>,
102
+ <span class="hljs-attr">customData5</span>: <span class="hljs-string">&#x27;customData5&#x27;</span>,
95
103
  }
96
104
 
97
105
  mkPlayer.load(mkStream).then(<span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params"></span>) </span>{
package/index.html CHANGED
@@ -1,7 +1,7 @@
1
1
  <!DOCTYPE html>
2
2
  <html lang='en'>
3
3
  <head>
4
- <title>MKPlayer 1.0.13</title>
4
+ <title>MKPlayer 1.0.14</title>
5
5
  <meta charset='UTF-8'/>
6
6
  <meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
7
7
  <meta name='viewport' content='width=device-width, initial-scale=1.0'>
@@ -306,14 +306,14 @@
306
306
  });
307
307
 
308
308
  let liveSource = {
309
- primaryUrl: "https://cdn-0573.aas.mediakind.com/cmaf/CES-Hero/index.m3u8",
309
+ primaryUrl: "http://52.232.209.101/cmaf/LiveCloudVideoTestChannel/index.m3u8",
310
310
  cdnFailoverPercent: 10,
311
311
  assetIdentifier: 'DASH Live',
312
- subtitleTracks: [{
313
- url: "https://cestestssl.akamaized.net/hls/live/2023638/cestest6/master_captionENG.m3u8",
314
- language: '123',
315
- type: 'm3u8'
316
- }]
312
+ // subtitleTracks: [{
313
+ // url: "https://cestestssl.akamaized.net/hls/live/2023638/cestest6/master_captionENG.m3u8",
314
+ // language: '123',
315
+ // type: 'm3u8'
316
+ // }]
317
317
  };
318
318
 
319
319
  let liveId3Source = {
@@ -336,6 +336,7 @@
336
336
  }],
337
337
  assetIdentifier: 'DASH Subtitle',
338
338
  poster: 'https://bitmovin-a.akamaihd.net/content/sintel/poster.png',
339
+ userId: 'badge1'
339
340
  };
340
341
 
341
342
  let dashVodSource = {
@@ -346,12 +347,19 @@
346
347
  url: 'https://bitdash-a.akamaihd.net/content/sintel/subtitles/subtitles_en.vtt',
347
348
  language: 'ms',
348
349
  }],
350
+ userId: 'badge2',
351
+ customData1: 'customData1',
352
+ customData2: 'customData2',
353
+ customData3: 'customData3',
354
+ customData4: 'customData4',
355
+ customData5: 'customData5',
349
356
  }
350
357
 
351
358
  let hlsSubtitleSource = {
352
359
  primaryUrl: 'https://mk-orionsedge.azureedge.net/test/hls/tos/index.m3u8',
353
360
  cdnFailoverPercent: 0,
354
361
  assetIdentifier: 'HLS Subtitle',
362
+ userId: 'badge3'
355
363
  }
356
364
 
357
365
  var vodSource = {
@@ -479,7 +487,7 @@
479
487
  console.info('[MKPlayer] metadata parsed' + JSON.stringify(event));
480
488
  });
481
489
 
482
- load(liveId3Source)
490
+ load(liveSource)
483
491
 
484
492
  </script>
485
493
  </body>
package/multi-camera.html CHANGED
@@ -1,7 +1,7 @@
1
1
  <!DOCTYPE html>
2
2
  <html lang='en'>
3
3
  <head>
4
- <title>MKPlayer 1.0.13</title>
4
+ <title>MKPlayer 1.0.14</title>
5
5
  <meta charset='UTF-8'/>
6
6
  <meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
7
7
  <meta name='viewport' content='width=device-width, initial-scale=1.0'>
@@ -116,10 +116,10 @@
116
116
  <input type='radio' name='options' id='option-latency3' autocomplete='off'>3 sec
117
117
  </label>
118
118
  <label class='btn btn-outline-secondary'>
119
- <input type='radio' name='options' id='option-latency6' autocomplete='off'>6 sec
119
+ <input type='radio' name='options' id='option-latency6' autocomplete='off'>4 sec
120
120
  </label>
121
121
  <label class='btn btn-outline-secondary'>
122
- <input type='radio' name='options' id='option-latency8' autocomplete='off'>8 sec
122
+ <input type='radio' name='options' id='option-latency8' autocomplete='off'>6 sec
123
123
  </label>
124
124
  </div>
125
125
  </div>
@@ -129,10 +129,10 @@
129
129
  <input type='radio' name='options' id='option-latency3-2' autocomplete='off'>3 sec
130
130
  </label>
131
131
  <label class='btn btn-outline-secondary'>
132
- <input type='radio' name='options' id='option-latency6-2' autocomplete='off'>6 sec
132
+ <input type='radio' name='options' id='option-latency6-2' autocomplete='off'>4 sec
133
133
  </label>
134
134
  <label class='btn btn-outline-secondary'>
135
- <input type='radio' name='options' id='option-latency8-2' autocomplete='off'>8 sec
135
+ <input type='radio' name='options' id='option-latency8-2' autocomplete='off'>6 sec
136
136
  </label>
137
137
  </div>
138
138
  </div>
@@ -142,10 +142,10 @@
142
142
  <input type='radio' name='options' id='option-latency3-3' autocomplete='off'>3 sec
143
143
  </label>
144
144
  <label class='btn btn-outline-secondary'>
145
- <input type='radio' name='options' id='option-latency6-3' autocomplete='off'>6 sec
145
+ <input type='radio' name='options' id='option-latency6-3' autocomplete='off'>4 sec
146
146
  </label>
147
147
  <label class='btn btn-outline-secondary'>
148
- <input type='radio' name='options' id='option-latency8-3' autocomplete='off'>8 sec
148
+ <input type='radio' name='options' id='option-latency8-3' autocomplete='off'>6 sec
149
149
  </label>
150
150
  </div>
151
151
  </div>
@@ -229,13 +229,13 @@
229
229
  });
230
230
 
231
231
  latency8Button.on('click', function() {
232
- console.log('Setting Latency to 8')
233
- mkPlayer1.setTargetLatency(8)
232
+ console.log('Setting Latency to 6')
233
+ mkPlayer1.setTargetLatency(6)
234
234
  });
235
235
 
236
236
  latency6Button.on('click', function() {
237
- console.log('Setting Latency to 6')
238
- mkPlayer1.setTargetLatency(6)
237
+ console.log('Setting Latency to 4')
238
+ mkPlayer1.setTargetLatency(4)
239
239
  });
240
240
 
241
241
  latency3Button2.on('click', function() {
@@ -244,13 +244,13 @@
244
244
  });
245
245
 
246
246
  latency8Button2.on('click', function() {
247
- console.log('Setting Latency to 8')
248
- mkPlayer2.setTargetLatency(8)
247
+ console.log('Setting Latency to 6')
248
+ mkPlayer2.setTargetLatency(6)
249
249
  });
250
250
 
251
251
  latency6Button2.on('click', function() {
252
- console.log('Setting Latency to 6')
253
- mkPlayer2.setTargetLatency(6)
252
+ console.log('Setting Latency to 4')
253
+ mkPlayer2.setTargetLatency(4)
254
254
  });
255
255
 
256
256
  latency3Button3.on('click', function() {
@@ -259,13 +259,13 @@
259
259
  });
260
260
 
261
261
  latency8Button3.on('click', function() {
262
- console.log('Setting Latency to 8')
263
- mkPlayer3.setTargetLatency(8)
262
+ console.log('Setting Latency to 6')
263
+ mkPlayer3.setTargetLatency(6)
264
264
  });
265
265
 
266
266
  latency6Button3.on('click', function() {
267
- console.log('Setting Latency to 6')
268
- mkPlayer3.setTargetLatency(6)
267
+ console.log('Setting Latency to 4')
268
+ mkPlayer3.setTargetLatency(4)
269
269
  });
270
270
 
271
271
  mkPlayer1.on('latencymodechanged', (event) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mediakind/mkplayer",
3
- "version": "1.0.13",
3
+ "version": "1.0.14",
4
4
  "description": "MediaKind Web Player",
5
5
  "repository": {
6
6
  "type": "git",
package/src/MKPlayer.ts CHANGED
@@ -133,6 +133,13 @@ export class MKPlayer {
133
133
  if (stream.assetIdentifier) {
134
134
  playerSource.analytics = {
135
135
  videoId: stream.assetIdentifier,
136
+ userId: stream.userId,
137
+ customData1: stream.customData1,
138
+ customData2: stream.customData2,
139
+ customData3: stream.customData3,
140
+ customData4: stream.customData4,
141
+ customData5: stream.customData5,
142
+ customData6: this.version(),
136
143
  };
137
144
  }
138
145
 
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
  }