Skip to content

Module: src/util/PerformanceMonitor

Displays a small overlay with real-time FPS & video rendering stats inside the VisionPlayer UI.

Version
1.0.0
Author
Frank Kudermann - alphanull
License
MIT
Requires
DomSmith
Looper
Source
PerformanceMonitor.js, line 13

Constructor

new PerformanceMonitor(player, parent, optionsopt)

Creates an instance of the PerformanceMonitor component.

Parameters:
Name Type Attributes Description
player Player

Reference to the VisionPlayer instance.

parent Player

Reference to the parent instance.

options Object optional

Additional options.

Parameters:
Name Type Attributes Description
apiKey symbol optional

Token for extended access to the player API.

Members

Reference to the VisionPlayer instance.

Type
Player
Source
PerformanceMonitor.js, line 19

Secret key only known to the player instance and initialized components. Used to be able to restrict access to API methods in conjunction with secure mode.

Type
symbol
Source
PerformanceMonitor.js, line 26

Text line with latest dropped frame info.

Type
string
Source
PerformanceMonitor.js, line 32

Previously recorded totalVideoFrames value.

Type
number
Source
PerformanceMonitor.js, line 38

Previously recorded droppedVideoFrames value.

Type
number
Source
PerformanceMonitor.js, line 44

DomSmith instance holding the floating stats overlay.

Type
DomSmith
Source
PerformanceMonitor.js, line 50

Render Loop Instance, used for updating the scrubber.

Type
Looper
Source
PerformanceMonitor.js, line 56

ID for the stats loop.

Type
number
Source
PerformanceMonitor.js, line 62

Methods

private #update()

Update loop, runs every 1 second. Updates FPS and video quality stats (if supported).

Source
PerformanceMonitor.js, line 107

destroy()

Teardown and cleanup.

Source
PerformanceMonitor.js, line 135