Fix lint errors in shortform demo app
PiperOrigin-RevId: 629080780
This commit is contained in:
parent
a49b625cc5
commit
74bb4ac98d
@ -32,6 +32,6 @@ class MediaItemDatabase {
|
|||||||
|
|
||||||
fun get(index: Int): MediaItem {
|
fun get(index: Int): MediaItem {
|
||||||
val uri = mediaUris.get(index.mod(mediaUris.size))
|
val uri = mediaUris.get(index.mod(mediaUris.size))
|
||||||
return return MediaItem.Builder().setUri(uri).setMediaId(index.toString()).build()
|
return MediaItem.Builder().setUri(uri).setMediaId(index.toString()).build()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -33,6 +33,7 @@ import java.util.Collections
|
|||||||
import java.util.LinkedList
|
import java.util.LinkedList
|
||||||
import java.util.Queue
|
import java.util.Queue
|
||||||
|
|
||||||
|
@OptIn(UnstableApi::class)
|
||||||
class PlayerPool(
|
class PlayerPool(
|
||||||
private val numberOfPlayers: Int,
|
private val numberOfPlayers: Int,
|
||||||
context: Context,
|
context: Context,
|
||||||
@ -92,10 +93,10 @@ class PlayerPool(
|
|||||||
*
|
*
|
||||||
* @param keepOngoingPlayer The optional player that should keep playing if not paused.
|
* @param keepOngoingPlayer The optional player that should keep playing if not paused.
|
||||||
*/
|
*/
|
||||||
fun pauseAllPlayers(keepOngoingPlayer: Player? = null) {
|
private fun pauseAllPlayers(keepOngoingPlayer: Player? = null) {
|
||||||
playerMap.values.forEach {
|
for (player in playerMap.values) {
|
||||||
if (it != keepOngoingPlayer) {
|
if (player != keepOngoingPlayer) {
|
||||||
it.pause()
|
player.pause()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -49,7 +49,7 @@ class ViewPagerMediaHolder(itemView: View, private val playerPool: PlayerPool) :
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val player: ExoPlayer?
|
private val player: ExoPlayer?
|
||||||
get() {
|
get() {
|
||||||
return exoPlayer
|
return exoPlayer
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user