Sportradar-AV-Player - v2.5.5
    Preparing search index...

    Class VideoPlayer

    Implements

    • Player
    Index
    • Returns true if player can handle media by any of the handlers, false if not.

      Parameters

      • url: any

        Can be a string or an object containing url and mimetype

      • OptionalmimeType: string

        Optional parameter denoting the mime-type of stream

      Returns boolean

    • Disables the overlay when casting on Chromecast

      Returns any

    • For dispatching events on player from outside of this file

      Parameters

      • event: string
      • Optionalpayload: any

      Returns void

    • Parameters

      • eventName: string
      • ...payload: any

      Returns void

    • Exits Picture-in-Picture when document.pictureInPictureEnabled is true.

      Returns Promise<void>

    • Returns the acive video handler used by the player

      Returns VideoHandlerBase

    • Returns the active handler being used by the player

      Returns string

    • Returns number

    • Returns the current buffer size from the handler

      Returns number

    • Returns an array of audio tracks available containing : - index, label, language and enabled information

      Returns AVVPLAudioTrack[]

    • Returns whether the autoplay overlay has been shown

      Returns boolean

    • Returns the bandwidth used by player to load the fragment, if available

      Returns number

    • Returns the browser's autoplay policy status (allowed/not allowed)

      Returns boolean

    • Get the config used by the player

      Parameters

      • selectedStreamId: number = 0

      Returns PlayerConfig

    • Returns the index of the active audio track. Returns 1 if no alternative audio tracks

      Returns number

    • Return the current playing frame in the video stream

      Returns number

    • Returns current playback rate of the video stream.
      Note: Always returns 1 if playback rate switch is disabled.

      Returns number

    • Returns current program datettime value in string(for hls streams, if available)

      Returns string

    • Returns the index of the active quality level

      Returns number

    • Returns the current playback time of the stream.

      Returns number

      Time in seconds

    • Returns player's current height and width in pixels

      Returns { height: number; width: number }

    • Returns the next quality index (current quality index + 1), if player not playing the highest bitrate

      Returns string | number

    • Returns the duration of the stream.

      Returns number

      Time in seconds

    • Returns current frames per second of the stream, if available

      Returns number

    • Returns number of dropped frames

      Returns number

    • Returns instance of handler created, if available

      Returns any

    • Returns the video and audio codec information, if available

      Returns any

    • Gets the live edge value of the stream.

      Returns number

      The live edge value, or null if the handler is not set.

    • Returns the video and audio codec information, if available

      Returns any

    • Returns any

    • Returns current segment that is being played - applicable for DASH and HLS

      Returns number | PlayingChunk

    • Returns an array of available quality levels of the video

      Returns number[]

    • Returns an array of requested segments - applicable for DASH and HLS

      Returns number[]

    • Returns resolution of the video being played back

      Returns string

    • Return image data of the snapshot taken from video frame

      Parameters

      • width: number

        Width of the snapshot image

      • height: number

        Height of the snapshot image

      Returns ImageData

    • Returns title of the player

      Returns string

    • Returns the buffer time set into player by config

      Returns number

    • Returns current version of the player

      Returns string

    • Returns the HTMLVideoElement used by the player

      Parameters

      • videoContainerId: number = 0

      Returns HTMLVideoElement

    • Returns 1 if 50% of the player is in view and is in the active tab, 0 otherwise

      Returns number

    • Returns the volume of the audio in the stream

      Returns number

    • Seek to particular frame number in the video stream

      Parameters

      • frameNum: number

        Frame number to which the player should seek to

      Returns void

    • Seek to next frame in the video stream

      Returns void

    • Seek back to previous frame in the video stream

      Returns void

    • Toggles Picture-in-Picture when document.pictureInPictureEnabled is true. If the video element is already in Picture-in-Picture mode, it exits Picture-in-Picture mode.

      Returns Promise<void>

    • Returns true if player is rendered in full screen, false otherwise

      Returns boolean

    • Returns true if the stream has multiple video playback qualities, false otherwise

      Returns boolean

    • Returns the mute state of the stream loaded in the player

      Returns boolean

    • Return if the videplayer is in paused state

      Returns boolean

    • Checks if the user is idle on screen.

      Returns boolean

      Returns true if the user is idle, false otherwise.

    • Returns false for live streams, true otherwise

      Returns boolean

    • Tries to load the stream with any of the handlers.

      
       url: "https://example.com/stream.m3u8"
       (or)
       url: {
           standard: "https://example.com/standardStream.m3u8",
           augmented: "https://example.com/augmentedStream.mpd"
       }
       

      May be called immediately after setupPlayer(); if the player is not ready yet, the request is queued and applied when handlers are registered ("loaded").

      Parameters

      • url: string | PlayerLoadUrl

        Stream url string or object containing multiple stream feed

      • Optionaloptions: PlayerLoadOptions

        (Optional)

        • options.videoContainerId (Optional) sets the videocontainerId for MV overlay and the start time for loading a stream
        • options.startTime (Optional) The start time for loading the stream at
        • options.standardFeedFirst (Optional) Whether to load the standard feed first when multiple feeds are provided

      Returns void

    • Stop listening to the event

      Parameters

      • eventname: string

        The name of the event to remove the listener for.

      • Optionalcallback: (payload?: any) => void

        An optional callback function to be executed after removing the listener.

      Returns any

      The result of the operation.

    • Adds an event listener for the specified event name.

      Parameters

      • eventname: string

        The name of the event to listen for.

      • Optionalcallback: (payload?: any) => void

        An optional callback function to be executed when the event is triggered.

      Returns any

      The result of the event listener registration.

    • Adds a one-time listener function for the specified event.

      Parameters

      • eventname: string

        The name of the event to listen for.

      • Optionalcallback: (payload?: any) => void

        An optional callback function to be executed when the event is triggered.

      Returns any

      Returns null.

    • Pause Ad while one is playing

      Returns void

    • Pauses the video loaded into the player

      Parameters

      • index: number = 0

      Returns void

    • Plays the video loaded into the player

      Parameters

      • index: number = 0

      Returns Promise<any>

    • Reload player with new config

      Parameters

      Returns void

    • Removes the player. Ensures player stops playback and DOM is cleared up

      Returns void

    • Remove all events from handler

      Returns void

    • Video will be reset to its original size

      Returns void

    • Stop listening to the event and listen right back to it with the specified event name and callback function.

      Parameters

      • eventname: string

        The name of the event to resubscribe to.

      • Optionalcallback: (payload?: any) => void

        An optional callback function to be executed when the event is triggered.

      Returns void

    • Resume Ad when it is in paused state

      Returns void

    • Seeks to the specified progream Datetime during runtime(for hls streams, if available)

      Parameters

      • time: string

        ProgramDateTime to seek to, format: "2019-02-19T14:54:23.031+08:00"

      Returns void

    • Sets the flag indicating the autoplay overlay has been shown

      Parameters

      • shown: boolean

      Returns void

    • Sets the browser's autoplay policy status

      Parameters

      • allowed: boolean

      Returns void

    • Change the audio track to the track provided in the given index

      Parameters

      • idx: number

      Returns void

    • Change the quality level to the bitrate provided in the given index

      Parameters

      • idx: number

        The index of the quality to set.

      Returns void

    • Sets the current playback time of the stream.

      Parameters

      • time: number

        Time in seconds

      Returns void

    • Video will be ended at the specified time passed the parameter

      Parameters

      • time: number

        Time in seconds at which the video must end

      Returns void

    • Sets the element on which fullscreen must be applied

      Parameters

      • el: HTMLElement

      Returns void

    • Sets / Toggles mute state of the stream loaded in the player

      Parameters

      • OptionalisMuted: boolean

        is optional - If not set, the player simply toggles the mute state

      • selectedStreamElement: number = 0

      Returns void

    • Set player config options

      Parameters

      Returns void

    • Sets the playback rate of the stream to the value passed.

      Parameters

      • playbackRate: number

        Speed at which video must stream (> 0)
        Possible to set the rate only if enablePlaybackRate is set to true in config.
        Note: Only valid for VOD streams and non-flash streams.

      Returns void

    • Video will be shrinked to the perecentage passed as paramter

      Parameters

      • percent: number

        Percentage in number to which the size of video must be shrinked to

      Returns void

    • Set volume of the audio in the stream

      Parameters

      • volume: number

        Volume to be set on the player between 0-100

      Returns void

    • Parameters

      • show: boolean

      Returns void

    • Shows/hides timeline markers when enabled via API

      Parameters

      • show: boolean

      Returns void

    • Stops the video loaded into the player

      Parameters

      • index: number = 0

      Returns void

    • Toggles the fullscreen mode of the video player.

      Parameters

      • Optionalelem: HTMLElement

        The HTML element to toggle fullscreen on. If not provided, the player's wrapper element will be used.

      Returns void

    • Toggles the play/pause state of the player.

      Parameters

      • isPlaying: boolean

        A boolean indicating whether the player is currently playing.

      Returns void

    • Reload the external overlay contents set via config htmlOverlay

      Parameters

      • Optionalhtml: string
      • Optionalcss: string

      Returns void