Solved

Trackbar and mediaplayer

Posted on 1997-11-11
5
355 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
HTML text in the body of an email (delphi code) 12 170
Convert GUI app into console app for Win32 Env 5 109
Multi-layered image in FireMonkey 9 49
MS Access from Delphi 31 60
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…

828 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