SRGSSR / srgmediaplayer-apple

An advanced media player library, simple and reliable
MIT License
158 stars 33 forks source link

Player dont stop buffering ui state (statusbar) #4

Closed dasoli closed 7 years ago

dasoli commented 8 years ago

Issue overview

The Player don't stop the buffering (maybe only ui state) anymore again. You could see this in the statusbar.

Environment information

Check the correct option below

  • [X] Always reproducible
  • [ ] Difficult to reproduce

    Code sample

I allocate the players like that:

//---------------------------------------------------------------------------------------------- -(RTSMediaPlayerController)mediaplayerWithUrl:(NSURL)url //---------------------------------------------------------------------------------------------- { if (!url) { return nil; } [self.mediaplayer pause]; self.mediaplayer = nil; return [[RTSMediaPlayerController alloc] initWithContentURL:url]; }

i stop like that :

[self.mediaplayer pause];

Steps to reproduce

  1. Play a realtime audio (for example radio stream: https://www.crowdradio.de/kunden/puls_br/puls_hifi.m3u )
  2. stop it
  3. the statusbar spinning wheel never stop again (but on cpu load i cant see something interesting, its around 0-2% load)
dasoli commented 8 years ago

The Problem is only with Livestreams, the solution is to force a hard source reset over the reset functions.

[mediaplayer reset];

Could be closed?

defagos commented 7 years ago

Hi,

Your issue is strange. Our implementation does not alter the status bar activity indicator visibility in any way. Do your code update it somehow?

Thanks.

dasoli commented 7 years ago

Hey, sorry for the late response @defagos.

After your hint i checked the code and it seems its AFNetwork Network Indicator Scanner. But maybe thats really a hint for a problem. Because, if the source is not a livestream all works fine and only with livestreams the scanner has its problems. If i dealloc the player via your reset func all works, if i only set the player to nil it doesnt.

For me its fixed, but maybe you could find something with the hint?

Thx and keep going on ;)

defagos commented 7 years ago

Thanks for your answer. It is still odd since what the player basically requires is a URL. Issues with how AFNetworking deals with the status indicator should therefore not arise anymore once the player plays its content, as AFNetworking involvement should be limited to retrieving the URL.

The only issue I could think of is if you implemented a data source (RTSMediaPlayerControllerDataSource) to retrieve the URL using AFNetworking. We had issues in the past (especially with canceling connections) and, depending on how the data source itself is implemented, I could imagine some subtle bugs could arise. If you are playing the URL directly, then those problems are not relevant to you.

We greatly simplified the URL retrieval process in our next 2.0 release of the library, though, by removing the data source concept altogether. The work on it is nearly done on develop, but we will only deliver an official tag when this version is in production within our applications (probably in the next couple of months).

Thanks again for your feedback. I will close this ticket for now, do not hesitate to reopen it if you encounter similar issues in the future.

Best regards.