Im using this code on the android 8 and below but on Android version 9+ its not working.
MediaPlayer player3;
player3 = new MediaPlayer();
player3.SetDataSource(url);
player3.SetAudioStreamType(Stream.Music);
player3.Completion += mediaPlayer_Completion;
player3.PrepareAsync();
player3.Start();
EDIT: Im trying to reproduce a audio stream link. The player doesn't do anything. The same code it works fine on another android versions.
Check https://koz.io/android-m-and-the-war-on-cleartext-traffic/
Solution 1
Create file
network_security_config.xml
AndroidManifest.xml -
Solution 2
Android:usesCleartextTraffic Doc
AndroidManifest.xml -