Mark6636596
Posts: 0
Joined: Tue Feb 04, 2014 9:16 pm

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

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

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

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

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.

Mark6636596
Posts: 0
Joined: Tue Feb 04, 2014 9:16 pm

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

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?

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

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

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

Return to “Issues”