Skip to content

Commit

Permalink
chore: ie 11 demo fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonocasey committed Mar 2, 2021
1 parent c348174 commit 0760d45
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions scripts/index-demo-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
var sources = JSON.parse(xhr.responseText);

sources.forEach(function(source) {
const option = document.createElement('option');
var option = document.createElement('option');

option.innerText = source.name;
option.value = source.uri;
Expand Down Expand Up @@ -87,7 +87,7 @@
if (el.type === 'url' || el.type === 'text' || el.nodeName.toLowerCase() === 'textarea') {
el.value = decodeURIComponent(value);
} else if (el.type === 'select-one') {
for (let i = 0; i < el.options.length; i++) {
for (var i = 0; i < el.options.length; i++) {
if (el.options[i].value === value) {
el.options[i].selected = true;
}
Expand Down Expand Up @@ -177,24 +177,25 @@
el.removeChild(el.firstChild);
}

const loaded = [];
var loaded = [];

function checkDone() {
var checkDone = function() {
if (loaded.length === urls.length) {
cb();
}
}
};

urls.forEach(function(url) {
var script = document.createElement('script');

urls.forEach((url) => {
const script = document.createElement('script');
// scripts marked as defer will be loaded asynchronously but will be executed in the order they are in the DOM
script.defer = true;
// dynamically created scripts are async by default unless otherwise specified
// async scripts are loaded asynchronously but also executed as soon as they are loaded
// we want to load them in the order they are added therefore we want to turn off async
script.async = false;
script.src = url;
script.onload = () => {
script.onload = function() {
loaded.push(url);
checkDone();
};
Expand Down Expand Up @@ -362,7 +363,7 @@
videoEl.className = 'vjs-default-skin';
fixture.appendChild(videoEl);

const mirrorSource = getInputValue(stateEls['mirror-source']);
var mirrorSource = getInputValue(stateEls['mirror-source']);

player = window.player = window.videojs(videoEl, {
plugins: {
Expand All @@ -382,10 +383,10 @@
});

player.on('sourceset', function() {
const source = player.currentSource();
var source = player.currentSource();

if (source.keySystems) {
const copy = JSON.parse(JSON.stringify(source.keySystems));
var copy = JSON.parse(JSON.stringify(source.keySystems));

// have to delete pssh as it will often make keySystems too big
// for a uri
Expand Down Expand Up @@ -441,7 +442,7 @@
});
});

const urlButtonClick = function(event) {
var urlButtonClick = function(event) {
var ext;
var type = stateEls.type.value;

Expand Down

0 comments on commit 0760d45

Please sign in to comment.