Javascript in Windows Media Player. HELP!

wxdqz

New Member
I'm not a coder and I'm trying to feel my way through a WMP player page for video on my site that someone else built in ASP and Javascript.

In a nutshell, the player page shows no controls so that the viewers cannot rewind the video. However, I've enabled the clickToPlay parameter in WMP in order to let the viewers click on the screen to pause the video during playback. The problem is, when the video ends its stream the users are able to click on the screen to start the video all over again. I don抰 want this. I only want them to be able to watch the stream once.

I抳e found that there is an event in WMP called EndOf Stream that occurs when the stream is finished that should be able to help me do this; I just don抰 have the coding skills to figure it out. It is described on the Microsoft page here:

<!-- m --><a class="postlink" href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmp6sdk/htm/player6endofstream.asp">http://msdn.microsoft.com/library/defau ... stream.asp</a><!-- m -->

The javascript function is described as follows:

<SCRIPT FOR="MediaPlayer" EVENT="EndOfStream(lResult)" LANGUAGE="JScript"> <!-- insert script commands --></SCRIPT>
It also says that:

Long value specifying the status of the clip after it has finished playing. A value of zero indicates the clip completed successfully.

So I抦 hoping that someone can suggest how I can integrate this into my player page below. If I can disable the clickToPlay parameter when the EndOf Stream value is at 0, I may be able to do what I want. I just don't have the slightest idea how to code this into my page. Any ideas as to what script commands I can use here?

Thanks,
Diggsy

CODE FOR PLAYER WMP PLAYER PAGE


<!-- #include file="include.j" -->
<%
mode = request("mode" )
video = "ernie09876/IntroHigh.wvx"
content = content & "<OBJECT ID='MediaPlayer'" & vbcrlf
content = content & "classid='CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95'" & vbcrlf
content = content & "CODEBASE='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715standby='Loading Microsoft Windows Media Player components...'" & vbcrlf
content = content & "type='application/x-oleobject'>" & vbcrlf
content = content & "<PARAM NAME='Filename' VALUE='http://vitalstream.com/" & video & "'>" & vbcrlf
content = content & "<PARAM NAME='AnimationatStart' VALUE='http://www.webdeveloper.com/forum/archive/index.php/true'>" & vbcrlf
content = content & "<PARAM NAME='TransparentatStart' VALUE='http://www.webdeveloper.com/forum/archive/index.php/true'>" & vbcrlf
content = content & "<PARAM NAME='AutoStart' VALUE='http://www.webdeveloper.com/forum/archive/index.php/true'>" & vbcrlf
content = content & "<PARAM NAME='AutoSize' VALUE='http://www.webdeveloper.com/forum/archive/index.php/1'>" & vbcrlf
content = content & "<PARAM NAME='ShowControls' VALUE='http://www.webdeveloper.com/forum/archive/index.php/0'>" & vbcrlf
content = content & "<PARAM NAME='ShowDisplay' value='http://www.webdeveloper.com/forum/archive/index.php/0'>" & vbcrlf
content = content & "<PARAM NAME='ClickToPlay' VALUE='http://www.webdeveloper.com/forum/archive/index.php/1'>" & vbcrlf
content = content & "<PARAM NAME='EnableContextMenu' VALUE='http://www.webdeveloper.com/forum/archive/index.php/0'>" & vbcrlf
content = content & "<PARAM NAME='ShowStatusBar' value='http://www.webdeveloper.com/forum/archive/index.php/1'><EMBED type='application/x-mplayer2'" & vbcrlf
content = content & "pluginspage='http://www.microsoft.com/isapi/redir.dll?prd=windows&sbp=mediaplayer&ar=Media&sba=Plugin&'" & vbcrlf
content = content & "Name='MediaPlayer' ShowControls=0 ShowDisplay='0' ShowStatusBar=1 EnableContextMenu=0 src=http://www.webdeveloper.com/forum/archive/index.php/"http://easylink.playstream.com/" & video & "" height=320 width=320 autosize='1'>" & vbcrlf
content = content & "</OBJECT>" & vbcrlf
if session("name" ) <> "" then
if session("viewsHigh" ) < 1 then
response.write "You do not have any high-speed views remaining. Please purchase some.<p>"
else
if logAction("Viewed : " & video) then errMsg = errMsg
if viewOneHigh() then errMsg = errMsg
'embeded media
response.write content
response.write "<br>" & "Click the video to pause and continue play"
end if
else
response.write "You must log in to view member content.<p>"
end if
%>
 
Back
Top