YoutubePlayerIFrameAPI class abstract

The skeleton for YouTube IFrame Player API.

Implementers

Constructors

YoutubePlayerIFrameAPI()

Properties

availablePlaybackRates Future<List<double>>
This function returns the set of playback rates in which the current video is available. The default value is 1, which indicates that the video is playing in normal speed.
no setterinherited
currentTime Future<double>
Returns the elapsed time in seconds since the video started playing.
no setterinherited
duration Future<double>
Returns the duration in seconds of the currently playing video. Note that duration will return 0 until the video's metadata is loaded, which normally happens just after the video starts playing.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
isMuted Future<bool>
Returns true if the player is muted, false if not.
no setterinherited
playbackRate Future<double>
This getter retrieves the playback rate of the currently playing video. The default playback rate is 1, which indicates that the video is playing at normal speed.
no setterinherited
playerState Future<PlayerState>
Returns the state of the player.
no setterinherited
playlist Future<List<String>>
This function returns an array of the video IDs in the playlist as they are currently ordered. By default, this function will return video IDs in the order designated by the playlist owner.
no setterinherited
playlistIndex Future<int>
This function returns the index of the playlist video that is currently playing.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
videoData Future<VideoData>
Returns the VideoData for the currently loaded/playing video.
no setterinherited
videoEmbedCode Future<String>
Returns the embed code for the currently loaded/playing video.
no setterinherited
videoLoadedFraction Future<double>
Returns a number between 0 and 1 that specifies the percentage of the video that the player shows as buffered.
no setterinherited
videoUrl Future<String>
Returns the YouTube.com URL for the currently loaded/playing video.
no setterinherited
volume Future<int>
Returns the player's current volume, an integer between 0 and 100. Note that it will return the volume even if the player is muted.
no setterinherited

Methods

cuePlaylist({required List<String> list, ListType? listType, int? index, double? startSeconds}) Future<void>
Queues the specified list of videos. The list can be a playlist or a user's uploaded videos feed.
inherited
cueVideoById({required String videoId, double? startSeconds, double? endSeconds}) Future<void>
This function loads the specified video's thumbnail and prepares the player to play the video. The player does not request the FLV until playVideo or seekTo is called.
inherited
cueVideoByUrl({required String mediaContentUrl, double? startSeconds, double? endSeconds}) Future<void>
This function loads the specified video's thumbnail and prepares the player to play the video. The player does not request the FLV until playVideo or seekTo is called.
inherited
loadPlaylist({required List<String> list, ListType? listType, int? index, double? startSeconds}) Future<void>
This function loads the specified list and plays it. The list can be a playlist or a user's uploaded videos feed.
inherited
loadVideoById({required String videoId, double? startSeconds, double? endSeconds}) Future<void>
This function loads and plays the specified video.
inherited
loadVideoByUrl({required String mediaContentUrl, double? startSeconds, double? endSeconds}) Future<void>
This function loads and plays the specified video.
inherited
mute() Future<void>
Mutes the player.
inherited
nextVideo() Future<void>
This function loads and plays the next video in the playlist.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pauseVideo() Future<void>
Pauses the currently playing video. The final player state after this function executes will be paused (2) unless the player is in the ended (0) state when the function is called, in which case the player state will not change.
inherited
playVideo() Future<void>
Plays the currently cued/loaded video. The final player state after this function executes will be playing (1).
inherited
playVideoAt(int index) Future<void>
This function loads and plays the specified video in the playlist.
inherited
previousVideo() Future<void>
This function loads and plays the previous video in the playlist.
inherited
seekTo({required double seconds, bool allowSeekAhead = false}) Future<void>
Seeks to a specified time in the video. If the player is paused when the function is called, it will remain paused. If the function is called from another state (playing, video cued, etc.), the player will play the video.
inherited
setLoop({required bool loopPlaylists}) → void
This function indicates whether the video player should continuously play a playlist or if it should stop playing after the last video in the playlist ends. The default behavior is that playlists do not loop.
inherited
setPlaybackRate(double suggestedRate) → void
This function sets the suggested playback rate for the current video. If the playback rate changes, it will only change for the video that is already cued or being played. If you set the playback rate for a cued video, that rate will still be in effect when the playVideo function is called or the user initiates playback directly through the player controls. In addition, calling functions to cue or load videos or playlists (cueVideoById, loadVideoById, etc.) will reset the playback rate to 1.
inherited
setShuffle({required bool shufflePlaylists}) → void
This function indicates whether a playlist's videos should be shuffled so that they play back in an order different from the one that the playlist creator designated. If you shuffle a playlist after it has already started playing, the list will be reordered while the video that is playing continues to play. The next video that plays will then be selected based on the reordered list.
inherited
setSize(double width, double height) → void
Sets the size in pixels of the
inherited
setVolume(int volume) Future<void>
Sets the volume. Accepts an integer between 0 and 100.
inherited
stopVideo() Future<void>
Stops and cancels loading of the current video. This function should be reserved for rare situations when you know that the user will not be watching additional video in the player. If your intent is to pause the video, you should just call the pauseVideo function. If you want to change the video that the player is playing, you can call one of the queueing functions without calling stopVideo first.
inherited
toString() String
A string representation of this object.
inherited
unMute() Future<void>
Unmutes the player.
inherited

Operators

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