Re: Send Video to Html page??



On Wed, 20 Jul 2005 10:17:06 -0700, iiSwanSongii
<iiSwanSongii@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

>I have a video on a webpage, where once the video is done playing, I want the
>video to automatically send the person to another page of the website.
>
>Is there any way to do this? and please I'm hoping some of you have time to
>help me out, becuase I am a newb so I will need as much information as you
>have time for.
>
>thanks sooooo much

There are 2 ways : One is to add a command directly to the media file
- in the Encoder directory is a program called wmeditor.exe : Open
that and then the video, and you can add a "Script Command" at the end
called a "URL Script Command". The URL you enter is sent to the
browser at the point in the video when the script command is entered.
So if you scrub the timeline up to 1/10th second before the end of the
clip, insert script command and try that.

Sending of URL commands can be switched off though, so there's another
technique using Javascript to detect the end of the clip and send the
URL through a redirect instead.

Here's the code, which'll nearly work as-is. Make sure you're reading
this in a *Text-Only* newsreader program (such as Google Groups) !!!

Change the <param name="url" /> and filename="bla" below to the URL of
your video, and in the javascript, set var redirURL='newtest.html'; to
the value of your html page (preferably use the FULL url). The video
will autostart when the page loads, change that <param /> value to
zero if you prefer.


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
<title>Untitled</title>
<script language="javascript" type="text/javascript">
var redirURL='newtest.html';
var canRedir=false;
var WMP9=new Object();

function setPlayerID() {
WMP9=document.getElementById("MediaPlayer");
if (WMP9==null) {
WMP9=document["MediaEmbed"];
}
WMP9.attachEvent("playstatechange",setPlayerState);
}

function setPlayerState() {
if (WMP9.playState==3) {
// We've detected the player is playing (Playstate 3)
// So when it's stopped we can then redirect
canRedir=true;
}
if (WMP9.playState==8) {
// Playstate 8 is "MediaEnded"
showRedir();
}
if (WMP9.playState==1) {
// Playstate 1 is "Stopped"
showRedir();
}
}
function showRedir() {
if (canRedir) {
location.href=redirURL;
}
}
</script>

</head>

<body onload="setPlayerID()">

<object id="MediaPlayer"
classid="clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6"
type="application/x-oleobject" width="320" height="240">
<param name="url" value="test-redir.asx" />
<param name="autostart" value="1" />
<param name="uimode" value="full" />
<param name="stretchtofit" value="1" />
<param name="enablecontextmenu" value="1" />
<param name="showcontrols" value="0" />
<param name="showstatusbar" value="1" />
<embed type="video/x-ms-wmv" id="MediaPlayer2"
name="MediaPlayer2"
width="320" height="240" filename="test-redir.asx"></embed>
</object>

</body>
</html>

.



Relevant Pages

  • Re: Help with opening a new webpage after showing movie
    ... I am trying to develop new training video, ... you just need to grab windows media encoder. ... script command menu / dialog, and point it to your web page. ...
    (microsoft.public.windowsmedia)
  • Re: to diminish the time of delay
    ... You would need to use a Windows Media Server, which you should be able to ... I use following script to synchronize the video with slide show and to ... var VDState = 0 ... .asf video/x-ms-asf ...
    (microsoft.public.windowsmedia)
  • Re: to diminish the time of delay
    ... I use following script to synchronize the video with slide show and to ... var VDState = 0 ... ..asf video/x-ms-asf ... If mms:// is pointing to an IIS or Apache server, ...
    (microsoft.public.windowsmedia)
  • Re: This small piece of code works in Firefox but not in IE 7... why?
    ... How hard could it be to create the embeded youtube object in ... this is the embebed youtube video object: ... var object1 = document.createElement; ... Why IE7 gives me an error but Firefox not? ...
    (comp.lang.javascript)
  • Re: German medical video translation
    ... following video? ... Tanks in advance ... Vargod: ...
    (de.sci.medizin.misc)