Fabian Posted December 17, 2007 Share Posted December 17, 2007 (edited) I'am working on a udf collection for embeding media in an autoitscript. Currently Quicktime, WMP and Flash are supported. If you have any idea for new functions, post them. Thanks to CyberZeroCool for his great Windows Media Player Embed UDF's.-Added Check if Flash is installedExample & Download:HereUDF's: expandcollapse popup;---------------------------------- ;-------QuickTime Functions-------- ;---------------------------------- #cs _qtcreate($show, $left, $top, $width = 100, $height = 100) $show: 1 = creates the control 2 = doesn't create the control Return: The object for the control #ce Func _qtcreate($show, $left, $top, $width = 100, $height = 100) $oQT = ObjCreate("QTOControl.QTControl") If $oQT = 0 Then Return 0 If $show = 1 Then GUICtrlCreateObj($oQT, $left, $top, $width, $height) EndIf Return $oQT EndFunc #cs _qtloadmedia( $object, $URL, $autostart = 1 ) $object: Object returned from the _qtcreate() $URL: Path or URL of the media $autostart: 1 = yes 0 = no Return: None #ce Func _qtloadmedia( $object, $URL, $autostart = 1 ) $object.URL = $URL _qtautostart($object, $autostart) EndFunc #cs _qtautostart($object, $autostart) $object: Object returned from the _qtcreate() $param: 0 = disable autoplay 1 = enable autoplay Return: The object for the control #ce Func _qtautostart($object, $autostart) If $autostart = 0 Then $object.Autoplay = False ElseIf $autostart = 1 Then $object.Autoplay = True EndIf EndFunc #cs _qtgetv($object) $object: Object returned from the _qtcreate() Return: version of quicktime #ce Func _qtgetv($object) $Version = $object.QuickTimeVersion() Return $Version EndFunc ;---------------------------------- ;------Adobe Flash Functions------- ;---------------------------------- #cs _flashcreate($show, $left, $top, $width = 100, $height = 100) $show: 1 = creates the control 2 = doesn't create the control Return: The object for the control #ce Func _flashcreate($show, $left, $top, $width = 100, $height = 100) If FileFindFirstFile(@SystemDir & "\Macromed\Flash\flash*.ocx") = -1 Then $Value = MsgBox(20, "Error", "It seems that you don't have Flash Player installed. Please download" & @CRLF & "it from www.adobe.com. Do you want to go there now?") If $Value = 6 Then ShellExecute("www.adobe.com") EndIf Exit EndIf $oFlash = ObjCreate("ShockwaveFlash.ShockwaveFlash") If $oFlash = 0 Then Return 0 If $show = 1 Then GUICtrlCreateObj($oFlash, $left, $top, $width, $height) EndIf Return $oFlash EndFunc #cs _flashloadmedia($object, $URL) $object: Object returned from the _flashcreate() $URL: Path or URL of the media Return: None #ce Func _flashloadmedia($object, $URL) $object.LoadMovie(0, $URL) EndFunc #cs _flashsetvalue($object, $setting) $object: Object returned from the _flashcreate() $setting: "play" "stop" Return: None #ce Func _flashvalue($object, $setting) Select Case $setting = "play" $object.play() Case $setting = "stop" $object.stop() EndSelect EndFunc ;---------------------------------- ;--Windows Media Player Functions-- ;---------------------------------- #cs _wmpcreate($show, $left, $top, $width = 100, $height = 100) $show: 1 = shows controls 2 = hides controls Return: The object for the control #ce Func _wmpcreate($show, $left, $top, $width = 100, $height = 100) $oWMP = ObjCreate("WMPlayer.OCX") If $oWMP = 0 Then Return 0 $oWMP.settings.autoStart = "False" If $show = 1 Then GUICtrlCreateObj($oWMP, $left, $top, $width, $height) EndIf Return $oWMP EndFunc #cs _wmploadmedia( $object, $URL, $autostart = 1 ) $object: Object returned from the _wmpcreate() $URL: Path or URL of the media $autostart: 1 = yes 0 = no Return: None #ce Func _wmploadmedia( $object, $URL, $autostart = 1 ) $object.URL = $URL While Not $object.controls.isAvailable("play") Sleep(1) WEnd If $autostart = 1 Then $object.controls.play() EndFunc #cs _wmpsetvalue( $object, $setting, $para=1 ) $object: Object returned from the _wmpcreate() $setting: "play" "stop" "pause" "invisible" (Hides all) "control" (Shows controls) "nocontrol" (Hides controls) "fullscreen" "step" (frames to step before freezing) "fastforward" "fastreverse" "volume" (0 To 100) "rate" (-10 To 10) "playcount" Return: None #ce Func _wmpvalue( $object, $setting, $para=1 ) Select Case $setting = "play" If $object.controls.isAvailable("play") Then $object.controls.play() Case $setting = "stop" If $object.controls.isAvailable("stop") Then $object.controls.stop() Case $setting = "pause" If $object.controls.isAvailable("pause") Then $object.controls.pause() Case $setting = "invisible" $object.uiMode = "invisible" Case $setting = "controls" $object.uiMode = "mini" Case $setting = "nocontrols" $object.uiMode = "none" Case $setting = "fullscreen" $object.fullscreen = "true" Case $setting = "step" If $object.controls.isAvailable("step") Then $object.controls.step($para) Case $setting = "fastForward" If $object.controls.isAvailable("fastForward") Then $object.controls.fastForward() Case $setting = "fastReverse" If $object.controls.isAvailable("fastReverse") Then $object.controls.fastReverse() Case $setting = "volume" $object.settings.volume = $para Case $setting = "rate" $object.settings.rate = $para Case $setting = "playcount" $object.settings.playCount = $para Case $setting = "setposition" $object.controls.currentPosition = $para Case $setting = "getposition" Return $object.controls.currentPosition Case $setting = "getpositionstring";Returns HH:MM:SS Return $object.controls.currentPositionString Case $setting = "getduration" Return $object.currentMedia.duration EndSelect EndFunc Edited December 20, 2007 by Fabian embeded-mediaUDF ~~ Embed WMP, Quicktime and Flash in your Au3 appYABC ~~ Yet another Binary Clock Link to comment Share on other sites More sharing options...
TomZ Posted December 18, 2007 Share Posted December 18, 2007 This is great, just what I was looking for Link to comment Share on other sites More sharing options...
MaudKip Posted December 18, 2007 Share Posted December 18, 2007 Wow, nice. =] Link to comment Share on other sites More sharing options...
Bert Posted December 18, 2007 Share Posted December 18, 2007 You may want to have a feature that detects if Flash is installed or not. If it isn't, then give them the option of installing it. The Vollatran project  My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
ConsultingJoe Posted December 18, 2007 Share Posted December 18, 2007 Thanks. Just one note. Some times the WMP embeded object messes up in size and controls. You would just have to play with it to see what I mean. Check out ConsultingJoe.com Link to comment Share on other sites More sharing options...
Bert Posted December 19, 2007 Share Posted December 19, 2007 You may want to have a feature that detects if Flash is installed or not. If it isn't, then give them the option of installing it.found a link that may help:http://www.autoitscript.com/forum/index.php?showtopic=57279 The Vollatran project  My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Fabian Posted December 19, 2007 Author Share Posted December 19, 2007 (edited) ok, i'll tryHere is the new version:expandcollapse popup;---------------------------------- ;-------QuickTime Functions-------- ;---------------------------------- #cs _qtcreate($show, $left, $top, $width = 100, $height = 100) $show: 1 = creates the control 2 = doesn't create the control Return: The object for the control #ce Func _qtcreate($show, $left, $top, $width = 100, $height = 100) $oQT = ObjCreate("QTOControl.QTControl") If $oQT = 0 Then Return 0 If $show = 1 Then GUICtrlCreateObj($oQT, $left, $top, $width, $height) EndIf Return $oQT EndFunc #cs _qtloadmedia( $object, $URL, $autostart = 1 ) $object: Object returned from the _qtcreate() $URL: Path or URL of the media $autostart: 1 = yes 0 = no Return: None #ce Func _qtloadmedia( $object, $URL, $autostart = 1 ) $object.URL = $URL _qtautostart($object, $autostart) EndFunc #cs _qtautostart($object, $autostart) $object: Object returned from the _qtcreate() $param: 0 = disable autoplay 1 = enable autoplay Return: The object for the control #ce Func _qtautostart($object, $autostart) If $autostart = 0 Then $object.Autoplay = False ElseIf $autostart = 1 Then $object.Autoplay = True EndIf EndFunc #cs _qtgetv($object) $object: Object returned from the _qtcreate() Return: version of quicktime #ce Func _qtgetv($object) $Version = $object.QuickTimeVersion() Return $Version EndFunc ;---------------------------------- ;------Adobe Flash Functions------- ;---------------------------------- #cs _flashcreate($show, $left, $top, $width = 100, $height = 100) $show: 1 = creates the control 2 = doesn't create the control Return: The object for the control #ce Func _flashcreate($show, $left, $top, $width = 100, $height = 100) If FileFindFirstFile(@SystemDir & "\Macromed\Flash\flash*.ocx") = -1 Then $Value = MsgBox(20, "Error", "It seems that you don't have Flash Player installed. Please download" & @CRLF & "it from www.adobe.com. Do you want to go there now?") If $Value = 6 Then ShellExecute("www.adobe.com") EndIf Exit EndIf $oFlash = ObjCreate("ShockwaveFlash.ShockwaveFlash") If $oFlash = 0 Then Return 0 If $show = 1 Then GUICtrlCreateObj($oFlash, $left, $top, $width, $height) EndIf Return $oFlash EndFunc #cs _flashloadmedia($object, $URL) $object: Object returned from the _flashcreate() $URL: Path or URL of the media Return: None #ce Func _flashloadmedia($object, $URL) $object.LoadMovie(0, $URL) EndFunc #cs _flashsetvalue($object, $setting) $object: Object returned from the _flashcreate() $setting: "play" "stop" Return: None #ce Func _flashvalue($object, $setting) Select Case $setting = "play" $object.play() Case $setting = "stop" $object.stop() EndSelect EndFunc ;---------------------------------- ;--Windows Media Player Functions-- ;---------------------------------- #cs _wmpcreate($show, $left, $top, $width = 100, $height = 100) $show: 1 = shows controls 2 = hides controls Return: The object for the control #ce Func _wmpcreate($show, $left, $top, $width = 100, $height = 100) $oWMP = ObjCreate("WMPlayer.OCX") If $oWMP = 0 Then Return 0 $oWMP.settings.autoStart = "False" If $show = 1 Then GUICtrlCreateObj($oWMP, $left, $top, $width, $height) EndIf Return $oWMP EndFunc #cs _wmploadmedia( $object, $URL, $autostart = 1 ) $object: Object returned from the _wmpcreate() $URL: Path or URL of the media $autostart: 1 = yes 0 = no Return: None #ce Func _wmploadmedia( $object, $URL, $autostart = 1 ) $object.URL = $URL While Not $object.controls.isAvailable("play") Sleep(1) WEnd If $autostart = 1 Then $object.controls.play() EndFunc #cs _wmpsetvalue( $object, $setting, $para=1 ) $object: Object returned from the _wmpcreate() $setting: "play" "stop" "pause" "invisible" (Hides all) "control" (Shows controls) "nocontrol" (Hides controls) "fullscreen" "step" (frames to step before freezing) "fastforward" "fastreverse" "volume" (0 To 100) "rate" (-10 To 10) "playcount" Return: None #ce Func _wmpvalue( $object, $setting, $para=1 ) Select Case $setting = "play" If $object.controls.isAvailable("play") Then $object.controls.play() Case $setting = "stop" If $object.controls.isAvailable("stop") Then $object.controls.stop() Case $setting = "pause" If $object.controls.isAvailable("pause") Then $object.controls.pause() Case $setting = "invisible" $object.uiMode = "invisible" Case $setting = "controls" $object.uiMode = "mini" Case $setting = "nocontrols" $object.uiMode = "none" Case $setting = "fullscreen" $object.fullscreen = "true" Case $setting = "step" If $object.controls.isAvailable("step") Then $object.controls.step($para) Case $setting = "fastForward" If $object.controls.isAvailable("fastForward") Then $object.controls.fastForward() Case $setting = "fastReverse" If $object.controls.isAvailable("fastReverse") Then $object.controls.fastReverse() Case $setting = "volume" $object.settings.volume = $para Case $setting = "rate" $object.settings.rate = $para Case $setting = "playcount" $object.settings.playCount = $para Case $setting = "setposition" $object.controls.currentPosition = $para Case $setting = "getposition" Return $object.controls.currentPosition Case $setting = "getpositionstring";Returns HH:MM:SS Return $object.controls.currentPositionString Case $setting = "getduration" Return $object.currentMedia.duration EndSelect EndFunc Edited December 20, 2007 by Fabian embeded-mediaUDF ~~ Embed WMP, Quicktime and Flash in your Au3 appYABC ~~ Yet another Binary Clock Link to comment Share on other sites More sharing options...
Delta Posted May 13, 2008 Share Posted May 13, 2008 Couldn't get the WMP function to work. [size="1"]Please stop confusing "how to" with "how do"[/size] Link to comment Share on other sites More sharing options...
kwacky1 Posted December 26, 2008 Share Posted December 26, 2008 Does anyone know if it's possible to get the dimensions of a Quicktime movie, I'm loading .mov's from local content and would like to position them on the screen according to their size. Secondly, after using _qtcreate to create the embedded movie, I am unable to remove it from the screen. Anyone got any ideas? Even if I set another gui control to be on top, the player window remains. At the minimum I want to hide the player window until it's next needed. Link to comment Share on other sites More sharing options...
kwacky1 Posted December 27, 2008 Share Posted December 27, 2008 Solved my qt control issue, the embedded media udf doesn't provide a handle to the actual gui control, so instead of using the udf I created my own function and now I can just use GuiCtrlDelete when I'm done.The only problem I'm left with is this one Link to comment Share on other sites More sharing options...
Kaba Posted October 9, 2011 Share Posted October 9, 2011 Hi sorry for posting in such an old topic, but it seems to be the answer to my researches. I find it awsome that Fabian created an UDF allowing to embed Quicktime to an autoit GUI. But unfortunatly the link to the example file doesn't work anymore. So I'm posting this in order to ask if anyone had downloaded the example file and could upload it again. Cheers Kaba Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now