HmVideoPlayer class
Native PlatformView video player with Mohe-style fullscreen transition.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- HmVideoPlayer
Constructors
-
HmVideoPlayer({Key? key, required String videoUrl, HmVideoPlayerController? controller, String title = '', bool cover = false, bool autoPlay = true, bool looping = true, bool autoRotateFullscreen = true, bool syncSystemGestureDirection = true, bool showNativeControls = true, bool enableInlineDoubleTapPlayPause = true, bool enableInlineDragGestures = true, NativeControlsConfig inlineControls = NativeControlsConfig.inlinePreset, NativeControlsConfig fullscreenControls = NativeControlsConfig.fullscreenPreset, Duration initialPosition = Duration.zero, List<
VideoQuality> qualities = const <VideoQuality>[], int currentQualityIndex = 0, List<VideoEpisode> episodes = const <VideoEpisode>[], int currentEpisodeIndex = 0, List<double> speeds = const <double>[0.75, 1.0, 1.25, 1.5, 2.0], List<DanmakuItem> danmakuItems = const <DanmakuItem>[], Duration? trialDuration, HmCastUiMode castUiMode = HmCastUiMode.flutter, bool enablePictureInPicture = true, bool autoEnterPictureInPicture = true, Map<String, String> httpHeaders = const <String, String>{}, ValueChanged<HmVideoPlayerController> ? onCreated}) -
const
Properties
- autoEnterPictureInPicture → bool
-
Whether to automatically enter PiP when the user leaves the app while playing.
final
- autoPlay → bool
-
final
- autoRotateFullscreen → bool
-
final
- castUiMode → HmCastUiMode
-
Whether cast UI is handled by Flutter (HmCastUiMode.flutter) or native panel.
final
- controller → HmVideoPlayerController?
-
final
- cover → bool
-
final
- currentEpisodeIndex → int
-
final
- currentQualityIndex → int
-
final
-
danmakuItems
→ List<
DanmakuItem> -
Reserved for future native danmaku rendering.
final
- enableInlineDoubleTapPlayPause → bool
-
Whether inline (non-fullscreen) player area supports double-tap
to toggle play/pause.
final
- enableInlineDragGestures → bool
-
Whether inline (non-fullscreen) player area supports drag gestures:
horizontal drag to seek, left vertical drag for brightness, right vertical
drag for volume. Center long-press still triggers speed boost.
final
- enablePictureInPicture → bool
-
Whether picture-in-picture is allowed for this player instance.
final
-
episodes
→ List<
VideoEpisode> -
final
- fullscreenControls → NativeControlsConfig
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
httpHeaders
→ Map<
String, String> -
Default HTTP request headers for video URLs (e.g. Authorization, Referer).
final
- initialPosition → Duration
-
final
- inlineControls → NativeControlsConfig
-
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- looping → bool
-
final
-
onCreated
→ ValueChanged<
HmVideoPlayerController> ? -
final
-
qualities
→ List<
VideoQuality> -
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- showNativeControls → bool
-
final
-
speeds
→ List<
double> -
final
- syncSystemGestureDirection → bool
-
Whether to request real system landscape after the player-only fullscreen
animation completes.
final
- title → String
-
final
- trialDuration → Duration?
-
Reserved for trial playback; native may emit a trial-ended event.
final
- videoUrl → String
-
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< HmVideoPlayer> -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited