Jump to content

Recommended Posts

Posted

I want to make a UDF from the wmp object but for some reason it wont play videos, videos work in the regular app but not in the gui, sound works though???

here is the api site:

http://msdn.microsoft.com/library/default....olreference.asp

Here is my script (replace "VIDEO FILE" with a video):

#include <GUIConstants.au3>
; == GUI generated with Koda ==
$Form1 = GUICreate("AForm1", 622, 448, 192, 125)
$play = GUICtrlCreateButton( "PLAY", 0, 300 )
$stop = GUICtrlCreateButton( "STOP", 100, 300 )
$pause = GUICtrlCreateButton( "Pause", 200, 300 )
$oWMP = ObjCreate("WMPlayer.OCX.7")
GUICtrlCreateObj($oWMP, 0, 0, 300, 300)
$oWMP.URL = "VIDEO FILE"
$oWMP.controls.play()
$oWMP.stretchToFit = True
GUISetState(@SW_SHOW)
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case $msg = $pause
        $oWMP.controls.pause()
    Case $msg = $play
        $oWMP.controls.play()
    Case $msg = $stop
        $oWMP.controls.stop()
    Case Else
        ;;;;;;;
    EndSelect
WEnd
Exit
Check out ConsultingJoe.com
Posted

this will work :D

Recards jpam

#include <GUIConstants.au3>

; == GUI generated with Koda ==

$Form1 = GUICreate("AForm1", 622, 448, 192, 125)

$play = GUICtrlCreateButton( "PLAY", 0, 300 )

$stop = GUICtrlCreateButton( "STOP", 100, 300 )

$pause = GUICtrlCreateButton( "Pause", 200, 300 )

$oWMP = ObjCreate("WMPlayer.OCX")

GUICtrlCreateObj($oWMP, 0, 0, 300, 300)

$oWMP.URL = "videofile"

With $oWMP

.controls.play()

.stretchToFit = True

.windowlessVideo = True

.fullscreen = False

.uiMode = 'None'

EndWith

GUISetState(@SW_SHOW)

While 1

$msg = GuiGetMsg()

Select

Case $msg = $GUI_EVENT_CLOSE

ExitLoop

Case $msg = $pause

$oWMP.controls.pause()

Case $msg = $play

$oWMP.controls.play()

Case $msg = $stop

$oWMP.controls.stop()

Case Else

;;;;;;;

EndSelect

WEnd

Exit

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...