I have two buttons Play & Full Screen. If u click on Play Button,Movie starts..Movie Starts within 15-20 Seconds.....When u clik on Full Screen Button.,Media Player is Maximised. I want the if the media player is maximised,& when we click on ESC Button, Media player is minimsed.......But I m nota ble to achiev that.. Secondly I do not know that which event is used for dat KeyPress Or keyDown.. I have used both of these,But None is working/..

Mine Code is as Under.Plz go thru it..& help me it sorting out---

Public Class Form1

Private Sub btnPLAY_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPLAY.Click
AxWindowsMediaPlayer1.URL = "http://www.voanews.com/wm/voa/europe/alba/alba1700vb.asx"
End Sub

Private Sub btnFULLSCREEN_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFULLSCREEN.Click
AxWindowsMediaPlayer1.fullScreen = True
End Sub


Private Sub AxWindowsMediaPlayer1_KeyDownEvent(ByVal sender As Object, ByVal e As AxWMPLib._WMPOCXEvents_KeyDownEvent) Handles AxWindowsMediaPlayer1.KeyDownEvent
If e.nKeyCode = Keys.Escape Then
If AxWindowsMediaPlayer1.fullScreen Then
AxWindowsMediaPlayer1.fullScreen = False
End If
End If
End Sub

Private Sub AxWindowsMediaPlayer1_KeyPressEvent(ByVal sender As Object, ByVal e As AxWMPLib._WMPOCXEvents_KeyPressEvent) Handles AxWindowsMediaPlayer1.KeyPressEvent
If e.nKeyAscii = 27 Then
If AxWindowsMediaPlayer1.fullScreen Then
AxWindowsMediaPlayer1.fullScreen = False
End If
End If
End Sub

End Class

Recommended Answers

All 14 Replies

instead of using wmp.dll try using msdxm.ocx.
you can include it from com components tab.
just right click-->toolbox-->select choose new item...and browse msdxm.ocx from system32 folder and click ok to add it.

make sure you have registered the component using regsvr32 utility.

regards
shouvik

What does it mean make sure you have registered the component using regsvr32 utility.

usually vb.net does not support any com components like the .ocx files we all use in vb6 apps. so whenever u need to use these files after adding the same from "choose toolbox items" dialog box, always the register it using the windows registry server utility. u can use the following command :-

regsvr32 <com component name/.ocx file name>
e.g. regsvr32 msdxm.ocx
(pass this command to register the above mentioned component)

u can pass this command from start->run

P.S. the .ocx files that ur machine has all installed in system32 directory of ur OS.

regards
shouvik

btw what about u Sonia??? r u too busy now so u r not making enough time to post replies.

why some one else is posting here on behalf of u!!!

I go to start & type the Coomand,Msg is threre DllRegisterServer in msdxm.ocx failed...What was it?????????????/

it can have possible three reasons :-

1. the msdxm.ocx module is not present in ur OS system directory.

2. your vs2005 software is opened and u hv a form where u have inserted an instance of the msdxm.ocx component.

3. if u r using windows vista then the above command regsvr32 won't work. it will only work less than vista versions.


check whether either of these is happening.

regards
shouvik

kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk

Fisrtly the project is opened...Where i have insretd an object....Secondly,,Windows is not vista..Thirly,msdxm.ocx is present in mine system32 folder...Then where is d probs..y it is not registerd.

i have type the Command-
regsvr32 msdxm.ocx

i don't know what exactly u r doing. but everything is working fine on my node. just change the syntax from baseurl like :-

mediaplayer1.filename="http://www.voanews.com/wm/voa/europe/alba/alba1700vb.asx"
mediaplayer1.play

and make a settings in properties window :-

showstatusbar=true

then run the code and hit the play button and u'll notice some actions in the status bar of the player. it will first contact with the server,then search for the codecs and install them into ur computer. after this buffering will start and here you go....BINGO!!!!

lets just do this and rply me.

regards
shouvik

I just Want to play the movie,,,On Play Button click..which is not owrking but acc. to U its workg on ur PC..

could you post what the error is???

i think the autoplay feature of the player is ON in your control. just right click and goto properties and turned it off. then run the code.

Error HRESULT E_FAIL has been returned from a call to a COM component.

There is no autoplay Feature,there is autostart property .....

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.