URL('static', args='audio2.ogg') will produce a URL like 
/myapp/default/static/audio2.ogg. When you only pass one positional 
argument to URL, it assumes it is the function and uses request.controller 
as the controller. If the file path is /static/audio2.ogg, you want 
URL('static', 'audio2.ogg') -- in that case, web2py will interpret "static" 
as the controller and 'audio2.ogg' as the function, producing 
/myapp/static/audio2.ogg.

Anthony

On Thursday, May 16, 2013 12:12:40 PM UTC-4, Zaka Elab wrote:
>
> Hello everybody,
>
> I'm trying to do some audio streaming with no success with the next code:
>
> <!DOCTYPE html>
> <html>
> <body>
> Stream ogg audio file: <br>
>
> <audio src="{{=URL(a=request.application, c='static', f='audio2.ogg')}}" 
> controls="controls" type="audio/ogg">
>     Your browser does not support the audio element.
> </audio>
>
> <audio>
>     <source src="{{=URL(a=request.application, c='static', 
> f='audio2.ogg')}}" controls="controls" type="audio/ogg">
>     Your browser does not support the audio element.
> </audio>
>
> <audio src="{{=URL('static', args='audio2.ogg')}}" controls="controls" 
> type="audio/ogg">
>     Your browser does not support the audio element.
> </audio>
>
> <audio>
>     <source src="{{=URL('static', args='audio2.ogg')}}" 
> controls="controls" type="audio/ogg">
>     Your browser does not support the audio element.
> </audio>
>
> </body>
> </html>
>
> The file name is audio2.ogg, it works with a simple html and audio tag.
> The path of the file is under the app in the static folder.
>
> I also tried to access the file via database with no luck. I'm sure I'm 
> doing
> something wrong, but I don't know where.
>
> I've read this 2 years old post http://alturl.com/v3jgu and tried the 
> suggestions
> with the same negative result.
>
> I attach the whole app in case anyone is interested.
>
> Thanks.
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to