View Full Version : the XML Music Ticker
taboca
09-15-2003, 01:54 AM
So I made this ticker as part of the evalutation and learning experience with Laszlo. So far it's using an external XML datasource to load a set of images, caption text and music links.
Important note. It's still missing the music play option. The expected behavior is to play an mp3 when you mouseclick on top of an image item.
I need help from Laszlo engineers in order to complete the sample. Each Mp3 is about 500K-1MB. Do you think that might be an issue? or might work as well? I was trying to use the audio link and a precompiler information states that is not possible to use the audio link in that context.
Note that I am trying to provide mp3 play for music links that are available in the XML file.
taboca
09-15-2003, 01:56 AM
Can we host this sample online? So I can use it to showcase the sample? When it's done?
All the images, resources and music samples are properly licensed.
whisperstorm
09-26-2003, 02:53 PM
taboca look at first post in this forum, looks like they only host img/xml/lzx files, not mp3's
antun
09-29-2003, 11:33 AM
OK at looooooong last I've had time to get this running locally, and I'm attaching the changes I made. To get it to play, I created a view at the canvas level that we'll use as the player (because you only want one track to play at any one time):
<view name="globalPlayer" />
Then, I uncommented your playMusic() method, and added the following to it:
<method name="playMusic">
debug.write( '== PLAYING NOW ==' );
var tuneURL = this.datapath.getXPath( '@music' );
debug.write( 'Playing: ' + tuneURL );
debug.write( 'You clicked: ' + this.datapath.getXPath('@caption') );
globalPlayer.stop();
globalPlayer.setSource( tuneURL );
globalPlayer.play();
</method>
</class>
I can get the URL of the tune to play, using the getXPath method, but the problem is that every time you click, you get exactly the same song. I think this may have something to do with how you're doing the fading in/out. I believe that the view that's on top doesn't fade all the way out, so it captures the clicks destined for the view below it. If you setVisible( false ) at the end of the fadeout, then that view should let mouse clicks through.
You don't really need to host the mp3s on mylaszlo at all - they can live where they are now and they'll stream over HTTP port 80 just fine.
Once you've fixed the issue with the clicking, and you're happy with it, post the app again, and I'll put it on mylaszlo.com.
Take care,
Antun
antun
09-29-2003, 11:34 AM
Here's the app.
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.