astro-embed icon indicating copy to clipboard operation
astro-embed copied to clipboard

Request/bug: pause playing the Youtube player when closing the modal

Open atjackiejohns opened this issue 6 months ago • 1 comments

Hey,

The problem I have is the following:

  1. I embed the YouTube player into a modal (using DaisyUI)
  2. I open the modal and click play on the YouTube video
  3. I close the modal but the video keeps playing.

This is not how it should behave I think. This does not happen in React, for example. It should pause/stop the video instead when the modal is closed.

atjackiejohns avatar Jun 17 '25 08:06 atjackiejohns

I don’t think this is related to this package? All this package does is embed an image that, when clicked, loads the standard YouTube <iframe>. If you’re using a <dialog>, you probably need to listen to the close event and stop playback I’d guess?

delucis avatar Jun 17 '25 16:06 delucis