Amazon Vinyl
    Preparing search index...

    Class TrackBase<EventMap, ConfigType>Abstract

    A base class for all tracks.

    Type Parameters

    Hierarchy (View Summary)

    Implements

    Index
    _error: Error | null = null

    Sets on handleError, cleared on 'reset'.

    disposer: Disposer = ...
    drmSessionAbort: AbortSlot = ...
    loadOptions: Maybe<ConfigType> = null

    The current load options, if this is an active track.

    logPrefix: string = ...

    A string prefix for all log statements made by this target.

    type: string

    The track type.

    uri: string

    The identifier of this track, used as the key in the track cache.

    • get extra(): any

      Returns the extra object from the load configuration's config when this track is active, or null if this track is not active.

      Returns any

    • Sets this track as active, deactivating any currently active track. This should set sources on the playback source and add any listeners needed for shared resources.

      Parameters

      • loadOptions: Maybe<ConfigType>

        Configuration from TrackLoadOptions.config, provided by the Application.

      Returns void

    • Sets this track as inactive. This should unset sources, and remove any listeners. Tracks do not implement disposable, when they are deactivated they are expected to be free for garbage collection if there are no longer references to the track.

      Returns void

    • Dispatches an event.

      Type Parameters

      • K extends string | number | symbol

      Parameters

      • type: K

        The key of the event within EventMap

      • event: EventMap[K]

        If the passed event is read-only, then it may be re-used/cached. Otherwise, it should be a new event object every dispatch. If no target property is set on the event, the target will be set to this host.

      Returns void

    • The track has been activated. Operations on shared resources such as the playback controller may only be done while the track is currently active. For example if there is a loading operation before the playback source is set, isActive must be checked before the property is changed.

      Parameters

      Returns void

    • Resets the track to recover from error states. Base implementation does nothing.

      Overrides should dispatch 'reset' after resetting error state.

      Parameters

      • hard: boolean = false

      Returns void