Youtube API
Overview
Api from youtube allows you to watch a video from youtube on the devices (Android and IOS) using TotalCross.
Source Code
Attributes
Type
Name
Description
static final int
STATE_UNSTARTED
is a state of when the video has not started yet
static final int
STATE_ENDED
is a state of when the video ended
static final int
STATE_PLAYING
is a state of when the video is still playing
static final int
STATE_PAUSED
is a state of when the video is still paused
static final int
STATE_BUFFERING
is a state of when the video is still loading
static final int
STATE_CUED
is a state of when the video is still cued
static final int
STATE_UNKNOWN
when the player does not know what current state
static final int
ERROR_VIDEO_NOT_FOUND
when the video was not found
static final int
ERROR_UNKNOWN
Unknown error happened
Methods
Type
Name
Description
YoutubePlayer
autoPlay
Sets the video to play automatically when it's loaded.
YoutubePlayer
end
Sets the end point in seconds of the video.
YoutubePlayer
start
Sets the start point in seconds of the video.
void
play(String id)
plays the video that was passed in id
void
play(String id, Callback callback)
plays the video that was passed in the id and has a callback to inform which state of the player
References
You can view the code shown above in github
Last updated