StyledPlayerView' is deprecated and is showing in android studio in Exoplayer 2.19 and google advised me to use AndroidX Media3 but I don't get anything on how to migrate to AndroidX Media3. can anyone write the sample code for this one?
here is my sample XML and Java code.
<com.google.android.exoplayer2.ui.StyledPlayerView
android:id="@+id/player_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:show_buffering="when_playing"
app:show_shuffle_button="true"
app:surface_type="texture_view"
app:use_controller="false" />
Java
playerView = findViewById(R.id.player_view);
// get path from raw folder ok.MOV video
String path = "android.resource://" + getPackageName() + "/" + R.raw.ok;
File file = new File(path);
playerView.setPlayer(player);
player.setMediaItem(MediaItem.fromUri(path));
player.prepare();
player.play();
how to do same in AndroidX Media3