[Resolved] Windows Media Player on web
Hi,
I have created Windows Media Player on my site.
<OBJECT style="Z-INDEX: 101; LEFT: 224px; POSITION: absolute; TOP: 56px" classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6" VIEWASTEXT>
<PARAM NAME="URL" VALUE="">
<PARAM NAME="volume" VALUE="50">
</OBJECT>
It works fine.
But how to change url of Windows Media Player when user selected a url from combo box?
code below is invalid how to correct this code?
<script runat="server">
private void DropDownList1_SelectedIndexChanged(object sender, System.EventArgs e)
{
A.URL="XXXX";
}
</script>
May someone give me an idea?
Thanks for advance :)
Re: Windows Media Player on web
Code:
<OBJECT id="wmpobj" style="Z-INDEX: 101; LEFT: 224px; POSITION: absolute; TOP: 56px" classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6" VIEWASTEXT>
then use client side javascript, call it in the OnChange event of the dropdown:
PHP Code:
wmpobj.URL="file7.wmv";
Re: Windows Media Player on web
Thanks mendhak.
Below is a code that i have edited from a code you gave me.
I still got an error, what's wrong of my code? :eek2:
can you help me to correct this code, if it work then I can do more my self
VB Code:
<HTML>
<script language="VB">
sub Submit_Click()
wmpobj.URL="D:\Songs\mangosteen_low.wav";
end sub
</script>
<body>
<input name="Submit" type="submit" id="Submit" value="Submit" >
<OBJECT id="wmpobj" style="Z-INDEX: 101; LEFT: 224px;POSITION: absolute; TOP: 56px" classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6" VIEWASTEXT>
</body>
</HTML>
Thanks :)
Re: Windows Media Player on web
Attention of above:
This code was generated on dreamweaver and have no codebehind yet.
Do I need code behind file?
Re: Windows Media Player on web
<script language="VBSCRIPT">
Re: Windows Media Player on web
I have changed to VBScript.
Once I run and press a button IE's statusbar shows "Error on page" :(
Do you think what is problem of my code?
Have you ever try to send a parameter from an aspx to ActiveX?
If so, how is a result and which script language you used?
Thanks mendhak
Re: Windows Media Player on web
What's the error? (Double click it)
1 Attachment(s)
Re: Windows Media Player on web
It doesnt shows error description, in the attachment is what i see.
Can you try above code?
I have try to use VS.NET to create aspx.
but in code behind file I cant use wmpobj.properties becuase
VS told me that class wmpobj cannot be found or something like this.
If I cant do that using HTML, Can I use code behind file to do that?
Thanks :)
Re: Windows Media Player on web
1 Attachment(s)
Re: Windows Media Player on web
This a code in that aspx page
VB Code:
<HTML>
<script language="VBScript">
sub Submit_Click()
wmpobj.URL="D:\Songs\mangosteen_low.wmv";
end sub
</script>
<body>
<input name="Submit" type="submit" id="Submit" value="Submit" >
<OBJECT id="wmpobj" style="Z-INDEX: 101; LEFT: 224px;POSITION: absolute; TOP: 56px" classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6" VIEWASTEXT>
</body>
</HTML>
Re: Windows Media Player on web
Quote:
Originally Posted by naruponk
This a code in that aspx page
VB Code:
<HTML>
<script language="VBScript">
sub Submit_Click()
wmpobj.URL="D:\Songs\mangosteen_low.wmv"[color=#CC0000];[/color]
end sub
</script>
<body>
<input name="Submit" type="submit" id="Submit" value="Submit" >
<OBJECT id="wmpobj" style="Z-INDEX: 101; LEFT: 224px;POSITION: absolute; TOP: 56px" classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6" VIEWASTEXT>
</body>
</HTML>
Try removing the semicolon.
Re: Windows Media Player on web
No error :) , but nothing happen (doesnt work) even i changed the command in
Submit_Click() to Msgbox ("Test"). why i cant access an events?
Thanks
Re: Windows Media Player on web
Let's try something else:
Code:
<HTML>
<script language="JavaScript">
function PlayIt()
{
wmpobj.URL="D:\Songs\mangosteen_low.wmv";
wmpobj.controls.play();
}
</script>
<body>
<input name="Submit" type="button" id="Submit" value="Submit" onClick="PlayIt();">
<OBJECT id="wmpobj" style="Z-INDEX: 101; LEFT: 224px;POSITION: absolute; TOP: 56px" classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6" VIEWASTEXT>
</body>
</HTML>
Re: Windows Media Player on web
Thanks man, works fine! :bigyello:
Can i do like this with others ActiveX?
Re: Windows Media Player on web
Re: Windows Media Player on web
Thanks a lot for your help :D