video.js icon indicating copy to clipboard operation
video.js copied to clipboard

TypeError: d is null

Open karneaud opened this issue 11 years ago • 13 comments

Got this error running on FireFox 34 for Windows 7

TypeError: d is null
http://cdnjs.cloudflare.com/ajax/libs/video.js/4.11.3/video.js
Line 111

Trying to debug it but no luck

karneaud avatar Jan 06 '15 11:01 karneaud

Thanks for reporting it. Any more info on what's required to reproduce the error? I'm not seeing it in FF34 on this demo page. http://jsbin.com/axedog/

heff avatar Jan 07 '15 00:01 heff

I'm not sure myself as I can't debug the code in its minified form...

karneaud avatar Jan 07 '15 13:01 karneaud

Can you see the same error or not in that jsbin example? And if not, can you point to any differences in what you're doing with the player?

heff avatar Jan 07 '15 20:01 heff

I'm seeing similar error in FF 35.0.1 on a mac. Works fine in Chrome. I'm not seeing any errors in your jsbin example.

"VIDEOJS:" TypeError: d is null Stack trace: t.p.$b/a.prototype.Ja@http://vjs.zencdn.net/4.11/video.js:111:336 T@http://vjs.zencdn.net/4.11/video.js:65:453 s.src/<@http://vjs.zencdn.net/4.11/video.js:74:313 s.Na@http://vjs.zencdn.net/4.11/video.js:36:189 Q/<@http://vjs.zencdn.net/4.11/video.js:63:307 s.Na@http://vjs.zencdn.net/4.11/video.js:36:189 t.f.checkReady@http://vjs.zencdn.net/4.11/video.js:129:420 t.f.onReady@http://vjs.zencdn.net/4.11/video.js:129:342 @http://dev.mopdog.com/:0:22

Runtheball avatar Jan 28 '15 17:01 Runtheball

I am seeing the exact same issues in Firefox as well. No issues in Chrome

wpinsite avatar Feb 01 '15 02:02 wpinsite

Same problem here, Chrome works well, but Firefox don't.

On the unminified version, the error is

"VIDEOJS:" TypeError: sh is null                             video.dev.js:1409:4
Stack trace:
vjs.MediaTechController.withSourceHandlers/Tech.prototype.setSource@http://localhost:3000/bower_components/video.js/dist/video-js/video.dev.js:6715:5
vjs.Player.prototype.techCall@http://localhost:3000/bower_components/video.js/dist/video-js/video.dev.js:4209:7
vjs.Player.prototype.src/<@http://localhost:3000/bower_components/video.js/dist/video-js/video.dev.js:4775:11
vjs.Component.prototype.triggerReady@http://localhost:3000/bower_components/video.js/dist/video-js/video.dev.js:2483:7
vjs.Player.prototype.loadTech/techReady@http://localhost:3000/bower_components/video.js/dist/video-js/video.dev.js:3933:5
vjs.Component.prototype.triggerReady@http://localhost:3000/bower_components/video.js/dist/video-js/video.dev.js:2483:7
vjs.Flash.checkReady@http://localhost:3000/bower_components/video.js/dist/video-js/video.dev.js:7525:5
vjs.Flash.onReady@http://localhost:3000/bower_components/video.js/dist/video-js/video.dev.js:7510:5
@http://localhost:3000/#:0:22

And at line 6700 and followings

  /**
   * Create a function for setting the source using a source object
   * and source handlers.
   * Should never be called unless a source handler was found.
   * @param {Object} source  A source object with src and type keys
   * @return {vjs.MediaTechController} self
   */
  Tech.prototype.setSource = function(source){
    var sh = Tech.selectSourceHandler(source); 

    // Dispose any existing source handler
    this.disposeSourceHandler();
    this.off('dispose', this.disposeSourceHandler);

    this.currentSource_ = source;
    this.sourceHandler_ = sh.handleSource(source, this); // Here sh is null
    this.on('dispose', this.disposeSourceHandler);

    return this;
  };

As a side note, if I set it up like @heff did on jsbin, it works. On the project I have, I'm using BigVideo.js and use it like that :

var BV = new $.BigVideo();
  BV.init();
  BV.show('./video/immeubles1.mp4', {
    ambient: true
  });

p-j avatar Feb 02 '15 08:02 p-j

Ok, so after further investigation, I fill I need to better explain the context : I'm runngin Firefox Developer Edition on Ubuntu 14.04.1. I have flash installed and can display Flash animation on Flash player help, I also tried with pipelight to get a more up-to-date version of flash player on Firefox, but no luck.

The sh above origininate from selectSourceHandler that I copy paste below

When I head to video.dev.js@6663

  /**
   * Return the first source handler that supports the source
   * TODO: Answer question: should 'probably' be prioritized over 'maybe'
   * @param  {Object} source The source object
   * @returns {Object}       The first source handler that supports the source
   * @returns {null}         Null if no source handler is found
   */
  Tech.selectSourceHandler = function(source){
    var handlers = Tech.sourceHandlers || [],
        can;

    for (var i = 0; i < handlers.length; i++) {
      can = handlers[i].canHandleSource(source);

      if (can) {
        return handlers[i];
      }
    }

    return null;
  };

handlers contains only Flash handlers and no HTML5 handlers. Both native and RTMP source handler return "" to the canHandleSource(source) call.

p-j avatar Feb 02 '15 10:02 p-j

Just tested on windows, with latest Firefox. Its working and using the HTML5 native handler.

p-j avatar Feb 02 '15 11:02 p-j

I found a way to get it working using BigVideo.js, instead of

  var BV = new $.BigVideo();
  BV.init();
  BV.show('./video/immeubles1.mp4', {
    ambient: true
  });

I used

  var BV = new $.BigVideo();
  BV.init();
  BV.show([{
    type: 'video/mp4',
    src: './video/immeubles1.mp4'
  }], {
    ambient: true
  });

Now I get the correct answer from canHandleSource(source) and it plays. It plays using the pipelight player though and not the native HTML5 one.

To get it to play with the native player, you also need to instantiate BigVideo with the argument {useFlashForFirefox:false}

Hope this helps someone else.

p-j avatar Feb 02 '15 12:02 p-j

That does help. Sounds like the issue comes about when a type isn't provided (though, you probably should always provide a type).

gkatsev avatar Feb 02 '15 17:02 gkatsev

I have same issue in FF 35.0.1

hjmodha avatar Feb 19 '15 12:02 hjmodha

I can't reproduce in 4.12 on OS X running this demo

  • Firefox 35
  • Firefox 36
  • Firefox 38 (Developer Edition)

That's setting the source via js both with and without a type. Setting it in the src tag has no affect. If someone can put together a reduced test case that shows this we can reopen, but I'm closing for now.

mmcc avatar Feb 27 '15 23:02 mmcc

I believe #1905 will fix this issue but I can't be sure. If someone could set up a reduced live example of the error happening I'd know better.

heff avatar Feb 27 '15 23:02 heff