@eluvio/elv-player-js 1.0.87 → 1.0.89

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.87",
3
+ "version": "1.0.89",
4
4
  "description": "![Eluvio Logo](src/static/images/Logo.png \"Eluvio Logo\")",
5
5
  "main": "src/index.js",
6
6
  "license": "MIT",
@@ -735,7 +735,11 @@ class PlayerControls {
735
735
  }
736
736
 
737
737
  if(this.GetAudioTracks) {
738
- this.AddSetting({Retrieve: this.GetAudioTracks, Set: this.SetAudioTrack});
738
+ const tracks = (this.GetAudioTracks() || {}).options || [];
739
+
740
+ if(tracks.length > 1) {
741
+ this.AddSetting({Retrieve: this.GetAudioTracks, Set: this.SetAudioTrack});
742
+ }
739
743
  }
740
744
 
741
745
  if(this.GetTextTracks) {
package/src/index.js CHANGED
@@ -538,11 +538,6 @@ export class EluvioPlayer {
538
538
  });
539
539
  this.resizeObserver.observe(this.target);
540
540
 
541
- const controlsPromise = this.PosterUrl().then(posterUrl => {
542
- this.posterUrl = posterUrl;
543
- this.controls = new PlayerControls(this.target, this.video, this.playerOptions, posterUrl, this.playerOptions.controlsClassName);
544
- });
545
-
546
541
  if(this.clientOptions.promptTicket && !this.clientOptions.ticketCode) {
547
542
  if(!this.clientOptions.tenantId) { throw Error("ELUVIO PLAYER: Tenant ID must be provided if ticket code is needed."); }
548
543
 
@@ -576,6 +571,20 @@ export class EluvioPlayer {
576
571
 
577
572
  let { protocol, drm, playoutUrl, drms, multiviewOptions } = await playoutOptionsPromise;
578
573
 
574
+ let controlsPromise;
575
+ if(["fairplay", "sample-aes"].includes(drm)) {
576
+ // Switch to default controls if using fairplay or sample aes
577
+ if(this.playerOptions.controls !== EluvioPlayerParameters.controls.OFF) {
578
+ this.playerOptions.controls = EluvioPlayerParameters.controls.DEFAULT;
579
+ this.video.controls = true;
580
+ }
581
+ } else {
582
+ controlsPromise = this.PosterUrl().then(posterUrl => {
583
+ this.posterUrl = posterUrl;
584
+ this.controls = new PlayerControls(this.target, this.video, this.playerOptions, posterUrl, this.playerOptions.controlsClassName);
585
+ });
586
+ }
587
+
579
588
  multiviewOptions.target = this.target;
580
589
 
581
590
  playoutUrl = URI(playoutUrl);