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

Reuse Same Container AKA Destroy Player #144

Open
maximilianor-tkf opened this issue Sep 5, 2023 · 1 comment
Open

Reuse Same Container AKA Destroy Player #144

maximilianor-tkf opened this issue Sep 5, 2023 · 1 comment
Labels

Comments

@maximilianor-tkf
Copy link

Hi,

I'm looking for a way to initialize different players in the same container at different times.

My use case is as follows:

We have a website where users interact with the player in a box, similar to a modal. When the user closes that modal, the player must be destroyed to make space for another player.

The "Multiple H5P players on the same page" initialization process described in the readme is not suitable for our use case.

Also, is there a way to handle actions like play, pause, or full screen outside the library?

Regards!

@maximilianor-tkf
Copy link
Author

Also, I tried destroying the child element of the container but then I get the following error when trying initialize a new player.

TypeError: Cannot read properties of undefined (reading 'H5P')

const { H5P } = H5PStandalone;

this.player = await new H5P(el, options);

@0xMurage 0xMurage added the bug label Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants