YoutubePlayer class

Displayes the video as defined in source.

Inheritance

Constructors

YoutubePlayer({@required String source, @required BuildContext context, @required YoutubeQuality quality, double aspectRatio: 16 / 9, double width, bool isLive: false bool autoPlay: true ControlsColor controlsColor, Duration startAt, bool showThumbnail: false bool keepScreenOn: true bool showVideoProgressbar: true bool startFullScreen: false bool controlsActiveBackgroundOverlay: false Duration controlsTimeOut: const Duration(seconds: 3), YoutubePlayerMode playerMode: YoutubePlayerMode.DEFAULT, ErrorCallback onError, VoidCallback onVideoEnded, YPCallBack callbackController, bool switchFullScreenOnLongPress: false bool hideShareButton: false bool reactToOrientationChange: true bool loop: false })

Properties

aspectRatio → double
Sets the aspect ratio of the player. e.g. aspectRatio = 16/9 [...]
final
autoPlay → bool
Defines whether to auto play video or not. [...]
final
callbackController YPCallBack
Returns VideoPlayerController after successfully initializing video.
final
context BuildContext
BuildContext of parent widget.
final
controlsActiveBackgroundOverlay → bool
Sets video-wide overlay when controls are active
final
controlsColor ControlsColor
Sets color of controls like play, pause, etc.
final
controlsTimeOut → Duration
Timeout for showing controls like play, pause, etc. [...]
final
hideShareButton → bool
If set to true, hides option to share video in the player. [...]
final
isLive → bool
Set this to true if the source is for live stream video. [...]
final
keepScreenOn → bool
Triggers screen to be on when not in fullscreen. [...]
final
loop → bool
If set to true, video will play in loop. [...]
final
onError ErrorCallback
Returns error if any found.
final
onVideoEnded VoidCallback
Callback which reports video end event.
final
playerMode YoutubePlayerMode
Defines mode of the player. [...]
final
quality YoutubeQuality
Sets the video quality as defined in YoutubeQuality. [...]
final
reactToOrientationChange → bool
If set to false, orientation Change won't trigger fullscreen. [...]
final
showThumbnail → bool
Shows thumbnail when video is initializing. [...]
final
showVideoProgressbar → bool
Shows progressbar below the video. [...]
final
source → String
Source of youtube video. It can be Video ID or URL.
final
startAt → Duration
Sets the starting position of the video.
final
startFullScreen → bool
If set to true, video will start in full screen. [...]
final
switchFullScreenOnLongPress → bool
If set to true, long press gesture on video will switch to full screen. [...]
final
width → double
Sets width to the player. It cannot be greater than Device's width. [...]
final
hashCode → int
The hash code for this object.
read-only, inherited
key Key
Controls how one widget replaces another widget in the tree. [...]
final, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited

Methods

createState() State<StatefulWidget>
Creates the mutable state for this widget at a given location in the tree. [...]
override
createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree. [...]
inherited
debugDescribeChildren() → List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children. [...]
@protected, inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node. [...]
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent 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.debug }) → String
Returns 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 ==(dynamic other) → bool
The equality operator.
inherited

Static Properties

brightness → Future<double>
read-only
isKeptOn → Future<bool>
read-only

Static Methods

keepOn(bool on) → Future
setBrightness(double brightness) → Future