XamarinMediaManager icon indicating copy to clipboard operation
XamarinMediaManager copied to clipboard

Play remote url is taking so long to start

Open mvnerisantos opened this issue 8 years ago • 9 comments

Hi, I´m trying to stream this url "http://208.115.213.242:9306". When start play is taking like 40 seconds to start play. Maybe i missing a configuration?

`IMediaFile mediaFile = new MediaFile { Type = MediaFileType.Audio, Availability = ResourceAvailability.Remote, Url = _appSettings.RadioUrl };

            await _mediaManager.Play(mediaFile);`

await CrossMediaManager.Current.Play("http://208.115.213.242:9306", MediaFileType.Audio)

mvnerisantos avatar Jan 21 '18 18:01 mvnerisantos

Which platform?

CSkoubo avatar Jan 23 '18 07:01 CSkoubo

Xamarin Forms.

mvnerisantos avatar Jan 23 '18 12:01 mvnerisantos

I am running a few shoutcast streams in my app and dont have a lag that long, there is a 3-5 second lag typically but not 40 seconds. I did find that certain hosting services were poorly configured and poorly managed, I ended up creating my own shoutcast server using Digital Ocean Droplets.

I have tested http://208.115.213.242:9306/stream in the sample app on the same network and devices that I test my app on (Where the streams connect in sub 5 seconds) and get the 40ish seconds connect time you are seeing, I suspect it is a server configuration issue as a service I initially tested during my development had a similiar issue, I abandoned the service and started my own shoutcast server.

I tested this on a Nexus 6p with Android 8.01 on it. IOS works properly, I suspect it is something about the stream does not work well with Android MediaPlayer, ExoPlayer and its myriad of streaming options should resolve the problem but there is no ETA at this point for completion of that code.

My streams encoding report as HE-AAC @ 128 kbps, 44.1 kHz Yours reports as HE-AAC @ 32 kbps, 22.05 kHz

mike-rowley avatar Jan 23 '18 18:01 mike-rowley

Im running the latest develop in my solution, and it plays shoutcast within a second. If using the 0.4.5 nuget i don't even bother waiting for it.

I think its in place to start pushing a Alpha release.

CSkoubo avatar Jan 23 '18 20:01 CSkoubo

@mike-rowley thanks. I´m going to check the server configuration.

mvnerisantos avatar Jan 24 '18 14:01 mvnerisantos

Hello there,

I have the same problem, audio takes at least 20 seconds to start playing. Testing it on a 100mbps internet connection so buffering is not an issue. The exact same code on UWP plays almost instantly.

Can we please have a prerelease nuget package with all latest fixes? I do not want to switch to paket (to reference this GitHub directly, already tried it, lots of errors and no time to investigate :) )

Chris-Ar avatar Mar 12 '18 09:03 Chris-Ar

If you want a prerelease, then take a look at the cake script and try to make it work. I am currently busy with the multi target implementation. When that is done ill take a look at cake, if none else has.

I have uploaded some nugets i made my self, for a project. They are latest develop, but with no track selection as it crashes.

https://www.myget.org/feed/temp-mediamanager/package/nuget/Plugin.MediaManager https://www.myget.org/feed/temp-mediamanager/package/nuget/Plugin.MediaManager.ExoPlayer

If you want me to remove it @martijn00 just ping me :)

CSkoubo avatar Mar 12 '18 10:03 CSkoubo

Thank you very much for the response and the packages.

I am new at this, I only found out about the cake file yesterday as I was searching. Right now I am trying to push a working app asap and after that I'll dig deeper into this.

Thanks again for your time

Chris-Ar avatar Mar 12 '18 11:03 Chris-Ar

I don't have time to fix up the missing pieces, or the other feature requests right now. I'm available for hire to fix this up and integrate changes into your project if you or anyone else wants. Drop me an email or message and we can talk about it.

martijn00 avatar May 18 '18 15:05 martijn00