File tree Expand file tree Collapse file tree 1 file changed +3
-10
lines changed
libraries/ui_compose/src/main/java/androidx/media3/ui/compose/state Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ import androidx.compose.runtime.mutableStateOf
24
24
import androidx.compose.runtime.remember
25
25
import androidx.compose.runtime.setValue
26
26
import androidx.media3.common.Player
27
- import androidx.media3.common.listen
27
+ import androidx.media3.common.listenTo
28
28
import androidx.media3.common.util.UnstableApi
29
29
30
30
/* *
@@ -52,15 +52,8 @@ class MetadataState(private val player: Player) {
52
52
private set
53
53
54
54
suspend fun observe (): Nothing {
55
- player.listen { events ->
56
- if (
57
- events.containsAny(
58
- Player .EVENT_AVAILABLE_COMMANDS_CHANGED ,
59
- Player .EVENT_MEDIA_ITEM_TRANSITION ,
60
- )
61
- ) {
62
- uri = getMediaItemUriWithCommandCheck()
63
- }
55
+ player.listenTo(Player .EVENT_AVAILABLE_COMMANDS_CHANGED , Player .EVENT_MEDIA_ITEM_TRANSITION ) {
56
+ uri = getMediaItemUriWithCommandCheck()
64
57
}
65
58
}
66
59
You can’t perform that action at this time.
0 commit comments