Open 0x0ece opened 11 years ago
maybe there is another prob. For each e.g. youtube player, lots of files were loaded. lets say we load 10 video. The result is 10 times load https://s.ytimg.com/yts/swfbin/player-vflLstCoX/watch_as3.swf with 291.5 kb https://s.ytimg.com/yts/cssbin/www-embed-player-vflvSgpSH.css with 23.4 kb https://s.ytimg.com/yts/jsbin/www-embed-player-vfldFMlKN/www-embed-player.js with 64.8 kb
sum load over 3000 kb
I have a page with many (say 20) youtube videos to oembed. Calling oembed on all them simultaneously slows down a lot the browser. I've tried substituting the call:
with:
Note that I'm using 'replace' within the options, so once a link is embedded, the original link is no longer available in the dom. That's why :first actually works (i.e. printing the urls, I can verify that the loop is correct).
Unfortunately the library seems not to work properly. The result is that:
The same behaviour can be seen using jquery queues, for instance:
In this second example, removing the delay() causes the embed to be almost simultaneous (like the $("a.embed").oembed(...); call) and properly works. It seems to me that there is some strange internal behaviour that works badly with concurrency...