Dealing with Android Mobile SDK Errors

You need to listen for error notifications on the player object.

First declare the following:

.
.public static final String ERROR_NOTIFICATION = "error" ;  
 /** Fires when an error occurs */

After an error notification is received, to determine the exact error, read the error property of the player object:

  public String getError() {
    return _error;
  }     
The errors are as follows, with explanatory comments:
  public enum OoyalaErrorCode {
    /** Authorization Response invalid */
    ERROR_AUTHORIZATION_INVALID,
    /** Content Tree Response invalid */
    ERROR_CONTENT_TREE_INVALID,
    /** Authorization failed */
    ERROR_AUTHORIZATION_FAILED,
    /** The signature of the Authorization Response is invalid */
    ERROR_AUTHORIZATION_SIGNATURE_INVALID,
    /** Content Tree Next failed */
    ERROR_CONTENT_TREE_NEXT_FAILED,
    /** An Internal Android Error. Check the Throwable properties. */
    ERROR_INTERNAL_ANDROID,
    /** Playback failed */
    ERROR_PLAYBACK_FAILED,
    /** Authorization Heartbeat failed.  Check properties. */
    ERROR_AUTHORIZATION_HEARTBEAT_FAILED,
    /** Metadata fetch failed*/
    ERROR_METADATA_FETCH_FAILED,
    ERROR_UNKNOWN,
    /** Failed to get Discovery results. */
    ERROR_DISCOVERY_GET_FAILURE,
    /** Failed to post Discovery pins. */
    ERROR_DISCOVERY_POST_FAILURE,
  };     

Authorization Error Codes

You can examine the authCode on your player object's current item (player().currentItem().authCode()) for possible errors, as shown below.

Error Code
AUTHORIZED 0
UNAUTHORIZED_PARENT 1
UNAUTHORIZED_DOMAIN 2
UNAUTHORIZED_LOCATION 3
BEFORE_FLIGHT_TIME 4
AFTER_FLIGHT_TIME 5
OUTSIDE_RECURRING_FLIGHT_TIMES 6
BAD_EMBED_CODE 7
INVALID_SIGNATURE 8
MISSING_PARAMS 9
MISSING_RULE_SET 10
UNAUTHORIZED 11
MISSING_PCODE 12
UNAUTHORIZED_DEVICE 13
INVALID_TOKEN 14
TOKEN_EXPIRED 15
UNAUTHORIZED_MULTI_SYND_GROUP 16
PROVIDER_DELETED 17
TOO_MANY_ACTIVE_STREAMS 18
MISSING_ACCOUNT_ID 19
NO_ENTITLEMENTS_FOUND 20
NON_ENTITLED_DEVICE 21
NON_REGISTERED_DEVICE 22

Was this article helpful?