<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<font size="-1"><font face="Helvetica, Arial, sans-serif">Ok, this
might do it, but just to check:<br>
<br>
I'm looking for a way to stream a dynamically specified MP3 file.&nbsp; I've
got the videoview working with an FLV, but can't seem to get it working
with an MP3.<br>
<br>
So, I guess I have two questions:<br>
<br>
1. The docs all talk about a videoview in terms that seem to suggest
that videoviews can stream and play MP3's.&nbsp; Is this true?&nbsp; If so, how
is it done?<br>
2. If I attach an MP3 as a resource to a regular view, will the file be
streamed?&nbsp; (i.e. does playback begin while the file is partially
loaded, or do we have to wait for the resource to be loaded in its
entirety)<br>
2.a. If a regular view <i>does</i> support streaming, then what makes
a videoview different with respect to MP3 download and playback?<br>
<br>
Thanks! :)<br>
-Rich<br>
</font></font><br>
Henry Minsky wrote:
<blockquote
 cite="mid:8c61fad60709211333v50242473vc29541c6c28aa687@mail.gmail.com"
 type="cite">
  <pre wrap="">There's an audio example in examples/music/music.lzx , which uses a
plain old view to fetch an audio mp3 file

&lt;view id="audioplayer" play="true" y="40"
        resource=<a class="moz-txt-link-rfc2396E" href="http:music.mp3">"http:music.mp3"</a>
        oninit="new LzDelegate( this, 'lastoff', this, 'onlastframe');
                new LzDelegate( this, 'stopped', this, 'onstop')"&gt;
        &lt;attribute name="vol" value="100" /&gt;
        &lt;view&gt;
            &lt;simplelayout axis="x" spacing="-1" /&gt;
            &lt;button width="40" onclick="audioplayer.play(1);" &gt;
               &lt;view resource="icons/rewind_all.png"  y="6" align="center"/&gt;
            &lt;/button&gt;
            &lt;button width="40" onclick="audioplayer.seek( -2 );" &gt;
                &lt;view resource="icons/rewind.png"  y="6" align="center"/&gt;
            &lt;/button&gt;
            &lt;button width="40" onclick="audioplayer.stop()" &gt;
                &lt;view resource="icons/stop.png"  y="6" align="center"/&gt;
            &lt;/button&gt;
            &lt;button width="40" onclick="audioplayer.play()" &gt;
                &lt;view resource="icons/play.png"  y="5" align="center"/&gt;
            &lt;/button&gt;
            &lt;button width="40" onclick="audioplayer.seek( 2 );" &gt;
                &lt;view resource="icons/fastfwd.png"  y="6" align="center"/&gt;
            &lt;/button&gt;
        &lt;/view&gt;

        &lt;view&gt;
            &lt;simplelayout axis="x" spacing="-1" /&gt;
            &lt;button width="40" onclick="audioplayer.setVolume(
audioplayer.getVolume() -10)"&gt;
                    &lt;view resource="icons/quieter.png"  y="5" align="center"/&gt;
                &lt;/button&gt;
            &lt;button width="40" onclick="audioplayer.setVolume(
audioplayer.getVolume() +10)"&gt;
                    &lt;view resource="icons/louder.png"  y="5" align="center"/&gt;
                &lt;/button&gt;
            &lt;button width="40" onclick="audioplayer.setPan(
audioplayer.getPan() - 10 );" &gt;
                    &lt;view resource="icons/pan_left.png"  y="5" align="center"/&gt;
            &lt;/button&gt;
            &lt;button width="40" onclick="audioplayer.setPan(
audioplayer.getPan() + 10 );" &gt;
                    &lt;view resource="icons/pan_right.png"  y="5" align="center"/&gt;
            &lt;/button&gt;
        &lt;/view&gt;

        &lt;simplelayout axis="x" spacing="10"/&gt;
        &lt;method name="lastoff"&gt;
            Debug.write("Got last");
        &lt;/method&gt;
        &lt;method name="stopped"&gt;
            Debug.write("Got stopped");
        &lt;/method&gt;
        &lt;view name="background" bgcolor="black" width="202"
height="15" y="50" options="ignorelayout;"&gt;
            &lt;view name="loadbar" resource="icons/audio_scrubtrack.png"
                  width="${audioplayer.loadperc * 200}" &gt;
            &lt;view name="playbar" resource="icons/audio_scrubber.png" y="1"
                  x="${Math.round(180 *
audioplayer.frame/audioplayer.totalframes)}" /&gt;
            &lt;/view&gt;
        &lt;/view&gt;
    &lt;/view&gt;

On 9/21/07, Rich Christiansen <a class="moz-txt-link-rfc2396E" href="mailto:warproof@warproof.com">&lt;warproof@warproof.com&gt;</a> wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap=""> Hey, all!

 For some reason, I can use a videoview to view a streaming FLV just fine.
However, I can't seem to get it to work with an MP3.  I've tried using a
simple videoview, a videoview with an embedded mediastream, using a file on
localhost, using files on a remote server, etc.  Nothing I do seems to help.
 From my tests, the files are loading fine, I just can't get them to play.

 I've uploaded an MP3 to a public-facing server for a simple test.  Please
give this test harness a shot:

 &lt;canvas width="100%" height="100%" debug="true"&gt;
     &lt;simplelayout axis="y"/&gt;

     &lt;videoview name="video" autoplay="true"&gt;
         &lt;!-- &lt;mediastream name="stream"
url=<a class="moz-txt-link-rfc2396E" href="http://localhost:8080/lps-4.0.2/track4.mp3">"http://localhost:8080/lps-4.0.2/track4.mp3"</a>&gt; --&gt;
         &lt;mediastream name="stream"
url=<a class="moz-txt-link-rfc2396E" href="http://featurific.com/files/tmp/shiver.mp3">"http://featurific.com/files/tmp/shiver.mp3"</a>&gt;
             &lt;handler name='onprogress'&gt;
                 Debug.write("PROGRESS! " + progress)
                 if(progress==1)
                 {
                     Debug.write("Come on, play!")
                     play()
                 }
             &lt;/handler&gt;

             &lt;handler name='onrequest'&gt;
                 Debug.write("REQUEST!")
             &lt;/handler&gt;

             &lt;handler name='onurl'&gt;
                 Debug.write("URL!")
             &lt;/handler&gt;

             &lt;handler name='onload'&gt;
                 Debug.write("LOAD!")
             &lt;/handler&gt;
         &lt;/mediastream&gt;
     &lt;/videoview&gt;

     &lt;!-- &lt;videoview
url=<a class="moz-txt-link-rfc2396E" href="http://featurific.com/files/tmp/shiver.mp3">"http://featurific.com/files/tmp/shiver.mp3"</a>
autoplay="true"/&gt; --&gt;

     &lt;!-- &lt;videoview
url=<a class="moz-txt-link-rfc2396E" href="http://site.airgundepot.com/video/agd.flv">"http://site.airgundepot.com/video/agd.flv"</a>
autoplay="true" width="800" height="600"/&gt; --&gt;

     &lt;!-- &lt;videoview
url=<a class="moz-txt-link-rfc2396E" href="http://site.airgundepot.com/video/agd.flv">"http://site.airgundepot.com/video/agd.flv"</a>
autoplay="true"&gt;
         &lt;animator name="movex" attribute="x" to="300" duration="5000"
start="true"/&gt;
         &lt;animator name="movey" attribute="y" to="300" duration="7000"
start="true"/&gt;
     &lt;/videoview&gt; --&gt;

 &lt;/canvas&gt;

 As a side-note, I've been able to find examples of using a videoview with a
.flv file.  However, I can't find any code examples on the net of someone
using a videoview with an MP3 file to provide just audio alone.  So strange
for a feature that seems so powerful!  (The original laszlo killer-app
(Pandora) relied profoundly on this feature, right?  Surprising...)

 Anyway, thanks in advance for your help! :)
 -Rich

 P.S. THis is my first post to the email group.  Which is better for
questions like this - the email group or the forums on the website?  I'd
imagine turnaround time is shorter here, and the discussion is still indexed
somewhere as Google-fodder, right?

    </pre>
  </blockquote>
  <pre wrap=""><!---->

  </pre>
</blockquote>
</body>
</html>