PlayerObserver mixin
Use with Video or Audio widget to get player notifications such as onPlay, onPause etc. See example on how to use.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
listenForAudioPlayerEvents(
) → Future< void> -
listenForVideoPlayerEvents(
int viewId) → Future< void> -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onComplete(
) → void - Override this method to get notifications when media has finished playing.
-
onDuration(
int? duration) → void -
Override this method to get notifications when media duration is
set or changed.
duration
is in milliseconds. Returns -1 for live stream -
onError(
String? error) → void - Override this method to get errors thrown by the player
-
onPause(
) → void - Override this method to get notifications when media is paused.
-
onPlay(
) → void - Override this method to get notifications when media is played.
-
onSeek(
int? position, double offset) → void -
Override this method to get notifications when a seek operation has
finished. This will occur when user finishes scrubbing media.
position
is position in seconds before seek started.offset
is seconds after seek processed. -
onTime(
int? position) → void -
Override this method to get update when playhead moves. This method
fires every second with
position
as seconds. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited