java.lang.Object | ||
↳ | java.lang.Enum<com.google.android.youtube.player.YouTubeInitializationResult> | |
↳ | com.google.android.youtube.player.YouTubeInitializationResult |
Provides the result of initializing the YouTube API Service. If initialization fails,
the reason for the failure is provided and, if this error is recoverable by user action,
then a mechanism to recover from the error is available via getErrorDialog(Activity, int)
.
Enum Values | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
YouTubeInitializationResult | CLIENT_LIBRARY_UPDATE_REQUIRED | The version of the client library used to connect to the YouTube API service is out of date. | |||||||||
YouTubeInitializationResult | DEVELOPER_KEY_INVALID | The developer key which was supplied to the initialization function is invalid. | |||||||||
YouTubeInitializationResult | ERROR_CONNECTING_TO_SERVICE | There was an error connecting to the YouTube API service. | |||||||||
YouTubeInitializationResult | INTERNAL_ERROR | An internal error occurred. | |||||||||
YouTubeInitializationResult | INVALID_APPLICATION_SIGNATURE | The application's APK has been incorrectly signed. | |||||||||
YouTubeInitializationResult | NETWORK_ERROR | There was an error connecting to the network which prevented the YouTube Player API service initializing. | |||||||||
YouTubeInitializationResult | SERVICE_DISABLED | The installed version of the YouTube API service has been disabled on this device. | |||||||||
YouTubeInitializationResult | SERVICE_INVALID | The version of the YouTube API service installed on this device is not valid. | |||||||||
YouTubeInitializationResult | SERVICE_MISSING | The YouTube API service is missing on this device. | |||||||||
YouTubeInitializationResult | SERVICE_VERSION_UPDATE_REQUIRED | The installed version of YouTube API service is out of date. | |||||||||
YouTubeInitializationResult | SUCCESS | The initialization attempt was successful. | |||||||||
YouTubeInitializationResult | UNKNOWN_ERROR | The reason for the error is not known. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns a dialog to address this initialization error.
| |||||||||||
Returns a dialog to address this initialization error.
| |||||||||||
Determines whether this error is user-recoverable.
| |||||||||||
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() |
The version of the client library used to connect to the YouTube API service is out of date. The calling application must be rebuilt against a new version of the YouTube Android Player API client library.
The developer key which was supplied to the initialization function is invalid.
To generate a new key, visit the Google Developers Console.
There was an error connecting to the YouTube API service.
An internal error occurred. Retrying should resolve the problem.
The application's APK has been incorrectly signed.
The application's APK must be signed with a single certificate. The YouTube Player API does not support applications which have not been signed, or have been signed by more than one certificate. For details on APK signing, please refer to this article.
There was an error connecting to the network which prevented the YouTube Player API service initializing. Check that the device is connected to the Internet.
The installed version of the YouTube API service has been disabled on this device.
The calling activity should pass this error reason to getErrorDialog(Activity, int)
to get a localized error dialog that will enable the user to resolve the error when shown.
The version of the YouTube API service installed on this device is not valid. This may happen if there is a service on the device with the same name as the YouTube API service, but which is not the official service provided by YouTube.
The YouTube API service is missing on this device. The calling activity should pass this
error reason to getErrorDialog(Activity, int)
to get a localized error dialog
that will enable the user to resolve the error when shown.
The installed version of YouTube API service is out of date. The calling activity should pass
this error reason to getErrorDialog(Activity, int)
to get a localized error dialog
that will enable the user to resolve the error when shown.
The reason for the error is not known. This may be because the client library is older than
the YouTube API service, and does not know of the actual YouTubeInitializationResult
that is being returned by the service. Retrying may resolve the problem.
Returns a dialog to address this initialization error. The returned dialog displays a localized message about the error and upon user confirmation (by tapping on dialog) will direct them to the Play Store if the YouTube App is out of date or missing, or to system settings if YouTube App is disabled on the device.
activity | The parent activity for creating the dialog, also used for identifying the language to display dialog in. |
---|---|
requestCode | The requestCode given when calling startActivityForResult .
|
Returns a dialog to address this initialization error. The returned dialog displays a localized message about the error and upon user confirmation (by tapping on dialog) will direct them to the Play Store if the YouTube App is out of date or missing, or to system settings if YouTube App is disabled on the device.
activity | parent activity for creating the dialog, also used for identifying language to display dialog in. |
---|---|
requestCode | The requestCode given when calling startActivityForResult . |
cancelListener | The DialogInterface.OnCancelListener to invoke if the dialog is
canceled.
|
Determines whether this error is user-recoverable. If true, proceed by calling
getErrorDialog(Activity, int)
and then show this dialog to enable users to recover
from this error.
true
if the error is recoverable with by calling
getErrorDialog(Activity, int)
, otherwise false
.