-
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
RemotePlaybackState enum can become misleading when changing media.src #125
Comments
This came up in the context of a recent bug report where YouTube.com is playing a video playlist in Safari while playing back wirelessly to an AppleTV, so this is a real world problem affecting a well-visited media site. |
CC @mounirlamouri for his thoughts. This proposal seems reasonable to me. Thinking through how resumption would work: if the video gets an We could add some additional |
Instead of adding a new state, could we add information to the disconnect event that explains why the disconnection happened? |
@mounir said "Instead of adding a new state, could we add information to the disconnect event that explains why the disconnection happened?" I'm not sure how that simplifies things. |
My concern is that by introducing a new state, it makes things more confusing. I see the
Is it what we want though? If we tell the page what happened, shouldn't we let the page decide? |
To answer your question with another question, can you go from So, can you go from
As I said above, there's a hole in that flow, namely around UA-driven remote playback. I also think it's weird that every time a page gets a "disconnected" event, they have to check some status code to try and tell if the disconnection is recoverable. Another is that a) |
I guess there is one key implementation point: I would assume that when receiving data that isn't compatible, the UA would disconnect from the remote screen and wouldn't attempt to auto-reconnect but instead leave it to the website to decide. You seem to suggest that the UA should keep a connection alive and attempt reconnecting as soon as possible. Is that correct? |
This is currently the platform behavior of AirPlay on iOS yes. I'm not saying that the spec should require this behavior, but the spec should allow this behavior to occur. That said, the only specced mechanism for a website to trigger remote playback is the |
This was discussed during the Second Screen WG F2F in Fukuoka. Main options raised during that meeting:
Also the point was made that supporting source switching may actually be optional. |
@jernoble I see that you have the API enabled in a Tech Preview but a look at the WebKit code shows that you haven't added a new event/state. Did you go with one of the solutions above or is this still something to be decided? |
Still to be decided. |
Having a quick look at the spec again, I would like to propose this simple addition: @jernoble WDYT? |
I have a counter-proposal: rather than sending across the current element URL, which may or may not be supported by the remote device, the UA should send over all the |
To be sure I understand, you are suggesting that the remote device runs the source selection algorithm and be sent all the information it needs instead of having the UA decide what to send? The idea of it sounds fine. I guess the spec could be more vague and just say that the UA and the remote device should pick the right source based on the currently available sources. @jernoble is my understanding correct? FWIW, I thought that in your case, you would want to swap from MSE to HLS or something like that. I thought that these would use @mfoltzgoogle would you have any recommendation based on your work on Open Screen? |
Yes, that's pretty much correct. And you're right that the spec could be pretty vague on this point, and just refer back to HTML to the source selection algorithm. And yes, this would require sites to use multiple |
I'm happy with this approach. I will sync with @mfoltzgoogle and send a pull request this week for review. |
From an Open Screen point of view, this sounds fine. The protocol allows multiple media resources to be sent with the remote playback start request, at which point the Open Screen receiver can use its own source selection logic to decide what to play. Here is the relevant section of the protocol spec (paragraph starting with "When section 6.2.4 says...") Of course, if the user agent isn't using the Open Screen protocol, then it can use whatever mechanism it has to negotiate with the remote playback device which source to play (like knowing that certain devices support certain sources or not). |
The steps for
prompt()
allow the promise returned to be rejected withNotSupportedErr
if the media element cannot support remote playback. This allows, e.g., UAs which support MSE to indicate that a media element backed by a MediaSource cannot be played back remotely, and further allows sites to switch to file-based playback. But a page that changes the media's src/srcObject from a file-based URL to a MediaSource would only get a"disconnect"
event, and would be unable to tell whether the user explicitly disconnected the remote playback session or whether the new src is unsupported.This could be mitigated by adding a new
RemotePlaybackState
enum, such as (straw man)"unsupported"
, with a matching"unsupported"
andonunsupported
message and event handler.Sites who start loading a media element with a file-based URL, successfully initiate remote playback with
prompt()
, and then switch the src/srcObject to a MediaSource would (straw man) receive a"unsupported"
message which would allow them to switch back to a file-based URL.The text was updated successfully, but these errors were encountered: