Options
All
  • Public
  • Public/Protected
  • All
Menu

YouTube Live Stream class for playing audio from Live Stream videos.

Hierarchy

  • LiveStream

Index

Constructors

  • new LiveStream(dash_url: string, interval: number, video_url: string, precache?: number): LiveStream
  • Live Stream Class Constructor

    Parameters

    • dash_url: string

      dash manifest URL

    • interval: number
    • video_url: string

      Live Stream video url.

    • Optional precache: number

    Returns LiveStream

Properties

base_url: string

Base URL in dash manifest file.

dash_timer: Timer

Timer used to update dash url so as to avoid 404 errors after long hours of streaming.

It updates dash_url every 30 minutes.

dash_url: string

Given Dash URL.

interval: number

Interval to fetch data again to dash url.

normal_timer?: Timer

Timer that creates loop from interval time provided.

precache: number

No of segments of data to add in stream before starting to loop

request?: IncomingMessage

Incoming message that we recieve.

Storing this is essential. This helps to destroy the TCP connection completely if you stopped player in between the stream

sequence: number

Segment sequence number

stream: Readable

Readable Stream through which data passes

Type of audio data that we recieved from live stream youtube url.

video_url: string

Timer used to update dash url so as to avoid 404 errors after long hours of streaming.

It updates dash_url every 30 minutes.

Methods

  • cleanup(): void
  • This cleans every used variable in class.

    This is used to prevent re-use of this class and helping garbage collector to collect it.

    Returns void

  • dash_updater(): Promise<void>
  • first_data(len: number): Promise<void>
  • Used only after initializing dash function first time.

    Parameters

    • len: number

      Length of data that you want to

    Returns Promise<void>

  • initialize_dash(): Promise<void>
  • Initializes dash after getting dash url.

    Start if it is first time of initialishing dash function.

    Returns Promise<void>

  • loop(): Promise<unknown>
  • pause(): void
  • resume(): void

Generated using TypeDoc