@eluvio/elv-player-js 1.0.70 → 1.0.73
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-lock.json +1 -1
- package/package.json +1 -1
- package/src/PlayerControls.js +10 -2
- package/src/index.js +24 -5
package/package-lock.json
CHANGED
package/package.json
CHANGED
package/src/PlayerControls.js
CHANGED
|
@@ -626,7 +626,11 @@ class PlayerControls {
|
|
|
626
626
|
classes: ["eluvio-player__controls__settings-menu__option"]
|
|
627
627
|
});
|
|
628
628
|
|
|
629
|
-
|
|
629
|
+
if(currentLevel.audioTrack) {
|
|
630
|
+
resolutionButton.innerHTML = `Quality: ${currentLevel.bitrate / 1000}kbps`;
|
|
631
|
+
} else {
|
|
632
|
+
resolutionButton.innerHTML = `Resolution: ${currentLevel.resolution}`;
|
|
633
|
+
}
|
|
630
634
|
|
|
631
635
|
if(this.SetLevel) {
|
|
632
636
|
resolutionButton.addEventListener("click", () => {
|
|
@@ -653,7 +657,11 @@ class PlayerControls {
|
|
|
653
657
|
classes: ["eluvio-player__controls__settings-menu__option", level.active ? "eluvio-player__controls__settings-menu__option-selected" : ""]
|
|
654
658
|
});
|
|
655
659
|
|
|
656
|
-
|
|
660
|
+
if(level.audioTrack) {
|
|
661
|
+
levelOption.innerHTML = `${level.bitrate / 1000}kbps`;
|
|
662
|
+
} else {
|
|
663
|
+
levelOption.innerHTML = `${level.resolution} (${(level.bitrate / 1000 / 1000).toFixed(1)}Mbps)`;
|
|
664
|
+
}
|
|
657
665
|
|
|
658
666
|
levelOption.addEventListener("click", () => {
|
|
659
667
|
this.SetLevel(level.index);
|
package/src/index.js
CHANGED
|
@@ -97,7 +97,9 @@ const DefaultParameters = {
|
|
|
97
97
|
playoutType: undefined,
|
|
98
98
|
context: undefined,
|
|
99
99
|
hlsjsProfile: true,
|
|
100
|
-
authorizationToken: undefined
|
|
100
|
+
authorizationToken: undefined,
|
|
101
|
+
clipStart: undefined,
|
|
102
|
+
clipEnd: undefined
|
|
101
103
|
}
|
|
102
104
|
},
|
|
103
105
|
playerOptions: {
|
|
@@ -107,6 +109,7 @@ const DefaultParameters = {
|
|
|
107
109
|
loop: EluvioPlayerParameters.loop.OFF,
|
|
108
110
|
watermark: EluvioPlayerParameters.watermark.ON,
|
|
109
111
|
settings: EluvioPlayerParameters.settings.ON,
|
|
112
|
+
posterUrl: undefined,
|
|
110
113
|
className: undefined,
|
|
111
114
|
hlsjsOptions: undefined,
|
|
112
115
|
dashjsOptions: undefined,
|
|
@@ -245,6 +248,10 @@ export class EluvioPlayer {
|
|
|
245
248
|
}
|
|
246
249
|
|
|
247
250
|
async PosterUrl() {
|
|
251
|
+
if(this.playerOptions.posterUrl) {
|
|
252
|
+
return this.playerOptions.posterUrl;
|
|
253
|
+
}
|
|
254
|
+
|
|
248
255
|
const client = await this.Client();
|
|
249
256
|
|
|
250
257
|
try {
|
|
@@ -277,7 +284,15 @@ export class EluvioPlayer {
|
|
|
277
284
|
async PlayoutOptions() {
|
|
278
285
|
const client = await this.Client();
|
|
279
286
|
|
|
280
|
-
let offeringURI;
|
|
287
|
+
let offeringURI, options = {};
|
|
288
|
+
if(this.sourceOptions.playoutParameters.clipStart || this.sourceOptions.playoutParameters.clipEnd) {
|
|
289
|
+
options.clip_start = parseFloat(this.sourceOptions.playoutParameters.clipStart || 0);
|
|
290
|
+
|
|
291
|
+
if(this.sourceOptions.playoutParameters.clipEnd) {
|
|
292
|
+
options.clip_end = parseFloat(this.sourceOptions.playoutParameters.clipEnd);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
|
|
281
296
|
if(this.sourceOptions.playoutParameters.directLink) {
|
|
282
297
|
const availableOfferings = await client.AvailableOfferings({
|
|
283
298
|
objectId: this.sourceOptions.playoutParameters.objectId,
|
|
@@ -297,7 +312,8 @@ export class EluvioPlayer {
|
|
|
297
312
|
|
|
298
313
|
if(!this.sourceOptions.playoutOptions) {
|
|
299
314
|
this.sourceOptions.playoutOptions = await client.PlayoutOptions({
|
|
300
|
-
offeringURI
|
|
315
|
+
offeringURI,
|
|
316
|
+
options
|
|
301
317
|
});
|
|
302
318
|
|
|
303
319
|
window.playoutOptions = this.sourceOptions.playoutOptions;
|
|
@@ -305,7 +321,8 @@ export class EluvioPlayer {
|
|
|
305
321
|
} else {
|
|
306
322
|
if(!this.sourceOptions.playoutOptions) {
|
|
307
323
|
this.sourceOptions.playoutOptions = await client.PlayoutOptions({
|
|
308
|
-
...this.sourceOptions.playoutParameters
|
|
324
|
+
...this.sourceOptions.playoutParameters,
|
|
325
|
+
options
|
|
309
326
|
});
|
|
310
327
|
|
|
311
328
|
window.playoutOptions = this.sourceOptions.playoutOptions;
|
|
@@ -610,12 +627,14 @@ export class EluvioPlayer {
|
|
|
610
627
|
}
|
|
611
628
|
|
|
612
629
|
if(this.controls) {
|
|
630
|
+
window.hls = hlsPlayer;
|
|
613
631
|
this.controls.SetQualityControls({
|
|
614
632
|
GetLevels: () => hlsPlayer.levels.map((level, index) => ({
|
|
615
633
|
index,
|
|
616
634
|
active: index === hlsPlayer.currentLevel,
|
|
617
635
|
resolution: level.attrs.RESOLUTION,
|
|
618
|
-
bitrate: level.bitrate
|
|
636
|
+
bitrate: level.bitrate,
|
|
637
|
+
audioTrack: !level.videoCodec
|
|
619
638
|
})),
|
|
620
639
|
SetLevel: levelIndex => hlsPlayer.nextLevel = levelIndex
|
|
621
640
|
});
|