Windows Media ActiveX Control

  • Thread starter Thread starter Wayne Gibson
  • Start date Start date
W

Wayne Gibson

Hi,

I'm trying to use the Windows Media ActiveX Control on my C# Windows form..
I am opening an playlist and I would like to be able to display the track
names within the listbox..
But can't seem to obtain this information..

Also anybody know how I can apply a skin to the control..

Thanks

Wayne Gibson
 
Skinning the control in C# is not supported.

To display the playlist in a list box, use a loop to iterate the playlist,
retrieve each item individually, retrieve the name of the item, then add the
name to the list.

Hope that helps,


--
Jim Travis
Microsoft Corp.
Windows Media Player SDK

Download:
http://msdn.microsoft.com/library/default.asp?url=/downloads/list/winmedia.asp

Latest online:
http://msdn.microsoft.com/library/en-us/wmplay/mmp_sdk/default.asp?frame=true

Please do not send email directly to this alias as this alias is for
newsgroup purposes only. This posting is provided "AS IS" with no
warranties, and confers no rights. You assume all risk for your use. © 2003
Microsoft Corporation. All rights reserved.
 
Hi Wayne,
Does this answer helpful to your problem?
If you still have questions on this issue, please feel free to post in the
group.
Thanks!

Best regards,

Ying-Shen Yu [MSFT]
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties and confers no rights.
You should not reply this mail directly, "Online" should be removed before
sending, Thanks!

--------------------
| From: "Jim Travis [ms]" <[email protected]>
| References: <[email protected]>
| Subject: Re: Windows Media ActiveX Control
| Date: Tue, 21 Oct 2003 09:51:50 -0700
| Lines: 44
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <[email protected]>
| Newsgroups:
microsoft.public.dotnet.framework.windowsforms,microsoft.public.multimedia.w
indows.mediaplayer,microsoft.public.windowsmedia.sdk
| NNTP-Posting-Host: 12-208-189-124.client.attbi.com 12.208.189.124
| Path:
cpmsftngxa06.phx.gbl!cpmsftngxa09.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.
phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.multimedia.windows.mediaplayer:25329
microsoft.public.windowsmedia.sdk:9496
microsoft.public.dotnet.framework.windowsforms:54942
| X-Tomcat-NG: microsoft.public.dotnet.framework.windowsforms
|
| Skinning the control in C# is not supported.
|
| To display the playlist in a list box, use a loop to iterate the playlist,
| retrieve each item individually, retrieve the name of the item, then add
the
| name to the list.
|
| Hope that helps,
|
|
| --
| Jim Travis
| Microsoft Corp.
| Windows Media Player SDK
|
| Download:
|
http://msdn.microsoft.com/library/default.asp?url=/downloads/list/winmedia.a
sp
|
| Latest online:
|
http://msdn.microsoft.com/library/en-us/wmplay/mmp_sdk/default.asp?frame=tru
e
|
| Please do not send email directly to this alias as this alias is for
| newsgroup purposes only. This posting is provided "AS IS" with no
| warranties, and confers no rights. You assume all risk for your use. ©
2003
| Microsoft Corporation. All rights reserved.
|
| | > Hi,
| >
| > I'm trying to use the Windows Media ActiveX Control on my C# Windows
| form..
| > I am opening an playlist and I would like to be able to display the
track
| > names within the listbox..
| > But can't seem to obtain this information..
| >
| > Also anybody know how I can apply a skin to the control..
| >
| > Thanks
| >
| > Wayne Gibson
| >
| >
|
|
|
 
Have been trying to do this.. But with no luck.. I'm passing a WPL to the
URL...

Anybody got a code sample for this..

Thanks

Wayne
 
hi Wayne,
I've contacted Jim, but he's OOF today.
Now I'm trying to write a small sample, however, it may take some time,
since I'm not
a specialist in Widows Media. I'll update this issue as soon as I complete
it.
Thanks!

Best regards,

Ying-Shen Yu [MSFT]
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties and confers no rights.
You should not reply this mail directly, "Online" should be removed before
sending, Thanks!

--------------------
| From: "Wayne Gibson" <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.windowsforms
| Subject: Re: Windows Media ActiveX Control
| Date: Wed, 22 Oct 2003 15:56:08 +0100
| Lines: 10
| Message-ID: <[email protected]>
| References: <[email protected]>
<[email protected]>
<[email protected]>
| NNTP-Posting-Host: 62.49.252.243
| X-Trace: news.demon.co.uk 1066834584 12345 62.49.252.243 (22 Oct 2003
14:56:24 GMT)
| X-Complaints-To: (e-mail address removed)
| NNTP-Posting-Date: Wed, 22 Oct 2003 14:56:24 +0000 (UTC)
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| X-Priority: 3
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MSMail-Priority: Normal
| Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-onlin
e.de!kibo.news.demon.net!news.demon.co.uk!demon!not-for-mail
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.windowsforms:55004
| X-Tomcat-NG: microsoft.public.dotnet.framework.windowsforms
|
| Have been trying to do this.. But with no luck.. I'm passing a WPL to the
| URL...
|
| Anybody got a code sample for this..
|
| Thanks
|
| Wayne
|
|
|
 
Hi Wayne,
Sorry,
I forgot to ask you the version of Windows Media ActiveX control you are
programming with,
Is it Windows Media Player 9?
Thanks!

Best regards,

Ying-Shen Yu [MSFT]
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties and confers no rights.
You should not reply this mail directly, "Online" should be removed before
sending, Thanks!
 
Hi Wayne,
In your post you asked how to get the name of each track in a playlist and
asked for some sample code.
First of all,I assume you have installed the WM Player SDK9 properly, and
registered the PIA followed the documentation described, because the
following method in my reply as well as code snippet is based on the method
name in PIA ,which has a bit different with the WMPSDK Docuementation.

You may get the track name as well as other attribute of an media item by
getItemInfo method,
this method has a string argument which should pass in a name of the
attribute. For example,

string titleName = axWMP1.currentPlayList.get_Item(0).getItemInfo("Title");

will return the title of the first media item in the current playlist. You
can find more attribute name list in WMP SDK9,

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmplay/mmp_
sdk/availableattributes.asp

Here is a code snippet which retrieve all attribute of every media item in
the current playlist.
<code>
///using Microsoft.MediaPlayer.Interop;
private void button1_Click(object sender, System.EventArgs e)
{
IWMPMedia media =
axWindowsMediaPlayer1.newMedia("C:\\WMSDK\\WMPSDK9\\samples\\media\\laure.wm
a");
axWindowsMediaPlayer1.currentPlaylist.appendItem(media);
media =
axWindowsMediaPlayer1.newMedia(@"C:\WMSDK\WMPSDK9\samples\media\house.wma");
axWindowsMediaPlayer1.currentPlaylist.appendItem(media);
media = axWindowsMediaPlayer1.newMedia
(@"C:\Documents and Settings\All Users\Documents\My Music\Sample
Music\Beethoven's Symphony No. 9 (Scherzo).wma");
axWindowsMediaPlayer1.currentPlaylist.appendItem(media);
}

private void button2_Click(object sender, System.EventArgs e)
{
IWMPPlaylist pl = axWindowsMediaPlayer1.currentPlaylist;
for(int i = 0; i < pl.count; ++i)
{
for (int j = 0; j < pl.get_Item(i).attributeCount; ++j)
{
IWMPMedia it = pl.get_Item(i);
string attrName = it.getAttributeName(j);
listBox1.Items.Add(attrName + " : " + it.getItemInfo(attrName));
}
}
}
<code>
Does this answer your question?
Please be free to post on our group, if you still have questions on it.
Thanks!




Best regards,

Ying-Shen Yu [MSFT]
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties and confers no rights.
You should not reply this mail directly, "Online" should be removed before
sending, Thanks!

--------------------
 
Back
Top