This sample illustrates how to load and play a media file, using FireMonkey.
You can find the MediaPlayerHD sample project at:
- Start | Programs | Embarcadero RAD Studio Alexandria | Samples and navigate to:
Object Pascal\Multi-Device Samples\Device Sensors and Services\App Tethering\MediaPlayer\MediaPlayerHD
CPP\Multi-Device Samples\Device Sensors and Services\App Tethering\MediaPlayer\MediaPlayerHD
- Subversion Repository:
- You can find Delphi and C++ code samples in GitHub Repositories. Search by name into the samples repositories according to your RAD Studio version.
How to Use the Sample
Load the wanted media file using the load button from the upper-left corner of the form. The file will start playing immediately. If the loaded file is a video file, the image is displayed on the center of the form.
- Navigate to one of the locations given above and open:
- Delphi: MediaPlayerHD.dproj.
- C++: CppMediaPlayerHD.cbproj.
- Press F9 or choose Run > Run.
MediaPlayerForm.pas represents the main window unit of the sample. It contains the TForm240 class, that defines the main form and contains:
- A TMediaPlayer object.
- A TMediaPlayerControl object.
- A TTimer object.
- Three TSpeedButton objects.
- A TCheckBox object.
- A TLabel object.
- A TOpenDialog object.
- Two TTrackBar objects.
- A TRectangle object.
- Loads the media file, displays information about the loaded file in the upper-right corner, and enables the controls to manipulate the loaded file (pause, forward/rewind, volume, visibility).
- Implements the actions to be attached to each control that allows to manipulate the loaded file.