CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: media player

  1. #1
    Join Date
    Nov 2000
    Location
    IL, U.S.A.
    Posts
    218

    media player

    What control would I use to be able to play a windows media player video
    on my form .avi, .mpeg, .rm files? Would there be any code for this? Can
    someone give me a code snippet? Is there something to set in the propertiees?


  2. #2
    Join Date
    Nov 2000
    Location
    Ohio
    Posts
    238

    Re: media player

    Here is some code using the MCI Multimedia control

    Private Sub Form_Load ()
    ' Set properties needed by MCI to open.
    MMControl1.Notify = FALSE
    MMControl1.Wait = TRUE
    MMControl1.Shareable = FALSE
    MMControl1.DeviceType = "WaveAudio"
    MMControl1.FileName = "C:\WINDOWS\MMDATA\GONG.WAV"

    ' Open the MCI WaveAudio device.
    MMControl1.Command = "Open"
    End Sub

    This code plays a wave file. However by changing the DeviceType string you can change what type of media you want to play.

    Here is a description from the MSDN

    DeviceType Property (Multimedia MCI Control)

    Specifies the type of MCI device to open.

    Syntax

    [form.]MMControl.DeviceType[ = device$]

    Remarks

    The argument device$ is the type of MCI device to open: AVIVideo, CDAudio, DAT, DigitalVideo, MMMovie, Other, Overlay, Scanner, Sequencer, VCR, Videodisc, or WaveAudio.

    The value of this property must be set when opening simple devices (such as an audio CD that does not use files). It must also be set when opening compound MCI devices when the file-name extension does not specify the device to use.

    Data Type

    String

    Good Luck
    Joe



  3. #3
    Join Date
    Nov 2000
    Location
    IL, U.S.A.
    Posts
    218

    Re: media player

    Hey Joe Thanks for the answer. Is there any way to change the size of the window the movie is playing in? I woul like to make it bigger.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured