AVI如何循环播放?[已解决]
本帖最后由 那片叶子 于 2014-7-23 22:49 编辑以下播放AVI,如何循环播放啊!
#include <GUIConstants.au3>
$x=ObjCreate("WMPlayer.OCX")
$Form1 = GUICreate("AForm1", 500,400, 193, 200)
$Button1 = GUICtrlCreateButton("开始", 104, 344, 97, 33, 0)
$Button2 = GUICtrlCreateButton("停止", 272, 336, 121, 41, 0)
$sky=GUICtrlCreateObj($x, 100,50,500,500)
GUISetState(@SW_SHOW)
$x.uimode="none"
$x.url="1.avi"
$x.Controls.play
;MsgBox(0,"",$sky)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd 回复 1# 那片叶子 Global $oWMP = ObjCreate("WMPlayer.OCX")
Global $sCurrent_File = "1.avi"
;..........
AdlibRegister('_Looping_Play', 500)
;..................
Func _Looping_Play()
#cs
playState
3:正在播放
2:暂停
1:已停止
#ce
If$oWMP.playState = 1 Then
$oWMP.url = $sCurrent_File
$oWMP.Controls.play
EndIf
EndFunc 回复 2# user3000
能帮我 整合到上面的代码吗?谢谢 #include <GUIConstants.au3>
#include <GUIConstantsEx.au3>
#include <wmp.au3>
#include <GuiAVI.au3>
$video = "1.avi"
$x = ObjCreate("WMPlayer.OCX")
$Form1 = GUICreate("AForm1", 500, 400, 193, 200)
$Button1 = GUICtrlCreateButton("开始", 104, 344, 97, 33, 0)
$Button2 = GUICtrlCreateButton("停止", 272, 336, 121, 41, 0)
$sky = GUICtrlCreateObj($x, 100, 50, 500, 500)
GUISetState(@SW_SHOW)
$x.uimode = "none"
$x.url = $video
$x.Controls.play
;MsgBox(0,"",$sky)
While 1
$nMsg = GUIGetMsg()
If $x.playState = 1 Then
$x.Controls.play
EndIf
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
$x.url = $video
$x.Controls.play
Case $Button2
_wmploadmedia($x, "stop")
EndSwitch
WEnd
回复 3# 那片叶子 回复 4# austere
非常完美!非常感谢啊!~~~~
页:
[1]