minor fix
This commit is contained in:
parent
b8e9786f4d
commit
672b6fd2dc
1 changed files with 10 additions and 6 deletions
|
@ -541,6 +541,7 @@ class MetadataFetchHandler(private val context: Context) : MethodCallHandler {
|
||||||
|
|
||||||
// fallback to MP4 `loci` box for location
|
// fallback to MP4 `loci` box for location
|
||||||
if (!metadataMap.contains(KEY_LATITUDE) || !metadataMap.contains(KEY_LONGITUDE)) {
|
if (!metadataMap.contains(KEY_LATITUDE) || !metadataMap.contains(KEY_LONGITUDE)) {
|
||||||
|
try {
|
||||||
Mp4ParserHelper.getUserDataBox(context, mimeType, uri)?.let { userDataBox ->
|
Mp4ParserHelper.getUserDataBox(context, mimeType, uri)?.let { userDataBox ->
|
||||||
Path.getPath<LocationInformationBox>(userDataBox, LocationInformationBox.TYPE)?.let { locationBox ->
|
Path.getPath<LocationInformationBox>(userDataBox, LocationInformationBox.TYPE)?.let { locationBox ->
|
||||||
if (!locationBox.isParsed) {
|
if (!locationBox.isParsed) {
|
||||||
|
@ -550,6 +551,9 @@ class MetadataFetchHandler(private val context: Context) : MethodCallHandler {
|
||||||
metadataMap[KEY_LONGITUDE] = locationBox.longitude
|
metadataMap[KEY_LONGITUDE] = locationBox.longitude
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.w(LOG_TAG, "failed to get Location Information box by MP4 parser for mimeType=$mimeType uri=$uri", e)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue