diff options
author | Sam Potts <sam@potts.es> | 2019-01-06 14:08:46 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-06 14:08:46 +1100 |
commit | db2997ef21aecde9af9f5e1d51b2440cd13a18fd (patch) | |
tree | 97b0d02ef9aa3381940bb8e886932a2b50146686 /src/js/html5.js | |
parent | 88ffd0f138b3db1e16dd689d9070dcd8fed4a845 (diff) | |
parent | 10c88f6e4936d522f249b78f0d02d4ea4e198030 (diff) | |
download | plyr-db2997ef21aecde9af9f5e1d51b2440cd13a18fd.tar.lz plyr-db2997ef21aecde9af9f5e1d51b2440cd13a18fd.tar.xz plyr-db2997ef21aecde9af9f5e1d51b2440cd13a18fd.zip |
Merge branch 'develop' into master
Diffstat (limited to 'src/js/html5.js')
-rw-r--r-- | src/js/html5.js | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/js/html5.js b/src/js/html5.js index 0876211a..3266a58e 100644 --- a/src/js/html5.js +++ b/src/js/html5.js @@ -5,6 +5,7 @@ import support from './support'; import { removeElement } from './utils/elements'; import { triggerEvent } from './utils/events'; +import is from './utils/is'; const html5 = { getSources() { @@ -14,8 +15,16 @@ const html5 = { const sources = Array.from(this.media.querySelectorAll('source')); - // Filter out unsupported sources - return sources.filter(source => support.mime.call(this, source.getAttribute('type'))); + // Filter out unsupported sources (if type is specified) + return sources.filter(source => { + const type = source.getAttribute('type'); + + if (is.empty(type)) { + return true; + } + + return support.mime.call(this, type); + }); }, // Get quality levels |