Skip to content

Commit

Permalink
Merge branch 'master' into feature/attribute-source
Browse files Browse the repository at this point in the history
  • Loading branch information
johnBartos committed Mar 6, 2018
2 parents 410e93c + 921fb5f commit 387d5df
Showing 1 changed file with 26 additions and 22 deletions.
48 changes: 26 additions & 22 deletions src/js/providers/providers-supported.js
Expand Up @@ -25,35 +25,39 @@ const MimeTypes = {
const SupportsMatrix = [
{
name: 'html5',
supports: function (source) {
if (isAndroidHls(source) === false) {
return false;
}
supports: supportsType
}
];

if (!video.canPlayType) {
return false;
}
export function supportsType(source) {
{
if (isAndroidHls(source) === false) {
return false;
}

const file = source.file;
const type = source.type;
if (!video.canPlayType) {
return false;
}

// Ensure RTMP files are not seen as videos
if (isRtmp(file, type)) {
return false;
}
const file = source.file;
const type = source.type;

const mimeType = source.mimeType || MimeTypes[type];
// Ensure RTMP files are not seen as videos
if (isRtmp(file, type)) {
return false;
}

// Not OK to use HTML5 with no extension
if (!mimeType) {
return false;
}
const mimeType = source.mimeType || MimeTypes[type];

// Last, but not least, we ask the browser
// (But only if it's a video with an extension known to work in HTML5)
return !!video.canPlayType(mimeType);
// Not OK to use HTML5 with no extension
if (!mimeType) {
return false;
}

// Last, but not least, we ask the browser
// (But only if it's a video with an extension known to work in HTML5)
return !!video.canPlayType(mimeType);
}
];
}

export default SupportsMatrix;

0 comments on commit 387d5df

Please sign in to comment.