feat: Add experimental rewrite of go2rtc live provider (MSE/WebRTC/MP4/MJPEG) (#2580)
- Closes #2556 - Closes #2450 **Key intended features:** - go2rtc compatible - 100% test coverage to significantly improve ability to test, maintain and work around browser weirdnesses (e.g. Safari). - Written from the ground up in the style of the rest of the project. **To use:** - Change `live_provider` from `go2rtc` to `go2rtc-experimental`.
This commit is contained in:
+19
-3
@@ -89,20 +89,36 @@ export type UnsubscribeCallback = () => void;
|
||||
// Reports each live/stalled transition of a player's media stream.
|
||||
export type LivenessCallback = (isLive: boolean) => void;
|
||||
|
||||
export interface MediaPlayerController {
|
||||
// Control over a pausable playback loop. Optional on the player: present only
|
||||
// when the player owns a stream it can start and stop (e.g. a real video, or an
|
||||
// image refreshed on a timer). A static image, or one fed frames as they arrive
|
||||
// where the client has no control (e.g. MP4, MJPEG), has no pausable loop and
|
||||
// omits it.
|
||||
export interface PlaybackControl {
|
||||
play(): Promise<void>;
|
||||
pause(): Promise<void>;
|
||||
isPaused(): boolean;
|
||||
}
|
||||
|
||||
export interface MediaPlayerController {
|
||||
mute(): Promise<void>;
|
||||
unmute(): Promise<void>;
|
||||
isMuted(): boolean;
|
||||
seek(seconds: number): Promise<void>;
|
||||
getScreenshotURL(): Promise<string | null>;
|
||||
|
||||
// If no value for controls if specified, the player should use the default.
|
||||
setControls(controls?: boolean): Promise<void>;
|
||||
isPaused(): boolean;
|
||||
getFullscreenElement(): FullscreenElement | null;
|
||||
getPIPElement(): PIPElement | null;
|
||||
|
||||
// Jump to a time position, if the media has a seekable timeline. Optional:
|
||||
// implemented only by players over seekable media.
|
||||
seek?(seconds: number): Promise<void>;
|
||||
|
||||
// Start/pause the media, if it is pausable. Optional: implemented only by
|
||||
// players that own a pausable playback loop.
|
||||
playback?: PlaybackControl;
|
||||
|
||||
// Observe whether the player is actively delivering media, so a silent freeze
|
||||
// (frames stop advancing while playing) can be detected. Optional:
|
||||
// implemented only by players that can observe their own frame progress. The
|
||||
|
||||
Reference in New Issue
Block a user