RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TMediaPlayer Class

TMediaPlayer controls devices that provide a Media Control Interface (MCI) driver.

Pascal
TMediaPlayer = class(TCustomControl);
C++
class TMediaPlayer : public TCustomControl;

MPlayer

The TMediaPlayer component includes a set of buttons (Play, Stop, Eject, and so on) that control a multimedia device such as a CD-ROM drive, MIDI sequencer, or VCR. A multimedia device may be hardware or software. 

The media player component contains of multiple buttons. These buttons can be clicked with the mouse, but are not separate objects or button components. 

ButtonValueAction

Button 
Value 
Action 
Play  
btPlay  
Plays the media player  
Pause  
btPause  
Pauses playing or recording. If already paused when clicked, resumes playing or recording.  
Stop  
btStop  
Stops playing or recording  
Next  
btNext  
Skips to the next track, or to the end if the medium doesn't use tracks  
Prev  
btPrev  
Skips to the previous track, or to the beginning if the medium doesn't use tracks  
Step  
btStep  
Moves forward a number of frames  
Back  
btBack  
Moves backward a number of frames  
Record  
btRecord  
Starts recording  
Eject  
btEject  
Ejects the medium  

The multimedia device is played, paused, stopped, and so on when the user clicks the corresponding button on the TMediaPlayer component. The device can also be controlled by the control methods that correspond to the buttons (Play, Pause, Stop, Next, Previous, Step, Back, StartRecording, and Eject). 

The type of multimedia device (such as dtWaveAudio or dtVideodisc) is specified by the DeviceType property. If the device stores its media in a file, the name of the media file is specified by the FileName property. If DeviceType is dtAutoSelect, the media player attempts to determine the type of device from the extension of the file specified by FileName

To have the media player attempt to open the device specified by DeviceType automatically when the media player component is created at runtime, set the AutoOpen property to true. 

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!