Skip to content

Commit

Permalink
Correctly forward MediaPeriod.Callback with PillarboxMediaPeriod.
Browse files Browse the repository at this point in the history
  • Loading branch information
StaehliJ committed Jan 17, 2025
1 parent dc83d53 commit e4e435a
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,19 @@ internal class PillarboxMediaPeriod(
fun release(mediaSource: MediaSource) {
mediaSource.releasePeriod(mediaPeriod)
}

override fun prepare(callback: MediaPeriod.Callback, positionUs: Long) {
mediaPeriod.prepare(
object : MediaPeriod.Callback {
override fun onPrepared(mediaPeriod: MediaPeriod) {
callback.onPrepared(this@PillarboxMediaPeriod)
}

override fun onContinueLoadingRequested(source: MediaPeriod) {
callback.onContinueLoadingRequested(this@PillarboxMediaPeriod)
}
},
positionUs
)
}
}

0 comments on commit e4e435a

Please sign in to comment.