Solved

Trackbar and mediaplayer

Posted on 1997-11-11
5
354 Views
Last Modified: 2010-05-18
hi,

how do I get the trackbar to display the playing time when opening a mediafile, and when starting to play, to update the trackbar to the playing position.
0
Comment
Question by:hellfire052497
  • 3
  • 2
5 Comments
 
LVL 3

Accepted Solution

by:
Pegasus100397 earned 150 total points
ID: 1349939
Hellfire, try this:

Trackbar1.Position := MediaPlayer1.Position

Good luck with your project!
Pegasus

P.S. You may also have to set the start and end positions (min/max) of the trackbar to correspond with how many "frames", etc are in the media file.
0
 
LVL 3

Expert Comment

by:Pegasus100397
ID: 1349940
side note: MediaPlayer1.Position is a a time value. Depending on what time values you want (minutes, seconds, etc) you will have to do some time juggling to get the trackbar to sync with the mediaplayer. Also, use a TTimer (about 1 sec) apart to set the trackbar position.

If you just need to indicate what track it's on, use MediaPlayer1.Trackposition.
0
 

Author Comment

by:hellfire052497
ID: 1349941
I have decided to use a progressbar, Now this is used different then Trackbar so could you please explain how to use this, when searching in help it says to look at StepIt, but when I click on the example button I get an error saying not found, so help!!
and also, when mediaplayer is open how do I close it? I tried
If MediaPlayer1 := open then Mediaplayer1.close; but it didn't work. it is the first time I use MediaPlayer and a progressbar.
thanks.
0
 
LVL 3

Expert Comment

by:Pegasus100397
ID: 1349942
Hellfire, what type of media are you playing with the media player? .WAV files? CDs? Curious because the routines are a little different for each.

The StepIt method is used as follows:
ProgressBar1.StepIt;

It's just a convienient way to increment the progress bar. Each call to StepIt will increment the progress bar the amount of the Step property.

to Stop the Mediaplayer issue Mediaplayer1.Stop

to actually make it "go away" (hide it, but leave it available) issue Mediaplayer1.Visible := False;

regards,
Pegasus
0
 

Author Comment

by:hellfire052497
ID: 1349943
with the Mediaplayer1.stop I know how to call it, but how do I check if MediaPlayer1.open is true and if so then to close it.
and also vice versa.

The idea was to make a general mediaplayer, so that it would play all supported files. (I use the autoselect for mediatype)

And how to use that progressbar?
if I open a file, I should set the min tracktime as 0 and the max tracktime as 100 for the progressbar, and when starting to play to increment the progressbar, probably with a timer.
But I have no idea how to make this, could you give a small example??
Thanks


0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Mobile Keyboard covers the display of the TMemo 3 86
select query - oracle 16 100
Twebbrowser add css to the header 3 25
Delphi problems to abort a printjob 9 19
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question