File tree Expand file tree Collapse file tree
adobe/android/src/main/java/com/theoplayer/reactnative/adobe Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ ' @theoplayer/react-native-analytics-adobe ' : patch
3+ ---
4+
5+ Fixed an issue on Android where the playhead for Live events would exceed the maximum value.
Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ import kotlin.collections.orEmpty
4444import kotlin.collections.plus
4545import kotlin.collections.toMutableMap
4646import kotlinx.serialization.json.*
47+ import java.util.Calendar
4748
4849typealias AddTextTrackEvent = com.theoplayer.android.api.event.track.texttrack.list.AddTrackEvent
4950typealias RemoveTextTrackEvent = com.theoplayer.android.api.event.track.texttrack.list.RemoveTrackEvent
@@ -371,8 +372,14 @@ class AdobeConnector(
371372 }
372373
373374 private fun getCurrentTime (): Int {
374- return when (player.currentTime) {
375- Double .POSITIVE_INFINITY -> (System .currentTimeMillis() / 1000 ) % 86400
375+ return when (player.duration) {
376+ Double .POSITIVE_INFINITY -> {
377+ // Return seconds since start of day for live streams
378+ val calendar = Calendar .getInstance()
379+ calendar.get(Calendar .SECOND ) +
380+ 60 * (calendar.get(Calendar .MINUTE ) +
381+ 60 * calendar.get(Calendar .HOUR_OF_DAY ))
382+ }
376383 else -> player.currentTime
377384 }.toInt()
378385 }
You can’t perform that action at this time.
0 commit comments