Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove orientation event listener after the player is disposed #29

Conversation

KVPasupuleti
Copy link
Contributor

We are adding the orientation event listener which is causing this error when the player is accessed after it's disposed

TypeError: Cannot read properties of null (reading 'paused')
  at method(../node_modules/video.js/dist/video.es.js:21454:17)
  at get(../node_modules/video.js/dist/video.es.js:9871:66)
  at techGet_(../node_modules/video.js/dist/video.es.js:23999:14)
  at paused(../node_modules/video.js/dist/video.es.js:24162:17)
  at apply(../node_modules/videojs-landscape-fullscreen/dist/videojs-landscape-fullscreen.es.js:69:18)
  at r(../../src/helpers.ts:87:17)

This PR removes that event listener after the player is disposed

@prateekrastogi
Copy link
Owner

concurrent chaining of apis is node.js anti-pattern, whereas c# repository namespace scaling.

Kindly bear so before expanding api skelton in typescript.

@KVPasupuleti
Copy link
Contributor Author

KVPasupuleti commented Apr 22, 2022

@prateekrastogi

Is this a relevant reply for the PR raised?

I think I have just provided a stack trace and I don't understand the reply given.

Will you please explain what the problem is?

@prateekrastogi
Copy link
Owner

Problem is You Are Nesting, due to lack of Type Polymorphism in your own Programming Language.

@KVPasupuleti
Copy link
Contributor Author

To be precise, this is not a Typescript error.

The error is happening because the player is getting accessed after it's disposed.

This PR fixes that issue by removing the orientationchange event after the player is disposed.

@prateekrastogi prateekrastogi merged commit 5fecfc4 into prateekrastogi:master Apr 22, 2022
@prateekrastogi
Copy link
Owner

Just Merged It. Kindly Bear Dispose Will affect Typescript defer Garbage Collector.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants