duner/statamic-embed-video-plugin — pull request #2 by raddevon (2013-11-01 03:12:48+00:00)
Title: Accounts for asynchronous load of jQuery

This accounts for the case where jQuery is not yet loaded when the plugin tries to load and initialize fitVids which prevents fitVids from working. Here, the injected scripts first test for jQuery before fetching the fitVids script. Once the script has been fetched, another check is made for fitVids. Only after this test has passed will fitVids be initialized on the body. The tests will each re-run every 50ms until the pass condition is met.

I have not tested this with a synchronous load of jQuery, but it should still work in that case as well.