webOS Nation Forums >  webOS developer forums >  JDF Software > Audio Sample - Using HTML5 Audio in Your WebOS App
Audio Sample - Using HTML5 Audio in Your WebOS App

  Reply
 
LinkBack Thread Tools Display Modes
Old 05/12/2010, 01:11 PM   #1 (permalink)
Member
 
Join Date: Jan 2010
Posts: 115
Likes Received: 0
Thanks: 7
Thanked 24 Times in 17 Posts
Default Audio Sample - Using HTML5 Audio in Your WebOS App

I've posted a new article on my blog, along with a sample app, to demonstrate the use of HTML5 audio in webOS apps, post 1.4. Any questions about using audio, or the app or source code should be asked here.

Article: http://bit.ly/jdf-sample-audio
Source: Source Code « JDF-Software.com
App: http://developer.palm.com/appredirec...e.audio-sample
jdforsythe is offline   Reply With Quote
Old 09/07/2010, 01:30 PM   #2 (permalink)
Member
 
Join Date: Dec 2009
Location: Germany
Posts: 8
Likes Received: 0
Thanks: 0
Thanked 0 Times in 0 Posts
Default

For me the media loop does only work with WAV and not with MP3. Is that a BUG or is my Code wrong? Discuss here: Forums webOS • View topic - Music loop trouble: WAV works, MP3 not (BUG?)

My code:

Quote:
MainAssistant.prototype.mediaSetup = function() {

this.libs = MojoLoader.require({ name: "mediaextension", version: "1.0"});

this.myAudio = this.controller.get('audio');
this.audioExt = this.libs.mediaextension.MediaExtension.getInstance(this.myAudio);
this.myAudio.src = Mojo.appPath + "audio/song.wav";
this.myAudio.load();
this.mediaReplay = this.mediaReplay.bind(this);
this.myAudio.addEventListener('ended', this.mediaReplay, false);
this.myAudio.play();

}

MainAssistant.prototype.mediaReplay = function() {
this.myAudio.play();
}

Last edited by simsche; 09/07/2010 at 01:31 PM. Reason: Code added
simsche is offline   Reply With Quote
Old 09/07/2010, 01:31 PM   #3 (permalink)
Member
 
kody.thompson113's Avatar
 
Join Date: Aug 2010
Location: houston, tx
Posts: 69
Likes Received: 0
Thanks: 23
Thanked 5 Times in 5 Posts
Default

hmmm
kody.thompson113 is offline   Reply With Quote
Old 09/07/2010, 01:49 PM   #4 (permalink)
Member
 
Join Date: Dec 2009
Location: Germany
Posts: 8
Likes Received: 0
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Now it works!
My BUG...


I used this code (main-scene.html)...
<audio id="audio" controls="false" x-palm-media-audio-class="navigation">
...for the loop. Only WAV worked, no MP3. Don't ask my why, but if you wanna user MP3 you had to use this code:
<audio id="audio" controls="false" x-palm-media-audio-class="media">
simsche is offline   Reply With Quote
Reply

 

Tags
audio, html5, source code

Thread Tools
Display Modes



 


Content Relevant URLs by vBSEO 3.6.0