-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add HLS support detection to Modernizr.video #1317
Conversation
@@ -52,7 +52,8 @@ define(['Modernizr', 'createElement'], function( Modernizr, createElement ) { | |||
bool.webm = elem.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,''); | |||
|
|||
bool.vp9 = elem.canPlayType('video/webm; codecs="vp9"').replace(/^no$/,''); | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like theres some leading whitesapce - can you strip it out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
thanks @zeno ! looks good, other than the whitespace, strip that out, then squish it down to a single commit, and we will get in in straight away! |
@@ -677,7 +677,7 @@ | |||
|
|||
<div class="test_wrap"><h3>Interact</h3><div id="video1" class="interact"></div><video width="160" height="120" controls=""> | |||
<source src="video.mp4" type="video/mp4"> | |||
<source src="video.ogv" type="video/ogv"> | |||
<source src="video.ogv" type="video/ogg"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because "video/ogv" is the wrong MIME type for OGG videos. It's a common mistake: since the file extension is .ogv we often tend to use video/ogv for the content type, but that's wrong, it must be video/ogg. You can test it on browsers that support the ogg format (like Firefox or Chrome): if you execute videoElement.canPlayType('video/ogg') you'll get "mabye" or "probably", but if you execute videoElement.canPlayType('video/ogv') you'll get "" (empty string). It's not a big deal and it's not related to my HLS detect patch, it's just a mini typo I saw...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the schoolin'!
could you squish everything down to a single commit?
|
Chrome Android 4.4 -> "probably" Safari iOS -> "probably" Safari OSX -> "probably" Fix typo in mime type for ogg video Strip out some leading whitespace
Done! |
badabing badaboom |
Add HLS support detection to Modernizr.video
Add HLS support detection to Modernizr.video
Chrome Android 4.4 -> "probably"
Safari iOS -> "probably"
Safari OSX -> "probably"