ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 VideoPlayer with progressbar

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
woolfik Posted - Feb 16 2015 : 15:13:28
Hello,

I try to make videoplayer with ImageEnView component based on this example:
ImageEn -> Demos -> Display -> VideoPlayer -> VideoPlayer.dpr

My problem is that I can play/pause/stop video everything works fine but I like to have progressbar that show me how long is media file, how many percent is already played and when I click in any place of progressbar media file will be move forward or back to point that was clicked. Can some one tell me how can I do that?

I like to know how to get information about file (how long is it, how many percent was already played, wich event should I use to change position (calculated on percent) of scrollbar)?
2   L A T E S T    R E P L I E S    (Newest First)
woolfik Posted - Feb 18 2015 : 15:25:33
Thats what I'm looking for. I'm very greatefull. Thx.
w2m Posted - Feb 16 2015 : 18:01:14
This will show the progress in the progress bar:
procedure Tfmain.Open1Click(Sender: TObject);
begin
  with ImageEnView1.IO.DShowParams do
  begin
    if State = gsRunning then
    begin
      Stop;
      Disconnect;
    end;
    if OpenDialog1.Execute then
    begin
      FileInput := OpenDialog1.FileName;
      EnableSampleGrabber := true;
      RenderAudio := true;
      Connect;
      Position := 0;
      Pause; // This shows first frame
      ImageEnView1.IO.DShowParams.TimeFormat := tfFrame;
      ProgressBar1.Max := ImageEnView1.IO.DShowParams.Duration;
      ProgressBar1.Position := 0;
      Percent1.Caption := IntToStr(0) + '%';
    end;
  end;
end;
procedure Tfmain.ImageEnView1DShowNewFrame(Sender: TObject);
var
  iMax: Int64;
  iFrame: Int64;
  iPosition: Int64;
  iPercent: integer;
begin
  with ImageEnView1 do
  begin
    IO.DShowParams.GetSample(IEBitmap);
    iMax := ImageEnView1.IO.DShowParams.Duration;
    iFrame := IO.DShowParams.Position;
    ProgressBar1.Position := iFrame;
    ProgressBar1.Position := iFrame-1;
    ProgressBar1.Position := iFrame;
    ProgressBar1.Update;
    Percent1.Caption := FormatFloat('###', (iFrame / iMax) * 100)  + '%';
    Percent1.Update;
    Update;
  end;
end;

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development