Open josch opened 1 year ago
First and foremost, as I mentioned in that syncplay issue, this functionality (WebSocket communication) is considered very new and message syntax may be changed before we reach an API stable Clapper 1.0 version release. Please bear that in mind if you want to already start working on it.
When designing the webrtc protocol this feature should probably be kept in mind?
Yes, it should. Same probably goes for MPRIS too. The latter one needs checking how other apps or spec says to do it correctly.
query the position and playback status
The design I have in mind is to send the current media info (with these) upon client connection/reconnection and later only inform client with changes/updates in real time. So, I hope that there will be no need for query, but we might add a request to send media info again if necessary.
send an unsolicited message when playback status changes
This already happens.
When #374 is done and merged, it should be a better alternative then websocket communication for your use-case, as:
I'm working on adding clapper support to syncplay. In https://github.com/Syncplay/syncplay/issues/577 @Rafostar suggested to use the webrtc interface to communicate with clapper. I'm opening this issue to track the missing features of clapper for successful integration with syncplay. Let me start with a couple of thoughts:
I have implemented a minimal clapper interface for syncplay using dbus. From that experience I can tell that the webrtc interface needs to support at least:
{"action":"set_playlist","value":["file:///path/to/video.mp4"]}
{"action":"seek","value":$time_in_ns}
{"action":"play"}
and{"action":"pause"}