Coder Social home page Coder Social logo

Comments (10)

jernoble avatar jernoble commented on June 12, 2024

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?

from remote-playback.

avayvod avatar avayvod commented on June 12, 2024

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.

from remote-playback.

foolip avatar foolip commented on June 12, 2024

It would be nice if calls to play() or pause() while connecting still take effect remotely after connecting, or locally if the setup fails. Otherwise you'll likely have in-page UI with play/pause buttons that don't know about this odd in-between state and it just seems flaky to the user.

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.

from remote-playback.

mounirlamouri avatar mounirlamouri commented on June 12, 2024

@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.

from remote-playback.

foolip avatar foolip commented on June 12, 2024

Hmm, so what seeking, which it can begin before the connection is complete, but doesn't finish locally until after?

from remote-playback.

mounirlamouri avatar mounirlamouri commented on June 12, 2024

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 connected, the remote playback should be in the same state as the local playback. In this case, it will also use the new seek position. Does that make sense?

from remote-playback.

foolip avatar foolip commented on June 12, 2024

It would be hard to get it into the same state, because it's locally showing a frame for time x but trying to seek to time y. While looking into seeking I filed whatwg/html#1362 but if that were fixed, I think that one could simply try to seek the remote to the official playback position after connection.

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?

from remote-playback.

avayvod avatar avayvod commented on June 12, 2024

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.

from remote-playback.

foolip avatar foolip commented on June 12, 2024

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.

Setting currentTime also sets the "official playback position" which will cause currentTime to immediately return that same value. There's also the seeking attribute that becomes true immediately.

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.

from remote-playback.

avayvod avatar avayvod commented on June 12, 2024

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.

from remote-playback.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.