This question is locked. New answers and comments are not allowed.
I just discovered Icenium and I have to say I am VERY impressed. I've dabbled in PhoneGap but always had trouble getting it set up, configured, and running. I love this whole concept.
So as a first quick test app I wanted to create an app for a friend who runs a streaming radio station called Dementia Radio. (He plays comedy music.) I made a quick app but I can't get the audio to work.
The thing is, the audio works for another stream I found, so I suspect the issue is that my friend is streaming MP3s (http://dementiaradio.org:8027) and the other site is streaming Ogg files (http://oggvorbis.tb-stream.net:80/technobase.ogg) but I"m not sure. I'm trying to narrow down the problem. His server is a ShoutCast server and he has live DJs on most evenings and then a random player on when nobody is casting.
The relevant part of the code is below. My question is should this work? Or is there something with ShoutCast/MP3s that doesn't work with this environment?
Thanks!
->Later.....Spice
<div class="app">
<h1>Dementia Radio</h1>
<div id="play_button">
<a href="#" onClick = "playStream();">Lisen Now</a>
</div>
</div>
<script type="text/javascript">
var myaudio
var music_player = document.getElementById("play_button");
music_player.play();
function playStream() {
try {
myaudio = new Audio('http://dementiaradio.org:8027/');
myaudio.id = 'playerMyAdio';
myaudio.play();
setToPause();
} catch (e) {
alert('no audio support!');
}
}
function pauseStream() {
myaudio.pause();
setToPlay();
}
function setToPause() {
var playButton = document.getElementById("play_button");
playButton.innerHTML = "<a href=\"#\" onClick = \"pauseStream();\">Pause</a>";
}
function setToPlay() {
var playButton = document.getElementById("play_button");
playButton.innerHTML = "<a href=\"#\" onClick = \"playStream();\">Play</a>";
}
</script>
So as a first quick test app I wanted to create an app for a friend who runs a streaming radio station called Dementia Radio. (He plays comedy music.) I made a quick app but I can't get the audio to work.
The thing is, the audio works for another stream I found, so I suspect the issue is that my friend is streaming MP3s (http://dementiaradio.org:8027) and the other site is streaming Ogg files (http://oggvorbis.tb-stream.net:80/technobase.ogg) but I"m not sure. I'm trying to narrow down the problem. His server is a ShoutCast server and he has live DJs on most evenings and then a random player on when nobody is casting.
The relevant part of the code is below. My question is should this work? Or is there something with ShoutCast/MP3s that doesn't work with this environment?
Thanks!
->Later.....Spice
<div class="app">
<h1>Dementia Radio</h1>
<div id="play_button">
<a href="#" onClick = "playStream();">Lisen Now</a>
</div>
</div>
<script type="text/javascript">
var myaudio
var music_player = document.getElementById("play_button");
music_player.play();
function playStream() {
try {
myaudio = new Audio('http://dementiaradio.org:8027/');
myaudio.id = 'playerMyAdio';
myaudio.play();
setToPause();
} catch (e) {
alert('no audio support!');
}
}
function pauseStream() {
myaudio.pause();
setToPlay();
}
function setToPause() {
var playButton = document.getElementById("play_button");
playButton.innerHTML = "<a href=\"#\" onClick = \"pauseStream();\">Pause</a>";
}
function setToPlay() {
var playButton = document.getElementById("play_button");
playButton.innerHTML = "<a href=\"#\" onClick = \"playStream();\">Play</a>";
}
</script>