MeeduPlayerController class

Constructors

MeeduPlayerController({ScreenManager screenManager = const ScreenManager(), Color colorTheme = Colors.redAccent, Widget? loadingWidget, bool controlsEnabled = true, bool manageWakeLock = true, bool manageBrightness = true, bool showLogs = true, bool excludeFocus = true, bool autoHideControls = true, String? errorText, ControlsStyle controlsStyle = ControlsStyle.primary, Widget? header, Widget? bottomRight, List<BoxFit> fits = const [BoxFit.contain, BoxFit.cover, BoxFit.fill, BoxFit.fitHeight, BoxFit.fitWidth, BoxFit.scaleDown], bool pipEnabled = false, CustomIcons customIcons = const CustomIcons(), EnabledButtons enabledButtons = const EnabledButtons(), EnabledControls enabledControls = const EnabledControls(), EnabledOverlays enabledOverlays = const EnabledOverlays(), CustomCallbacks customCallbacks = const CustomCallbacks(), Responsive? responsive, dynamic durations = const Durations(), void onVideoPlayerClosed()?, BoxFit? initialFit})
creates an instance of MeeduPlayerController

Properties

autoHideControls bool
if the player should automatically hide the controls
final
autoplay bool
autoPlay is true if the player has enabled the autoplay
no setter
bottomRight Widget?
getter/setter pair
brightness → Rx<double>
brightness is true if the player controls are visible
no setter
buffered → Rx<Duration>
duration of the video buffered
no setter
bufferedPercent ↔ Rx<double>
getter/setter pair
bufferingVideoDuration ↔ Rx<bool>
getter/setter pair
closedCaptionEnabled → Rx<bool>
no setter
colorTheme Color
final
controls bool
show or hide the player controls
no getter
controlsEnabled bool
final
controlsStyle ControlsStyle
final
customCallbacks CustomCallbacks
Provides custom callback functions for specific player interactions.
final
customCaptionView Widget Function(BuildContext context, MeeduPlayerController controller, Responsive responsive, String text)?
customCaptionView when a custom view for the captions is needed
getter/setter pair
customControls Widget?
getter/setter pair
customIcons CustomIcons
use this class to change the default icons with your custom icons
getter/setter pair
dataStatus MeeduPlayerDataStatus
the dataStatus to notify the load sources events dataStatus has a status observable
final
desktopOrWeb bool
for defining that video player is working on desktop or web
getter/setter pair
doubleTapCount ↔ Rx<int>
getter/setter pair
duration → Rx<Duration>
duration of the video
no setter
durations → dynamic
Defines the animation durations for various animations in a video.
final
enabledButtons EnabledButtons
use this class to hide some buttons in the player
getter/setter pair
enabledControls EnabledControls
use this class to disable controls in the player
getter/setter pair
enabledOverlays EnabledOverlays
Controls the visibility of player overlays.
final
errorText String?
no setter
excludeFocus bool
controls if widgets inside videoplayer should get focus or not
final
fits List<BoxFit>
getter/setter pair
forceUIRefreshAfterFullScreen → Rx<bool>
final
forwardIcons ↔ Rx<bool>
getter/setter pair
fullscreen → Rx<bool>
fullscreen is true if the player is in fullscreen mode
no setter
hashCode int
The hash code for this object.
no setterinherited
getter/setter pair
isBuffering ↔ Rx<bool>
getter/setter pair
isInPipMode → Rx<bool>
isInPipMode is true if pip mode is enabled
no setter
launchedAsFullScreen bool
stores the launch state
getter/setter pair
loadingWidget Widget?
getter/setter pair
lockedControls → Rx<bool>
returns true if the pip mode can used on the current device, the initial value will be false after check if pip is available
no setter
looping bool
looping is true if the player is looping
no setter
manageBrightness bool
if the player should manage Brightness
final
manageWakeLock bool
if the player should use wakelock_plus
final
mobileControls bool
for defining that video player needs mobile controls (even if its running on a web on a mobile device)
getter/setter pair
mouseMoveInitial double
getter/setter pair
mute → Rx<bool>
mute is true if the player is muted
no setter
onBrightnessChanged Stream<double>
no setter
onBufferedChanged Stream<Duration>
use this stream to listen the changes in the video buffered
no setter
onClosedCaptionEnabledChanged Stream<bool>
no setter
onDataStatusChanged Stream<DataStatus>
use this stream to listen the player data events like none, loading, loaded, error
no setter
onDurationChanged Stream<Duration>
use this stream to listen the changes in the video duration
no setter
onFullscreenChanged Stream<bool>
no setter
onMuteChanged Stream<bool>
no setter
onPipModeChanged Stream<bool?>
no setter
onPlayerStatusChanged Stream<PlayerStatus>
use this stream to listen the player data events like completed, playing, paused
no setter
onPositionChanged Stream<Duration>
use this stream to listen the changes in the video position
no setter
onShowBrightnessStatusChanged Stream<bool>
no setter
onShowControlsChanged Stream<bool>
no setter
onShowSwipeDurationChanged Stream<bool>
no setter
onShowVolumeStatusChanged Stream<bool>
no setter
onSliderPositionChanged Stream<Duration>
no setter
onSwipeDurationChanged Stream<int>
no setter
onVideoPlayerClosed ↔ void Function()?
getter/setter pair
onVolumeChanged Stream<double>
no setter
osVersion Future<double>
no setter
pipAvailable → Rx<bool>
returns true if the pip mode can used on the current device, the initial value will be false after check if pip is available
no setter
pipEnabled bool
final
playbackSpeed double
the playback speed default value is 1.0
no setter
playerStatus MeeduPlayerStatus
the playerStatus to notify the player events like paused,playing or stopped playerStatus has a status observable
final
position → Rx<Duration>
current position of the player
no setter
prefs ↔ SharedPreferences?
getter/setter pair
responsive Responsive
A utility class that helps make the UI responsive by defining the size of icons, buttons, and text relative to the screen size. if null default values are Responsive({ this.fontSizeRelativeToScreen = 2.5, this.maxFontSize = 16, this.iconsSizeRelativeToScreen = 7, this.maxIconsSize = 40, this.buttonsSizeRelativeToScreen = 8, this.maxButtonsSize = 40, });
getter/setter pair
rewindIcons ↔ Rx<bool>
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
screenManager ScreenManager
Screen Manager to define the overlays and device orientation when the player enters in fullscreen mode
final
showBrightnessStatus → Rx<bool>
showSwipeDuration is true if the player controls are visible
no setter
showControls → Rx<bool>
showControls is true if the player controls are visible
no setter
showLogs bool
if the player should show Logs
final
showSwipeDuration → Rx<bool>
showSwipeDuration is true if the player controls are visible
no setter
showVolumeStatus → Rx<bool>
showSwipeDuration is true if the player controls are visible
no setter
sliderPosition → Rx<Duration>
sliderPosition the video slider position
no setter
subscriptions List<StreamSubscription>
getter/setter pair
swipeDuration → Rx<int>
swipeDuration is true if the player controls are visible
no setter
tag String?
getter/setter pair
timerForTrackingMouse Timer?
getter/setter pair
videoController VideoController?
videoController instace of Player
no setter
videoFit → Rx<BoxFit>
return fit of the Video,By default it is set to BoxFit.contain
no setter
videoFitChanged ↔ Rx<bool>
getter/setter pair
videoFitChangedTimer Timer?
getter/setter pair
videoOverlay Widget?
getter/setter pair
videoPlayerController Player?
videoPlayerController instace of Player
no setter
volume → Rx<double>
volume is true if the player controls are visible
no setter

Methods

closePip(BuildContext context) → void
customDebugPrint(Object? object) → void
dispose() Future<void>
dispose de video_player controller
enterPip(BuildContext context) Future<void>
enter to picture in picture mode only Android
fastForward() Future<void>
fast Forward (10 seconds)
getAspectRatio() double
getCurrentBrightness() Future<void>
getCurrentVolume() Future<void>
getUserPreferenceForBrightness() Future<void>
getUserPreferenceForFit() Future<void>
goToFullscreen(BuildContext context, {bool applyOverlaysAndOrientations = true, bool disposePlayer = false}) Future<void>
show the player in fullscreen mode
launchAsFullscreen(BuildContext context, {required DataSource dataSource, bool autoplay = false, bool looping = false, Widget? header, Widget? bottomRight, Duration seekTo = Duration.zero}) Future<void>
launch a video using the fullscreen apge
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onChangedSlider(double v) → dynamic
onChangedSliderEnd() → void
onChangedSliderStart() → void
onClosedCaptionEnabled(bool enabled) → void
enable or diable the visibility of ClosedCaptionFile
onFullscreenClose() Future<void>
onVideoFitChange(BoxFit fit) → void
Change Video Fit accordingly
pause({bool notify = true}) Future<void>
pause the current video
play({bool repeat = false, bool hideControls = true}) Future<void>
play the current video
removeListeners() → void
resetBrightness() Future<void>
rewind() Future<void>
rewind (10 seconds)
seekTo(Duration position) Future<void>
seek the current video position
setBrightness(double brightnes) Future<void>
setDataSource(DataSource dataSource, {bool autoplay = true, bool looping = false, Duration seekTo = Duration.zero}) Future<void>
set the video data source
setFullScreen(bool fullscreen, BuildContext context) → void
Sets the full-screen mode of the application window.
setMute(bool enabled) Future<void>
set the video player to mute or sound
setPlaybackSpeed(double speed) Future<void>
Sets the playback speed of this.
setUserPreferenceForBrightness() Future<void>
setUserPreferenceForFit() Future<void>
setVideoAsAppFullScreen(BuildContext context, {bool applyOverlaysAndOrientations = true, bool disposePlayer = false}) Future<void>
setVolume(double volumeNew, {bool videoPlayerVolume = false}) Future<void>
Sets the audio volume volume indicates a value between 0.0 (silent) and 1.0 (full volume) on a linear scale.
startListeners() → void
toggleFullScreen(BuildContext context) → void
Toggles the full-screen mode of the application window.
toggleLockScreenMobile() → void
togglePlay() Future<void>
toggle play the current video
togglePlaybackSpeed() Future<void>
toggleVideoFit() → void
Toggle Change the videofit accordingly
toString() String
A string representation of this object.
inherited
videoPlayerClosed() Future<void>
videoSeekToNextSeconds(int seconds, bool playing) Future<void>
enter to picture in picture mode only Android
volumeUpdated() → void

Operators

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

Static Methods

of(BuildContext context) MeeduPlayerController