Forum Cross Platform with Xamarin
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

trouble Stream audio live

hi i been trying, multiples nuget for stream live audios but nothing work
I try:
* CrossMediamanage

  • MediaManager
  • libVlc
    but no one work with 2 diferents stream URL
    I cant post url but i give img

someone, please help me, I use Xamarin forms 4.7 with prism.
also, try mediaelement to nothing happen.

with all the NuGet I try others stream like mp3 or mp4 and work,

any kind of help is welcome thanks

Best Answer

  • SeeddraverSeeddraver Member ✭✭
    Accepted Answer

    ok ok i got the trouble, After Android 9 (API level 28), cleartext support is disabled by default so to get the solution I use what @Javan show me and add on de android manifest

    so part of the solution Javan was right in part and that give the way to search for
    Thanks

Answers

  • SeeddraverSeeddraver Member ✭✭
    edited October 19

    this is a picture of android code that multiples forums use but not work

  • JarvanJarvan Member, Xamarin Team Xamurai
    edited October 20

    Try to specify the 'AudioStreamType' for the MediaPlayer.

    player = new MediaPlayer();
    player.SetAudioStreamType(Stream.Music);
    player.Prepared += (sender, args) => player.Start();
    ...
    await player.SetDataSourceAsync(ApplicationContext, Android.Net.Uri.Parse(Mp3));
    player.PrepareAsync();
    

    Related tutorial:
    https://devblogs.microsoft.com/xamarin/background-audio-streaming-with-xamarin-android/#starting-and-stopping-playback

  • SeeddraverSeeddraver Member ✭✭

    hi, not work no error in the try catch , i try but see 2 things for androids 5 work but the sound is minimal that's why i think that not work sorry , but for android 8, 9 ,10 no sound no error, whattttttttttttt???
    Jarvan thanks

  • SeeddraverSeeddraver Member ✭✭
    Accepted Answer

    ok ok i got the trouble, After Android 9 (API level 28), cleartext support is disabled by default so to get the solution I use what @Javan show me and add on de android manifest

    so part of the solution Javan was right in part and that give the way to search for
    Thanks

Sign In or Register to comment.