DVMediaController class final

A handle on a player.

Signals read the session this handle drives or follows. A handle and a session are separate so DVBox.video(source).controller can be taken before the box is mounted, and a box rebuilt by its parent can hand its new handle to the player already running instead of starting another one.

Constructors

DVMediaController(DVMediaSource source, {DVBackgroundPlayback background = DVBackgroundPlayback.none, DVMediaSession? session, DVCaptions? captions, DVMediaEnvironment? environment})

Properties

background → DVBackgroundPlayback
final
buffered → DVMediaSignal<List<DVRange>>
no setter
canPictureInPicture → bool
Whether enterPictureInPicture can work on this target.
no setter
caption → DVMediaSignal<String?>
The caption text for the current position, or null.
no setter
captionError → DVMediaSignal<String?>
Why the last caption track asked for could not be shown, or null.
no setter
captions → DVCaptions?
The caption tracks this player offers.
final
captionTrack → DVMediaSignal<String?>
The language of the captions showing, or null when none are.
no setter
duration → DVMediaSignal<Duration>
Zero until the source is loaded, and for a live stream.
no setter
environment → DVMediaEnvironment
final
error → DVMediaSignal<String?>
Why the player failed, or null.
no setter
hashCode → int
The hash code for this object.
no setterinherited
isAttached → bool
Whether this handle drives a session rather than following another's.
no setter
pictureInPicture → DVMediaSignal<bool>
Whether the video is floating in picture-in-picture, as the platform reports it.
no setter
position → DVMediaSignal<Duration>
Where playback is. Moves to a seek's target the moment it is issued and ignores reports measured before the backend completed that seek.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
session → DVMediaSession?
What the lock screen shows while this player holds it. Null keeps the player off the now-playing surface.
final
source → DVMediaSource
final
stallTimeout → Duration
How long "playing" may go without the position advancing before the state says DVPlaybackState.stalled.
no setter
state → DVMediaSignal<DVPlaybackState>
no setter
videoSize → DVMediaSignal<(int, int)?>
The decoded picture's width and height, once the backend reports it.
no setter

Methods

attach(DVMediaPlayerBackend backend) → Future<void>
Loads source into backend and starts observing the application.
dispose() → Future<void>
Releases this handle. A handle that owns its session releases the backend, audio focus, timers and the lifecycle subscription; one that follows another stops following and leaves that player alone.
enterPictureInPicture() → Future<void>
Floats the video over other applications. Throws DVMediaPictureInPictureUnavailable where the target has no such thing; pictureInPicture moves when the platform confirms.
exitPictureInPicture() → Future<void>
follow(DVMediaController owner) → void
Makes this handle read and drive owner's session.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pause() → Future<void>
play() → Future<void>
seek(Duration position) → Future<void>
Moves to position, clamped to the duration once it is known.
setCaptionTrack(String? language) → Future<void>
Shows the captions in language, or none when null. Throws ArgumentError for a language captions does not offer.
setVolume(double volume) → Future<void>
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited