oskarrough/ember-youtube

Automatically stop playback when compontent is removed. Play video when component is added.

bummzack opened this issue · 4 comments

First of all, let me thank you for creating this component. It's really useful!

There's an issue when a user navigates away from a route with a video, when the video is still playing. In that case, the setTimeout will still continue to fire and create lots of JS errors.

There should be a willDestroyElement handler that stops/unloads the video (or at least stop the timeout from running).

Similarly, there's an issue when a user revisits a route with a video, where the video won't show at all. Example: There's a video and something route. User starts at / and then visits video. The video playback starts. Then the user navigates to something and later back to video, resulting in no video-playback.

In this case, there should probably be a handler for didInsertElement that makes sure the video will be initialized?

What do you think? Or is there an obvious thing I'm missing here and this isn't an issue at all?

Thank you! It's great that someone is actually using this. But no, this is definitely an issue. To be honest I've only ever used this component on the application level. You're welcome to try it out otherwise I will as soon as possible.

Ok I'll give this a try and create a PR.

Closing this, since it has been fixed.

Cheers!