Class: shaka.util.Stats

Constructor

new Stats(elementnon-null)

Parameters:
Name Type Description
element HTMLMediaElement
Source:

Members

(private) bandwidthEstimate_ :number

Type:
  • number
Source:

(private) bufferingTime_ :number

Type:
  • number
Source:

(private) height_ :number

Type:
  • number
Source:

(private, nullable) lastTimeUpdate_ :number

Type:
  • number
Source:

(private) loadFinished_ :number

Type:
  • number
Source:

(private) loadStarted_ :number

Type:
  • number
Source:

(private) playTime_ :number

Type:
  • number
Source:

(private, non-null) stateHistory_ :shaka.util.StateHistory

Type:
Source:

(private, non-null) switchHistory_ :shaka.util.SwitchHistory

Type:
Source:

(private) totalDecodedFrames_ :number

Type:
  • number
Source:

(private) totalDroppedFrames_ :number

Type:
  • number
Source:

(private) variantBandwidth_ :number

Type:
  • number
Source:

(private) width_ :number

Type:
  • number
Source:

Methods

(static) getEmptyBlob() → {shaka.extern.Stats}

Create an empty stats blob. This resembles the stats when we are not playing any content.
Source:
Returns:
Type
shaka.extern.Stats

getBlob() → {shaka.extern.Stats}

Create a stats blob that we can pass up to the app. This blob will not reference any internal data.
Source:
Returns:
Type
shaka.extern.Stats

getStateHistory() → (non-null) {shaka.util.StateHistory}

Source:
Returns:
Type
shaka.util.StateHistory

getSwitchHistory() → (non-null) {shaka.util.SwitchHistory}

Source:
Returns:
Type
shaka.util.SwitchHistory

(private) getSystemTimeInSeconds_() → {number}

Get the system time in seconds.
Source:
Returns:
Type
number

markEndOfLoad()

Mark the end of the load process. This should only be called after calling |markStartOfLoad|.
Source:

markStartOfLoad()

Mark the start of the load process. This call will have no visible effect until |markEndOfLoad| is called.
Source:

setBandwidthEstimate(bandwidth)

Parameters:
Name Type Description
bandwidth number
Source:

setDroppedFrames(dropped, decoded)

Update the ratio of dropped frames to total frames. This will replace the previous values.
Parameters:
Name Type Description
dropped number
decoded number
Source:

setResolution(width, height)

Set the width and height of the video we are currently playing.
Parameters:
Name Type Description
width number
height number
Source:

setVariantBandwidth(bandwidth)

Parameters:
Name Type Description
bandwidth number
Source:

updateTime(isBuffering)

Add to the time spent playing or buffering based on the time since the last call to |updateTime|. The value of |isBuffering| will control which time value is updated. The first call to |updateTime| will not add time.
Parameters:
Name Type Description
isBuffering boolean
Source: