Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
SDK
/
exoplayer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
5b51cb72
authored
Nov 23, 2020
by
olly
Committed by
Ian Baker
Nov 30, 2020
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Reference IMA language code bug
PiperOrigin-RevId: 343883034
parent
d5829336
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
extensions/ima/src/main/java/com/google/android/exoplayer2/ext/ima/ImaAdsLoader.java
extensions/ima/src/main/java/com/google/android/exoplayer2/ext/ima/ImaAdsLoader.java
View file @
5b51cb72
...
@@ -1959,11 +1959,12 @@ public final class ImaAdsLoader
...
@@ -1959,11 +1959,12 @@ public final class ImaAdsLoader
/**
/**
* Returns a language code that's suitable for passing to {@link ImaSdkSettings#setLanguage} and
* Returns a language code that's suitable for passing to {@link ImaSdkSettings#setLanguage} and
* corresponds to the device's {@link Locale#getDefault() default Locale}.
* corresponds to the device's {@link Locale#getDefault() default Locale}. IMA will fall back to
* its default language code ("en") if the value returned is unsupported.
*/
*/
// TODO: It may be possible to define a better mapping onto IMA's supported language codes. See:
// TODO: It may be possible to define a better mapping onto IMA's supported language codes. See:
// https://developers.google.com/interactive-media-ads/docs/sdks/android/client-side/localization.
// https://developers.google.com/interactive-media-ads/docs/sdks/android/client-side/localization.
//
IMA will fall back to its default language code ("en") if the value returned is unsuppor
ted.
//
[Internal ref: b/174042000] will help if implemen
ted.
private
static
String
getImaLanguageCodeForDefaultLocale
()
{
private
static
String
getImaLanguageCodeForDefaultLocale
()
{
return
Util
.
splitAtFirst
(
Util
.
getSystemLanguageCodes
()[
0
],
"-"
)[
0
];
return
Util
.
splitAtFirst
(
Util
.
getSystemLanguageCodes
()[
0
],
"-"
)[
0
];
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment