senza-sdk 4.4.1-4ca75a1.0 → 4.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -181,209 +181,3 @@ export const TargetPlayingState = Object.freeze({
181
181
  PLAYING_UI: "playingUi",
182
182
  PLAYING_ABR: "playingAbr"
183
183
  });
184
-
185
- export const iso6393to1 = {
186
- "aar": "aa",
187
- "abk": "ab",
188
- "afr": "af",
189
- "aka": "ak",
190
- "alb": "sq",
191
- "amh": "am",
192
- "ara": "ar",
193
- "arg": "an",
194
- "arm": "hy",
195
- "asm": "as",
196
- "ava": "av",
197
- "ave": "ae",
198
- "aym": "ay",
199
- "aze": "az",
200
- "bak": "ba",
201
- "bam": "bm",
202
- "baq": "eu",
203
- "bel": "be",
204
- "ben": "bn",
205
- "bih": "bh",
206
- "bis": "bi",
207
- "bod": "bo",
208
- "bos": "bs",
209
- "bre": "br",
210
- "bul": "bg",
211
- "bur": "my",
212
- "cat": "ca",
213
- "ces": "cs",
214
- "cha": "ch",
215
- "che": "ce",
216
- "chi": "zh",
217
- "chu": "cu",
218
- "chv": "cv",
219
- "cor": "kw",
220
- "cos": "co",
221
- "cre": "cr",
222
- "cym": "cy",
223
- "dan": "da",
224
- "deu": "de",
225
- "div": "dv",
226
- "dut": "nl",
227
- "dzo": "dz",
228
- "ell": "el",
229
- "eng": "en",
230
- "epo": "eo",
231
- "est": "et",
232
- "eus": "eu",
233
- "ewe": "ee",
234
- "fao": "fo",
235
- "fas": "fa",
236
- "fij": "fj",
237
- "fin": "fi",
238
- "fra": "fr",
239
- "fre": "fr",
240
- "fry": "fy",
241
- "ful": "ff",
242
- "geo": "ka",
243
- "ger": "de",
244
- "gla": "gd",
245
- "gle": "ga",
246
- "glg": "gl",
247
- "glv": "gv",
248
- "gre": "el",
249
- "grn": "gn",
250
- "guj": "gu",
251
- "hat": "ht",
252
- "hau": "ha",
253
- "heb": "he",
254
- "her": "hz",
255
- "hin": "hi",
256
- "hmo": "ho",
257
- "hrv": "hr",
258
- "hun": "hu",
259
- "hye": "hy",
260
- "ibo": "ig",
261
- "ice": "is",
262
- "ido": "io",
263
- "iii": "ii",
264
- "iku": "iu",
265
- "ile": "ie",
266
- "ina": "ia",
267
- "ind": "id",
268
- "ipk": "ik",
269
- "isl": "is",
270
- "ita": "it",
271
- "jav": "jv",
272
- "jpn": "ja",
273
- "kal": "kl",
274
- "kan": "kn",
275
- "kas": "ks",
276
- "kat": "ka",
277
- "kau": "kr",
278
- "kaz": "kk",
279
- "khm": "km",
280
- "kik": "ki",
281
- "kin": "rw",
282
- "kir": "ky",
283
- "kom": "kv",
284
- "kon": "kg",
285
- "kor": "ko",
286
- "kua": "kj",
287
- "kur": "ku",
288
- "lao": "lo",
289
- "lat": "la",
290
- "lav": "lv",
291
- "lim": "li",
292
- "lin": "ln",
293
- "lit": "lt",
294
- "ltz": "lb",
295
- "lub": "lu",
296
- "lug": "lg",
297
- "mac": "mk",
298
- "mah": "mh",
299
- "mal": "ml",
300
- "mao": "mi",
301
- "mar": "mr",
302
- "may": "ms",
303
- "mkd": "mk",
304
- "mlg": "mg",
305
- "mlt": "mt",
306
- "mon": "mn",
307
- "mri": "mi",
308
- "msa": "ms",
309
- "mya": "my",
310
- "nau": "na",
311
- "nav": "nv",
312
- "nbl": "nr",
313
- "nde": "nd",
314
- "ndo": "ng",
315
- "nep": "ne",
316
- "nld": "nl",
317
- "nno": "nn",
318
- "nob": "nb",
319
- "nor": "no",
320
- "nya": "ny",
321
- "oci": "oc",
322
- "oji": "oj",
323
- "ori": "or",
324
- "orm": "om",
325
- "oss": "os",
326
- "pan": "pa",
327
- "per": "fa",
328
- "pli": "pi",
329
- "pol": "pl",
330
- "por": "pt",
331
- "pus": "ps",
332
- "que": "qu",
333
- "roh": "rm",
334
- "ron": "ro",
335
- "rum": "ro",
336
- "run": "rn",
337
- "rus": "ru",
338
- "sag": "sg",
339
- "san": "sa",
340
- "sin": "si",
341
- "slk": "sk",
342
- "slo": "sk",
343
- "slv": "sl",
344
- "sme": "se",
345
- "smo": "sm",
346
- "sna": "sn",
347
- "snd": "sd",
348
- "som": "so",
349
- "sot": "st",
350
- "spa": "es",
351
- "sqi": "sq",
352
- "srd": "sc",
353
- "srp": "sr",
354
- "ssw": "ss",
355
- "sun": "su",
356
- "swa": "sw",
357
- "swe": "sv",
358
- "tah": "ty",
359
- "tam": "ta",
360
- "tat": "tt",
361
- "tel": "te",
362
- "tgk": "tg",
363
- "tgl": "tl",
364
- "tha": "th",
365
- "tib": "bo",
366
- "tir": "ti",
367
- "ton": "to",
368
- "tsn": "tn",
369
- "tso": "ts",
370
- "tuk": "tk",
371
- "tur": "tr",
372
- "twi": "tw",
373
- "uig": "ug",
374
- "ukr": "uk",
375
- "urd": "ur",
376
- "uzb": "uz",
377
- "ven": "ve",
378
- "vie": "vi",
379
- "vol": "vo",
380
- "wel": "cy",
381
- "wln": "wa",
382
- "wol": "wo",
383
- "xho": "xh",
384
- "yid": "yi",
385
- "yor": "yo",
386
- "zha": "za",
387
- "zho": "zh",
388
- "zul": "zu"
389
- };
@@ -217,6 +217,21 @@ class RemotePlayer extends EventTarget {
217
217
  UNLOADING: "unloading"
218
218
  });
219
219
 
220
+
221
+ /**
222
+ * @typedef {Object} AccessibilityPurposeCode
223
+ * @property {string} NONE
224
+ * @property {string} VISUALLY_IMPAIRED
225
+ * @property {string} HARD_OF_HEARING
226
+ * @property {string} SPOKEN_SUBTITLES
227
+ */
228
+ AccessibilityPurposeCode = {
229
+ NONE: "",
230
+ VISUALLY_IMPAIRED: "1",
231
+ HARD_OF_HEARING: "2",
232
+ SPOKEN_SUBTITLES: "9"
233
+ };
234
+
220
235
  /** get the player configuration.
221
236
  * @returns {Config}
222
237
  * */
@@ -328,10 +343,13 @@ class RemotePlayer extends EventTarget {
328
343
  return this.LoadMode.NOT_LOADED;
329
344
  }
330
345
 
346
+
331
347
  /**
332
348
  * @typedef {Object} TextTrack
333
349
  * @property {string} id - A unique ID for the track
334
350
  * @property {string} lang - The track's language
351
+ * @property {string[]} roles - The track's roles
352
+ * @property {string=} accessibilityPurpose - The track's accessibilityPurpose code
335
353
  * @property {boolean} selected - Whether the track is selected
336
354
  * @property {boolean} autoTranslate - (Optional) Whether the track is an auto-translated language
337
355
  */
@@ -353,6 +371,8 @@ class RemotePlayer extends EventTarget {
353
371
  * @typedef {Object} AudioTrack
354
372
  * @property {string} id - A unique ID for the track
355
373
  * @property {string} lang - The track's language
374
+ * @property {string[]} roles - The track's roles
375
+ * @property {string=} accessibilityPurpose - The track's accessibilityPurpose code
356
376
  * @property {boolean} selected - Whether the track is selected
357
377
  */
358
378
  /** Get all the audio tracks.
@@ -377,10 +397,22 @@ class RemotePlayer extends EventTarget {
377
397
  return noop("RemotePlayer.selectAudioTrack", audioTrackId);
378
398
  }
379
399
 
380
- /** Select a specific text (subtitle) track.
400
+ /** Selects an audio track based on given language, role and accessibility.
401
+ * Tf exact track match - Best track will be selected by the internal system
402
+ * @private
403
+ * @param {string} language - The language of the track to select.
404
+ * @param {string=} role - The role of the track to select.
405
+ * @param {AccessibilityPurposeCode=} accessibilityPurposeCode - The accessibilityPurposeCode of the track to select. Based on DASH manifest role "urn:tva:metadata:cs:AudioPurposeCS:2007"
406
+ * @returns {Promise<void>} A Promise that resolves once the selection process is complete.
407
+ **/
408
+ async selectAudioLanguage(language, role="", accessibilityPurposeCode=this.AccessibilityPurposeCode.NONE) {
409
+ return noop("RemotePlayer.selectAudioLanguage", language, role, accessibilityPurposeCode);
410
+ }
411
+
412
+ /** Select a text track based on given language, role and accessibility.
381
413
  * Track id should come from a call to getTextTracks.
382
414
  * If no tracks exist - this is a no-op.
383
- * If the id does not match the id of any of the existing tracks - this is a no-op.
415
+ * Tf no tracks exist - fallback ID will be used by internal system to select best matching track.
384
416
  * @param {string} textTrackId - The ID of the text track to select.
385
417
  * @returns {Promise<void>} A Promise that resolves once the selection process is complete.
386
418
  * @throws {RemotePlayerError} If the player is not initialized or not loaded.
@@ -389,6 +421,17 @@ class RemotePlayer extends EventTarget {
389
421
  return noop("RemotePlayer.selectTextTrack", textTrackId);
390
422
  }
391
423
 
424
+ /** Selects a text track based on given language, role and accessibility.
425
+ * Tf exact track match - Best track will be selected by the internal system
426
+ * @private
427
+ * @param {string} language - The language of the track to select.
428
+ * @param {string=} role - The role of the track to select.
429
+ * @param {AccessibilityPurposeCode=} accessibilityPurposeCode - The accessibilityPurposeCode of the track to select. Based on DASH manifest role "urn:tva:metadata:cs:AudioPurposeCS:2007"
430
+ * @returns {Promise<void>} A Promise that resolves once the selection process is complete.
431
+ **/
432
+ async selectTextLanguage(language, role="", accessibilityPurposeCode=this.AccessibilityPurposeCode.NONE) {
433
+ return noop("RemotePlayer.selectTextLanguage", language, role, accessibilityPurposeCode);
434
+ }
392
435
  /**
393
436
  * Enable or disable the subtitles.
394
437
  * If the player is in an unloaded state, the request will be applied next time content is played.
@@ -1,5 +1,4 @@
1
1
  import * as shaka from "shaka-player";
2
- import shakaUI from "shaka-player/dist/shaka-player.ui.js";
3
2
 
4
3
  // Define custom error category
5
4
  shaka.util.Error.Category.SENZA_PLAYER_ERROR = 50;
@@ -7,7 +6,7 @@ shaka.util.Error.Code.SENZA_PLAYER_ERROR = 10500;
7
6
 
8
7
  // Copy the shaka module and replace the Player class with SenzaShakaPlayer
9
8
  // if we don't Copy the shaka module, the Player class will be replaced for all the other modules that import shaka
10
- const senzaShaka = { ...shaka, ui: shakaUI.ui };
9
+ const senzaShaka = { ...shaka };
11
10
 
12
11
 
13
12
  /**
@@ -1 +1 @@
1
- export const version = "4.4.1-4ca75a1.0";
1
+ export const version = "4.4.1";