dysania/onebox — pull request #196 by vikhyat (2014-02-08 01:39:04+00:00)
Title: Youtube onebox enhancements

I've had users complain about having trouble making posts with multiple videos embedded, which turned out to be gateway timeouts caused by the two HTTP requests that need to be made for every video taking too long to finish.

Since the Youtube embed URL is known it makes sense to try to extract the video ID and generate the HTML directly without making HTTP requests, which is what I've done. If the user posts an unknown URL format we fall back to making HTTP requests to figure out the embed code.

I've also added a `placeholder_html` method that will return a thumbnail for the composer.