Vinyl
    Preparing search index...

    Interface DrmController

    DrmController manages media keys and sessions, provides tracks a way to declare their content protections.

    interface DrmController {
        error: null | Error;
        closeSessions(): void;
        configure(options: Maybe<Partial<DrmOptions>>): void;
        hasAnyListeners(): boolean;
        hasListeners(type: keyof DrmControllerEventMap): boolean;
        initializeForPlayback(
            drmInfo: null | MediaFormatMetadata,
            abort?: ReadonlyAbort,
        ): void;
        isEmeSupported(): boolean;
        isSupported(drmInfo: MediaFormatMetadata): Promise<DrmKeySystemSupport>;
        on<K extends keyof DrmControllerEventMap>(
            type: K,
            handler: EventHandler<DrmControllerEventMap[K]>,
            options?: SignalOptions,
        ): Unsubscribe;
        reset(): void;
        setBufferingDrmInfo(
            drmInfo: null | MediaFormatMetadata,
            abort?: ReadonlyAbort,
        ): void;
    }

    Hierarchy (View Summary)

    Implemented by

    Index

    Properties

    error: null | Error

    The last error emitted. Use reset to reset error state.

    Methods

    • Clears all active DRM sessions. This should not be called unless the audio source has been cleared.

      Returns void

    • Configures this DrmController for the current track. This will override any player-level configuration.

      Parameters

      Returns void

    • Returns true if the event host has any listeners.

      Returns boolean

    • Initializes media keys if they have not yet been created and attached, creates a key session if the selected DrmProtection contains PSSH data.

      The first supported key system will be used. Once a key system has been set, it cannot be changed, all future content protections will be expected to contain the supported key system.

      Parameters

      • drmInfo: null | MediaFormatMetadata

        Format metadata for the representation. May contain content protections.

      • Optionalabort: ReadonlyAbort

        If aborted, the created session will be closed.

      Returns void

    • Returns true if Encrypted Media Extensions are supported.

      Returns boolean

    • Resets the error state.

      Returns void

    • Sets content protection data on drm controller for the currently buffering media.

      The key session will be created on the 'encrypted' event when the decoder has been initialized.

      Parameters

      • drmInfo: null | MediaFormatMetadata

        Format metadata for the representation. May contain content protections.

      • Optionalabort: ReadonlyAbort

        If aborted, the created session from an 'encrypted' event will be closed.

      Returns void