@eluvio/elv-player-js 1.0.71 → 1.0.74
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 +5 -5
- package/src/PlayerControls.js +10 -2
- package/src/index.js +19 -5
- package/package-lock.json +0 -17167
- package/src/.DS_Store +0 -0
- package/src/static/.DS_Store +0 -0
- package/src/static/icons/media/.DS_Store +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eluvio/elv-player-js",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.74",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"license": "MIT",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"hls.js": "^1.0.4",
|
|
44
44
|
"lodash": "^4.17.21",
|
|
45
45
|
"resize-observer-polyfill": "^1.5.1",
|
|
46
|
-
"urijs": "^1.19.
|
|
46
|
+
"urijs": "^1.19.11",
|
|
47
47
|
"url-join": "^4.0.1"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
@@ -72,20 +72,20 @@
|
|
|
72
72
|
"html-webpack-inline-source-plugin": "0.0.10",
|
|
73
73
|
"html-webpack-plugin": "^3.2.0",
|
|
74
74
|
"image-webpack-loader": "^4.6.0",
|
|
75
|
-
"node-sass": "^4.13.1",
|
|
76
75
|
"postcss-loader": "^3.0.0",
|
|
77
76
|
"pre-commit": "^1.2.2",
|
|
78
77
|
"raw-loader": "^0.5.1",
|
|
79
78
|
"regenerator-runtime": "^0.12.1",
|
|
79
|
+
"sass": "^1.51.0",
|
|
80
80
|
"sass-lint": "^1.12.1",
|
|
81
81
|
"sass-lint-auto-fix": "^0.21.0",
|
|
82
|
-
"sass-loader": "^
|
|
82
|
+
"sass-loader": "^10.2.1",
|
|
83
83
|
"source-map-loader": "^0.2.4",
|
|
84
84
|
"style-loader": "^0.22.1",
|
|
85
85
|
"svg-inline-loader": "^0.8.0",
|
|
86
86
|
"svg-inline-react": "^3.1.0",
|
|
87
87
|
"uuid": "^7.0.2",
|
|
88
|
-
"webpack": "^4.
|
|
88
|
+
"webpack": "^4.46.0",
|
|
89
89
|
"webpack-bundle-analyzer": "^3.3.2",
|
|
90
90
|
"webpack-cli": "^3.3.0",
|
|
91
91
|
"webpack-dev-server": "^3.11.2"
|
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: {
|
|
@@ -282,7 +284,15 @@ export class EluvioPlayer {
|
|
|
282
284
|
async PlayoutOptions() {
|
|
283
285
|
const client = await this.Client();
|
|
284
286
|
|
|
285
|
-
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
|
+
|
|
286
296
|
if(this.sourceOptions.playoutParameters.directLink) {
|
|
287
297
|
const availableOfferings = await client.AvailableOfferings({
|
|
288
298
|
objectId: this.sourceOptions.playoutParameters.objectId,
|
|
@@ -302,7 +312,8 @@ export class EluvioPlayer {
|
|
|
302
312
|
|
|
303
313
|
if(!this.sourceOptions.playoutOptions) {
|
|
304
314
|
this.sourceOptions.playoutOptions = await client.PlayoutOptions({
|
|
305
|
-
offeringURI
|
|
315
|
+
offeringURI,
|
|
316
|
+
options
|
|
306
317
|
});
|
|
307
318
|
|
|
308
319
|
window.playoutOptions = this.sourceOptions.playoutOptions;
|
|
@@ -310,7 +321,8 @@ export class EluvioPlayer {
|
|
|
310
321
|
} else {
|
|
311
322
|
if(!this.sourceOptions.playoutOptions) {
|
|
312
323
|
this.sourceOptions.playoutOptions = await client.PlayoutOptions({
|
|
313
|
-
...this.sourceOptions.playoutParameters
|
|
324
|
+
...this.sourceOptions.playoutParameters,
|
|
325
|
+
options
|
|
314
326
|
});
|
|
315
327
|
|
|
316
328
|
window.playoutOptions = this.sourceOptions.playoutOptions;
|
|
@@ -615,12 +627,14 @@ export class EluvioPlayer {
|
|
|
615
627
|
}
|
|
616
628
|
|
|
617
629
|
if(this.controls) {
|
|
630
|
+
window.hls = hlsPlayer;
|
|
618
631
|
this.controls.SetQualityControls({
|
|
619
632
|
GetLevels: () => hlsPlayer.levels.map((level, index) => ({
|
|
620
633
|
index,
|
|
621
634
|
active: index === hlsPlayer.currentLevel,
|
|
622
635
|
resolution: level.attrs.RESOLUTION,
|
|
623
|
-
bitrate: level.bitrate
|
|
636
|
+
bitrate: level.bitrate,
|
|
637
|
+
audioTrack: !level.videoCodec
|
|
624
638
|
})),
|
|
625
639
|
SetLevel: levelIndex => hlsPlayer.nextLevel = levelIndex
|
|
626
640
|
});
|