@eluvio/elv-player-js 1.0.127 → 1.0.128

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eluvio/elv-player-js",
3
- "version": "1.0.127",
3
+ "version": "1.0.128",
4
4
  "description": "![Eluvio Logo](src/static/images/Logo.png \"Eluvio Logo\")",
5
5
  "main": "src/index.js",
6
6
  "license": "MIT",
@@ -918,7 +918,7 @@ class PlayerControls {
918
918
  submit.addEventListener("click", () => {
919
919
  try {
920
920
  SetPlayerProfile({
921
- profile: "custom",
921
+ profile: EluvioPlayerParameters.playerProfile.CUSTOM,
922
922
  customHLSOptions: JSON.parse(options)
923
923
  });
924
924
 
package/src/index.js CHANGED
@@ -21,7 +21,8 @@ export const EluvioPlayerParameters = {
21
21
  },
22
22
  playerProfile: {
23
23
  DEFAULT: "default",
24
- LOW_LATENCY: "low_latency"
24
+ LOW_LATENCY: "low_latency",
25
+ CUSTOM: "custom"
25
26
  },
26
27
  drms: {
27
28
  FAIRPLAY: "fairplay",
@@ -157,6 +158,18 @@ export class EluvioPlayer {
157
158
  this.warnings = false;
158
159
  this.reloads = [];
159
160
 
161
+ try {
162
+ if(
163
+ parameters.playerOptions.hlsjsOptions &&
164
+ Object.keys(parameters.playerOptions.hlsjsOptions).length > 0
165
+ ) {
166
+ this.customHLSOptions = parameters.playerOptions.hlsjsOptions;
167
+ parameters.playerOptions.playerProfile = EluvioPlayerParameters.playerProfile.CUSTOM;
168
+ }
169
+ } catch(error) {
170
+ this.Log(error, true);
171
+ }
172
+
160
173
  this.DetectRemoval = this.DetectRemoval.bind(this);
161
174
 
162
175
  this.Initialize(target, parameters);
@@ -802,12 +815,11 @@ export class EluvioPlayer {
802
815
  playoutUrl.searchParams.delete("authorization");
803
816
 
804
817
  const profileSettings = (PlayerProfiles[this.playerOptions.playerProfile] || {}).hlsSettings || {};
805
- const customProfileSettings = this.playerOptions.playerProfile === "custom" ? this.customHLSOptions : {};
818
+ const customProfileSettings = this.playerOptions.playerProfile === EluvioPlayerParameters.playerProfile.CUSTOM ? this.customHLSOptions : {};
806
819
 
807
820
  this.hlsOptions = {
808
821
  capLevelToPlayerSize: this.playerOptions.capLevelToPlayerSize,
809
822
  ...profileSettings,
810
- ...(this.playerOptions.hlsjsOptions || {}),
811
823
  ...customProfileSettings
812
824
  };
813
825
 
@@ -933,7 +945,7 @@ export class EluvioPlayer {
933
945
  }
934
946
  };
935
947
 
936
- if(key === "custom") {
948
+ if(key === EluvioPlayerParameters.playerProfile.CUSTOM) {
937
949
  this.controls.ShowHLSOptionsForm({
938
950
  hlsOptions: this.hlsOptions,
939
951
  SetPlayerProfile,