Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: How to play a MP4 video files within a defined area rectangle ?


This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 1 - Last Post: Sep 9, 2017 1:45 PM Last Post By: GAI CHEW KAI
GAI CHEW KAI

Posts: 53
Registered: 7/29/04
How to play a MP4 video files within a defined area rectangle ?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 8, 2017 9:48 PM
Embarcadero® C++Builder 10.2 Version 25.0.26309.314
Android 7.0.1
Microsoft Windows 10 x64 Pro [Version 10.0.14393]

I wondered how to use TMediaPlayer to play a MP4 video file in a defined rectangle for an Android application ?

Any help or link is much appreciated.

Please advise.

GAI CHEW KAI

Posts: 53
Registered: 7/29/04
Re: How to play a MP4 video files within a defined area rectangle ?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 9, 2017 1:40 PM   in response to: GAI CHEW KAI in response to: GAI CHEW KAI
....found the answer, where components used:

TMediaPlayer* mp;
TMediaPlayerControl* mpc;
TRectangle* rect;

1. set mpc->MediaPlayer property to mp

2. set mpc->parent to rect->parent: mpc->Parent = rect->Parent;

3. NOTE: The width of rect is not suitable when positioning the video horizontally at center, use TScreen::DesktopWidth instead.

4. mp->Width or mp->Size->Width or mp->Height or mp->Size->Height is the same, it basically defines the video box size to show. Therefore, I set it the same as the width and height of "rect".

5. You can start use the standard mp methods to run a video such as the mp->Volume, mp->FileName, mp->CurrentTime, mp->Play()

6. DONE

Hopes, this help.
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02