Giter Club home page Giter Club logo

Comments (7)

avayvod avatar avayvod commented on July 1, 2024

Some combinations don't make sense, do they? E.g. { transient: false, mixable: true }

from mediasession.

richtr avatar richtr commented on July 1, 2024

There's a certain simplicity in having a kind of media session.

As a web dev, I would much prefer to do new MediaSession('content') (or potentially even new MediaSession('music')) than new MediaSession({transient: false, mixable: false, pauseInBackground: false}).

These bools/enums also don't capture other behaviors like whether you want media key access or want to show interfaces in the notification or lock screen.

There is probably a compromise in here, where var session = new MediaSession('content') actually lists readonly properties of the media session as per your proposal (e.g. session.mixable === false, session.pauseInBackground === false, session.hasRemoteControls === true, etc).

from mediasession.

foolip avatar foolip commented on July 1, 2024

For the combinations that don't make sense, we could throw an exception or (preferably) just coerce it into a state that does make sense, so new MediaSession({transient: false, mixable: true}) would give a session where both transient and mixable are false.

from mediasession.

foolip avatar foolip commented on July 1, 2024

For some context, my concern here is that we'll have to double the number of kinds if a new aspect of media sessions are added, or have a mix of kind and bools. There is already one somewhat sensible thing we cannot express, namely a non-transient session that interrupts other playback, like content, but which also automatically pauses and resumes when it goes into the background, like ambient.

from mediasession.

doomdavve avatar doomdavve commented on July 1, 2024

Fwiw, foolip's last use case is present and called SoloAmbient on iOS.

from mediasession.

richtr avatar richtr commented on July 1, 2024

There is already one somewhat sensible thing we cannot express, namely a non-transient session that interrupts other playback, like content, but which also automatically pauses and resumes when it goes into the background, like ambient.

Something like ambient-solo?

Fwiw, foolip's last use case is present and called SoloAmbient on iOS.

But it is not called {transient: false, mixable: false: pauseInBackground: true}.

from mediasession.

foolip avatar foolip commented on July 1, 2024

Since we have not been able to actually come up with something better here, I'm going to close this.

@domenic, I know you supported this idea, so if you have some ideas for improvement please just suggest it and we'll try it out.

from mediasession.

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.