Browse Source

Guard against possible invalid tech usage

pull/1872/head
Gabe Kangas 4 years ago
parent
commit
7935bcf5f3
No known key found for this signature in database
GPG Key ID: 9A56337728BC81EA
  1. 5
      webroot/js/components/player.js

5
webroot/js/components/player.js

@ -292,6 +292,11 @@ class OwncastPlayer { @@ -292,6 +292,11 @@ class OwncastPlayer {
// Quality selected
newMenuItem.on('click', function () {
// If for some reason tech doesn't exist, then don't do anything
if (!tech) {
console.warn('Invalid attempt to access null player tech');
return;
}
// Only enable this single, selected representation.
tech.vhs.representations().forEach(function (rep, index) {
rep.enabled(index === item.index);

Loading…
Cancel
Save