diff options
author | Fabio Varesano <fax8@13637.no-reply.drupal.org> | 2006-06-18 14:16:10 +0000 |
---|---|---|
committer | Fabio Varesano <fax8@13637.no-reply.drupal.org> | 2006-06-18 14:16:10 +0000 |
commit | 2540b23c26f79ed8b223d6ec8b00ca4bfc76e7ef (patch) | |
tree | defb7add526acc8ead82c5bd1e12ee5a70c2206e | |
parent | 855c13196c23195583cd526ea1cb35f58a6ab43e (diff) | |
download | video-2540b23c26f79ed8b223d6ec8b00ca4bfc76e7ef.tar.gz video-2540b23c26f79ed8b223d6ec8b00ca4bfc76e7ef.tar.bz2 |
Added file video.js for javascript functions. Contains several Internet Explorer workarounds.
-rw-r--r-- | video.js | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/video.js b/video.js new file mode 100644 index 0000000..d4d5e11 --- /dev/null +++ b/video.js @@ -0,0 +1,38 @@ +// $Id$ +/** + * @file + * This file contains some useful functions which fixes different + * Internet Explorer strange behaviours. + * This file is inclueded at each video play. + * See functions video_play and theme_video_get_script on video.module + * file for more informations. + * + * @author Fabio Varesano <fvaresano at yahoo dot it> +*/ + +//We do this code only on Internet Explorer. +if (document.all) { + + // Fix for the "Click to interact with ActiveX control" message on IE + var objects = document.getElementsByTagName( 'object' ); + for ( var i = 0; i < objects.length; i++ ) { + var obj = objects[ i ]; + var clone = obj.cloneNode( true ); + var parent = obj .parentNode; + var sibling = obj .nextSibling; + parent.removeChild( obj ); + parent.insertBefore( clone, sibling ); + clone.outerHTML = clone.outerHTML; + } + + + function InsertQuicktimeVideo(vidfile, height, width) + { + document.writeln('<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" width="' + width + '" height="' + height + '" scale="tofit" codebase="http://www.apple.com/qtactivex/qtplugin.cab">'); + document.writeln('<param name="SRC" value="' + vidfile + '" />'); + document.writeln('<param name="AUTOPLAY" value="true" />'); + document.writeln('<param name="KIOSKMODE" value="false" />'); + 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>'); + } + +} |