FMX.MediaPlayerHD Sample

From RAD Studio Code Examples
Jump to: navigation, search

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 Sydney | 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.


This application uses TMediaPlayer, TMediaPlayerControl, and TTimer in order to implement the HD media player.

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.

  1. Navigate to one of the locations given above and open:
    • Delphi: MediaPlayerHD.dproj.
    • C++: CppMediaPlayerHD.cbproj.
  2. 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:


The sample:

  • 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.


See Also