VideoPlayerCallbacks class
A configuration class that provides callback hooks for responding to video player events.
VideoPlayerCallbacks allows developers to attach custom logic to lifecycle events, UI changes, and error handling during playback.
These callbacks are completely optional and non-intrusive.
Example usage:
VideoPlayerCallbacks(
onControllerCreated: (controller) {
controller.play();
},
onFullScreenToggled: (isFullScreen) {
print('Fullscreen toggled: $isFullScreen');
},
)
- Annotations
Constructors
- VideoPlayerCallbacks({void onControllerCreated(OmniPlaybackController controller)?, void onFullScreenToggled(bool isGoingFullScreen)?, void onOverlayControlsVisibilityChanged(bool areVisible)?, void onCenterControlsVisibilityChanged(bool areVisible)?, void onMuteToggled(bool isMute)?, void onSeekStart(Duration currentPosition)?, void onSeekEnd(Duration currentPosition)?, bool onSeekRequest(Duration targetPosition)?, VoidCallback? onFinished, VoidCallback? onReplay})
-
Creates a new set of callback hooks for OmniVideoPlayer and related widgets.
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- onCenterControlsVisibilityChanged → void Function(bool areVisible)?
-
Called when central controls (e.g., play/pause icon in the center) are shown or hidden.
final
- onControllerCreated → void Function(OmniPlaybackController controller)?
-
Called once when the internal OmniPlaybackController is created and ready.
final
- onFinished → VoidCallback?
-
Called when the video reaches the end of playback.
final
- onFullScreenToggled → void Function(bool isGoingFullScreen)?
-
Called when the player enters or exits fullscreen mode.
final
- onMuteToggled → void Function(bool isMute)?
-
Called when the mute state is toggled.
final
- onOverlayControlsVisibilityChanged → void Function(bool areVisible)?
-
Called when overlay controls (e.g., seek bar, volume/mute, fullscreen) are shown or hidden.
final
- onReplay → VoidCallback?
-
Called when the user presses the replay button after the video has finished.
final
- onSeekEnd → void Function(Duration currentPosition)?
-
Called when the user ends a seek operation.
final
- onSeekRequest → bool Function(Duration targetPosition)?
-
Called before performing a seek operation.
final
- onSeekStart → void Function(Duration currentPosition)?
-
Called when the user starts seeking.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
copyWith(
{void onControllerCreated(OmniPlaybackController controller)?, void onFullScreenToggled(bool isGoingFullScreen)?, void onOverlayControlsVisibilityChanged(bool areVisible)?, void onCenterControlsVisibilityChanged(bool areVisible)?, void onMuteToggled(bool isMute)?, void onSeekStart(Duration currentPosition)?, void onSeekEnd(Duration currentPosition)?, bool onSeekRequest(Duration targetPosition)?, VoidCallback? onFinished, VoidCallback? onReplay}) → VideoPlayerCallbacks - Returns a new VideoPlayerCallbacks instance with specified callbacks overridden.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited