본문 바로가기
Android

ExoPlayer clip media

by kkong93 2023. 8. 1.
반응형
exoPlayer?.apply {
    prepare()
    playWhenReady = true
    repeatMode = REPEAT_MODE_ALL
    volume = 0f
}

val clippingConfiguration = MediaItem.ClippingConfiguration.Builder()
    .setStartPositionMs(startTime)
    .setEndPositionMs(endTime)
    .build()

val mediaItem = MediaItem.Builder()
    .setUri(url)
    .setClippingConfiguration(clippingConfiguration)
    .build()

exoPlayer?.setMediaItem(mediaItem)
반응형

댓글