Video class
Widget for showing Video inside the Widget tree. Creation of Player instance is necessary as a controller, for this Widget to show Video output.
An example configuration between a Player and a Video can be as follows.
The Player.id
and Video.playerId
must be same for two to work together.
class _MyAppState extends State<MyApp> {
Player player = Player(id: 0);
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Video(
player: player,
height: 420.0,
width: 320.0
),
),
);
}
}
This Widget internally uses StreamController.
Prefer calling Player.stop & Video.dispose
to freed the resources.
A global Key may be used for this purpose.
- Inheritance
Constructors
- Video({Key? key, @Deprecated('playerId is deprecated. Use player instead.') int? playerId, Player? player, double? width, double? height, BoxFit fit = BoxFit.contain, AlignmentGeometry alignment = Alignment.center, double scale = 1.0, bool showControls = true, Color? progressBarActiveColor, Color? progressBarInactiveColor = Colors.white24, Color? progressBarThumbColor, Color? progressBarThumbGlowColor = const Color.fromRGBO(0, 161, 214, .2), Color? volumeActiveColor, Color? volumeInactiveColor = Colors.grey, Color volumeBackgroundColor = const Color(0xff424242), Color? volumeThumbColor, double? progressBarThumbRadius = 10.0, double? progressBarThumbGlowRadius = 15.0, bool showTimeLeft = false, TextStyle progressBarTextStyle = const TextStyle(), FilterQuality filterQuality = FilterQuality.low, bool showFullscreenButton = false, Color fillColor = Colors.black})
- Widget for showing Video inside the Widget tree. Creation of Player instance is necessary as a controller, for this Widget to show Video output.
Properties
- alignment → AlignmentGeometry
-
How to align the picture box within the player viewport.
Defaults to Alignment.center
final
- fillColor → Color
-
Fill color.
final
- filterQuality → FilterQuality
-
Filter quality.
final
- fit → BoxFit
-
How to inscribe the picture box into the player viewport.
Defaults to BoxFit.contain.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- height → double?
-
Height of the viewport.
Defaults to the height of the parent.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- player → Player
-
The Player whose Video output should be shown.
final
- progressBarActiveColor → Color?
-
Active color of the progress bar
final
- progressBarInactiveColor → Color?
-
Inactive color of the progress bar
final
- progressBarTextStyle → TextStyle
-
TextStyle for the Progress Bar
final
- progressBarThumbColor → Color?
-
Thumb color of the progress bar
final
- progressBarThumbGlowColor → Color?
-
Thumb's glow color of the progress bar
final
- progressBarThumbGlowRadius → double?
-
Radius of the progressbar's glow of the thumb
final
- progressBarThumbRadius → double?
-
Radius of the progressbar's thumb
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scale → double
-
Scale.
final
- showControls → bool
-
Built-In video controls.
final
- showFullscreenButton → bool
-
Whether to show the fullscreen button.
final
- showTimeLeft → bool
-
If you want the progress bar to display the time left while playing
instead of the total time, set this to true
final
- volumeActiveColor → Color?
-
Active color of the volume slider
final
- volumeBackgroundColor → Color
-
Background color of the volume slider
final
- volumeInactiveColor → Color?
-
Inactive color of the volume slider
final
- volumeThumbColor → Color?
-
Thumb color of the volume slider
final
- width → double?
-
Width of the viewport.
Defaults to the width of the parent.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → _VideoStateBase -
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}) → 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