How to play a windows media file wmv in NETCF1.1 using vb.net

G

Guest

Hi,

I would like to know is there a way to play windows media file (wmv) or mp3
file in a vb.net application to be run in pocketpc.

Thanks a lot
 
P

Paul G. Tobey [eMVP]

There's no way to play it 'in' your application. You can't embed an ActiveX
control for the media player in .NET CF 1.0, so you can't do it. You can
start the Media Player application, though. Look at OpenNETCF SDF to get
the necessary classes to run other processes (Process.cs). I think that the
command line that you'll need to use has been covered in this newsgroup
before. You can search the archives here:

http://groups.google.com/group/micr...tframework?hl=en&lr=lang_en&ie=UTF-8&oe=UTF-8

Here's a thread that I think may help:

http://groups.google.com/group/micr...play+media+file&rnum=3&hl=en#5cc71811fc18bbaa

Paul T.
 
S

Sergey Bogdanov

Yes and fairly easy:

1. Create new Device Application
2. Project->Add Reference->Browse->
Select $WINDIR$\System32\wmp.dll
3. Write the this code snippet in the load event of your form:

WMPLib.WindowsMediaPlayerClass wmp = new WMPLib.WindowsMediaPlayerClass();
wmp.currentMedia = wmp.newMedia(@"\path_to_soundfile.wma");
wmp.controls.play();

4. Close wmp object at the end.

That's it.
 

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