Comments (9)
I would be in favour of any of these options:
disableRemotePlayback
is used in theplay()
algorithm and any change afterplay()
steps are ran is ignored.disableRemotePlayback
is used likeplaybackRate
orsrc
and affects the playback (thus stops it if it is playing remotely).
@jernoble, do you have a preference? What would be the closest to Safari's behaviour?
@foolip, which solution would be the most consistent with the HTMLMediaElement spec?
from remote-playback.
I think that looking at disableRemotePlayback
only in play()
(or potentially other points) and ignoring anything that happens after that sounds good. This would be consistent with the allowfullscreen
attribute on iframes, which is checked when the iframe's browsing context is created, setting a flag, and removing the attribute after that point has no effect. (Blink/WebKit actually checks the attribute when requesting fullscreen, but still removing the attribute after that point has no effect.)
from remote-playback.
I'm not sure, why play()
should look at the attribute at all, it should be agnostic from the Remote Playback API I think. If the element is in connected
state, play is forwarded to the remote playback device, period.
How about the following (allowfullscreen-ish behavior):
- once the attribute is present:
- any call to
getAvailability()
rejects with an error - any call to
connect()
rejects with an error - user agent must not start remote playback as a result of any other event outside of the page control (default controls, external UI, system wide setting, etc)
- any call to
- when the attribute is added or removed, nothing changes w/r/t pending promises or existing availability objects or the current state of the element
Basically the page can keep observing availability and if the device selection or start remote playback algorithm has started, it can proceed.
If we want more like src-ish behavior, it could look like this (more complex so I prefer the former):
-
Once the attribute is present:
a) any call to
getAvailability()
rejects with an error
b) any call toconnect()
rejects with an error -
When the attribute is added:
a) in any state, all pending promises to
connect()
orgetAvailability()
get rejected with an error
b) any existing availability objects returned bygetAvailability()
change their value to false
c) if the state isconnecting
orconnected
, the user agent queues a task to stop remote playback if it hasn't already -
When the attribute is removed:
a) if there's any availability objects alive and the state is "disconnected", start background monitoring of available remote playback devices
b) if the state is not "disconnected", perform step 3a) when the state has changed to "disconnected" (see note below)
Note: when the stop remote playback algorithm is running, the user agent must reject all new returned promises from connect()
or getAvailability()
. So if the page starts remote playback, then adds and removes the attribute, it won't be able to start new remote playback or get availability until the current remote playback has finished. Maybe this restriction is too much though.
from remote-playback.
FWIW, I think the first behaviour makes sense and is simple.
from remote-playback.
Safari's current behavior for the equivalent feature is that the "x-webkit-wirelessvideoplaybackdisabled" attribute is "live"; setting it while a remote playback session is active will stop the session and return playback to the local device.
from remote-playback.
@jernoble would you say the second proposal from my comment above better matches the current Safari's behavior then? Would the first proposal be good enough?
from remote-playback.
Discussed at the F2F:
http://www.w3.org/2016/05/24-webscreens-minutes.html#item06
PROPOSED RESOLUTION: Use Anton's first proposal (no spec language to address this case). Add a non-normative note that existence of attribute is a hint for discovery.
PROPOSED RESOLUTION: Refine behavior of existing alg's for attribute, i.e. Promise rejections would reference it.
from remote-playback.
To be clear, is it this one?
Once the attribute is present:
a) any call to getAvailability() rejects with an error
b) any call to connect() rejects with an error
That sounds like what I was hoping for in #6 (comment) but it's quite different from what @jernoble says is Safari's current behavior.
from remote-playback.
Addressed by #49.
from remote-playback.
Related Issues (20)
- Use [Exposed=Window]
- Add explicit text to define the disableRemotePlayback content attribute
- Restrict the API to Secure Contexts or discuss the decision in Security Considerations HOT 1
- Rephrase normative statement in security and privacy consideration section HOT 1
- Compatibility of Remote Playback API with AirPlay mirroring HOT 2
- [Chrome 64] The RemotePlayback API is disabled on this platform HOT 4
- Chromecast TV not detected HOT 5
- Define remote playback interaction with background playback policies HOT 3
- Explore polyfilling Remote Playback API on top of Presentation API HOT 1
- Support for TTML and IMSC captions HOT 1
- How does remote playback interact with EME? HOT 4
- RemotePlaybackState enum can become misleading when changing media.src HOT 17
- Specify the task source for each task to be enqueued HOT 1
- [meta] Publish Proposed Recommendation HOT 2
- Allow adapting the bitrate to network/receiver constraints when using MSE
- Export terms HOT 2
- A
- render a dummy video/progress bar HOT 1
- example HOT 2
- check on the flag to activate the Remote Playback API on desktop HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from remote-playback.