Lazarus中文社区

 找回密码
 立即注册(注册审核可向QQ群索取)

QQ登录

只需一步,快速开始

Lazarus IDE and 组件 下载地址版权申明
查看: 2727|回复: 1

Lazarus在Linux下调用mplayer播放器的例子

[复制链接]

该用户从未签到

发表于 2013-4-2 14:28:13 | 显示全部楼层 |阅读模式
  1. uses
  2.   Classes, ..., FileUtil, LCLProc, UTF8Process;

  3. ...

  4. implementation

  5. procedure TMainForm.Button1Click(Sender: TObject);
  6. var
  7.   Player: TProcessUTF8;
  8.   Filename: String;
  9.   PlayerPath: String;
  10.   PlayerParams: String;
  11. begin
  12.   Filename:='/home/username/video.mpg';
  13.   PlayerPath:=FindDefaultExecutablePath('mplayer');
  14.   PlayerParams:='"'+Filename+'"';
  15.   Player:=TProcessUTF8.Create(nil);
  16.   try
  17.     Player.CommandLine:=PlayerPath+' '+PlayerParams;
  18.     Player.Execute;
  19.   finally
  20.     Player.Free;
  21.   end;
  22. end;
复制代码

回复

使用道具 举报

该用户从未签到

发表于 2014-2-4 21:45:38 | 显示全部楼层
windows下是很么效果呢?
回复 支持 反对

使用道具 举报

*滑块验证:

本版积分规则

QQ|手机版|小黑屋|Lazarus中国|Lazarus中文社区 ( 鄂ICP备16006501号-1 )

GMT+8, 2025-5-2 21:17 , Processed in 0.030322 second(s), 12 queries , Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表