Posts Tagged ‘MooTools’

silverstripe shadowbox combination fix for embedded vidoes not playing in firefox

Monday, August 25th, 2008

For several days i struggled to find a fix for my problem with embedding .flv’s in firefox in the silverstripe php framework.  I am using the js video lightbox ‘shadowbox,’ which i really like and can get working just fine when I use it in a typical html page.  But for some reason when I tried implementing this framework into my silverstripe application, the videos wouldn’t load in firefox, exclusively.  All other browsers worked fine, and after days of banging my head and searching for answers on google and irc I found this fix:

Shadowbox needs to load a .js file for each media type you wish to use.  I was using .flv so I loaded the ’shadowbox-flv.js.’  That file returns:

return {
tag:        'object',
id:         this.id,
name:       this.id,
type:       'application/x-shockwave-flash',
data:       options.flvPlayer,
children:   [
{ tag: 'param', name: 'movie', value: options.flvPlayer },
{ tag: 'param', name: 'flashvars', value: flashvars.join('&') },
{ tag: 'param', name: 'allowfullscreen', value: 'true' }
],
height:     h, // new height includes controller
width:      w
};

What i did was change it so that instead of using ‘object’ to embed the video, I used ‘embed,’ and now it worked!! Simple.

here is what i changed:

return {
tag: 'embed',
id: this.id,
src: 'flvplayer.swf',
allowscriptaccess: 'true',
allowfullscreen: 'true',
flashvars:  flashvars.join('&'),
height:     h, // new height includes controller
width:      w
};
},

see it working here

I’ve learned that firefox has a bug dealing with object vs embed which in certain cases doesn’t allow the swf loader to function properly.  Specifying ‘autoplay’ seems to have an effect on this as well.  The firefox bug for this issue is here.

hopefully this bug will be fixed soon :)

SlickSpeed results for Spry vs Prototype, MooTools, and Dojo

Friday, November 16th, 2007

SlickSpeed Selectors Test for Frameworks measures the time javascript frameworks take to return elements with their CSS Selector functions. SlickSpeed is developed by MooTools, but aims to offer unbiased results (indeed, Prototype beat MooTools in my test).

I couldn’t find any results for Spry, so I downloaded the test kit from its home at Google Code. I included Spry 1.6, Prototype 1.6, MooTools 1.2b1, and Dojo 1.0. I tested the default selectors against the default template (an excerpt from As You Like It). I ran the test under Firefox, but will update with results from IE7 and Safari 3 with more toolkits another day. You can run the test yourself here.

Prototype 1.6 and MooTools 1.2b1 basically tie at about 250ms, while Spry and Dojo take about twice as long.

Spry may be excused for finishing last as Adobe just introduced the Spry.$$() CSS Selector in its latest pre-release version 1.6.

framework test 1 test 2 test 3 avg
Spry 1.6 514 554 498 522
prototype 1.6 232 236 259 242
MooTools 1.2b1 263 212 275 250
dojo query 412 418 443 424