benjipott / video.js-chromecast

Use chromecast with videojs html5 player
Other
207 stars 86 forks source link

Uncaught TypeError: Cannot read property 'classList' of null #55

Open AdamTyler opened 6 years ago

AdamTyler commented 6 years ago

I'm not sure how to reproduce this issue but I see it when watching through videos intermittently.

Seen after VIDEOJS: Cast APIs are available

image

samueleastdev commented 6 years ago

The same error did you find a solution?

AdamTyler commented 6 years ago

I haven't had time to look into it unfortunately. You?

samueleastdev commented 6 years ago

Nope, nothing yet our issue happens when trying to reinitialize the player after a dispose call.

samueleastdev commented 6 years ago

Ok, a little more information I am not familiar with this library so I am just hacking at the code but maybe this will help the main dev.

In the initializeApi function these lines.

apiConfig = new chrome.cast.ApiConfig(sessionRequest, this.sessionJoinedListener.bind(this), this.receiverListener.bind(this));
            return chrome.cast.initialize(apiConfig, this.onInitSuccess.bind(this), this.castError.bind(this));

If i console log the receiverListener event like this.

key: 'receiverListener',
        value: function receiverListener(availability) {
            console.log('receiverListener');
            if (availability === 'available') {
                return this.show();
            }
        }

The receiverListener event is called correctly first time but after a dispose then it doesnt get called again.