至今比较满意的delphi多媒体组件PasLibVlc3.0最新,可以播放各种视频格式

1、PasLibVlc是vlc for delphi的组件

2、可以播放已知的各种视频格式:avi,mp4,wmv,kmv,rm等等。

3、使用方法也非常容易:

  播放:

var
  p_mi: libvlc_media_player_t_ptr;
begin
  PasLibVlcPlayer1.Play(Self.CheckListBox1.items[
    Self.CheckListBox1.itemindex]);
  ProgBar.OnChange := nil;

  Sleep(2000);

  p_mi := PasLibVlcPlayer1.GetPlayerHandle();

  libvlc_video_set_marquee_string(p_mi, libvlc_marquee_Text, 'ABC');
  libvlc_video_set_marquee_int(p_mi, libvlc_marquee_Color, libvlc_video_marquee_color_White);
  libvlc_video_set_marquee_int(p_mi, libvlc_marquee_Opacity, libvlc_video_marquee_opacity_full);
libvlc_video_marquee_position_Center);
  libvlc_video_set_marquee_int(p_mi, libvlc_marquee_X, 10);
  libvlc_video_set_marquee_int(p_mi, libvlc_marquee_Y, 10);
after xx ms, 0 - show always
  libvlc_video_set_marquee_int(p_mi, libvlc_marquee_Enable, 1);

  libvlc_video_set_logo_string(p_mi, libvlc_logo_File, PAnsiChar(UTF8Encode(ExtractFilePath(Application.ExeName) + 'logo.png')));
  libvlc_video_set_logo_int(p_mi, libvlc_logo_Delay, 10);
  libvlc_video_set_logo_int(p_mi, libvlc_logo_Repeat, 10);
  libvlc_video_set_logo_int(p_mi, libvlc_logo_Position, libvlc_video_logo_position_Center);
  libvlc_video_set_logo_int(p_mi, libvlc_logo_Opacity, 255);
  libvlc_video_set_logo_int(p_mi, libvlc_logo_Enable, 1);

end;

  暂停:

  PasLibVlcPlayer1.Pause();
  ProgBar.OnChange := ProgBarChange;

  继续:

  PasLibVlcPlayer1.Resume();
  ProgBar.OnChange := nil;

  截图:

  PasLibVlcPlayer1.SnapShot(ChangeFileExt(Application.ExeName, '.png'));

  到指定的时间处播放:

 PasLibVlcPlayer1.SetVideoPosInMs(1000*60*5);//到视频的5分钟处

  显示当前播放时间:

ProgLabel1.Caption := PasLibVlcPlayer1.GetVideoPosStr('hh:mm:ss.ms');

ProgBar.Position := PasLibVlcPlayer1.GetVideoPosInMs();

  总时间:

  ProgLabel2.Caption := PasLibVlcPlayer1.GetVideoLenStr();
  ProgBar.Max := PasLibVlcPlayer1.GetVideoLenInMs();

  引用:

uses PasLibVlcUnit, PasLibVlcClassUnit, PasLibVlcPlayerUnit;

  

  最新PasLibVlc 3.0组件下载地址(支持 • Delphi 10.2.2 Tokyo • Lazarus 1.8.0 (FPC 3.0.4).)