...

View Full Version : Embedded WMP - Won't play w/code...



chaser7016
10-13-2006, 12:06 AM
As seen here www.mubiquity.com I have no play functionality with the embedded player on my site. I can turn volume up/down, mute and move progress bar but play/stop/pause are all greyed out. Im using the following code. Anyone tell me what Im missing?

<html>

<head>

<script language="javascript">

function loadplayercontrols()
{

Player.FileName="\\sample.wmv";
Player.ShowControls=1;
player.AutoRewind=1;
player.EnableTracker=0;
player.Volume ="-450";
Player.Play();

}

</script>

</head>

<body onLoad="loadplayercontrols()">
<object id="Player" width="208" height="231" class="back"
classid="CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6" standby="Loading
Windows Media Player components..." type="application/x-oleobject">

<param name="loop" value="1">
<embed width="208" height="231" loop="1" src="1">
</embed>
</object>

</body>

</html>

Cheers, Chaser

_Aerospace_Eng_
10-13-2006, 05:02 AM
Looks like you have an incorrect filename value. Just so you know the javascript and playing you are using will only work in IE.

chaser7016
10-14-2006, 01:28 AM
Thanks AeroSpace my code looks as below ( www.ryanismy.name ) and I have a sample.wmv on my host's server ( www.ryanismy.name/sample.wmv ) . Unfortunately, the play button is still greyed out.

<html>

<head>

<script language="javascript">

function loadplayercontrols()
{

Player.FileName="\\sample.wmv";
Player.ShowControls=1;
player.AutoRewind=1;
player.EnableTracker=0;
player.Volume ="-450";
Player.Play();

}

</script>

</head>

<body onLoad="loadplayercontrols()">
<object id="Player" width="208" height="231" class="back"
classid="CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6" standby="Loading
Windows Media Player components..." type="application/x-oleobject">

<param name="loop" value="1">
<embed width="208" height="231" loop="1" src="1">
</embed>
</object>

</body>

</html>

Well thank u for any and all thoughts and help!

Cheers, Chaser

_Aerospace_Eng_
10-14-2006, 01:51 AM
Sighs I guess a little more detail to my answer will help you understand what I'm saying better. Remove the stuff in red

Player.FileName="\\sample.wmv";
Player.ShowControls=1;
player.AutoRewind=1;
player.EnableTracker=0;
player.Volume ="-450";
Player.Play();

chaser7016
10-14-2006, 11:13 AM
Hi thank you so much for your help. Sorry if Im a bit of tard in regards to programming, Im learning as I go.

The goal here is to create an embedded player that will work in regular Internet Explorer and Internet Explorer for Pocket PC. I have a Treo 700w SmartPhone in which I access the Internet using Internet Explorer Pocket PC. I want to be able via my Treo to go to my site and tune into sample.wmv for instance; ultimately my online radio station, but first Im just trying to get the play button to work properly.

If you go here www.mubiquity.com I am using different code that works fine on a PC, but through PIE(PocketPC IE) I choose the play button causing a windows error to pop up stating, "Parameter is Incorrect" and nothing plays.

If you go here www.ryanismy.name you will c Im using the code listed in this posting where I removed the two red dashes u suggested. Well maybe I missing something more then the removal of those two dashes?

Both of these WMP Class IDs(most other WMP embedded codes do not even display in PIE, but these two do) are viewable in regular IE and in PIE, but getting them to actually play in PIE is the challenge.

Well thanks as always for your interest, thoughts, comments and help!

_Aerospace_Eng_
10-14-2006, 02:23 PM
I'm not even sure why you are trying to use js in the first place just to get the video to play which seems like its the root of your problem. Try this

<object width="208" height="231"
classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"
codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"
standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject">
<param name="url" value="sample.wmv">
<param name="uiMode" value="full">
<param name="autoStart" value="1">
<param name="playCount" value="9999">
<param name="AutoRewind" value="1">
<param name="volume" value="0">
<embed type="application/x-mplayer2"
pluginspage="http://microsoft.com/windows/mediaplayer/en/download/"
showcontrols="1" uimode="full" width="208" height="231"
src="sample.wmv" autostart="1" playcount="9999" autorewind="1" volume="0">
</object>
Reason it likely wasn't working with the js was there was no filename parameter. Don't use the js if you don't have to. As you can see you don't.

chaser7016
10-14-2006, 10:15 PM
Thank you again and if u still have interest thanks. Using the code in the post the player displays/plays fine in reg. IE, but not PIE(PocketPC Internet Explorer). The player doesnt appear at all in PIE.

Maybe I should create a filename parameter with either code used here www.mubiquity.com or here www.ryanismy.name?

Cheers, Chaser



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum