-
Notifications
You must be signed in to change notification settings - Fork 7.5k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
video.min.js errors in IE8, must use video.js #3064
Comments
Can you elaborate on what you mean by ie8 being broken? Are there any errors in the console? What behavior are you seeing and what behavior are you expecting to see? |
Yeah console error and the Flash video player never loads because of it |
What error are you seeing? |
Nothing useful, that's why I didn't include it: Script error |
Can't know unless I ask. A lot of times errors do contain useful information but the people reporting the issue don't think it's useful so they don't provide it. It's generally best to provide such information even if at first glance it seems not useful. |
Have you tried to use compatibility mode set to IE9? For example, JWPlayer 7 flash source not working on IE8 or lower! I suspect the same behaviour with VideoJS |
I tried adding <meta http-equiv="X-UA-Compatible" content="IE=Edge" /> to the page but it didn't change anything. Probably because that applies to the DOM not javascript. There's some issue with your minimizing function that makes it incompatible with IE8. |
I just tested this in IE8 on 5.10.0 and this bug still exists. See also #3142 What I've found is that I must use video.js not video.min.js if I'm using javascript initialization for the video player or it errors on line 13611 which I've marked below. Here are all the test cases: http://ivcmiami.com/testvideojs/min_js_setup.htm // Check if any media elements exist
if (mediaEls && mediaEls.length > 0) {
for (var i = 0, e = mediaEls.length; i < e; i++) {
var mediaEl = mediaEls[i];
// Check if element exists, has getAttribute func.
// IE seems to consider typeof el.getAttribute == 'object' instead of 'function' like expected, at least when loading the player immediately.
if (mediaEl && mediaEl.getAttribute) {
// Make sure this player hasn't already been set up.
if (mediaEl['player'] === undefined) {
var options = mediaEl.getAttribute('data-setup');
// Check if data-setup attr exists.
// We only auto-setup if they've added the data-setup attr.
if (options !== null) {
// Create new video.js instance.
var player = videojs(mediaEl); <- IT ERRORS HERE
}
}
// If getAttribute isn't defined, we need to wait for the DOM.
} else {
autoSetupTimeout(1);
break;
}
}
// No videos were found, so keep looping unless page is finished loading.
} else if (!_windowLoaded) {
autoSetupTimeout(1);
} |
Have a reduced test case? When I was testing the fix (#3233), it was working fine for me in IE8 as well. |
reduced test cases http://ivcmiami.com/testvideojs/min_js_setup.htm <- broken in IE8 |
@sethborg looks like the minified version is erroring out when you pass in a player id as a string to it. This is actually occurring because the minifier is doing weird stuff that is causing issues. var videojs = function(id, options, ready) {
return videojs.getPlayers()[id]; to something like var videojs = function vjs(id, options, ready) {
return vjs.getPlayers()[id]; However, in IE8, |
Also, interestingly enough, if you pass in an element reference instead of a string id, it works just fine. I guess because it doesn't enter the main block that does |
Looks like the issue isn't uglify but rather that babel produces a named function expression that then uglify changes the names of. |
This is a fix for IE8 where the name of a named function expression is different from the variable that function is assigned to. This is an issue because our version of babel outputs functions like that. Fixes #3064 again.
Fixed in 5.10.5. |
Something's busted about video.min.js since it breaks IE8 support. Could someone look into this or if you aren't going to fix it, at least update the docs with an html comment in the source code so people know
Use the below to see the error, change video.min.js to video.js and see how it works fine
<!DOCTYPE html>
<html lang="en">
<head>
<link href="http://vjs.zencdn.net/5.5.3/video-js.css" rel="stylesheet">
<script src="http://vjs.zencdn.net/ie8/1.1.1/videojs-ie8.min.js" ></script>
<!-- must use video.js, IE8 errors if you use video.min.js -->
<script src="http://vjs.zencdn.net/5.5.3/video.min.js" ></script>
</head>
<body>
<video controls="controls" class="video-js vjs-fluid vjs-default-skin vjs-big-play-centered" preload="auto" data-setup='{}'>
<source src="http://clips.vorwaerts-gmbh.de/VfE_html5.mp4" type="video/mp4">
<p class="vjs-no-js">
To view this video please enable JavaScript, and consider upgrading to a web browser that
<a href="http://videojs.com/html5-video-support/" target="_blank">supports HTML5 video</a>
</p>
</video>
</body>
</html>
The text was updated successfully, but these errors were encountered: