YouTubeInitializationResult
extends Enum<E extends Enum<E>>
java.lang.Object | ||
↳ | java.lang.Enum<E extends java.lang.Enum<E>> | |
↳ | com.google.android.youtube.player.YouTubeInitializationResult |
Overview
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)
.
Summary
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.
| |||||||||||
YouTubeInitializationResult |
|||||||||||
YouTubeInitializationResult[] |
Inherited methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Enum values
public
static
final
YouTubeInitializationResult
CLIENT_LIBRARY_UPDATE_REQUIRED
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.
public
static
final
YouTubeInitializationResult
DEVELOPER_KEY_INVALID
The developer key which was supplied to the initialization function is invalid.
To generate a new key, visit the Google Developers Console.
public
static
final
YouTubeInitializationResult
ERROR_CONNECTING_TO_SERVICE
There was an error connecting to the YouTube API service.
public
static
final
YouTubeInitializationResult
INTERNAL_ERROR
An internal error occurred. Retrying should resolve the problem.
public
static
final
YouTubeInitializationResult
INVALID_APPLICATION_SIGNATURE
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.
public
static
final
YouTubeInitializationResult
NETWORK_ERROR
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.
public
static
final
YouTubeInitializationResult
SERVICE_DISABLED
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.
public
static
final
YouTubeInitializationResult
SERVICE_INVALID
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.
public
static
final
YouTubeInitializationResult
SERVICE_MISSING
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.
public
static
final
YouTubeInitializationResult
SERVICE_VERSION_UPDATE_REQUIRED
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.
public
static
final
YouTubeInitializationResult
SUCCESS
The initialization attempt was successful.
public
static
final
YouTubeInitializationResult
UNKNOWN_ERROR
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.
Public methods
public Dialog getErrorDialog (Activity activity, int requestCode)
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.
Parameters
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 .
|
public Dialog getErrorDialog (Activity activity, int requestCode, DialogInterface.OnCancelListener cancelListener)
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.
Parameters
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.
|
public boolean isUserRecoverableError ()
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.
Returns
true
if the error is recoverable with by callinggetErrorDialog(Activity, int)
, otherwisefalse
.
public
static
YouTubeInitializationResult
valueOf
(String name)
public
static
final
YouTubeInitializationResult[]
values
()
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2022-11-04 UTC.