-
Notifications
You must be signed in to change notification settings - Fork 1
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
Vue teleportation breaks playback #16
Comments
The VueJs documentation for the Teleport component explicitly mentions moving videos from and to the teleportation target: https://github.com/vuejs/rfcs/blob/2c62d12d0b8dc53018ed6ab6fbc5aea336d8eea6/active-rfcs/0025-teleport.md#disabled |
After some experimenting with keep-alive and other vue-related stuff, I am coming to the conclusion that this is inherent to the IFrame player itself. However, I did not find a way to prevent the IFrame player to pick up the teleportation. This behaviour seems to be known: https://stackoverflow.com/a/15757469/79485 A possible workaround, as of the link above, might be to capture any further onReady event, and then handling these with a initialisation of the "new" player with the state the "old" player was in (position, volume etc..). I will try to play with the above stackblitz example in this direction. |
Okay this is a completely new use-case. I never tested teleportation in Vue using this library. I will take a look at it, but I really can't say if this is fixable or not. Also let me know, if you made any progress yourself. |
I now ended up living with it for the time being, with the only resolution to actually also recreate my playback wrapper when teleportation occurs. This ensures for me, that all my handling code also gets recreated and attaches properly to the (new) vue-youtube instance. It currently does not recreate state like playback and exact position. It's good enough for me. Here's my real live code for this: https://github.com/suterma/replayer-pwa/blob/72fbdfbf20454e035dfa3621728c568aea0f74e6/src/components/track/MediaTrack.vue#L665 I will currently leave it at this. Feel free to close. |
We might be able to store the state (have to figure out what needs to be included) in the manager. We could then maybe provide some helper methods to restore the state after teleportation finished. |
In my app, I would like to teleport the playing video to a "widget" area at times, using Vue's built in
Teleport
component.Here is some example code:
One caveat is playback when actually teleporting. The created player is reset on teleportation. To see the effect, start the video, then toggle teleportation. The playback is not continuous, but gets interrupted by a reset/recreated player.
The full example from above: https://stackblitz.com/edit/vue-youtube-teleportation?file=index.html
NOTE: To actually load the video, you need to use the "Open in New Tab" button.
Observations:
The optimal solution would be to have just continuous playback all the time, regardless of the teleportation. Maybe this is also more of Vue or teleportation issue. Maybe there something like a "silent" teleportation" that does not trigger some event down to child components?
The text was updated successfully, but these errors were encountered: