07-07-2011 09:13 PM - edited 07-08-2011 01:09 AM
I am running into an interesting situation where everytime I try to play an audio stream it stops once I close the alert message. As a matter of fact if I do not include the alert message in the method I never hear the audio at all.
Any thoughts on why the audio may not be playing/stopping after the method call?
My first assumption was the audio object was being reference locally versus globally so I moved it outside the function but still no luck.
Below is a snippet of the code.
Html file:
<img src="images/btn_play_main.png" class="button" id="play_button" onClick="playOrpause()"/>
Script file:
audio = new Audio('http://shoutcast.canopyradio.com:38700/;');
function playOrpause()
{
try{
if(audio.paused){
$("#button").attr("src","images/btn_pause_main.png ");
audio.play();
alert("Play");
}else{
$("#button").attr("src","images/btn_play_main.png" );
audio.pause();
alert("Paused");
}
}
catch(e) {
alert("Exception [scripts.js showAbout()]: " + e);
}
}
UPDATE: Added an alert message to check the state and the audio object thinks it is still playing but there is no audio on the actual playbook. In ripple and vmware emulator everything works fine.
07-09-2011 05:41 PM
Can you post the version of PlayBook OS you have loaded on the actual Tablet device?
07-09-2011 05:53 PM
OS Version 1.0.6.2390
Also I've found that this doesnt play either:
<audio id="footer_btn" src="http://shoutcast.canopyradio.com:38700/;stream.nsv" controls="controls"/>
which is a standard HTML5 Audio tag.
Even if i type the URL straight into the browser, a player control shows up but it doesnt play the stream.
07-11-2011 02:39 AM
02-18-2012 10:21 PM
Did you ever get a resolution for this?
I built an applicaiton based on HTML5. Like you, everything works in Ripple. But when I test on an actual device, the stream does not play.