-
Notifications
You must be signed in to change notification settings - Fork 20
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
Specify the transition between the local and remote playback when changing remote.state #25
Comments
Perhaps I'm misunderstanding, but ideally wouldn't the local- and remote-player states always be synchronized? Wouldn't then the last rule be unnecessary? |
Yes, as long as we're talking about the media element and its state exposed to the webpage. I believe I meant the backend for the local playback under "local player" which could just be suspended until the remote playback is stopped and then synchronized with the remote playback state to continue from there. |
It would be nice if calls to A tricky one is seeking, since that's defined in terms of a bunch of state that might be different on the remote side. I suppose seeking would have to just remember the requested time and base nothing on the local state until the connection is complete. |
@foolip, I think that the idea here is that while connecting, all commands go to the local playback. That way, the developer can keep the playback running or can stop it while the connection is being made. |
Hmm, so what seeking, which it can begin before the connection is complete, but doesn't finish locally until after? |
I guess the local player state would change. Whether the network request related to the seek should be cancelled should probably be an implementation detail. When switching to |
It would be hard to get it into the same state, because it's locally showing a frame for time This is a basic question, but what happens to the local side when the connection is complete? If its internal media player is destroyed (perhaps to be recreated later) then all is well, but if it lives on then it might end up somewhere other than at the official playback position, but I guess restoring the remote state to local when disconnecting should take care of that? |
I guess in practice we'll bind the local state and remote states in this case to the external APIs/controls/UI, not the internal/remote media player - when one seeks, the UI/controls usually move to the target position so when the local state will be transferred to the remote playback device once the UA is connected to it, the seek for the target position will be sent to the remote playback device and the controls will reflect the remote player state immediately afterwards. Not sure if seek/fastSeek changes the page visible attributes of the media element to the desired position immediately or if there're some events that need to happen before that. In the latter case, the UA will have to remember to send these events and update the position once the remote player updates it. |
Setting I don't thing any of this will be very hard to sort out, but it does mean that one may have to decide whether to seek the remote to the requested position or the actual position in case a seek finishes during the connecting phase. |
I think this is fixed by #49 although we could be more explicit about what's included in the state, perhaps. Let's file a new issue if we feel so. |
A spin-off from the issue #3:
state
is "disconnected" or "connecting", all interaction with HTMLMediaElement is forwarded to/from the local playerstate
is "connected", all interaction with HTMLMediaElement is forwarded to/from the remote playerstate
changes from "connecting" to "connected", the last known state of the local player is passed to the remote playerstate
changes from "connected" to "disconnected", last known state of the remote player is passed to the local player@foolip are there any methods we'd need to disable in "connecting" state? (for example, pause() is allowed but play() could be rejected)?
The text was updated successfully, but these errors were encountered: