@eluvio/elv-player-js 1.0.127 → 1.0.129

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.129",
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,
@@ -1124,6 +1136,13 @@ export class EluvioPlayer {
1124
1136
  }
1125
1137
 
1126
1138
  UpdateTextTracks({dashPlayer}={}) {
1139
+ const tracks = dashPlayer ?
1140
+ dashPlayer.getTracksFor("text") : Array.from(this.video.textTracks);
1141
+
1142
+ if(!tracks || tracks.length === 0) {
1143
+ return;
1144
+ }
1145
+
1127
1146
  this.controls.SetTextTrackControls({
1128
1147
  GetTextTracks: () => {
1129
1148
  const activeTrackIndex = dashPlayer ?
@@ -440,11 +440,6 @@ $button-height: 35px;
440
440
 
441
441
  button {
442
442
  border: 1px solid transparent;
443
-
444
- &.eluvio-player__controls__settings-menu__close {
445
- border: 1.5px solid $button-color;
446
- border-radius: 100%;
447
- }
448
443
  }
449
444
 
450
445
  &__close {
@@ -452,6 +447,7 @@ $button-height: 35px;
452
447
  display: none;
453
448
  height: 20px;
454
449
  justify-content: center;
450
+ padding: 0;
455
451
  position: absolute;
456
452
  right: 20px;
457
453
  top: 20px;
@@ -482,7 +478,9 @@ $button-height: 35px;
482
478
  }
483
479
 
484
480
  &-back__icon {
485
- height: 15px;
481
+ align-items: center;
482
+ display: flex;
483
+ height: 100%;
486
484
  left: 20px;
487
485
  margin-right: 5px;
488
486
  position: absolute;