Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 5    Views: 56

@rob
Code is Art
Profile
Posts: 115
Reg: Dec 10, 2013
Alabama
8,800
02/24/14 10:55 PM (10 years ago)

CP_Stream Tweaks

Anyone know of a hack for the cp_stream plug-in to make the audio file stop playing if the user navigates away from the audio player screen. By default the player keeps playing the audio after the user leaves the screen. For my purposes I need the player to stop.
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
02/25/14 12:23 AM (10 years ago)
Try doing a search along those angles. Into Google.com you would type: site:buzztouch.com/forum stop sound After you get it done, make a new post telling us how to do it. Try to make the subject be specific: "(fixed) Stopping audio upon leaving screen" -- Niraj
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
02/25/14 12:29 AM (10 years ago)
Did you get it?
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
02/25/14 12:32 AM (10 years ago)
Well, if you're willing to play with it a little bit… I can't confirm if it works, because in the app I have it in, I prefer the default behavior. However… (referring to the Cp_stream.java file) Looking through the code, it seems that below the 'playAudio' method, there is 'stopMyPlayService' which unregisters the reciever and stops both service and music. If this is the behavior you want, I'd add this in my 'onPause' method: stopMyPlayService(); and maybe something similar in your 'onStop' method. As said; it might take some playing around for the 'best' spot, but thats where I'd start. Cheers! -- Smug
 
@rob
Code is Art
Profile
Posts: 115
Reg: Dec 10, 2013
Alabama
8,800
like
02/25/14 09:02 AM (10 years ago)
Thanks Smug, I will poke around with that today and let you know.
 
@rob
Code is Art
Profile
Posts: 115
Reg: Dec 10, 2013
Alabama
8,800
like
02/25/14 10:01 AM (10 years ago)
Smug I added "stopMyPlayService();" to my onPause method and it worked perfectly as expected, thanks for the idea!
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.