Class MediaSessionApiHelper

Note: instances of this class should't be constructed manually. Instead use global instance.

See

MediaSessionHelper

Hierarchy

  • MediaSessionApiHelper

Constructors

Properties

actionHandlers: Map<MediaSessionActionType, ((e) => void)> = ...

Type declaration

    • (e): void
    • Parameters

      • e: any

      Returns void

activationResults: Map<MediaSessionActionType, any> = ...
activeActions: Set<MediaSessionActionType> = ...
initialized: boolean = false
innerEventBus: DefaultEventBus<MediaSessionEvent> = ...
lastSetMediaPositionState: null | MediaSessionPositionState = null
lastSetMediaSessionMetadata: null | MediaSessionMetadata = null
setActiveActions: ((actions) => void) = ...

Type declaration

innerInstance: MediaSessionApiHelper = ...

Accessors

  • get isSupported(): boolean
  • Returns boolean

Methods

  • Returns boolean

  • Since Chrome on android loves to randomly remove notification and thus clear metadata of media session without killing js vm.

    It makes next call to setMetadata always take effect.

    Returns void

  • Since Chrome on android loves to randomly remove notification and thus clear metadata of media session without killing js vm.

    It makes next call to setPositionState always take effect.

    Returns void

  • Returns void

  • Returns errors that occurred while this manager tried to activate/deactivate actions. It includes all actions used in last call setActiveActions.

    Returns {
        length: any;
        [iterator]: any;
        anchor: any;
        at: any;
        big: any;
        blink: any;
        bold: any;
        charAt: any;
        charCodeAt: any;
        codePointAt: any;
        concat: any;
        endsWith: any;
        fixed: any;
        fontcolor: any;
        fontsize: any;
        includes: any;
        indexOf: any;
        italics: any;
        lastIndexOf: any;
        link: any;
        localeCompare: any;
        match: any;
        matchAll: any;
        normalize: any;
        padEnd: any;
        padStart: any;
        repeat: any;
        replace: any;
        search: any;
        slice: any;
        small: any;
        split: any;
        startsWith: any;
        strike: any;
        sub: any;
        substr: any;
        substring: any;
        sup: any;
        toLocaleLowerCase: any;
        toLocaleUpperCase: any;
        toLowerCase: any;
        toString: any;
        toUpperCase: any;
        trim: any;
        trimEnd: any;
        trimLeft: any;
        trimRight: any;
        trimStart: any;
        valueOf: any;
    }

    • Readonly length: any

      Returns the length of a String object.

  • Gets set of actions, which are really active. It means that they were set using setSupportedActions AND they are supported by browser.

    Returns MediaSessionActionType[]

  • Parameters

    Returns void

  • Parameters

    • state: "playing" | "none" | "paused"

    Returns void

  • Parameters

    Returns void

  • Sets actions that will be handled on event bus.

    Automatically removes actions, which are not supported by browser.

    Parameters

    Returns void

    Deprecated

    use setActiveActions instead, as this method is poorly named

Generated using TypeDoc