FAQ
Hi
I have created a directory called "media" in the path
/root/static/media and put some audio files in there (happen to be
ogg-vorbis). I am using the HTML5 tag <audio> in the Firefox 4 browser
to play the file in an app. It mostly works but there is a problem in
that the browser cannot determine the tracks duration. (Ogg files do
not store duration in their headers as other audio formats do, but
that's not the issue here).

I set up a simple experiment where I took the same ogg audio file and
simply served it as a straight file from Apache and Catalyst. So in
one case the URL typed in to FF was http://apacheURL/media/test.ogg
and the other was http://catalystURL/static/media/test.ogg (both URLs
are on the same LAN, no firewalls etc)

With Apache there were no issues,, with Catayst the file plays but the
duration info is not present - (hence the "play cursor" is always hard
against the right hand side of the play bar.)

Any ideas??
Thanks - Jeff

Search Discussions

  • Larry Leszczynski at Apr 8, 2011 at 8:26 pm
    Hi Jeff -
    I have created a directory called "media" in the path
    /root/static/media and put some audio files in there (happen to be
    ogg-vorbis). I am using the HTML5 tag <audio> in the Firefox 4 browser
    to play the file in an app. It mostly works but there is a problem in
    that the browser cannot determine the tracks duration. (Ogg files do
    not store duration in their headers as other audio formats do, but
    that's not the issue here).

    I set up a simple experiment where I took the same ogg audio file and
    simply served it as a straight file from Apache and Catalyst. So in
    one case the URL typed in to FF was http://apacheURL/media/test.ogg
    and the other was http://catalystURL/static/media/test.ogg (both URLs
    are on the same LAN, no firewalls etc)

    With Apache there were no issues,, with Catayst the file plays but the
    duration info is not present - (hence the "play cursor" is always hard
    against the right hand side of the play bar.)
    What differences do you see when you look at the response headers,
    especially Content-Type?


    Larry
  • Jeff robinson at Apr 8, 2011 at 8:58 pm
    Larry,
    Thanks for the quick response. Here are the headers - similar but not the same:

    Catalyst
    ------------
    Content-Length: 238400
    Content-Type: audio/ogg
    Last-Modified: Fri, 08 Apr 2011 15:20:31 GMT
    Status: 20 0
    X-Catalyst: 5.80029

    Apache
    -----------
    Accept-Ranges: bytes
    Content-Length: 238400
    Keep-Alive: timeout, max0
    Connection: Keep-Alive
    Content-Type: application/ogg

    Best - J

    On Fri, Apr 8, 2011 at 4:26 PM, Larry Leszczynski wrote:
    Hi Jeff -
    I have created a directory called "media" in the path
    /root/static/media and put some audio files in there (happen to be
    ogg-vorbis). I am using the HTML5 tag <audio> in the Firefox 4 browser
    to play the file in an app. It mostly works but there is a problem in
    that the browser cannot determine the tracks duration. (Ogg files do
    not store duration in their headers as other audio formats do, but
    that's not the issue here).

    I set up a simple experiment where I took the same ogg audio file and
    simply served it as a straight file from Apache and Catalyst. So in
    one case the URL typed in to FF was ?http://apacheURL/media/test.ogg
    and the other was http://catalystURL/static/media/test.ogg (both URLs
    are on the same LAN, no firewalls etc)

    With Apache there were no issues,, with Catayst the file plays but the
    duration info is not present - (hence the "play cursor" is always hard
    against the right hand side of the play bar.)
    What differences do you see when you look at the response headers,
    especially Content-Type?


    Larry

    _______________________________________________
    List: Catalyst@lists.scsys.co.uk
    Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
    Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
    Dev site: http://dev.catalyst.perl.org/
  • Tomas Doran at May 3, 2011 at 10:09 am

    On 8 Apr 2011, at 21:58, jeff robinson wrote:

    Larry,
    Thanks for the quick response. Here are the headers - similar but
    not the same:

    Catalyst
    ------------
    Content-Length: 238400
    Content-Type: audio/ogg
    Last-Modified: Fri, 08 Apr 2011 15:20:31 GMT
    Status: 20 0
    X-Catalyst: 5.80029

    Apache
    -----------
    Accept-Ranges: bytes
    Content-Length: 238400
    Keep-Alive: timeout, max0
    Connection: Keep-Alive
    Content-Type: application/ogg
    I guess the difference here is in the Content-Type.

    Does it do what you want if you override Static::Simple to send the
    other type?

    Cheers
    t0m
  • Jeff robinson at May 3, 2011 at 1:55 pm
    Tom,
    Nope - it turned out to be a bunch of other attributes that FF was
    looking for, the most important of which was the "Accept-Ranges:
    bytes" header. It also helps to add the "X-Content-Duration" header.
    As OGG files do not have any duration info you need to obtain this by
    running a utility like "sox -i". All in all I needed to write a small
    handler for the job. There is a great article with all the details
    here:
    https://developer.mozilla.org/en/Configuring_servers_for_Ogg_media
    FYI - J
    On Tue, May 3, 2011 at 6:09 AM, Tomas Doran wrote:
    On 8 Apr 2011, at 21:58, jeff robinson wrote:

    Larry,
    Thanks for the quick response. Here are the headers - similar but not the
    same:

    Catalyst
    ------------
    Content-Length: 238400
    Content-Type: audio/ogg
    Last-Modified: Fri, 08 Apr 2011 15:20:31 GMT
    Status: 20 0
    X-Catalyst: 5.80029

    Apache
    -----------
    Accept-Ranges: bytes
    Content-Length: 238400
    Keep-Alive: timeout, max0
    Connection: Keep-Alive
    Content-Type: application/ogg
    I guess the difference here is in the Content-Type.

    Does it do what you want if you override Static::Simple to send the other
    type?

    Cheers
    t0m


    _______________________________________________
    List: Catalyst@lists.scsys.co.uk
    Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
    Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
    Dev site: http://dev.catalyst.perl.org/

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcatalyst @
categoriescatalyst, perl
postedApr 8, '11 at 8:20p
activeMay 3, '11 at 1:55p
posts5
users3
websitecatalystframework.org
irc#catalyst

People

Translate

site design / logo © 2022 Grokbase