-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for THEOlive integration on Android
- Loading branch information
1 parent
8859db7
commit 953a2a4
Showing
3 changed files
with
60 additions
and
9 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
android/src/main/java/com/theoplayer/latency/LatencyConfiguration.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.theoplayer.latency | ||
|
||
import com.theoplayer.android.api.latency.LatencyConfiguration | ||
import org.json.JSONObject | ||
|
||
private const val PROP_MINIMUM_OFFSET = "minimumOffset" | ||
private const val PROP_MAXIMUM_OFFSET = "maximumOffset" | ||
private const val PROP_TARGET_OFFSET = "targetOffset" | ||
private const val PROP_FORCE_SEEK_OFFSET = "forceSeekOffset" | ||
private const val PROP_MINIMUM_PLAYBACK_RATE = "minimumPlaybackRate" | ||
private const val PROP_MAXIMUM_PLAYBACK_RATE = "maximumPlaybackRate" | ||
|
||
fun parseLatencyConfiguration(jsonLatency: JSONObject): LatencyConfiguration { | ||
return LatencyConfiguration.Builder().apply { | ||
setMinimumOffset(jsonLatency.optDouble(PROP_MINIMUM_OFFSET)) | ||
setMaximumOffset(jsonLatency.optDouble(PROP_MAXIMUM_OFFSET)) | ||
setTargetOffset(jsonLatency.optDouble(PROP_TARGET_OFFSET)) | ||
setForceSeekOffset(jsonLatency.optDouble(PROP_FORCE_SEEK_OFFSET)) | ||
setMinimumPlaybackRate(jsonLatency.optDouble(PROP_MINIMUM_PLAYBACK_RATE)) | ||
setMaximumPlaybackRate(jsonLatency.optDouble(PROP_MAXIMUM_PLAYBACK_RATE)) | ||
}.build() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters