Skip to content

Commit

Permalink
fix(player): Added missing conditional to set an empty source when no…
Browse files Browse the repository at this point in the history
…ne is present
  • Loading branch information
rafa8626 committed Aug 10, 2019
1 parent f0e42e9 commit 3bd81b1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
7 changes: 7 additions & 0 deletions dist/openplayer.js
Expand Up @@ -6843,6 +6843,13 @@ var Media = function () {
});
}

if (!mediaFiles.length) {
mediaFiles.push({
src: '',
type: source.predictType('')
});
}

return mediaFiles;
}
}, {
Expand Down
2 changes: 1 addition & 1 deletion dist/openplayer.min.js

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions src/js/media.ts
Expand Up @@ -257,6 +257,7 @@ class Media {
if (this.element.src) {
this.element.setAttribute('data-op-file', this.mediaFiles[0].src);
}

this.element.src = this.mediaFiles[0].src;
this.media.src = this.mediaFiles[0];
}
Expand Down Expand Up @@ -460,6 +461,13 @@ class Media {
});
}

if (!mediaFiles.length) {
mediaFiles.push({
src: '',
type: source.predictType(''),
});
}

return mediaFiles;
}

Expand Down

0 comments on commit 3bd81b1

Please sign in to comment.