Skip to content

Commit

Permalink
Fix bug where events would be missing on release
Browse files Browse the repository at this point in the history
  • Loading branch information
stoyicker committed Jun 28, 2024
1 parent b3e1c00 commit b06c976
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,12 @@ internal class ExoPlayerPlaybackEngine(
}

override fun release() {
val positionInSeconds = if (forwardingMediaProduct?.productType == ProductType.BROADCAST) {
extendedExoPlayer.currentPositionSinceEpochMs
} else {
extendedExoPlayer.currentPositionMs
}.toDouble() / MS_IN_SECOND
reportEnd(EndReason.OTHER, endPositionSeconds = positionInSeconds)
extendedExoPlayer.release()
coroutineScope.launch {
eventSink.emit(Event.Release)
Expand Down

0 comments on commit b06c976

Please sign in to comment.