首页 > 设计 > 媒体动画 > 正文

Authorware综合技巧:运用MCI语句控制MPEG文件地播放

2020-09-19 18:39:20
字体:
来源:转载
供稿:网友

在装入a4wmme.u32时,选择 mcisendstring 和 mcigetreturnstring 函数。

(1) 打开设备命令:

cmdstring := "open "^moviefile^ " alias movie"
mcisendstring(cmdstring)
cmdstring := "window movie handle "^windowhandle
mcisendstring(cmdstring)
cmdstring := "window movie state no action"
mcisendstring(cmdstring)
cmdstring :="seek movie to end"
mcisendstring(cmdstring)
cmdstring :="status movie position"
mcisendstring(cmdstring)
end := mcigetreturnstring()
cmdstring :="seek movie to start"
mcisendstring(cmdstring)
cmdstring :="status movie position"
mcisendstring(cmdstring)
start := mcigetreturnstring()

(2) 播放设备命令:
cmdstring := "put movie destination at 170 120 320 240"
mcisendstring(cmdstring)
cmdstring := "play movie"
mcisendstring(cmdstring)

(3)停止并关闭设备命令:

cmdstring :="pause movie"
mcisendstring(cmdstring)
cmdstring := "put movie destination at 0 0 0 0"
mcisendstring(cmdstring)
cmdstring := "stop movie"
mcisendstring(cmdstring)
cmdstring := "close movie"
mcisendstring(cmdstring)

  以上mci 命令可以完成基本的播放任务,可以在需要的程序位置上加入。moviefile变量中放置所要播放的mpeg文件名即可。有关其它mci 命令的具体使用,需要参阅mci 命令手册。 

 

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表