YouTube

YouTubeInitializationResult

public final enum
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 initializating 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. 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
Dialog getErrorDialog(Activity activity, int requestCode)
Returns a dialog to address this initialization error.
Dialog getErrorDialog(Activity activity, int requestCode, DialogInterface.OnCancelListener cancelListener)
Returns a dialog to address this initialization error.
boolean isUserRecoverableError()
Determines whether this error is user-recoverable.
static YouTubeInitializationResult valueOf(String name)
final static YouTubeInitializationResult[] values()
[Expand]
Inherited methods
final Object clone()
int compareTo(Object arg0)
final int compareTo(E arg0)
final boolean equals(Object arg0)
final void finalize()
final Class<E> getDeclaringClass()
final int hashCode()
final String name()
final int ordinal()
String toString()
static <T extends Enum<T>> T valueOf(Class<T> arg0, String arg1)
Object clone()
boolean equals(Object arg0)
void finalize()
final Class<?> getClass()
int hashCode()
final void notify()
final void notifyAll()
String toString()
final void wait()
final void wait(long arg0, int arg1)
final void wait(long arg0)
abstract int compareTo(T arg0)

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 APIs 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

An unknown error occurred. Retrying might 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 parent activity for creating the dialog, also used for identifying 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

public static YouTubeInitializationResult valueOf (String name)

public static final YouTubeInitializationResult[] values ()

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.