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ít want this. I only want them to be able to watch the stream once.

Iíve 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ít have the coding skills to figure it out. It is described on the Microsoft page here:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmp6sdk/htm/player6endofstream.asp

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ím 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='true'>" & vbcrlf
content = content & "<PARAM NAME='TransparentatStart' VALUE='true'>" & vbcrlf
content = content & "<PARAM NAME='AutoStart' VALUE='true'>" & vbcrlf
content = content & "<PARAM NAME='AutoSize' VALUE='1'>" & vbcrlf
content = content & "<PARAM NAME='ShowControls' VALUE='0'>" & vbcrlf
content = content & "<PARAM NAME='ShowDisplay' value='0'>" & vbcrlf
content = content & "<PARAM NAME='ClickToPlay' VALUE='1'>" & vbcrlf
content = content & "<PARAM NAME='EnableContextMenu' VALUE='0'>" & vbcrlf
content = content & "<PARAM NAME='ShowStatusBar' value='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://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
%>