Closed ooobo closed 10 years ago
I would add to this bug a possibly related bug: Once you have played and finished an audio feed and go do something else audio related the audio starts playing again.
Steps to reproduce:
Audio continues playing in background. On return to same story, audio player is in default/unplayed state, can be played again which does stop original background audio (but you've just started a new audio player). Only way to stop audio is either play different embedded audio in NewsBlur app, or force quit NewsBlur app.
Thanks Joey, I've definitely had that occur too, essentially every time you play an audio file in NewsBlur. Always a bit of a surprise as the audio can start again even hours later.
Thanks for the detailed repro! One more question: any hints on feeds that have audio recently so I can test a fix?
http://www.newsblur.com/site/505901/weird-canada Weird Canada is an easy one, it always has HTML embedded audio. Thanks Daniel
On Sun, Jul 14, 2013 at 10:19 AM, Daniel notifications@github.com wrote:
Thanks for the details repro! One more question: any hints on feeds that have audio recently so I can test a fix?
— Reply to this email directly or view it on GitHubhttps://github.com/samuelclay/NewsBlur/issues/315#issuecomment-20929370 .
Have done a ton of work on this, but it looks like we're down to platform bugs with the impl used by android.webkit.WebView
. I added some code to ensure that our view does correctly have onPause()
called any time it goes off screen and confirmed that it is relably called. However, on my test platforms (2.3 and 4.2), this doesn't pause or stop embedded audio.
A bit of googling around suggests that the problem isn't unique to us. Tried updating the WebSettings.PluginState
to OFF
, but this has no effect. Tried calling pauseTimers()
, but it also has no effect, and breaks all views until the app restarts. There are some very dirty hacks that can be used to attempt to totally destroy()
the view and all content, but that will add quite a bit of work and slow down the app, since we would also need to re-create it from scratch on every scroll from story to story.
This does seem like an utterly bad UX, platform bug or not, though. Once you lose track of that view, it might take ages for it to get destroyed naturally. Force exiting the app does destroy it, so a manual "Stop All Media and Exit" action for the app would one option we could pursue if warranted.
Thanks Daniel, I had the feeling it was a platform bug as I've seen a similarish issue with Twitter & Falcon Pro, I think they employ the destroy option or close to it as the media stops when you re-enter the app.
From a user standpoint, I think the best bet would be the last option you suggested, a "Stop All Media and Exit" menu option would be an acceptable option. You could put it in the 3-dot menu as "Stop All Media". If that is possible of course.
Apologies for never responding to this, but the pull request and subsequent point update above did alleviate the issue a fair bit, thanks @ojiikun Audio now stops when I return to the list of feeds (i.e. away from story list/story view) - I assume you destroy the webview at that stage. Works a charm!
Looks like it was a combination of our adding the correct handling (the webview just gets correctly paused, not destroyed) and a platform bugfix that was made. Are you by any chance running a 4.3 ROM?
5 months late...yes I was. Apologies for my horrible tardiness. Haven't seen this happen since your fix/4.3.
Running v. 2.02 on Nexus 4.2.2. Steps to reproduce:
Hard to say what is best to do here, the background audio is great but having to force-quit to stop it not so much.