Class MediaSession

Object
org.mozilla.geckoview.MediaSession

@UiThread public class MediaSession extends Object
The MediaSession API provides media controls and events for a GeckoSession. This includes support for the DOM Media Session API and regular HTML media content.
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static interface 
    Implement this delegate to receive media session events.
    static class 
    The representation of a media element's metadata.
    static class 
    Flags for supported media session features.
    static class 
    The representation of a media session's metadata.
    static @interface 
    Media session feature flag definitions for supported media operations.
    static class 
    Holds the details of the media session's playback state.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Create a new MediaSession for the given GeckoSession.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Get whether the media session is active.
    void
    muteAudio(boolean mute)
    Set whether audio should be muted.
    void
    Select and play the next track.
    void
    Pause playback for the media session.
    void
    Start playback for the media session.
    void
    Select and play the previous track.
    void
    Seek backward by a sensible number of seconds.
    void
    Seek forward by a sensible number of seconds.
    void
    seekTo(double time, boolean fast)
    Seek to a specific time.
    void
    Skip the advertisement that is currently playing.
    void
    Stop playback for the media session.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MediaSession

      protected MediaSession(GeckoSession session)
      Create a new MediaSession for the given GeckoSession.
      Parameters:
      session - The GeckoSession this media session is associated with.
  • Method Details