Re: [web2py] Re: how to support video in an app

2013-02-08 Thread Massimo Di Pierro
You don't. If the video is embedded automatically, than you can only 
control width and size using CSS.

On Thursday, 7 February 2013 14:04:13 UTC-6, Tito Garrido wrote:
>
> How to set the width and height of the embed video using expand_one? 
>
>
> On Sat, Feb 2, 2013 at 12:00 AM, Massimo Di Pierro 
> 
> > wrote:
>
>> Sorry my bad:
>>
>> {{=XML(expand_one('http://www.**youtube.com/watch?v=**
>> 7yvt2Pt6LRA',cache.ram('**mycache',lambda:dict(),3600))
>> )}**}
>>
>> expand one converts to HTML but then is must be wrapped into XML else it 
>> gets escaped.
>>
>>
>> On Friday, 1 February 2013 19:10:12 UTC-6, sasogeek wrote:
>>>
>>> when the page loads and i click on view page source, here's what's 
>>> there...
>>>
>>> 
>
> and it appears as html on the actual page...
>
>
> On Saturday, 2 February 2013 00:47:26 UTC, Massimo Di Pierro wrote:
>>
>> If you need it in a view
>>
>> {{from gluon.contrib.autolinks import expand_one}}
>>
>> Mind that expend_one may call a service (oembed service). This may may 
>> delay the generation of the page and even block it if the service is not 
>> available. The second argument of expand one is a dictionary and it uses to 
>> cache the expanded links. You can do
>>
>> {{=expand_one('
>> http://www.youtube.com/watch?v=7yvt2Pt6LRA',cache.ram('mycache',lambda:dict(),3600))
>> }}
>>
>> and this will keep the expended links cached for 3600 seconds in the 
>> dict() The dict will be persistant in ram.
>>
>>
>>
>> On Friday, 1 February 2013 17:25:04 UTC-6, sasogeek wrote:
>>>
>>> where do I put the import statement?
>>>
>>> On Friday, 18 January 2013 16:02:27 UTC, Massimo Di Pierro wrote:

 from gluon.contrib.autolinks import expand_one

 {{=expand_one('http://www.youtube.com/watch?v=7yvt2Pt6LRA')}}

 On Friday, 18 January 2013 04:58:20 UTC-6, sasogeek wrote:
>
> at the moment, i can let users upload pictures and use the img tag to 
> allow the image to be displayed on a page, when users upload videos, how 
> do 
> i allow the videos to display and play on the page... and if users submit 
> a 
> youtube link, how do i grab the embed code to display the video on the 
> page?



-- 

--- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: how to support video in an app

2013-02-01 Thread sasogeek
when the page loads and i click on view page source, here's what's there...

http://www.youtube.com/embed/7yvt2Pt6LRA?feature=oembed"; 
frameborder="0" allowfullscreen>

and it appears as html on the actual page...


On Saturday, 2 February 2013 00:47:26 UTC, Massimo Di Pierro wrote:
>
> If you need it in a view
>
> {{from gluon.contrib.autolinks import expand_one}}
>
> Mind that expend_one may call a service (oembed service). This may may 
> delay the generation of the page and even block it if the service is not 
> available. The second argument of expand one is a dictionary and it uses to 
> cache the expanded links. You can do
>
> {{=expand_one('
> http://www.youtube.com/watch?v=7yvt2Pt6LRA',cache.ram('mycache',lambda:dict(),3600))
> }}
>
> and this will keep the expended links cached for 3600 seconds in the 
> dict() The dict will be persistant in ram.
>
>
>
> On Friday, 1 February 2013 17:25:04 UTC-6, sasogeek wrote:
>>
>> where do I put the import statement?
>>
>> On Friday, 18 January 2013 16:02:27 UTC, Massimo Di Pierro wrote:
>>>
>>> from gluon.contrib.autolinks import expand_one
>>>
>>> {{=expand_one('http://www.youtube.com/watch?v=7yvt2Pt6LRA')}}
>>>
>>> On Friday, 18 January 2013 04:58:20 UTC-6, sasogeek wrote:

 at the moment, i can let users upload pictures and use the img tag to 
 allow the image to be displayed on a page, when users upload videos, how 
 do 
 i allow the videos to display and play on the page... and if users submit 
 a 
 youtube link, how do i grab the embed code to display the video on the 
 page?
>>>
>>>

-- 

--- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: how to support video in an app

2013-02-01 Thread Massimo Di Pierro
If you need it in a view

{{from gluon.contrib.autolinks import expand_one}}

Mind that expend_one may call a service (oembed service). This may may 
delay the generation of the page and even block it if the service is not 
available. The second argument of expand one is a dictionary and it uses to 
cache the expanded links. You can do

{{=expand_one('
http://www.youtube.com/watch?v=7yvt2Pt6LRA',cache.ram('mycache',lambda:dict(),3600))
}}

and this will keep the expended links cached for 3600 seconds in the dict() 
The dict will be persistant in ram.



On Friday, 1 February 2013 17:25:04 UTC-6, sasogeek wrote:
>
> where do I put the import statement?
>
> On Friday, 18 January 2013 16:02:27 UTC, Massimo Di Pierro wrote:
>>
>> from gluon.contrib.autolinks import expand_one
>>
>> {{=expand_one('http://www.youtube.com/watch?v=7yvt2Pt6LRA')}}
>>
>> On Friday, 18 January 2013 04:58:20 UTC-6, sasogeek wrote:
>>>
>>> at the moment, i can let users upload pictures and use the img tag to 
>>> allow the image to be displayed on a page, when users upload videos, how do 
>>> i allow the videos to display and play on the page... and if users submit a 
>>> youtube link, how do i grab the embed code to display the video on the page?
>>
>>

-- 

--- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: how to support video in an app

2013-02-01 Thread sasogeek
where do I put the import statement?

On Friday, 18 January 2013 16:02:27 UTC, Massimo Di Pierro wrote:
>
> from gluon.contrib.autolinks import expand_one
>
> {{=expand_one('http://www.youtube.com/watch?v=7yvt2Pt6LRA')}}
>
> On Friday, 18 January 2013 04:58:20 UTC-6, sasogeek wrote:
>>
>> at the moment, i can let users upload pictures and use the img tag to 
>> allow the image to be displayed on a page, when users upload videos, how do 
>> i allow the videos to display and play on the page... and if users submit a 
>> youtube link, how do i grab the embed code to display the video on the page?
>
>

-- 

--- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: how to support video in an app

2013-01-18 Thread Massimo Di Pierro
from gluon.contrib.autolinks import expand_one

{{=expand_one('http://www.youtube.com/watch?v=7yvt2Pt6LRA')}}

On Friday, 18 January 2013 04:58:20 UTC-6, sasogeek wrote:
>
> at the moment, i can let users upload pictures and use the img tag to 
> allow the image to be displayed on a page, when users upload videos, how do 
> i allow the videos to display and play on the page... and if users submit a 
> youtube link, how do i grab the embed code to display the video on the page?

--