Embedding WM Player

A

Anil Gupte

How do I embed Windows Media Player so I can control it with VB code. I am
familiar with embedding in a web page like this:
***************
<embed src="Test.asx" width=320 height=300 autostart=True
type="application/x-mplayer2"
pluginspage="http://www.microsoft.com/Windows/MediaPlayer/"
name="MediaPlayer1" showcontrols=1 showstatusbar=1> </embed>
****************

I have also created a WM Player control in a VB Windows Application. But
now, I want to create the same app in a web page. I want to create my own
Play, FF, Rewind etc buttons with associated functions that handle these
events in a custom manner. I am using VB.Net 2003

Thanx,
 
M

Michel Posseth [MCP]

Hello Anil

Just set a media player control in the toolbox and drag it on your form

regards

michel
 
A

Anil Gupte

I tried that but it does not work. The object I dragged into the WebForm
appears to have no name or ID that I can use to address it. One of the
params in the embedded object is "ID" and another is "Name". I tried
supplying values to those paramaters, but it does not work.

So, the HTML looks like this:

<OBJECT id="PlayerID" style="Z-INDEX: 102; LEFT: 432px; POSITION: absolute;
TOP: 48px" classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6"
name="PlayerName" VIEWASTEXT>
<PARAM NAME="URL" VALUE="">
etc...
</OBJECT>

Note that I added id= and name= . Then I added a button:
Private Sub btnPlay_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnPlay.Click
PlayerID.enabled = True
PlayerID.URL = "bud5.wmv"
PlayerID.controls.play()
End Sub

It will not work.

Thanx,
 
L

Lloyd Sheen

Anil Gupte said:
I tried that but it does not work. The object I dragged into the WebForm
appears to have no name or ID that I can use to address it. One of the
params in the embedded object is "ID" and another is "Name". I tried
supplying values to those paramaters, but it does not work.

So, the HTML looks like this:

<OBJECT id="PlayerID" style="Z-INDEX: 102; LEFT: 432px; POSITION:
absolute; TOP: 48px" classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6"
name="PlayerName" VIEWASTEXT>
<PARAM NAME="URL" VALUE="">
etc...
</OBJECT>

Note that I added id= and name= . Then I added a button:
Private Sub btnPlay_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnPlay.Click
PlayerID.enabled = True
PlayerID.URL = "bud5.wmv"
PlayerID.controls.play()
End Sub

It will not work.

Thanx,

To use the embedded control you will have to use javascript to play. If you
set the control to autoplay then you set the url and when the page loads it
will play. The play code on the server will do nothing so your button click
will have to be handled on the client side.

Hope this helps
Lloyd Sheen
 
A

Anil Gupte

Yeah, I got this same feedback elsewhere. I thought embedded objects were
to be addressed only server side. After all the point of having an embedded
object was so the object did not need to be installed on the client side.
 
L

Lloyd Sheen

Anil Gupte said:
Yeah, I got this same feedback elsewhere. I thought embedded objects were
to be addressed only server side. After all the point of having an
embedded object was so the object did not need to be installed on the
client side.

Unless the control exists on the client nothing will happen. There is no
way for a server to cause music to play on a client. The client will
request a song from a server and then play it using the WM player that
exists on the client. All control of the playing is done thru the client
although the server may update attributes on the client page.


If you PM me (private message) at sqlguy at hotmail dot com I will give you
link to my site and see if that is close to what you want. If so I can
share code.

Lloyd Sheen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top