Skip to content

Module: src/util/Debug

The Debug component provides internal diagnostics during player initialization and runtime. It logs basic environment and state data and helps developers debug player behavior by monitoring events and inspecting supported media formats. While not intended for end users, this component can be very useful during development, testing, or when troubleshooting media playback issues. Note that this component is usually not included in the regular production builds.

Version
1.0.0
Author
Frank Kudermann - alphanull
License
MIT
Source
Debug.js, line 13

Constructor

new Debug(player)

Creates an instance of the Debug component.

Parameters:
Name Type Description
player Player

Reference to the VisionPlayer instance.

Members

Contains configuration options for this component.

Properties
Name Type Attributes Default Description
logMediaEvents boolean optional true

Logs media related events, i.e. Event topic starts with media.

logPlayerEvents boolean optional true

Logs all other events, except for media related events, like player/ready.

verboseLogging boolean optional false

Enables verbose logging, i.e. Additional 'spammy' events like media/progress are logged via console.debug.

Type
Object
Source
Debug.js, line 22

Reference to the main player instance.

Type
Player
Source
Debug.js, line 32

Holds tokens of subscriptions to player events, for later unsubscribe.

Type
Array<number>
Source
Debug.js, line 38

Methods

private #logEvent(data, topic)

Logs events coming from the debug mode to the console.

Parameters:
Name Type Description
data Object

Data object from the event.

topic string

The pubsub event topic (e.g., "media/play", "media/error").

Source
Debug.js, line 67

destroy()

Cleans up the Debug component by unsubscribing from events.

Source
Debug.js, line 114

static canPlayTest(player)

Determines all MIME type formats the client can (probably) play and displays the results in the console.

Parameters:
Name Type Description
player Player

Reference to the media player instance.

Source
Debug.js, line 124