media player

liunx

Guest
Embedded 6.4 Media Player so that player and timer start when a user hits the 2 key. Works finr on some IE, but not NS7. MediaPlayer does not exist according to NS7, but right click on the screen allows me to play the video.<br />
<br />
<!-- w --><a class="postlink" href="http://www.mapzap.com/tracetest.php">www.mapzap.com/tracetest.php</a><!-- w --> is the link to the code.<br />
<br />
code follows<br />
<br />
<html><br />
<head><br />
<title>Moment to Moment</title><br />
<br />
<SCRIPT LANGUAGE="javaScript"><br />
<br />
var $tid=0;<br />
<br />
<br />
<br />
<br />
function countDown(){<br />
if ($tid){<br />
clearTimeout($tid);<br />
$tid=0;<br />
}<br />
$ctrstr=document.outform.timer.value;<br />
$timarr=$ctrstr.split(":");<br />
if ($timarr[1]<50){<br />
$timarr[1]++;<br />
$t=$timarr[1];<br />
}else{<br />
<br />
return;<br />
}<br />
if ($timarr[1]<=9){$timfil="0";}else{$timfil="";}<br />
<br />
document.outform.timer.value=$timarr[0]+":"+$timfil+$timarr[1];<br />
$tid=setTimeout("countDown()",1000);<br />
<br />
}<br />
<br />
<br />
<br />
function startit(){<br />
<br />
window.document.MediaPlayer.Play();<br />
countDown();<br />
}<br />
<br />
</SCRIPT><br />
<br />
<br />
</head><br />
<br />
<body><br />
<table width="100%"><br />
<tr><td align="center"><br />
<br />
<br />
<br />
<H1>Moment to Moment Reactions</H1><br />
<br />
You start the video by depressing the 2 key.<br><br><br />
<br />
</td></tr><br />
<tr><td align="center"><br />
<br />
<?php<br />
$videoUrl="http://www.mapzap.com/IMAGES/sensitiveteeth.asf";<br />
printf('<OBJECT ID="MediaPlayer"<br />
CLASSID="CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95"<br />
STANDBY="Loading Windows Media Player components..."<br />
TYPE="application/x-oleobject"<br />
CODEBASE="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112"><br />
<PARAM name="autoStart" value="false"><br />
<PARAM name="filename" value="%s"><br />
<PARAM name="playcount" value="1"><br />
<PARAM name="showDisplay" value="false"><br />
<PARAM name="showControls" value="false"<br />
<EMBED TYPE="application/x-mplayer2" width="400" height="323"<br />
PLUGINSPAGE="http://microsoft.com/windows/mediaplayer/en/Download <!--more-->/"<br />
ID="MediaPlayer"<br />
NAME="MediaPlayer"<br />
SRC=http://www.webdeveloper.com/forum/archive/index.php/"%s"<br />
SHOWCONTROLS="0"<br />
AUTOSTART="0"><br />
</EMBED><br />
</OBJECT>',$videoUrl,$videoUrl);<br />
?><br />
</td></tr><br />
<tr><td align="center"><br />
<form name="outform"><br />
<input type="hidden" name="mouseval" value=0><br />
<input type="text" name="timer" value="0:00"><br><br />
</form><br />
</td></tr><br />
<tr><td align="center"><br />
Depress the 2 Key to Start.<br />
</td></tr><br />
<SCRIPT LANGUAGE="javaScript"><br />
var brow=(navigator.appName.substr(0,3));<br />
var ver = parseInt(navigator.appVersion);<br />
if (brow=="Net"){b="NS";}<br />
if (brow=="Mic"){b="IE";}<br />
if (b=="NS"){document.captureEvents(Event.KEYPRESS)}<br />
document.onkeypress=kpress;<br />
<br />
function kpress(e){<br />
if(b=="IE"){key=event.keyCode;}else{key=e.which;}<br />
keyval=String.fromCharCode(key);<br />
<br />
if (keyval == 2 ){startit();}<br />
<br />
}<br />
<br />
</SCRIPT><br />
<table><br />
</body><br />
</html><!--content-->why are you embedding medial player? Why not just embed the file, for users with ie (depending ont he format and system defaults) medial player will be there, for users using a mac quick time or something might be there, or real etc.<!--content-->I am tracing reactions to commercials. I edited out the code to react to the video as it runs. So I am looking for a constant position and size for the video, while i do other things as it runs. Can I control the video size, placement and other code on the screen using your suggestions?<!--content-->well if you use the object tag and modify the size of the object you should be able to. I would not use the embed tag because it is not as inclusive and off the top of my head I believe it is depreciated.<!--content-->
 
Back
Top