Giter Site home page Giter Site logo

Comments (11)

joeyparrish avatar joeyparrish commented on August 19, 2024 1

Hrm... 2.0.7-beta isn't a tag in our repo. Is that one of yours in clappr?

Just based on the log Uncaught TypeError: Cannot read property 'abr' of null, I assume this is a bug where the 'abr' member of the configuration object is accessed after the config has been set to null by destroy().

The compiled snippet you mentioned looks like the body of Player.prototype.destroy() itself. What we have there in HEAD is:

  var p = Promise.all([
    this.config_ ? this.config_.abr.manager.stop() : null,

3 weeks ago, before the commit "Overhaul load/unload/destroy", we had only this:

  var p = Promise.all([
    this.config_.abr.manager.stop(),

So prior to that overhaul, multiple calls to destroy() might result in that TypeError.

I think the best solution is to move to a version that includes the overhauled destroy(). Shaka Player v2.0.0-beta3 will have this commit. I can ping this ticket when it's out, if that's helpful.

The next best solution is to make sure that you do not call destroy() more than once on the same Player instance. This should effectively work around the bug until you upgrade to a fixed version of Shaka.

from dash-shaka-playback.

ibreakstuff93 avatar ibreakstuff93 commented on August 19, 2024 1

@leandromoreira thanks for your awesome work!

from dash-shaka-playback.

joeyparrish avatar joeyparrish commented on August 19, 2024 1

JFYI, Shaka Player v2.0.0-beta3 came out recently with the fix mentioned above.

from dash-shaka-playback.

leandromoreira avatar leandromoreira commented on August 19, 2024

@ibreakstuff93 thanks I can reproduce it here https://jsfiddle.net/hzzurtkh/

from dash-shaka-playback.

leandromoreira avatar leandromoreira commented on August 19, 2024

@ibreakstuff93 I cloned the shaka project to try to reproduce the same error (aka call destroy) but I couldn't, either on the HEAD or the tag 2.0.7-beta.

@joeyparrish maybe you can help us here, I'm calling the player destroy and then the success promise is executed... but after that a weird error shows up at console Uncaught TypeError: Cannot read property 'abr' of null

    /// _player is an instance of shaka
    this._player.destroy().then(() => console.log('success'), () => console.log('error') )

I saw it was raising this error on the last line of this snippet. (probably because a.a was undefined)

                                function ne(a) {
                                    a.u && a.u.Y(a.A, "sourceopen");
                                    a.c && (a.c.removeAttribute("src"),
                                    a.c.load());
                                    var b = Promise.all([a.a.abr.manager.stop(), a.g ? a.g.s() : null , a.O ? a.O.s() : null , a.h ? a.h.s() : null , a.b ? a.b.s() : null , a.o ? a.o.stop() : null ]);

But again I couldn't reproduce this behavior while on the HEAD or at the tag tag 2.0.7-beta using solely Shaka.

from dash-shaka-playback.

leandromoreira avatar leandromoreira commented on August 19, 2024

I think I have a clue, we're removing the DOM element (video) after the destroy success, maybe this is not safe.

from dash-shaka-playback.

leandromoreira avatar leandromoreira commented on August 19, 2024

Hrm... 2.0.7-beta isn't a tag in our repo. Is that one of yours in clappr?

yep, my mistake in fact I checkout to v2.0.0-beta2

Shaka Player v2.0.0-beta3 will have this commit. I can ping this ticket when it's out, if that's helpful.

It'll be! Thanks

By the way, @joeyparrish is right, we're calling destroy twice this is a bug on Clappr side!

from dash-shaka-playback.

leandromoreira avatar leandromoreira commented on August 19, 2024

@ibreakstuff93 this will be fixed when a newer version will be published

from dash-shaka-playback.

ibreakstuff93 avatar ibreakstuff93 commented on August 19, 2024

@leandromoreira - sorry for being a n00b here, is this tagged as wontfix as the problem lies on the clappr side - and if I go to the latest version of Clappr it will work? Sorry for being a thickie!

from dash-shaka-playback.

leandromoreira avatar leandromoreira commented on August 19, 2024

@ibreakstuff93 yes, I fixed this at clappr/clappr#1047 and when a new clappr version came out this will be fixed :)

from dash-shaka-playback.

leandromoreira avatar leandromoreira commented on August 19, 2024

Thanks @joeyparrish I'll try to use the last one now lol

from dash-shaka-playback.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.