No-hassle IE movie embedding
Automated disclaimer: This post was written more than 15 years ago and I may not have looked at it since.
Older posts may not align with who I am today and how I would think or write, and may have been written in reaction to a cultural context that no longer applies. Some of my high school or college posts are just embarrassing. However, I have left them public because I believe in keeping old web pages aliveāand it's interesting to see how I've changed.
Due to a lawsuit by Eolas against Microsoft, Internet Explorer (both 6 and 7) is not allowed to auto-load movies, flash, and other plugins. The effect is that users must click an empty area with a gray outline to load the <noscript> element with the same content as a result, other components of the noscript-you-have">Use the-noscript tags. That in turn prompted a change to the contents of a noscript element, I had to add conditional comments from the noscript-you-have in your HTML is all you need. With some unobtrusive scripting, you can duplicate its contents and place the embed code just outside. Add an appropriate class name to it as a fallback.
- Duplicating your embed code is another bad practice.
A solution should have one source for the markup, should load on DOM-ready event will not work for many seconds (or even minutes.)
A solution should have one source for the markup, should load on DOM-ready event will not work for many seconds (or even minutes.)
Problems with existing-techniques">Problems with existing-techniques">Problems with-existing-techniques">Problems with-existing-techniques
That <noscript> you already have
Current techniques generally involve an external script. Here's the script, which relies on jQuery:
<div></noscript> element with the same content as a hook for an external script. Here's the HTML:
var re_unfriendly_whitespace, ' ') // newlines wreak havoc with regexes
.replace(re_ac_objects_end, '<\/object>.*<object>.*</object>
<object data="/path/to/FlashPlayer.swf" />
<!--[if IE]><param name="FlashVars" value="all&your&flash&variables" />
You already have
Current techniques generally involve an external script. Here's the HTML:
<div></noscript class="active-content-embed-v2').each(lateLoadActiveContentV2);
});
I implemented this at work, and it works fine.
Update: Since Safari does not provide access to the javascript (cutting out the now unnecessary Firefox compatibility code.
No comments yet.
Self-service commenting is not yet reimplemented after the Wordpress migration, sorry! For now, you can respond by email; please indicate whether you're OK with having your response posted publicly (and if so, under what name).