| Sign In/My Account | View Cart |
| Article: |
Hi-Res YouTube Hacks | |
| Subject: | Browser Compatibility | |
| Date: | 2008-05-14 01:39:45 | |
| From: | DavidBattino | |
|
Response to: Browser Compatibility
|
||
|
Thanks for the report. Since I'm not able to test this on IE6 and no one has written me directly, here's the modified code. Please let us know if it works. Basically, I split the external embedding script into two scripts. The first, which you can call poster-swap-o.js, contains this:
|
||
Showing messages 1 through 7 of 7.
Browser Compatibility
function flipMoviePoster(divIdOne,divIdTwo)
{
document.getElementById(divIdOne).style.display = 'none';
document.getElementById(divIdTwo).style.display = '';
}
Body
<div id="poster" align="center" onclick="flipMoviePoster(this.id,this.id+'2')" style="cursor:pointer;">
<img src="SAN_Provo_002.jpg" alt="Click to Play" width="425" height="355" border="0" />
</div>
<div id="poster2" align="center" style="display:none;">
<object width="425" height="355">
<param name="movie" value="http://www.youtube.com/v/5cwjKwe7a5s&hl=en&ap=%2526fmt%3D18&autostart=1"></param>
<param name="wmode" value="transparent"></param>
<embed src="http://www.youtube.com/v/5cwjKwe7a5s&hl=en&ap=%2526fmt%3D18&autoplay=1"
type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed>
</object>
</div>
</body>
</html>
Browser Compatibility
function viewTube(triggerID,movieURL,movieWth,movieHt) {
var div = document.createElement('div'); //Create DIV variable
var embedcode = "<object width='" + movieWth + "&autostart=1' height='" + movieHt + "'>";
embedcode += "<param name='movie' value='" + movieURL + "'></param>";
embedcode += "<param name='wmode' value='transparent'></param>";
embedcode += "<embed src='" + movieURL + "&autoplay=1' type='application/x-shockwave-flash' wmode='transparent' width='" + movieWth + "' height='" + movieHt + "'></embed></object>";
div.innerHTML = embedcode; //Assign embedcode to DIV variable
document.getElementById(triggerID).innerHTML = ""; //Clear DIV
document.getElementById(triggerID).insertBefore(div,null); //Insert new DIV content
}
It still works in Firefox and IE7.
B