Skip to content

Commit

Permalink
Merge pull request #285 from THEOplayer/bugfix/parse-sideloaded-textt…
Browse files Browse the repository at this point in the history
…rack-srclang-android

Bugfix/parse sideloaded texttrack srclang android
  • Loading branch information
wjoosen authored Mar 15, 2024
2 parents cb21e0e + bf9969a commit d781696
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

- Improved NowPlayingInfo updates for iOS by setting playbackRate on pause/playing events and processing the final info on player desctruction.
- Fixed an issue with misinterpretation of `targetVideoQuality = 0` (use video track with `uid == 0`) as `targetVideoQuality = undefined` (use ABR across all video qualities).
- Fixed an issue where the `srclang` property of a `textTrack` passed to a `SourceDescription` would not be parsed on Android.

### Added

Expand Down
2 changes: 2 additions & 0 deletions android/src/main/java/com/theoplayer/source/SourceAdapter.kt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ private const val PROP_SRC = "src"
private const val PROP_SOURCES = "sources"
private const val PROP_DEFAULT = "default"
private const val PROP_LABEL = "label"
private const val PROP_SRCLANG = "srclang"
private const val PROP_KIND = "kind"
private const val PROP_TIME_OFFSET = "timeOffset"
private const val PROP_INTEGRATION = "integration"
Expand Down Expand Up @@ -325,6 +326,7 @@ class SourceAdapter {
val builder = TextTrackDescription.Builder(jsonTextTrack.optString(PROP_SRC))
.isDefault(jsonTextTrack.optBoolean(PROP_DEFAULT))
.label(jsonTextTrack.optString(PROP_LABEL))
.srclang(jsonTextTrack.optString(PROP_SRCLANG))
.kind(parseTextTrackKind(jsonTextTrack.optString(PROP_KIND))!!)
return builder.build()
}
Expand Down

0 comments on commit d781696

Please sign in to comment.