Comments (5)
In WebKit, there is support for passing
null
instead as a means of clearing the position state
I don't think this is valid to pass a null dictionary member as a method argument, WebKit implementation should probably be updated.
I think Chrome is supporting both setPostionState()
and setPositionState({})
to clear the state.
But the latter throws in WebKit so maybe we could outlaw it.
If we agree on this, one possible WebIDL is:
dictionary MediaPositionState {
required double duration; // make it required
double playbackRate = 1; // add a default value
double position = 0; // add a default value
}
partial interface MediaSession {
undefined clearPositionState(); // needed?
undefined setPositionState(); // clear state, same as above
undefined setPositionState(MediaPositionState state); // set state
}
from mediasession.
Is there a reason WebKit needs to throw on setPositionState({})
? The spec currently allows the website to send an empty MediaPositionState to clear it and only requires duration to be set for a non-empty MediaPositionState, which feels reasonable to me, and then the interface is just:
partial interface MediaSession {
undefined setPositionState(optional MediaPositionState state = {});
}
from mediasession.
@steimelchrome, what you propose (with addition of @youennf's defaults) sounds quite reasonable to me and, as @youennf points out, it indeed does away with the need for clearPositionState()
.
We can update WebKit to match. Would you match it in Chrome?
from mediasession.
I think the required
on duration
would prevent that from working, right? Should we remove that and then in the setPositionState()
steps insist that duration must exist if the given position state is not empty?
from mediasession.
Yes, that would make sense, and it would be easy to enforce.
from mediasession.
Related Issues (20)
- Should there be a toggle screenshare action? HOT 5
- What is the relationship between toggle microphone/camera actions and MediaStreamTrack mute/unmute events? HOT 11
- Introduce a MediaSession task source HOT 1
- Support multiple devices to support Video Conferencing use cases HOT 20
- Should toggle capture actions expose the new capture state?
- Details dictionary parameters description could be more precise HOT 1
- #320 broke IDL: MediaSessionActionHandler can only use the base MediaSessionActionDetails but not any extensions
- Broken references in Media Session
- Replace uses of "browsing contexts" with "navigables"?
- [SameObject] should not be used in FrozenArray attributes HOT 5
- Using MediaSession without playing audio? HOT 2
- MediaSessionActionHandler callback's type is never correctly chosen HOT 2
- The update capture state algorithm needs refinement HOT 2
- The spec should state that capture related actions should generally have a source target
- Horizontal reviews
- Android Webview Support
- Allow websites to disable default action handlers HOT 4
- Missing tasks in parallel steps in Media Session
- Make "skipad" action more generic
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 mediasession.