How do I resolve video.js 5.6.0 runtime error - Object doesn't support this property or method?

0

I recently switched to using video.js version 5.6.0 (was previously using a 4.x version), and noticed that I now consistently get the following error using the non-minified version of video.js:

Exception was thrown at line 811, column 5 in http://vjs.zencdn.net/5.6.0/video.js 0x800a01b6 - JavaScript runtime error: Object doesn't support this property or method

I haven't changed anything in my use of video.js, and the line:

<script src="http://vjs.zencdn.net/5.6.0/video.js"></script>

appears immediately below the video element. The matching 5.6.0 CSS appears in a link tag in the head section.

This is occurring under Internet Explorer 11 on Windows 8.1. The error is reported through Visual Studio 2013.

I tried falling back to video.js version 5.4.6, but it gives the same error at the same line. I tried the minified versions of both 5.6.0 and 5.4.6, and both give the same error (at a different line/column, of course).

I've examined the offending area, but must admit I'm not well-versed enough in JavaScript to determine what the cause of this issue is. I've commented-out all of my own JavaScript, to ensure that it's not interacting somehow with video.js, and I still get the error consistently.

Any ideas on how to fix or work around this error? The video.js player seems to work as expected in spite of this error, so it's not a blocking issue...just a concern.

javascript
video
runtime-error
video.js
asked on Stack Overflow Feb 6, 2016 by kgcode

1 Answer

0

If you look at that part of the script, you'll see the line that errors is handled in a try catch block, precisely because an error is expected on modern browsers. The subsequent code only needs to run on browsers that don't error. This is from lodash, a utility library used by video.js. These sort of tests are not uncommon.

var isHostObject = (function() {
  try {
    Object({ 'toString': 0 } + ''); // Line 811
  } catch(e) {
    return function() { return false; };
  }
  return function(value) {
    // IE < 9 presents many host objects as `Object` objects that can coerce
    // to strings despite having improperly defined `toString` methods.
    return typeof value.toString != 'function' && typeof (value + '') == 'string';
  };
}());

There's nothing to fix here. You would only see this error at all if you have 'break on all exceptions' turned on in your debug tools (terminology may vary in Visual Studio). 'Break on unhandled exceptions' is generally more useful as this shows the errors that are not expected and need to be actioned.

answered on Stack Overflow Feb 6, 2016 by misterben

User contributions licensed under CC BY-SA 3.0