Page 1 of 1

Instead of pausing the component audio stream, how can I change source to prevent it from streaming indefinitely?

Posted: Tue Feb 04, 2014 9:16 pm
by Mark6636596

I'm very new to all this, but I've learned the HTML5 audio component will only pause audio, not stop it. So even if I pause stream and minimize app, it will continue to buffer foreverrrrr.
I am running a constant radio stream to it, and would like a simple way to kill the stream when I click a stop button. I would assume creating an event to change source would kill it, but can't find any example js code to use.

I have set up the audio component, hidden with its one audio/mpeg src in the properties section. When I click 'play_button' image, it is set to run javascript Appery("radio").get(0).play();
when I click 'pause_button' image, it runs
Appery("radio").get(0).pause();

What would I add to change source?
Thanks


Instead of pausing the component audio stream, how can I change source to prevent it from streaming indefinitely?

Posted: Tue Feb 04, 2014 9:40 pm
by maxkatz

Appery(..) is wrapper on top of jQuery: http://docs.appery.io/javascript-api/ . You should do a select with jQuery (or Appery(..) function) and modify the source if the browser allows to do that.


Instead of pausing the component audio stream, how can I change source to prevent it from streaming indefinitely?

Posted: Tue Feb 04, 2014 11:18 pm
by Mark6636596

So I'm just wanting to make this work on android and ios.
What I added worked great when I test it by launching in my web browser on my computer, but it plays no audio when I export the .apk and install it on my android phone.

When I click 'play_button' image, it is set to run javascript:
Appery('radio').attr("src", "http://s11.myradiostream.com:9646/;st...");
Appery("radio").get(0).play();

when I click 'pause_button' image, it runs:
Appery("radio").get(0).pause();
Appery('radio').attr("src", "");

Why won't it work as an app?


Instead of pausing the component audio stream, how can I change source to prevent it from streaming indefinitely?

Posted: Wed Feb 05, 2014 3:30 pm
by Maryna Brodina

Hello! Try preAppery("audioComponentName").find("source").eq(0).attr("src", "http://...").attr("type", "new type")/preto change scr in first ( eq(0) ) source
or this code to change src for all sources at oncepreAppery("audioComponentName").find("source").attr("src", "http://...").attr("type", "new type")/pre