| 1 |
// $Id: video.js,v 1.2 2007/01/14 14:59:06 fax8 Exp $
|
| 2 |
/**
|
| 3 |
* @file
|
| 4 |
* This file contains some useful functions which fixes different
|
| 5 |
* Internet Explorer strange behaviours.
|
| 6 |
* This file is inclueded at each video play.
|
| 7 |
* See functions video_play and theme_video_get_script on video.module
|
| 8 |
* file for more informations.
|
| 9 |
*
|
| 10 |
* @author Fabio Varesano <fvaresano at yahoo dot it>
|
| 11 |
* porting to Drupal 6
|
| 12 |
* @author Heshan Wanigasooriya <heshan at heidisoft.com><heshanmw@gmail.com>
|
| 13 |
* @todo
|
| 14 |
*/
|
| 15 |
|
| 16 |
//We do this code only on Internet Explorer.
|
| 17 |
if (document.all) {
|
| 18 |
|
| 19 |
// Fix for the "Click to interact with ActiveX control" message on IE
|
| 20 |
var objects = document.getElementsByTagName( 'object' );
|
| 21 |
for ( var i = 0; i < objects.length; i++ ) {
|
| 22 |
var obj = objects[ i ];
|
| 23 |
var clone = obj.cloneNode( true );
|
| 24 |
var parent = obj .parentNode;
|
| 25 |
var sibling = obj .nextSibling;
|
| 26 |
parent.removeChild( obj );
|
| 27 |
parent.insertBefore( clone, sibling );
|
| 28 |
clone.outerHTML = clone.outerHTML;
|
| 29 |
}
|
| 30 |
|
| 31 |
|
| 32 |
function InsertQuicktimeVideo(vidfile, height, width)
|
| 33 |
{
|
| 34 |
document.writeln('<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" width="' + width + '" height="' + height + '" scale="tofit" codebase="http://www.apple.com/qtactivex/qtplugin.cab">');
|
| 35 |
document.writeln('<param name="SRC" value="' + vidfile + '" />');
|
| 36 |
document.writeln('<param name="AUTOPLAY" value="true" />');
|
| 37 |
document.writeln('<param name="KIOSKMODE" value="false" />');
|
| 38 |
document.writeln('<embed src="' + vidfile + '" width="' + width + '" height="' + height + '" scale="tofit" autoplay="true" kioskmode="false" pluginspage="http://www.apple.com/quicktime/download/"></embed>\n</object>');
|
| 39 |
}
|
| 40 |
|
| 41 |
}
|
| 42 |
|
| 43 |
|
| 44 |
|