vollenhove / oohembed

Automatically exported from code.google.com/p/oohembed
Other
0 stars 0 forks source link

YouTube embed doesn't respect maxwidth and maxheight #7

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Take, for example:
http://oohembed.com/oohembed/?maxwidth=300&format=json&url=http%3A//www.youtube.
com/watch%3Fv%3DI_B8H956-rg&callback=

The resulting embed does not respect the maxwidth parameter.

YouTube support arbitrary widths and heights on the <object>.

Original issue reported on code.google.com by damian.j...@gmail.com on 16 Sep 2009 at 12:59

GoogleCodeExporter commented 8 years ago
This is a known issue. Max width/height are not supported by oohembed for 
situations 
where the site in question isn't an oembed provider. As a middle-man, there's 
no 
reliable way for oohembed to determine how to constrain the resulting code in 
size.

However, Youtube itself is testing oembed support and pretty soon, once they go 
live 
as oembed providers, I'll switch to using their endpoint. As a side-effect of 
that, 
max width/height will be automatically supported.

Hope I was clear in this explanation!

Original comment by deepak.s...@gmail.com on 16 Sep 2009 at 6:22

GoogleCodeExporter commented 8 years ago
Thank you for your reply.

I understand the rationale, but in YouTube's case it's possible to assign 
arbitrary
dimensions to the <object> embed. So one could simply assign width=maxWidth and
height=maxHeight and everything will work.

Apparently this works very well and is very easy to implement. I don't know much
Python but I can get a coworker to submit a patch if you agree to apply.

Thank you again.

Original comment by damian.j...@gmail.com on 16 Sep 2009 at 1:44

GoogleCodeExporter commented 8 years ago
Can you post a sample request & expected response here?

Original comment by deepak.s...@gmail.com on 16 Sep 2009 at 4:02

GoogleCodeExporter commented 8 years ago
GET
http://oohembed.com/oohembed/?maxwidth=300&maxheight=250&format=json&url=http%3A
//www.youtube.com/watch%3Fv%3DI_B8H956-rg&callback=
{
 "title": "Nightingale - Yanni", 
 "html": "<embed src='http://www.youtube.com/v/I_B8H956-rg&fs=1'
allowfullscreen='true' type='application/x-shockwave-flash' wmode='transparent'
width='300' height='250'></embed>", 
 "author_name": "carrie820", 
 "height": 250, 
 "thumbnail_width": 120, 
 "width": 300, 
 "version": "1.0", 
 "author_url": "http://www.youtube.com/user/carrie820", 
 "provider_name": "Youtube", 
 "thumbnail_url": "http://i.ytimg.com/vi/I_B8H956-rg/1.jpg", 
 "type": "video", 
 "thumbnail_height": 90
}

Original comment by damian.j...@gmail.com on 16 Sep 2009 at 5:05