This is a migrated thread and some comments may be shown as answers.

Streaming audio

5 Answers 70 Views
General Discussion
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Tom
Top achievements
Rank 1
Tom asked on 09 Feb 2013, 05:06 PM
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>



5 Answers, 1 is accepted

Sort by
0
Tom
Top achievements
Rank 1
answered on 09 Feb 2013, 06:28 PM
Just to follow up, while there's no sound in any of the emulators I decided to try it on a device anyway.  My Android phone also produced no sound, but my iPod Touch was able to connect to the stream and play it!

So now I'm wondering if it's an Android versioning issue.  My phone is running 2.3.3 and can't go beyond that.  I'll send it to some friends and see if it plays on any of their more modern things.
0
Yavor Georgiev
Telerik team
answered on 09 Feb 2013, 10:08 PM
Hello Tom,

 MP3 streams don't play in the Graphite simulator, because we can't legally distribute the codecs needed. We bundle free codecs like OGG, though. The Mist simulator depends on the browser it's running in.

 Audio and video support in Android is hit and miss (mostly miss on 2.x), whereas iOS support is very good.

All the best,
Yavor Georgiev
the Telerik team

Share feedback and vote for features on our Feedback Portal.
Want some Kendo UI online training - head over to Pluralsight.
0
Tom
Top achievements
Rank 1
answered on 09 Feb 2013, 10:16 PM
OK thanks.  That makes sense.  

I sent the app to some friends to install.  I haven't heard back from any of them yet.  Hopefully it'll work on someone's.
0
Yavor Georgiev
Telerik team
answered on 09 Feb 2013, 10:52 PM
Hello Tom,

 Please let us know what you discover and what you end up doing in the end. We're curious to see what our community makes of HTML5 multimedia.

Greetings,
Yavor Georgiev
the Telerik team

Share feedback and vote for features on our Feedback Portal.
Want some Kendo UI online training - head over to Pluralsight.
0
Tom
Top achievements
Rank 1
answered on 11 Feb 2013, 04:17 PM
OK, just to follow up I have heard back from 2 of my friends who have better phones than I do and I'm happy to report that it worked for both of them!

So now that the proof of concept was a success I'm going to start working on the "real" functionality of the app.  Although for the first round it's pretty much just going to be a launch-and-listen experience.

Thanks!
Tags
General Discussion
Asked by
Tom
Top achievements
Rank 1
Answers by
Tom
Top achievements
Rank 1
Yavor Georgiev
Telerik team
Share this question
or