Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TwitchEmbed

A TS wrapper for the Twitch interactive media player, that can also include the chat.

Hierarchy

  • TwitchEmbed

Index

Constructors

constructor

Properties

Private Readonly _divId

_divId: string

Private Readonly _embed

_embed: Embed

Private Readonly _player

_player: TwitchPlayer

Private Readonly _twitchEmbedOptions

_twitchEmbedOptions: TwitchEmbedOptions

Accessors

divId

  • get divId(): string

twitchEmbedOptions

Methods

addEventListener

  • Adds an event listener for the given event.

    Parameters

    • event: TwitchPlayerEvent

      The event type to which the listener should react.

    • callback: () => void

      The logic that should happen when the listener fires.

        • (): void
        • Returns void

    Returns void

disableCaptions

  • disableCaptions(): void
  • Disables the captions for the content that is currently playing.

    deprecated

    Use with caution, not inculded in the official Twitch documentation.

    Returns void

enableCaptions

  • enableCaptions(): void
  • Enables the captions for the content that is currently playing.

    deprecated

    Use with caution, not inculded in the official Twitch documentation.

    Returns void

getChannel

  • getChannel(): string | undefined

getChannelId

  • getChannelId(): string | undefined

getCollection

  • getCollection(): string | undefined

getCurrentTime

  • getCurrentTime(): number

getDuration

  • getDuration(): number

getEnded

  • getEnded(): boolean

getMuted

  • getMuted(): boolean

getPlaybackStatistics

  • Retrieves the playback statistics for this player. The statistics contain information such as video FPS, resolution, latency and dropped frames.

    deprecated

    Use with caution, not inculded in the official Twitch documentation.

    Returns PlaybackStatistics

getPlayer

getQualities

getQuality

  • getQuality(): string

getVideo

  • getVideo(): string | undefined

getVolume

  • getVolume(): number

isPaused

  • isPaused(): boolean

pause

  • pause(): void

play

  • play(): void

seek

  • seek(timestamp: number): void
  • Seeks to the specified timestamp (in seconds) in the video and resumes playing if paused. Does not work for live streams.

    Parameters

    • timestamp: number

      The specified timestamp (in seconds).

    Returns void

setChannel

  • setChannel(channel: string): void

setChannelId

  • setChannelId(channelId: string): void

setCollection

  • setCollection(collectionId: string, videoId?: undefined | string): void
  • Sets the collection to be played. Optionally also specifies the video within the collection, from which to start playback. If a video ID is not provided here or the specified video is not part of the collection, playback starts with the first video in the collection.

    Parameters

    • collectionId: string

      The identifier for the collection.

    • Optional videoId: undefined | string

      The identifier for the video.

    Returns void

setMuted

  • setMuted(muted: boolean): void
  • If true, mutes the player; otherwise, unmutes it. This is independent of the volume setting.

    Parameters

    • muted: boolean

      If true, player will be muted. Otherwise, it will be unmuted.

    Returns void

setQuality

  • setQuality(quality: string): void
  • Sets the quality of the video. quality should be a string value returned by getQualities.

    Parameters

    • quality: string

      The quality to be set.

    Returns void

setVideo

  • setVideo(videoID: string, timestamp: number): void
  • Sets the video to be played to be played and starts playback at timestamp (in seconds).

    Parameters

    • videoID: string

      The identifier of the video to be played.

    • timestamp: number

      The spot where the playback will be started (in seconds).

    Returns void

setVolume

  • setVolume(volumeLevel: number): void
  • Sets the volume to the specified volume level, a value between 0.0 and 1.0.

    Parameters

    • volumeLevel: number

      A number between 0 and 1.

    Returns void

Generated using TypeDoc