MediaPlayer Control

noccy

Registered User.
Local time
Today, 18:56
Joined
Aug 19, 2003
Messages
67
Hello!

I have put a standard Windows MediaPlayer (version 9) on a form.

On the same form I have a button that I want to use to make the player play the current file

The command should be:

Me.MediaPlayer1.Controls.Play

Problem is that all I get is an error, saying that The method wasn't found =(

Do I need to make a module for the controls or something, or should I be able to have just this one line of code on my form?

Im attaching an example db to show my problem

I hope someone can answer this one........tnx


noccy
 

Attachments

sorry can't download the file, im a97 user u see. anyway have you got the reference ticked in in the library. If not you should have. Go to Vb window, hit Tools-References and find your media player control. the code should then use that reference to interpret the vb
 
ok - here it is in 97 format =)


appreciate any help plz
 

Attachments

if you are only playing wav files, there are 2 parts to playing a .WAV file in Access or VB
1. Need to declare the sndPlaySound function in the winmm.dll file.
2. Call the sndPlaySound function as shown below.

' ----------------------- Put this in a Module -------------
Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long

' for playing sounds (each one is listed below in detail)
Global Const KEY_RETURN = &HD
Global Const SND_SYNC = &H0
Global Const SND_ASYNC = &H1
Global Const SND_NODEFAULT = &H2
Global Const SND_LOOP = &H8
Global Const SND_NOSTOP = &H10
'-----------------------------------------------------------

'----------------- Put this in a sub to play a wav file ----
x% = sndPlaySound("c:\wavs\beep.wav", SND_SYNC)
'-----------------------------------------------------------

' Specifies options for playing the sound using one or more of the following flags:
' SND_SYNC
' The sound is played synchronously and the function does
' not return until the sound ends.

' SND_ASYNC
' The sound is played asynchronously and the function
' returns immediately after beginning the sound.

' SND_NODEFAULT
' If the sound cannot be found, the function returns
' silently without playing the default sound.

' SND_LOOP
' The sound will continue to play repeatedly until

' sndPlaySound is called again with the lpszSoundName$
' parameter set to null. You must also specify the
' SND_ASYNC flag to loop sounds.

' SND_NOSTOP
' If a sound is currently playing, the function will
' immediately return False without playing the requested
' sound.
 
Well I need some more controls....I need to be able to pause while playing.

I also need to use the currentPosition function that allows me to start playing the file from a given number of milliseconds into the file......


suggestions?
 
I seemed to have sussed Media Player out, take a look at the form I created here...
 

Attachments

hmmm It wont work here, need to make a new reference to the automatation library..

Anyway i got a look at the code, and I still need to ble able to define the current position of a file.

I have made all this work with a realplayer control, but realplayer is full of spyware.....

The mediaplayer control seems simple enough to use, and when i tried it in vb it worked fine...

In vba it won't work.

As I write the code, and have come as far as:

MediaPlayer1.Controls. it should then show me what valid values I can use. All it shows med then is Count and Item which is from the Access.Controls lib.



noccy
 

Users who are viewing this thread

Back
Top Bottom