Player class
Creates and controls a YouTube player in an
- Annotations
-
- @JS('YT.Player')
Constructors
- Player(dynamic elt_id, PlayerOptions options)
-
Initializes a new instance of the Player class.
Initializes a new instance of the Player class.
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addEventListener(
dynamic eventName, void listener(dynamic event)) → void - Adds an event listener for the specified event.
-
cuePlaylist(
dynamic playlist_args, [num index, num startSeconds, String suggestedQuality]) → void - Queues a playlist of videos. Queues a playlist of videos.
-
cueVideoById(
dynamic videoId_args, [num startSeconds, String suggestedQuality]) → void - Queues a video by ID. Queues a video by ID.
-
cueVideoByUrl(
dynamic mediaContentUrl_args, [num startSeconds, String suggestedQuality]) → void - Queues a video by media content URL. Queues a video by media content URL.
-
destroy(
) → void - Removes the
-
getAvailablePlaybackRates(
) → List< num> -
getAvailableQualityLevels(
) → List< String> -
getCurrentTime(
) → num -
getDuration(
) → num -
getIframe(
) → IFrameElement -
getPlaybackQuality(
) → String -
getPlaybackRate(
) → num -
getPlayerState(
) → num -
getPlaylist(
) → List< String> -
getPlaylistIndex(
) → num -
getVideoEmbedCode(
) → String -
getVideoLoadedFraction(
) → num -
getVideoUrl(
) → String -
getVolume(
) → num -
isMuted(
) → bool -
loadPlaylist(
dynamic playlist_args, [num index, num startSeconds, String suggestedQuality]) → void - Loads a playlist of videos. Loads a playlist of videos.
-
loadVideoById(
dynamic videoId_args, [num startSeconds, String suggestedQuality]) → void - Loads and plays a video by ID. Loads and plays a video by ID.
-
loadVideoByUrl(
dynamic mediaContentUrl_args, [num startSeconds, String suggestedQuality]) → void - Loads a video by media content URL. Loads a video by media content URL.
-
mute(
) → void - Mutes the player.
-
nextVideo(
) → void - Loads and plays the next video in the playlist.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pauseVideo(
) → void - Pauses the currently playing video.
-
playVideo(
) → void - Plays the currently cued/loaded video.
-
playVideoAt(
num index) → void - Loads and plays the specified video in the playlist.
-
previousVideo(
) → void - Loads and plays the previous video in the playlist.
-
removeEventListener(
dynamic eventName, void listener(dynamic event)) → void - Remove an event listener for the specified event.
-
seekTo(
num seconds, bool allowSeekAhead) → void - Seeks to a specified time in the video.
-
setLoop(
bool loopPlaylists) → void - Sets whether the player should continuously play a playlist.
-
setPlaybackQuality(
String suggestedQuality) → void - Sets the suggested video quality for the current video.
-
setPlaybackRate(
num suggestedRate) → void - Sets the suggested playback rate for the current video.
-
setShuffle(
bool shufflePlaylist) → void - Sets whether a playlist's videos should be shuffled.
-
setSize(
num width, num height) → void - Sets the size in pixels of the
-
setVolume(
num volume) → void - Sets the player volume.
-
stopVideo(
) → void - Stops and cancels loading of the current video.
-
toString(
) → String -
A string representation of this object.
inherited
-
unMute(
) → void - Unmutes the player.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited