java.lang.Object | |
↳ | com.google.android.youtube.player.YouTubeIntents |
A selection of static methods that create intents which navigate to specific activities within the main YouTube application.
Video and playlist IDs required by methods such as
createPlayVideoIntent(Context, String)
or
createOpenPlaylistIntent(Context, String)
are provided by the YouTube Data API. To learn
more about this API, visit https://developers.google.com/youtube/v3/.
Use the canResolve
methods before sending an intent to make sure that the user's device
has a version of the YouTube application that supports the given intent.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Checks if the YouTube application installed on the user's device supports the open channel
intent.
| |||||||||||
Checks if the YouTube application installed on the user's device supports the open playlist
intent.
| |||||||||||
Checks if the YouTube application installed on the user's device supports the play playlist
intent.
| |||||||||||
Checks if the YouTube application installed on the user's device supports the play video
intent.
| |||||||||||
Checks if the YouTube application installed on the user's device supports the
fullscreen and finishOnEnd optional parameters when resolving a play video
intent. | |||||||||||
Checks if the YouTube application installed on the user's device supports the open search
results intent.
| |||||||||||
Checks if the YouTube application installed on the user's device supports the upload video
intent.
| |||||||||||
Checks if the YouTube application installed on the user's device supports the open user intent.
| |||||||||||
Creates an Intent that, when resolved, will open the channel page for the given channel ID
in the YouTube application.
| |||||||||||
Creates an Intent that, when resolved, will open the given playlist in the YouTube
application.
| |||||||||||
Creates an Intent that, when resolved, will start playing the given playlist in the YouTube
application from its first video.
| |||||||||||
Creates an Intent that, when resolved, will start playing the video specified by
videoId , within the YouTube application. | |||||||||||
Creates an Intent that, when resolved, will start playing the video specified by
videoId , within the YouTube application. | |||||||||||
Creates an Intent that, when resolved, will open the search results for the given query
in the YouTube application.
| |||||||||||
Creates an Intent that, when resolved, will open the upload activity in the YouTube
application for the video specified by the
videoUri . | |||||||||||
Creates an Intent that, when resolved, will open the user page for the given user ID
in the YouTube application.
| |||||||||||
Retrieves the version code of the YouTube application installed on the user's device.
| |||||||||||
Retrieves the version name of the YouTube application installed on the user's device.
| |||||||||||
Checks if the YouTube application is installed on the user's device.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Checks if the YouTube application installed on the user's device supports the open channel intent.
context | The current Context. |
---|
true
if the YouTube application installed on the user's device allows external
apps to navigate to the Channel page, false
otherwise.Checks if the YouTube application installed on the user's device supports the open playlist intent.
context | The current Context. |
---|
true
if the YouTube application installed on the user's device allows external
apps to navigate to the Playlist page, false
otherwise.Checks if the YouTube application installed on the user's device supports the play playlist intent.
context | The current Context. |
---|
true
if the YouTube application installed on the user's device allows external
apps to start playing a playlist, false
otherwise.Checks if the YouTube application installed on the user's device supports the play video intent.
context | The current Context. |
---|
true
if the YouTube application installed on the user's device allows external
apps to play a video in the YouTube application, false
otherwise.Checks if the YouTube application installed on the user's device supports the
fullscreen
and finishOnEnd
optional parameters when resolving a play video
intent.
true
, then your application can call the createPlayVideoIntentWithOptions
method.false
, then your application should call the createPlayVideoIntent
method instead.context | The current Context. |
---|
true
if the YouTube application installed on the user's device supports the
fullscreen
and finishOnEnd
optional parameters when resolving a play
video intent, false
otherwise.Checks if the YouTube application installed on the user's device supports the open search results intent.
context | The current Context. |
---|
true
if the YouTube application installed on the user's device allows external
apps to perform a search, false
otherwise.Checks if the YouTube application installed on the user's device supports the upload video intent.
context | The current Context. |
---|
true
if the YouTube application installed on the user's device allows external
apps to upload videos to YouTube, false
otherwise.Checks if the YouTube application installed on the user's device supports the open user intent.
context | The current Context. |
---|
true
if the YouTube application installed on the user's device allows external
apps to navigate to the User page, false
otherwise.Creates an Intent that, when resolved, will open the channel page for the given channel ID in the YouTube application.
context | The current Context. |
---|---|
channelId | The ID of the channel to be displayed, as returned from the YouTube Data API. |
Creates an Intent that, when resolved, will open the given playlist in the YouTube application.
context | The current Context. |
---|---|
playlistId | The ID of the playlist to be opened, as returned from the YouTube Data API. |
Creates an Intent that, when resolved, will start playing the given playlist in the YouTube application from its first video.
context | The current Context. |
---|---|
playlistId | The ID of the playlist to be played, as returned from the YouTube Data API. |
Creates an Intent that, when resolved, will start playing the video specified by
videoId
, within the YouTube application.
context | The current Context. |
---|---|
videoId | The ID of the video to be played, as returned from the YouTube Data API. |
Creates an Intent that, when resolved, will start playing the video specified by
videoId
, within the YouTube application.
context | The current Context. |
---|---|
videoId | The ID of the video to be played, as returned from the YouTube Data API. |
fullscreen | If true the video will be played fullscreen, if false the
video will be played according to the orientation of the device. |
finishOnEnd | If true will finish the YouTube application activity and return to
the calling activity once the video has finished, if false will only return
when the user clicks the back button. |
Creates an Intent that, when resolved, will open the search results for the given query in the YouTube application.
context | The current Context. |
---|---|
query | The search query to request search results for. |
Creates an Intent that, when resolved, will open the upload activity in the YouTube
application for the video specified by the videoUri
. An exception will be thrown if
videoUri
does not exist or is invalid. If the video specified by videoUri
does
not exist, the resulting Activity will end immediately after starting.
context | The current Context. |
---|---|
videoUri | A Uri that points to the video on your device you wish to upload. |
IllegalArgumentException | will be thrown if the video specified by the Uri is invalid. |
---|
Creates an Intent that, when resolved, will open the user page for the given user ID in the YouTube application.
context | The current Context. |
---|---|
username | The name of the channel that you want to retrieve information about. |
Retrieves the version code of the YouTube application installed on the user's device.
context | The current Context. |
---|
-1
if YouTube is not installed.
Retrieves the version name of the YouTube application installed on the user's device.
context | The current Context. |
---|
null
if YouTube is not installed.
Checks if the YouTube application is installed on the user's device.
context | The current Context. |
---|
true
if the YouTube application is installed on the user's device,
false
otherwise.