Player¶
Publishes a file-like source with player controls. Prefer :func:publish, which accepts paths and live sources directly. The worker thread starts immediately; every control is safe to call from any thread.
Player(
source: ,
url: ,
key: ,
verify_tls: = True,
connect_timeout: = 15.0,
command_timeout: = 10.0,
reconnect_delay: = 1.0,
max_reconnect_delay: = 30.0,
lookahead_ms: = 1000,
wait_video_ms: = 1000,
freeze_interval: = 1.0,
loop: = False,
window_bytes: = 0,
on_connection: = None,
log: = None
)
Members¶
position¶
property
Seconds into the source (freezes while paused)
paused¶
property
muted¶
property
stopped¶
property
Whether the player has ended: stop() was called, or the worker
error¶
property
The fault that ended the session, if any
connected¶
property
Whether a session is live right now
window_bytes¶
property
Bytes buffered in the rolling window (when one is configured; else None)
publisher¶
property
The underlying Publisher (advanced)
pause¶
method
.pause( )
play¶
method
.play( )
mute¶
method
.mute( )
unmute¶
method
.unmute( )
stop¶
method
.stop( )
frames_sent¶
property
video_frames_sent¶
property
bytes_sent¶
property
frames_dropped¶
property
warnings¶
property
av_skew_ms¶
property
The wire skew of the audio timeline against the video one, in ms
bitrate_kbps¶
property
Stream throughput in kbit/s, averaged over the last ~10 seconds
stats¶
property
One snapshot for dashboards: state, position, throughput, counters