Localization (Android v3)


The JWP SDK for Android supports localizing error strings and setting the language in the IMA SDK.

Localized Error Messages

The following default error messages can be overridden by defining string resources in your application's strings.xml file.

String IDDescription
jw_error_unrecognized_input_format_exceptionDisplayed when the content URL doesn't point to video, or is being redirected to a WiFi portal or proxy.
jw_error_decoder_initialization_exceptionDisplayed when the device does not have a hardware decoder that can decode the video content.
jw_error_io_exceptionDisplayed when any IO exception occurs - e.g. interrupted stream, failed to read local file.
jw_error_illegal_argument_exceptionDisplayed when an illegal argument is passed to ExoPlayer.
jw_error_invalid_response_code_exceptionDisplayed when an HTTP request recieves an unsupported response code - e.g. 500, 404.
jw_error_http_data_source_exceptionDisplayed when ExoPlayer fails to fetch a segment of content - e.g. attempting to buffer while offline.
jw_error_cast_media_format_unsupportedDisplayed when casting is attempted with an unsupported media type.
jw_error_cast_loading_failedDisplayed when loading fails during casting.
jw_error_cast_loading_failed_with_status_codeDisplayed when loading failed during casting and a status code is available.
jw_error_cast_loading_failed_no_connectionDisplayed when connecting to Chromecast fails


ImaSdkSettings

To localize the language used during IMA ads:

ImaSdkSettings imaSdkSettings = new ImaSdkSettings();
	// Use the 2-letter ISO 639-1 language code for your desired language 
	imaSdkSettings.setLanguage("NL");
	ImaAdvertising imaAdvertising = new ImaAdvertising(schedule, imaSdkSettings);
	playerConfig.setAdvertising(imaAdvertising);