Player

A Pythonic interface for querying and controlling a MultiViewerForF1 player.

class mvf1.Player(player_dict: dict)

Encapsulate the behaviour of Player.

Attributes

id: int

Player Id.

state: str

Player state.

driver_data: dict

Player driver_data.

stream_data: dict

Player stream_data.

content_id: int

Player F1TV Content ID.

channel_id: int

Player F1TV Channel ID.

title: str

Title of stream playing in player.

bounds: dict

Player bounds.

x: float

X coordinate of player’s top left corner.

y: float

Y coordinate of player’s top left corner.

width: float

Width of player.

height: float

Height of player.

fullscreen: bool

Is player fullscreen?

always_on_top: bool

Is player always on top?

maintain_aspect_ratio: bool

Does player maintain aspect ratio?

remote: MultiViewerForF1

Interface to control MultiViewerForF1.

delete() dict

Delete this player.

Returns

dict

Response of deletion operation.

mute(muted: bool | None = None) dict

Mutes/unmutes player or specifies muted state for player.

Parameters

muted: bool, optional

Mute the player.

Returns

dict

Server response of this player’s muted state.

pause(paused: bool | None = None) dict

Pauses/unpauses player or specifies pause state for player.

Parameters

paused: bool, optional

Desired pause state of this player.

Returns

dict

Server response of this player’s pause state.

seek(absolute: int | None = None, relative: int | None = None) dict

Seeks this player’s timestamp to an absolute or relative position.

Parameters

absolute: float, optional

Absolute value.

relative: float, optional

Relative value.

Returns

dict

Server response of this player’s seek operation.

set_always_on_top(always_on_top: bool | None = None) dict

Turns player on/off always on top.

Parameters

always_on_top: bool, optional

Is the player always on top?

Returns

dict

Server response fo this player’s speedometer visibility.

set_bounds(x: int | None = None, y: int | None = None, width: int | None = None, height: int | None = None) dict

Set bounds of this player.

Parameters

x: int, optional

X coordinate of this player’s top left corner.

y: int, optional

Y coordinate of this player’s top left corner.

width: int, optional

Width of player.

height: int, optional

Height of player.

Returns

dict

Server response of setting this player’s bounds.

set_driver_header_mode(mode: str | None = None) dict

Sets the overlay display for a driver stream.

Parameters

id: int

Id of player.

mode: str, optional

Desired overlay of the player - can be DRIVER_HEADER, NONE or OBC_LIVE_TIMING

Returns

dict

Server response to this player’s driver header mode.

set_fullscreen(fullscreen: bool | None = None) dict
Toggles fullscreen for a player or specifies fullscreen state for

player.

Parameters

fullscreen: bool, optional

Desired fullscreen state of this player.

Returns

dict

Server response of this player’s fullscreen state.

set_speedometer_visibility(visible: bool | None = None) dict
Makes speedometer overlay on this player visible/invisible or specifies

visibility.

Parameters

visible: bool, optional

Visibility of speedometer overlay on this player.

Returns

dict

Server response fo this player’s speedometer visibility.

set_volume(volume: int) dict

Set volume of this player.

Parameters

volume: int, optional

Desired volume of this player.

Returns

dict

Server response of setting this player’s volume.

switch_stream(title: str) dict

Switch stream of this player.

Parameters

title: str

Title of stream feed (e.g. ‘INTERNATIONAL’ for Crofty or ‘PER’ for Checo).

Returns

dict

Dict with result of player_create operation.

Please see the implementation note on MultiViewerForF1.player_create.

sync() dict

Synchronize all MultiViewerForF1 players to the timestamp of this player.

Returns

dict

Server response of this player’s sync operation.