Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: RES: Windows Media Player - Automatic redirection after the end of the video


Message #1 by =?iso-8859-1?Q?Maur=EDcio_A._Guimar=E3es?= <mandrade@o...> on Wed, 9 Oct 2002 11:12:30 -0300
Hi,

If you are creating the streaming media using the Windows Media Encoder, you
could add a "script" to stream along with audio and video, and send the next
URL in this script. Of course, you would need to modify your "player" page
to capture and run this command script. If the files are already encoded,
you will need to know when the player ends, and redirect the user to another
page. Both solutions probably can be achieved with Client-Side Javascript
(or VBScript).

I'll send you some sample code if I find it, but tou can browse the "Windows
Media SDK" for more information.

HTH

Maurício

-----Mensagem original-----
De: charalyi@n... [mailto:charalyi@n...]
Enviada em: terça-feira, 8 de outubro de 2002 15:37
Para: ASP Web HowTo
Assunto: [asp_web_howto] Windows Media Player - Automatic redirection
after the end of the video


Hello all,

I have added streaming media to our intranet site with windows media
technologies.

I would like at the end of the video, to automatically redirect the users
to a new page, but i dont know how to do it.....

Is there a way to implement this?
Thanks in advanced.


here is the code
<HTML>
<HEAD>
<TITLE>Embedded Windows Media Player 6.4 Control</TITLE>
</HEAD>
<BODY>
<!-- *******************************************  -->
<p align="center">
<OBJECT ID="MediaPlayer" WIDTH=400 HEIGHT=320
  CLASSID="CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95"
  STANDBY="Loading Windows Media Player components..."
  TYPE="application/x-oleobject"
CODEBASE="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf
.cab#Version=6,4,5,715"

VIEWASTEXT>

  <PARAM name="autoStart" value="True">
  <PARAM name="filename" value="<%=Request.QueryString("URL")%>">


<EMBED TYPE="application/x-mplayer2"
    SRC="<%=Request.QueryString("URL")%>"
    NAME="MediaPlayer"
    WIDTH=320
    HEIGHT=240>
  </EMBED>
</OBJECT>
</BODY>
</HTML>


---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20

Message #2 by =?iso-8859-1?Q?Maur=EDcio_A._Guimar=E3es?= <mandrade@o...> on Thu, 10 Oct 2002 15:04:54 -0300
Yiannis,

My solution uses on-the-fly encoded files.
But if you add some Javascript to the "playStateChange" Event of your
"MediaPlayer" object, I think you can do what you want.
Try this:


<script LANGUAGE="JavaScript" FOR="MediaPlayer"
EVENT="playStateChange(NewState)">
	<!--
		// Handler for player state change
		if (NewState == 3)
			{
				// Play
			}
		else if (NewState == 6)
			{
				// Buffering
			}
		else if (NewState == 1)
			{
				// Stop
				// You may add your code here, like location.href='<%= strDestinationURL
%>';
				// Note that "strDestinationURL" is an ASP variable, which you can
change.
				// if all users must go to the same URL, just type it instead.
			}
		else if (NewState == 7)
			{
				// Waiting
			}
	// -->
</script>

Remember, this is not ASP, so it's case-sensitive, okay?
Hope this helps
Maurício


  Return to Index