@ceeblue/wrts-client
    Preparing search index...

    Class RTSReader

    RTSReader to unserialize RTS container

    Format: MEDIA PACKET -- (7bit packetSize)[7bit trackId+1 << 2 | type](7bit firstTime)[7bit duration << 2 | hasCompositionOffset<<1 | isKeyFrame](7bit compositionOffset) [frame] -- DATA PACKET -- (7bit packetSize)[7bit trackId+1 << 2 | type][7bit time] [frame] -- INIT TRACKS -- (7bit packetSize)[7bit 0 << 2 | 3] (7bit audioTrackId+1)(7bit videoTrackId+1)-- METADATA -- (7bit packetSize)[7bit 0 << 2 | 0] [meta] --

    packetSize => optional packet size trackId => track id type = [0, 1, 2, 3] = [Data, Audio, Video, Reserved] firstTime => timestamp only the first time per track after a INIT TRACKS signal time => data time compositionOffset => composition offset frame => binary frame payload meta => JSON metadata payload

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    log: ILog

    Start a log

    a Log object with the levels of log to call

    Methods

    • Event unsubscription

      Parameters

      • name:
            | "sample"
            | "error"
            | "metadata"
            | "Error"
            | "Metadata"
            | "InitTracks"
            | "Sample"
            | "inittracks"

        Name of event without the 'on' prefix (ex: 'log' to 'onLog' event declared)

      • event: Function

        Unsubscriber Function, must be the one passed to on or once subscription methods

      Returns boolean

    • Event subscription

      Parameters

      • name:
            | "sample"
            | "error"
            | "metadata"
            | "Error"
            | "Metadata"
            | "InitTracks"
            | "Sample"
            | "inittracks"

        Name of event without the on prefix (ex: log to onLog event declared)

      • event: Function

        Subscriber Function

      • Optionaloptions: { signal?: AbortSignal }
        • Optionalsignal?: AbortSignal

          Optional AbortSignal to stop this or multiple subscriptions in same time

      Returns void

    • Event subscription only one time, once time fired it's automatically unsubscribe

      Parameters

      • name:
            | "sample"
            | "error"
            | "metadata"
            | "Error"
            | "Metadata"
            | "InitTracks"
            | "Sample"
            | "inittracks"

        Name of event without the on prefix (ex: log to onLog event declared)

      • event: Function

        Subscriber Function

      • Optionaloptions: { signal?: AbortSignal }
        • Optionalsignal?: AbortSignal

          Optional AbortSignal to stop this or multiple subscriptions in same time

      Returns void

    • Children class must implement the parsing logic, and returns how many bytes have to be kept.

      Parameters

      • packet: Uint8Array

        the binary to parse

      Returns number

    Events