here is the code. for some reason In IE the plug in doesnt work and in fire fox it crashes
Expand|Select|Wrap|Line Numbers
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
- <title>Untitled Document</title>
- <script language="javascript" type="text/javascript">
- /*if you have windows media player*/
- function WMPFrame() {
- var iframe = document.createElement("iframe");
- iframe.setAttribute("src", "WMPIframe.html");
- iframe.setAttribute("id", "playerframe");
- iframe.setAttribute("scrolling", "no");
- iframe.setAttribute("frameBorder", "0");
- iframe.setAttribute( "width", "200" );
- iframe.setAttribute( "height", "200" );
- document.getElementById('misterioProgram').appendChild(iframe);
- }
- /*if you have quicktime*/
- function QUIFrame() {
- var Frame = document.createElement("iframe");
- Frame.setAttribute("src", "QuicktimeIfram.html");
- Frame.setAttribute("id", "timeframe");
- Frame.setAttribute("scrolling", "no");
- Frame.setAttribute("frameBorder", "0");
- Frame.setAttribute( "width", "200" );
- Frame.setAttribute( "height", "200" );
- document.getElementById('misterioProgram').appendChild(Frame);
- }
- /*if you have no plugins*/
- function read(){
- var answer = confirm ("Please click on OK to continue loading my page, or CANCEL to be directed to the Yahoo site.")
- if (answer)
- var MKDIV = document.createElement( 'div' );
- MKDIV.setAttribute('id','pluginsite');
- MKDIV.style.backgroundColor="#F0CCF0";
- MKDIV.style.border = '1px solid blue';
- MKDIV.style.left = '35%'
- MKDIV.style.top = '200px'
- MKDIV.style.width = '300px'
- MKDIV.style.heigh = '200px'
- MKDIV.style.font = '14px arial #FF6666'
- MKDIV.style.position='absolute'
- document.getElementsByTagName( 'body' )[0].appendChild( MKDIV );
- MKDIV.appendChild(document.createTextNode("To download quick time \u00a0 "))
- var lQT=document.createElement('a');
- lQT.setAttribute('href','http://www.apple.com/qtactivex/qtplugin.cab' );
- lQT.appendChild( document.createTextNode( 'QuickTime' ) );
- MKDIV.appendChild(lQT);
- MKDIV.appendChild(document.createTextNode("\u00a0 or go to windows media player's download page \u00a0"));
- var lWMP=document.createElement('a');
- lWMP.setAttribute('href','http://www.microsoft.com/windows/windowsmedia/download/AllDownloads.aspx' );
- lWMP.appendChild( document.createTextNode( 'WMP' ) );
- MKDIV.appendChild(lWMP);
- window.setTimeout("stopdiv();", 12000)
- }
- function stopdiv ( )
- {
- document.body.removeChild(document.getElementById('pluginsite'))
- }
- /*end of no plugin and Iframes.*/
- /*start os detection script that I got from someone else*/
- // create a multidimensional associative array to store our plugin names and datatypes
- $plugin_type = {
- 'SVG Viewer': {
- 'ieAndWin': 'Adobe.SVGCtl',
- 'nsOrMac': 'image/svg-xml' },
- 'Shockwave Director': {
- 'ieAndWin': 'SWCtl.SWCtl.1',
- 'nsOrMac': 'application/x-director' },
- 'Flash': {
- 'ieAndWin': 'ShockwaveFlash.ShockwaveFlash.1',
- 'nsOrMac': 'application/x-shockwave-flash' },
- 'RealPlayer': {
- 'ieAndWin': 'rmocx.RealPlayer G2 Control.1',
- 'nsOrMac': 'audio/x-pn-realaudio-plugin' },
- 'QuickTime': {
- 'ieAndWin': 'QuickTimeCheckObject.QuickTimeCheck.1',
- 'nsOrMac': 'video/quicktime' },
- 'Windows Media Player': {
- 'ieAndWin': 'MediaPlayer.MediaPlayer.1',
- 'nsOrMac': 'application/x-mplayer2' },
- 'Acrobat Reader': {
- 'ieAndWin': 'PDF.PdfCtrl.5',
- 'nsOrMac': 'application/pdf' }}; function detectPlugin( $inPluginName ){
- var agt = navigator.userAgent.toLowerCase();
- var ie = ( agt.indexOf('msie') != -1 );
- var ns = ( navigator.appName.indexOf('Netscape') != -1 );
- var win = ( ( agt.indexOf('win') != -1 ) || ( agt.indexOf('32bit') != -1 ) );
- var mac = ( agt.indexOf('mac') != -1 );
- $pluginEnabled = false;
- if( $inPluginName != 'Java' ) {
- if( ie && win )
- { $pluginEnabled = detectIE( $plugin_type[$inPluginName]['ieAndWin'] ); }
- if( ns || !win ) { nse = '';
- for( var i = 0; i < navigator.mimeTypes.length; i++ )
- { nse += navigator.mimeTypes[i].type.toLowerCase(); } $pluginEnabled = detectNS( $plugin_type[$inPluginName]['nsOrMac'] ); } }
- else { $pluginEnabled = navigator.javaEnabled() ? true : false; }
- return $pluginEnabled ;}
- function detectNS( ClassID ){ n = '';
- if( nse.indexOf( ClassID ) != -1 ) {
- if( navigator.mimeTypes[ClassID].enabledPlugin != null ) { return true; }
- else { return false; } }}
- function detectIE( ClassID ){ result = false;
- // this line needs to be broken to prevent errors in internet explorer, hence the strangeness in the middle of</SC' + 'RIPT>
- document.write( '<SCRIPT LANGUAGE=VBScript>\n on error resume next \n result = IsObject( CreateObject("' + ClassID + '") )</SC' + 'RIPT>' );
- if( result ) { return true; }
- else { return false; }}
- // ==========================================================
- // this portion determines what to do
- // ==========================================================
- if( detectPlugin( 'QuickTime' ) == true ){QUIFrame()}
- else if( detectPlugin( 'Windows Media Player' ) == true ){WMPFrame()}
- else{read()}
- /*end of detection script*/
- window.onload = function() { var links = document.getElementsByTagName('a'); for (var i = 0; i < links.length; i++) { if (links[i].className == 'movieloader') { /*find links with class="movieloader" */
- links[i].onclick = function(e) { /* attach function to each */
- if (window.event) window.event.returnValue = false; else e.preventDefault(); /*stop browser from going to link href */
- var mP = document.getElementById('misterioProgram'); mP.style.display = 'block'; if( detectPlugin( 'QuickTime' ) == true ){frames['timeframe'].document.getElementById('misterioProgram').getElementsByTagName('embed')[0].src = this.href;
- frames['timeframe'].document.getElementById('misterioProgram').getElementsByTagName('param')[0].value = this.href; }
- else if( detectPlugin( 'Windows Media Player' ) == true ){frames['playerframe'].document.getElementById('misterioProgram').getElementsByTagName('embed')[0].src = this.href;
- frames['playerframe'].document.getElementById('misterioProgram').getElementsByTagName('param')[0].value = this.href; } } } }}
- </script>
- <style type="text/css">
- <!--
- #misterioProgram {
- background-color: #666666;
- display: none;
- position: absolute;
- z-index: 4;
- height: 400px;
- width: 400px;
- left: 200px;
- top: 200px;
- }
- -->
- </style>
- </head>
- <body>
- <a class="movieloader" href="http://www.fileden.com/files/2006/11/20/398972/lupe%20fiasco%20-%20kick%20push.mp3">clickhere </a>
- <div id="misterioProgram">
- <h1 id="vidh">the video page</h1>
- <p id="vidp">it will take some time to load</p>
- <div id="MTVplayer">
- </div>
- <!--the big div-->
- <div id="ChooseSeason" align="left" >
- <!--the div of the navi-->
- <div id="Mtt1" class="theSeasons">
- <!--the div for teen titans season one Mtt one-->
- <ul>
- <li> Teen Titans Season 3 </li>
- <a href="http://www.fileden.com/files/2006/11/20/398972/Seal%20-%20Kiss%20From%20A%20Rose.mp3" onclick="misterio(); return false;">
- the end part one</a>
- </ul>
- </div>
- <!--end of the teen titans div-->
- </div>
- <!--end of nav div-->
- </div>
- </body>
- </html>
[HTML]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
WMP Iframe
<OBJECT classid='clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B' width='320' height='240' codebase='http://www.apple.com/qtactivex/qtplugin.cab'>
<param name='src' value=''>
<param name='autoplay' value='true'>
<param name='controller' value='true'>
<param name='loop' value='false'>
<EMBED src='' width='320' height='240' autoplay='true'
controller='true' loop='false' bgcolor='#000000' pluginspage='http://www.apple.com/quicktime/download/'>
</EMBED>
</OBJECT>
</body>
</html>
[/HTML]
quictime frame
[HTML]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
Windows media player page. will be an Iframe.
<OBJECT id='mediaPlayer' width="320" height="240"
classid='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95'
codebase='http://activex.microsoft.com/activex/controls/ mplayer/en/nsmp2inf.cab#Version=5,1,52,701'
standby='this will take some time<img src='misterioloder'' type='application/x-oleobject'>
<param name='fileName' value="">
<param name='animationatStart' value='1'>
<param name='transparentatStart' value='1'>
<param name='autoStart' value='1'>
<param name='ShowControls' value='1'>
<param name='ShowStatusBar' value='0'>
<param name='loop' value='0'>
<EMBED type='application/x-mplayer2'
pluginspage='http://microsoft.com/windows/mediaplayer/ en/download/'
id='mediaPlayer2' name='mediaPlayer' displaysize='4' autosize='0'
bgcolor='darkblue' showcontrols='true' showtracker='true'
showdisplay='0' showstatusbar='0' videoborder3d='0' width="320" height="240"
src='' autostart='1' designtimesp='5311' loop='0'>
</EMBED>
</OBJECT>
</body>
</html>
[/HTML]