@eluvio/elv-player-js 2.0.7 → 2.0.8

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.
@@ -463,14 +463,14 @@ export class EluvioPlayer {
463
463
  }
464
464
  }
465
465
 
466
- async __InitializeHLS({playoutUrl, authorizationToken, drm, multiviewOptions}) {
466
+ async __InitializeHLS({playoutUrl, authorizationToken, drm, drms, multiviewOptions}) {
467
467
  this.HLS = (await import("hls.js")).default;
468
468
 
469
- if(["fairplay", "sample-aes"].includes(drm) || !this.HLS.isSupported()) {
469
+ if([EluvioPlayerParameters.drms.FAIRPLAY, EluvioPlayerParameters.drms.SAMPLE_AES].includes(drm) || !this.HLS.isSupported()) {
470
470
  // HLS JS NOT SUPPORTED - Handle native player
471
471
  this.nativeHLS = true;
472
472
 
473
- if(drm === "fairplay") {
473
+ if(drm === EluvioPlayerParameters.drms.FAIRPLAY) {
474
474
  InitializeFairPlayStream({playoutOptions: this.sourceOptions.playoutOptions, video: this.video});
475
475
  } else {
476
476
  this.video.src = playoutUrl.toString();
@@ -494,27 +494,40 @@ export class EluvioPlayer {
494
494
  // HLS JS
495
495
  playoutUrl.searchParams.delete("authorization");
496
496
 
497
+ let drmSettings = {};
498
+ if (drm === EluvioPlayerParameters.drms.PLAYREADY) {
499
+ drmSettings = {
500
+ drmSystems: {
501
+ "com.microsoft.playready": {
502
+ licenseUrl: drms[drm].licenseServers[0]
503
+ },
504
+ },
505
+ emeEnabled: true,
506
+ licenseXhrSetup: (xhr, url) => {
507
+ xhr.open("POST", url, true);
508
+ xhr.setRequestHeader("Authorization", `Bearer ${authorizationToken}`);
509
+ }
510
+ };
511
+ }
512
+
497
513
  const profileSettings = (PlayerProfiles[this.playerOptions.playerProfile] || {}).hlsSettings || {};
498
514
  const customProfileSettings = this.playerOptions.playerProfile === EluvioPlayerParameters.playerProfile.CUSTOM ? this.customHLSOptions : {};
499
515
 
500
516
  this.hlsOptions = {
501
517
  capLevelToPlayerSize: this.playerOptions.capLevelToPlayerSize,
502
- ...profileSettings,
503
- ...customProfileSettings
504
- };
505
-
506
- const hlsPlayer = new this.HLS({
507
518
  xhrSetup: xhr => {
508
519
  xhr.setRequestHeader("Authorization", `Bearer ${authorizationToken}`);
509
-
510
520
  if((this.playerOptions.hlsjsOptions || {}).xhrSetup) {
511
521
  this.playerOptions.hlsjsOptions.xhrSetup(xhr);
512
522
  }
513
-
514
523
  return xhr;
515
524
  },
516
- ...this.hlsOptions
517
- });
525
+ ...drmSettings,
526
+ ...profileSettings,
527
+ ...customProfileSettings
528
+ };
529
+
530
+ const hlsPlayer = new this.HLS(this.hlsOptions);
518
531
 
519
532
  // Limit playback to maximum bitrate, if specified
520
533
  if(this.playerOptions.maxBitrate) {
@@ -6,6 +6,7 @@ export const PlayerParameters = {
6
6
  networks: {
7
7
  MAIN: "https://main.net955305.contentfabric.io/config",
8
8
  DEMO: "https://demov3.net955210.contentfabric.io/config",
9
+ DEMO_LOCAL: "http://localhost:8008/config?qspace=demov3&self",
9
10
  TEST: "https://test.net955203.contentfabric.io/config",
10
11
  TESTV4: "https://test.net955205.contentfabric.io/config"
11
12
  },
@@ -20,7 +21,8 @@ export const PlayerParameters = {
20
21
  SAMPLE_AES: "sample-aes",
21
22
  AES128: "aes-128",
22
23
  WIDEVINE: "widevine",
23
- CLEAR: "clear"
24
+ CLEAR: "clear",
25
+ PLAYREADY: "playready"
24
26
  },
25
27
  protocols: {
26
28
  HLS: "hls",
@@ -108,7 +110,8 @@ export const DefaultParameters = {
108
110
  PlayerParameters.drms.SAMPLE_AES,
109
111
  PlayerParameters.drms.AES128,
110
112
  PlayerParameters.drms.WIDEVINE,
111
- PlayerParameters.drms.CLEAR
113
+ PlayerParameters.drms.CLEAR,
114
+ PlayerParameters.drms.PLAYREADY
112
115
  ],
113
116
  contentInfo: {
114
117
  title: undefined,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eluvio/elv-player-js",
3
- "version": "2.0.7",
3
+ "version": "2.0.8",
4
4
  "description": "![Eluvio Logo](lib/static/images/Logo.png \"Eluvio Logo\")",
5
5
  "main": "lib/index.js",
6
6
  "license": "MIT",
@@ -36,10 +36,10 @@
36
36
  "package-lock.json"
37
37
  ],
38
38
  "dependencies": {
39
- "@eluvio/elv-client-js": "^4.0.88",
39
+ "@eluvio/elv-client-js": "^4.0.89",
40
40
  "dashjs": "~4.7.0",
41
41
  "focus-visible": "^5.2.0",
42
- "hls.js": "~1.4.12",
42
+ "hls.js": "~1.5.12",
43
43
  "mux-embed": "^4.30.0",
44
44
  "react": "^18.2.0",
45
45
  "react-dom": "^18.2.0",
@@ -56,6 +56,7 @@
56
56
  "eslint-plugin-react-hooks": "^4.6.0",
57
57
  "eslint-plugin-react-refresh": "^0.4.5",
58
58
  "jsdoc": "^4.0.0",
59
+ "sass": "^1.77.6",
59
60
  "stylelint": "^16.2.0",
60
61
  "stylelint-config-standard": "^36.0.0",
61
62
  "stylelint-order": "^6.0.4",