slidev icon indicating copy to clipboard operation
slidev copied to clipboard

Sync presenter and play mode

Open arnoson opened this issue 4 years ago • 1 comments

I'm not sure if I'm missing something, but the presenter and play mode are not in sync. For example: when using the starter presentation and increasing the counter in the Components slide, the counter value doesn't update in the play mode window. The same problem occurs when using layout: iframe. If I scroll the website, the scroll position isn't in sync.

Would be awesome if all mouse/keyboard events from the presenter mode are synced with the play mode. Otherwise I can't really see the usecase for presenter mode when working with interactive slides.

arnoson avatar Feb 18 '22 18:02 arnoson

It can be quite complicated to create a universal solution.

Currently there are multiple synchronized states between the view mode and the presenter mode:

  • a shared state containing:
    • the page
    • the click (of v-click/v-clicks/v-after elements)
    • the mouse position
  • a drawing state for the drawings

You can create a custom button component that will used the shared state if you want to share the state of the counter between both modes. Here is an example of an external component that adds some data in that state: https://github.com/Smile-SA/slidev-component-spotlight/blob/main/src/slidev-spotlight.vue

It's more simple to share a state than to share an event. If we try to synchronize events, there still be some cases where it would not work. For exemple some actions in the browser requires that a real user is at the origin of the event and it will not work if the event is triggered programmatically. And want event should we synchronize ? Only clicks ? But what about hover effects...etc.

tonai avatar May 05 '22 14:05 tonai

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 14 '22 17:09 stale[bot]