Made sure sources get ordered in a predictable way

This commit is contained in:
Erik Thuning 2024-09-06 14:58:42 +02:00
parent 1182bed672
commit 0b22fab6a2

@ -1305,16 +1305,18 @@ input[type="range"]::-ms-track {
this._elapsed.textContent = this.formatTime(0);
this._duration.textContent = this.formatTime(
presentation.duration);
const sourcenames = Object.keys(presentation.sources);
const resolutions = Object.keys(
presentation.sources[sourcenames[0]].video);
const streams = presentation.sources;
const sourcenames = Object.keys(streams);
// sorting the source names so they get a predictable ordering
sourcenames.sort();
const resolutions = Object.keys(streams[sourcenames[0]].video);
const defaultRes = 0;
const token = presentation.token;
this.setResolutions(resolutions, defaultRes);
// create streams
const streams = presentation.sources;
for(const key in streams) {
for(var i = 0; i < sourcenames.length; ++i) {
const key = sourcenames[i];
const stream = streams[key];
// skip setting up the stream if it is explicitly
// configured to be hidden.