Closed IbrahimMAATKI closed 9 months ago
Media3 1.2.0
main
reproducible on all devices
Not tested
Current Configuration of project "com.android.tools.buil:gradle:8.2.0" "org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.20" "com.squareup:javapoet:1.13.0" "androidx.media3:media3-exoplayer:1.2.0" "com.google.dagger:hilt-android:2.48.1" Java_1_8
"com.android.tools.buil:gradle:8.2.0" "org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.20" "com.squareup:javapoet:1.13.0" "androidx.media3:media3-exoplayer:1.2.0" "com.google.dagger:hilt-android:2.48.1" Java_1_8
val viewModel = hiltViewModel<MainViewModel>() val videoItems by viewModel.videoItems.collectAsState() val selectVideoLauncher = rememberLauncherForActivityResult( contract = ActivityResultContracts.GetContent(), onResult = { uri -> uri?.let(viewModel::addVideoUri) } ) var lifecycle by remember { mutableStateOf(Lifecycle.Event.ON_CREATE) } val lifecycleOwner = LocalLifecycleOwner.current DisposableEffect(lifecycleOwner) { val observer = LifecycleEventObserver { _, event -> lifecycle = event } lifecycleOwner.lifecycle.addObserver(observer) onDispose { lifecycleOwner.lifecycle.removeObserver(observer) } } Column( modifier = Modifier .fillMaxSize() .padding(16.dp) ) { AndroidView( factory = { context -> PlayerView(context).also { it.player = viewModel.player } }, update = { when (lifecycle) { Lifecycle.Event.ON_PAUSE -> { it.onPause() it.player?.pause() } Lifecycle.Event.ON_RESUME -> { it.onResume() } else -> Unit } }, modifier = Modifier .fillMaxWidth() .aspectRatio(16 / 9f) ) Spacer(modifier = Modifier.height(8.dp)) IconButton(onClick = { selectVideoLauncher.launch("video/mp4") }) { Icon( imageVector = Icons.Default.FileOpen, contentDescription = "Select video" ) } Spacer(modifier = Modifier.height(16.dp)) LazyColumn( modifier = Modifier.fillMaxWidth() ) { items(videoItems) { item -> Text( text = item.name, modifier = Modifier .fillMaxWidth() .clickable { viewModel.playVideo(item.contentUri) } .padding(16.dp) ) } } }
Media player runs normally
Emulator freezes with only (E ioctl c0044901 failed with code -1: Not a typewriter) in logcat
Media files are MP4 stored in raw resource folder Codec : H.264
adb bugreport
Not relevant as it's happening on emulator adn just changing android version on emulator fixes the issue
Version
Media3 1.2.0
More version details
main
Devices that reproduce the issue
Devices that do not reproduce the issue
reproducible on all devices
Reproducible in the demo app?
Not tested
Reproduction steps
Current Configuration of project
"com.android.tools.buil:gradle:8.2.0" "org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.20" "com.squareup:javapoet:1.13.0" "androidx.media3:media3-exoplayer:1.2.0" "com.google.dagger:hilt-android:2.48.1" Java_1_8
Expected result
Media player runs normally
Actual result
Emulator freezes with only (E ioctl c0044901 failed with code -1: Not a typewriter) in logcat
Media
Media files are MP4 stored in raw resource folder Codec : H.264
Bug Report
adb bugreport
to android-media-github@google.com after filing this issue.