- This topic has 8 replies, 3 voices, and was last updated 10 years, 10 months ago by BryanBudelon.
-
AuthorPosts
-
BryanBudelonMemberHi guys.
I’m developing app of radio. But he work only in Android.
Problem: Clicked in button ‘Play’ e nothing happens, but in Android the audio starts.Code:
phoneui.documentReadyHandler = function() { initAudio(); } function initAudio(){ audio = new Audio(); audio.src = 'http://audio.tupa.am.br:9986/;'; } function playAudio() { if($("#m1-Sobral-Play").attr("src") == "images/play.png"){ $("#m1-Sobral-Play").attr("src","images/pause.png"); audio.play(); } else if($("#m1-Sobral-Play").attr("src") == "images/pause.png"){ $("#m1-Sobral-Play").attr("src","images/play.png"); audio.pause(); } }
On button of ‘Play’ have: playAudio();
And yes, the streaming works.
– thanks for listening! 😀
BrandonMemberWhich version of Mobione are you using?
Is this with the new Audio API?
BryanBudelonMember> Which version of Mobione are you using?
I’m using 2.6.1> Is this with the new Audio API?
No got it exactly question.
support-octavioMemberHi Bryan,
Are you developing a native app or webapp? Can you share details about your iOS device? (model and OS)
We tested your audio stream url in the audio player with no issues in a native ios app. You should use the new api that you can find here: http://www.genuitec.com/mobile/docs/audioWidgetAPI/audioWidgetAPI.html
BryanBudelonMember-> Are you developing a native app or webapp? Can you share details about your iOS device? (model and OS)
Native.
Model: iPhone 4
OS: iOS 7.0.4I tried to different.
Put widget of audio and changed the code,
function playAudio() { var audio = AudioPlayerWidget.fromWidget( $('[id$=Player-container]') ); if($("#m1-Sobral-Play").attr("src") == "images/play.png"){ $("#m1-Sobral-Play").attr("src","images/pause.png"); audio.play(); audio.release(); } else if($("#m1-Sobral-Play").attr("src") == "images/pause.png"){ $("#m1-Sobral-Play").attr("src","images/play.png"); audio.pause(); } }
But yet continues the problem.
BryanBudelonMemberSomeone?
BrandonMemberYour original code:
phoneui.documentReadyHandler = function() { initAudio(); } function initAudio(){ audio = new Audio(); audio.src = 'http://audio.tupa.am.br:9986/;'; } function playAudio() { if($("#m1-Sobral-Play").attr("src") == "images/play.png"){ $("#m1-Sobral-Play").attr("src","images/pause.png"); audio.play(); } else if($("#m1-Sobral-Play").attr("src") == "images/pause.png"){ $("#m1-Sobral-Play").attr("src","images/play.png"); audio.pause(); } }
THis line: audio.src = ‘http://audio.tupa.am.br:9986/;’;
the first ; should not be there: audio.src = ‘http://audio.tupa.am.br:9986/’;see if that helps.
support-octavioMemberHi Bryan,
Looks like you are mixing snippets from the Audio Widget API doc. audio.release(); destroys the player and won’t be possible to play audio. Also, This method is for case when user creates media object programmatically.
I would suggest you to take a look closely at this section of previous doc, which should meet your requirement: http://www.genuitec.com/mobile/docs/audioWidgetAPI/audioWidgetAPI.html#player_with_no_ui
Also, the example project should be helpful:
http://www.genuitec.com/mobile/docs/audioWidgetAPI/audioWidgetAPI.html#exampleLet us know if you need further assistance.
BryanBudelonMemberThe problem has been solved. The problem was in configuration the audio of iPhone.
Thanks all! 😀
-
AuthorPosts