Re: Send Video to Html page??
- From: "Neil Smith [MVP Digital Media]" <neil@xxxxxxxxxx>
- Date: Thu, 21 Jul 2005 09:03:21 GMT
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>
.
- References:
- Send Video to Html page??
- From: iiSwanSongii
- Send Video to Html page??
- Prev by Date: Re: Bad result (low fps) during conversion to file with WME
- Next by Date: Re: Bad result (low fps) during conversion to file with WME
- Previous by thread: Send Video to Html page??
- Next by thread: error with publishing point
- Index(es):
Relevant Pages
|