Re: One player window for auto start video and click on demand vid

Tech-Archive recommends: Fix windows errors by optimizing your registry



It's not helping that the distinction between "auto start" and "on
demand" is not defined. However :

You would create links which had a javascript action that was routed
to a JS function. It would return true if the action was successful,
or false if not - in the false case, you'd *also* have a URL on the
anchor which the browser navigated to instead - thereby starting the
standlone player in case of failure.

The function would identify the player's HTML ID (correctly !) and set
the player URL, something like

function setURL(which) {
player = document.getElementById("msMediaPlayer");
try {
if (player.controls.isAvailable("stop") {
player.controls.stop();
}
player.URL = which;
if (player.controls.isAvailable("play") {
player.controls.play();
}
return true;
}
catch (err) {
// Optional error reporting here
}
return false;
}



Cheers - Neil

On Sat, 6 Jan 2007 15:05:00 -0800, Marvin Mowatt
<MarvinMowatt@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

Ok lets forget the technicalities of the script example and focus on the
question.

If I have a video set to auto start and I would like to add on demand
videos on my web site, how do I get the on demand videos to play in the same
window as the auto start video window?

"Neil Smith [MVP Digital Media]" wrote:

That cannot be the entire code of your page which handles the players,
because the initial Object has an HTML ID of msMediaPlayer, there is
no Player HTML ID in the code sample you added.

In addition, the EMBED tag just seems to stop after
ShowControls="True", and then merges into that form element.

The first thing is to create a minimal but complete example which is
properly constructed HTML, we'll probably then see where the Player ID
comes in - but it definitely *can't* apply to the player snippet below

PS there's no "name" attribute on OBJECT tags ;-)

PPS Your OBJECT and EMBED elements should *not* share the same HTML ID
"msMediaPlayer", because that again makes the HTML invalid - an ID has
to be unique within the web page, you can't apply it to more than one
tag.

HTH
Cheers - Neil

On Wed, 3 Jan 2007 15:22:01 -0800, Marvin Mowatt
<MarvinMowatt@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

I am working on a video webpage for my website and I currenlt have an auto
start video that starts up in preset media player window.
I have also added an on demand video (using JS onlick command) However, this
creates a another media player window on my web page, resulting in two player
windows and video playing at the same time. Is there a way to let my video on
demand play in the same window as the default auto start video window.
Here is the script I am using:

<object id="msMediaPlayer" type="application/x-oleobject"
height="305" standby="Loading Stream..." width="304"
classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" name="msMediaPlayer">
<param NAME="URL"
VALUE="http://America.com/Test.asx";>
<param NAME="rate" VALUE="1">
<param NAME="balance" VALUE="0">
<param NAME="currentPosition" VALUE="469.534347">
<param NAME="defaultFrame" VALUE>
<param NAME="playCount" VALUE="1">
<param NAME="autoStart" VALUE="-0">
<param NAME="currentMarker" VALUE="0">
<param NAME="invokeURLs" VALUE="-1">
<param NAME="baseURL" VALUE>
<param NAME="volume" VALUE="50">
<param NAME="mute" VALUE="0">
<param NAME="uiMode" VALUE="full">
<param NAME="stretchToFit" VALUE="-1">
<param NAME="windowlessVideo" VALUE="0">
<param NAME="enabled" VALUE="-1">
<param NAME="enableContextMenu" VALUE="-1">
<param NAME="fullScreen" VALUE="0">
<param NAME="SAMIStyle" VALUE>
<param NAME="SAMILang" VALUE>
<param NAME="SAMIFilename" VALUE>
<param NAME="captioningID" VALUE>
<param NAME="enableErrorDialogs" VALUE="0">
<param NAME="_cx" VALUE="8467">
<param NAME="_cy" VALUE="8070">
<embed id="msMediaPlayer" name="msMediaPlayer"
src="http://America.com/Test.asx";
type="application/x-mplayer2" width="320" height="305"
ShowControls="True"


<INPUT TYPE="BUTTON" NAME="BtnPlay" VALUE="America "
OnClick="StartMeUp()">
<SCRIPT>
<!--

function StartMeUp ()
{
Player.URL = "http://America.com/ja80.wmv";;

}


-->
</SCRIPT>
------------------------------------------------
Digital Media MVP : 2004-2007
http://mvp.support.microsoft.com/mvpfaqs

------------------------------------------------
Digital Media MVP : 2004-2007
http://mvp.support.microsoft.com/mvpfaqs
.


Quantcast