@eluvio/elv-player-js 1.0.126 → 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.126",
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",
@@ -63,8 +63,11 @@ export const CreateElement = ({parent, type="div", label, options={}, classes=[]
63
63
  return element;
64
64
  };
65
65
 
66
- const CreateImageButton = ({parent, svg, label, options={}, classes=[], prepend=false}) => {
67
- classes.unshift("eluvio-player__controls__button");
66
+ const CreateImageButton = ({parent, svg, label, options={}, classes=[], noDefaultClass, prepend=false}) => {
67
+ if(!noDefaultClass) {
68
+ classes.unshift("eluvio-player__controls__button");
69
+ }
70
+
68
71
  const button = CreateElement({parent, type: "button", label, options, classes, prepend});
69
72
  button.innerHTML = svg;
70
73
 
@@ -915,7 +918,7 @@ class PlayerControls {
915
918
  submit.addEventListener("click", () => {
916
919
  try {
917
920
  SetPlayerProfile({
918
- profile: "custom",
921
+ profile: EluvioPlayerParameters.playerProfile.CUSTOM,
919
922
  customHLSOptions: JSON.parse(options)
920
923
  });
921
924
 
@@ -938,7 +941,8 @@ class PlayerControls {
938
941
  parent: this.settingsMenu,
939
942
  svg: CloseIcon,
940
943
  type: "button",
941
- classes: ["eluvio-player__controls__settings-menu__close"]
944
+ classes: ["eluvio-player__controls__settings-menu__close"],
945
+ noDefaultClass: true
942
946
  });
943
947
 
944
948
  closeButton.addEventListener("click", () => this.HideSettingsMenu());
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,
@@ -448,10 +448,14 @@ $button-height: 35px;
448
448
  }
449
449
 
450
450
  &__close {
451
+ align-items: center;
451
452
  display: none;
453
+ height: 20px;
454
+ justify-content: center;
452
455
  position: absolute;
453
456
  right: 20px;
454
457
  top: 20px;
458
+ width: 20px;
455
459
 
456
460
  * {
457
461
  color: $button-color;
@@ -889,13 +893,12 @@ $button-height: 35px;
889
893
  text-align: center;
890
894
 
891
895
  &-back {
892
- font-size: 24px;
893
896
  margin-bottom: 20px;
894
897
  }
895
898
  }
896
899
 
897
900
  &__close {
898
- display: unset;
901
+ display: flex;
899
902
  z-index: 100;
900
903
  }
901
904
  }
@@ -911,17 +914,35 @@ $button-height: 35px;
911
914
  text-align: center;
912
915
 
913
916
  &-back {
914
- font-size: 24px;
915
917
  margin-bottom: 20px;
916
918
  }
917
919
  }
918
920
 
919
921
  &__close {
920
- display: unset;
922
+ display: flex;
921
923
  }
922
924
  }
923
925
  }
924
926
 
927
+ .eluvio-player__hls-options-form {
928
+ padding: 10px;
929
+
930
+ &__title {
931
+ font-size: 12px;
932
+ margin-bottom: 5px;
933
+ }
934
+
935
+ &__input {
936
+ font-size: 12px;
937
+ }
938
+
939
+ &__action {
940
+ font-size: 12px;
941
+ height: 20px;
942
+ width: 60px;
943
+ }
944
+ }
945
+
925
946
  .eluvio-player__hotspot-overlay {
926
947
  .eluvio-player__hotspot-overlay__target {
927
948
  .eluvio-player__hotspot-overlay__target__title {