Avi Video bei Koda form desgin mit einbauen doch wie Funktioniert es?

  • Hallo an euch allen !

    Ich will ein kleines Project Basteln mit Koda und will ein Video (.avi) mit einbauen das auch wenn das video zu ende ist wieder von vorne anfängt (endlosschleife). doch egal welche avi datei ich einbaue es passiert nichts und eine meldung kommt das er es nicht könnte. Das projekt soll eine art Fleier werden und das video soll in das erstellte fenster abgespielt werden.

    nun hier ist schon mal mein Skript was noch nicht fertig ist.

    Spoiler anzeigen
    [autoit]

    #include <AVIConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #Region ### START Koda GUI section ### Form=C:\Users\Megatron\Desktop\Form2.kxf
    $Form2 = GUICreate("Form2", 602, 452, 196, 126)
    GUISetBkColor(0xFF00FF)
    $Label1 = GUICtrlCreateLabel("MaDonna", 240, 8, 344, 91)
    GUICtrlSetFont(-1, 65, 400, 0, "MS PMincho")
    GUICtrlSetColor(-1, 0x3399FF)
    $Label2 = GUICtrlCreateLabel("Mädchenkult e.v", 320, 88, 187, 33)
    GUICtrlSetFont(-1, 20, 400, 0, "Modern No. 20")
    GUICtrlSetColor(-1, 0x3399FF)
    $Pic1 = GUICtrlCreatePic("C:\Users\Megatron\Desktop\alte_muster.jpg", 240, 120, 337, 41, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
    $Pic2 = GUICtrlCreatePic("C:\Users\Megatron\Desktop\test55.jpg", 8, 8, 209, 177, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
    $Avi1 = GUICtrlCreateAvi("No File", -1, 232, 176, 361, 265)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit

    [/autoit] [autoit][/autoit] [autoit]

    EndSwitch
    WEnd

    [/autoit]

    und hier ein skript von TheShadowAE das es fast ist was ich bräuchte und funkioniert.

    Spoiler anzeigen
    [autoit]

    #NoTrayIcon
    #include <GUIConstants.au3>

    [/autoit] [autoit][/autoit] [autoit]

    #Region ### START Koda GUI section ### Form=D:\Progen\AutoIt\Meine\Forms\Video.kxf
    $Form1 = GUICreate("Kleiner Videoplayer", 633, 447, 193, 125)
    $wmp = ObjCreate("wmplayer.ocx")
    $obj=GUICtrlCreateObj($wmp,32, 32, 561, 329)
    $Slider1 = GUICtrlCreateSlider(32, 376, 561, 25)
    GUICtrlSetLimit($Slider1,100,0)
    $Button1 = GUICtrlCreateButton("Start/Weiter", 32, 408, 89, 25, 0)
    $Button2 = GUICtrlCreateButton("Pause", 144, 408, 89, 25, 0)
    $Button4 = GUICtrlCreateButton("Stop", 260, 408, 81, 25, 0)
    $Button5 = GUICtrlCreateButton("Datei", 494, 408, 81, 25, 0)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    [/autoit] [autoit][/autoit] [autoit]

    With $WMP
    .URL = ("")
    .fullScreen = True
    ;.windowlessVideo = True
    .stretchToFit = True
    .enableContextMenu = True
    .enabled = True
    .uiMode = "full"; none / mini full
    .settings.autostart = True
    .settings.mute = True
    .settings.volume = 100; 0 - 100
    .settings.Balance = 0; -100 to 100
    EndWith

    [/autoit] [autoit][/autoit] [autoit]

    if $CmdLine[0]>0 Then
    $wmp.URL=($cmdline[1])
    $wmp.controls.play()
    EndIf

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Button5
    $file=FileOpenDialog("Video auswählen","","Videos(*.mp4)",11)
    $wmp.URL=($file)
    $wmp.controls.play()
    Case $Button1
    $wmp.controls.play()
    Case $Button4
    $wmp.controls.stop()
    case $Button2
    $wmp.controls.pause()
    Case $Slider1

    [/autoit] [autoit][/autoit] [autoit]

    EndSwitch
    WEnd

    [/autoit]

    ich erkläre mal was ich genau vorgestellt habe und es bei mir ihrgendwie nicht klappt.

    1. das video soll gleich beim Start des Fenster gespielt werden oder eine kleine verzögerung von 15 Sekunden
    2. Das Video soll am ende von vorn anfangen also eine Endlos Schleife
    3. Der Player (steuerungselement) soll verbogen sein (wünschens wert zu wissen wie man die steuerungelemente ein und ausblendet)
    4. für das Video soll keine Buttons benutzt werden.


    Bitte um Hilfe da ich mit koda die videos noch nie eingebaut habe?

    Mit freundlichen Grüßen

    Baron

  • Hallo ich habe diese datei

    Spoiler anzeigen
    [autoit]

    #cs
    _wmpcreate($show, $left, $top, $width = 100, $height = 100)
    $show: 1 = shows controls
    2 = hides controls

    [/autoit] [autoit][/autoit] [autoit]

    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

    [/autoit] [autoit][/autoit] [autoit]

    Return: None
    #ce
    Func _wmploadmedia( $object, $URL, $autostart = 1 )
    $object.URL = $URL
    If $autostart = 1 And $object.controls.isAvailable("play") 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"

    [/autoit] [autoit][/autoit] [autoit]

    Return: None
    #ce
    Func _wmpsetvalue( $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
    EndSelect
    EndFunc

    [/autoit]

    gespeichert als wmp.au3 und im include gepackt und diese datei

    Spoiler anzeigen
    [autoit]

    #include <GUIConstants.au3>
    #include <wmp.au3>
    ; == GUI generated with Koda ==
    $Form1 = GUICreate("AForm1", 518, 439, 192, 125)
    $wmp = _wmpcreate(1, 8, 8, 425, 425);creates object
    _wmpsetvalue( $wmp, "nocontrols" );hides controls
    GUISetState(@SW_SHOW)
    _wmploadmedia( $wmp, @HomeDrive & "\WINDOWS\clock.avi" );loads media
    ;Sleep(1000)
    ;_wmpsetvalue( $wmp, "controls" );shows controls
    While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
    ExitLoop
    Case Else
    ;;;;;;;
    EndSelect
    WEnd
    Exit

    [/autoit]

    soll die WMP_Example sein das ist doch die wo man es testet oder ?

    jeden falls kommt von autoit fehler wmp.au3 und da passiert nichts würdest du mir die include und mir einen kleinen beispiel skript bauen wehre echt nett?

    Gruß Baron

  • Sprenger120! :rock:

    Mit der wmp.au3 Datei geht es doch ich habe beim speichern ein fehler gemacht habe die endung mit geschriben das es so ausgesehen hat wmp.au3.au3 dann kann es ja nicht gehen.

    jetzt noch eine andere frage wie bekomme ich es hin das mein video beim ende wieder von vorn anfangt

    hier mein Skript wo jetzt auch das Video geht.

    Spoiler anzeigen
    [autoit]

    #include <AVIConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #include <wmp.au3>
    #Region ### START Koda GUI section ### Form=C:\Users\Megatron\Desktop\Form2.kxf
    $Form2 = GUICreate("MaDonna - Mädchenkult.Ur e.V.", 602, 452, 196, 126)
    GUISetBkColor(0xFF00FF)
    $Label1 = GUICtrlCreateLabel("MaDonna", 240, 8, 344, 91)
    GUICtrlSetFont(-1, 65, 400, 0, "MS PMincho")
    GUICtrlSetColor(-1, 0x3399FF)
    $Label2 = GUICtrlCreateLabel("Mädchenkult.Ur e.V.", 320, 88, 187, 33)
    GUICtrlSetFont(-1, 20, 400, 0, "Modern No. 20")
    GUICtrlSetColor(-1, 0x3399FF)
    $Pic1 = GUICtrlCreatePic("C:\Users\Megatron\Desktop\alte_muster.jpg", 240, 120, 337, 41, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
    $Pic2 = GUICtrlCreatePic("C:\Users\Megatron\Desktop\test55.jpg", 8, 8, 209, 177, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))

    [/autoit] [autoit][/autoit] [autoit]

    $wmp = _wmpcreate( 1, 240, 176, 158, 155);creates object
    _wmpsetvalue( $wmp, "nocontrols" );hides controls
    GUISetState(@SW_SHOW)
    While 1
    _wmploadmedia( $wmp, @DesktopDir & "\testlogi.avi" );loads media
    Sleep(260)
    GUISetState(@SW_SHOW)
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    #EndRegion ### END Koda GUI section ###

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit

    [/autoit] [autoit][/autoit] [autoit]

    EndSwitch
    WEnd

    [/autoit]

    doch die datei die in while 1 drin ist (testlogi.avi) für die endlosschleife gefählt mir nicht da die while schleife andere option blockiert wie das Close Button und auch andere Buttons um eine Aktion auszuführen.

    bitte um Hilfe :S

    Gruß Baron

    P.s. gibt es auch für das format Gif für animation bilder eine datei namens Gif.au3 damit man auch die animations bilder beweglich sieht wenn ja wo kann man es runterladen.

  • So habs mal nen bischen umgebaut. Ungetestet

    Spoiler anzeigen
    [autoit]


    #include <AVIConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #include <wmp.au3>
    #Region ### START Koda GUI section ### Form=C:\Users\Megatron\Desktop\Form2.kxf
    $Form2 = GUICreate("MaDonna - Mädchenkult.Ur e.V.", 602, 452, 196, 126)
    GUISetBkColor(0xFF00FF)
    $Label1 = GUICtrlCreateLabel("MaDonna", 240, 8, 344, 91)
    GUICtrlSetFont(-1, 65, 400, 0, "MS PMincho")
    GUICtrlSetColor(-1, 0x3399FF)
    $Label2 = GUICtrlCreateLabel("Mädchenkult.Ur e.V.", 320, 88, 187, 33)
    GUICtrlSetFont(-1, 20, 400, 0, "Modern No. 20")
    GUICtrlSetColor(-1, 0x3399FF)
    $Pic1 = GUICtrlCreatePic("C:\Users\Megatron\Desktop\alte_muster.jpg", 240, 120, 337, 41, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS))
    $Pic2 = GUICtrlCreatePic("C:\Users\Megatron\Desktop\test55.jpg", 8, 8, 209, 177, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS))

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    $wmp = _wmpcreate(1, 240, 176, 158, 155);creates object
    _wmpsetvalue($wmp, "nocontrols");hides controls
    _wmploadmedia($wmp, @DesktopDir & "\testlogi.avi");loads media
    _wmpvalue($wmp,"play")
    GUISetState(@SW_SHOW)
    AdlibRegister("_Endless",250)
    ;~ While 1
    ;~
    ;~ Sleep(260)
    ;~ GUISetState(@SW_SHOW)
    ;~ WEnd

    [/autoit] [autoit][/autoit] [autoit]

    #EndRegion ### END Koda GUI section ###

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit

    [/autoit] [autoit][/autoit] [autoit]

    EndSwitch
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func _Endless()
    If $object.controls.isAvailable("play") Then $object.controls.play()
    EndFunc ;==>_Endless

    [/autoit]


    und zu den GIF´s

    [autoit]


    Func GuiCtrlCreateGif($pic_dir, $left, $up, $right, $down, $border = 0)
    $oIE = ObjCreate("Shell.Explorer.2")
    GUICtrlCreateObj($oIE, $left, $up, $right, $down)
    $oIE.navigate ("about:blank")
    $oIE.document.body.style.border = $border&"px"
    $oIE.document.body.background = $pic_dir
    $oIE.document.body.scroll = "no"
    EndFunc

    [/autoit]
  • Brauche Hilfe

    Das letzte Skript hier

    Spoiler anzeigen
    [autoit]

    #include <AVIConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #include <wmp.au3>
    #Region ### START Koda GUI section ### Form=C:\Users\Megatron\Desktop\Form2.kxf
    $Form2 = GUICreate("MaDonna - Mädchenkult.Ur e.V.", 602, 452, 196, 126)
    GUISetBkColor(0xFF00FF)
    $Label1 = GUICtrlCreateLabel("MaDonna", 240, 8, 344, 91)
    GUICtrlSetFont(-1, 65, 400, 0, "MS PMincho")
    GUICtrlSetColor(-1, 0x3399FF)
    $Label2 = GUICtrlCreateLabel("Mädchenkult.Ur e.V.", 320, 88, 187, 33)
    GUICtrlSetFont(-1, 20, 400, 0, "Modern No. 20")
    GUICtrlSetColor(-1, 0x3399FF)
    $Pic1 = GUICtrlCreatePic("C:\Users\Megatron\Desktop\alte_muster.jpg", 240, 120, 337, 41, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS))
    $Pic2 = GUICtrlCreatePic("C:\Users\Megatron\Desktop\test55.jpg", 8, 8, 209, 177, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS))

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    $wmp = _wmpcreate(1, 240, 176, 158, 155);creates object
    _wmpsetvalue($wmp, "nocontrols");hides controls
    _wmploadmedia($wmp, @DesktopDir & "\testlogi.avi");loads media
    _wmpvalue($wmp,"play")
    GUISetState(@SW_SHOW)
    AdlibRegister("_Endless",250)
    ;~ While 1
    ;~
    ;~ Sleep(260)
    ;~ GUISetState(@SW_SHOW)
    ;~ WEnd

    [/autoit] [autoit][/autoit] [autoit]

    #EndRegion ### END Koda GUI section ###

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit

    [/autoit] [autoit][/autoit] [autoit]

    EndSwitch
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func _Endless()
    If $object.controls.isAvailable("play") Then $object.controls.play()
    EndFunc ;==>_Endless

    [/autoit]

    was Sprenger120 so freundlich angepasst hat will nicht starten da kommt beim ausführen diese fehler meldung

    [Blockierte Grafik: http://s2.imgimg.de/uploads/fehlerf172cda8png.png]

    Das Skript soll das video Starten aber darf nicht andere option verhindern wie button zum Drücken oder das Schließ Button.


    Gruß Baron

    Bitte um ganz dolle Hilfe von euch

  • so hauts hin, getestet

    Spoiler anzeigen
    [autoit]


    #include <AVIConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #include <wmp.au3>
    #Region ### START Koda GUI section ### Form=C:\Users\Megatron\Desktop\Form2.kxf
    $Form2 = GUICreate("MaDonna - Mädchenkult.Ur e.V.", 602, 452, 196, 126)
    GUISetBkColor(0xFF00FF)
    $Label1 = GUICtrlCreateLabel("MaDonna", 240, 8, 344, 91)
    GUICtrlSetFont(-1, 65, 400, 0, "MS PMincho")
    GUICtrlSetColor(-1, 0x3399FF)
    $Label2 = GUICtrlCreateLabel("Mädchenkult.Ur e.V.", 320, 88, 187, 33)
    GUICtrlSetFont(-1, 20, 400, 0, "Modern No. 20")
    GUICtrlSetColor(-1, 0x3399FF)
    $Pic1 = GUICtrlCreatePic("C:\Users\Megatron\Desktop\alte_muster.jpg", 240, 120, 337, 41, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS))
    $Pic2 = GUICtrlCreatePic("C:\Users\Megatron\Desktop\test55.jpg", 8, 8, 209, 177, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS))

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    $wmp = _wmpcreate(1, 240, 176, 158, 155);creates object
    _wmpvalue($wmp, "nocontrols");hides controls
    _wmploadmedia($wmp, FileOpenDialog("",@DesktopDir," (*.*)"));@DesktopDir & "\testlogi.avi");loads media
    _wmpvalue($wmp,"play")
    GUISetState(@SW_SHOW)
    AdlibRegister("_Endless",250)
    ;~ While 1
    ;~
    ;~ Sleep(260)
    ;~ GUISetState(@SW_SHOW)
    ;~ WEnd

    [/autoit] [autoit][/autoit] [autoit]

    #EndRegion ### END Koda GUI section ###

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit

    [/autoit] [autoit][/autoit] [autoit]

    EndSwitch
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func _Endless()
    If $wmp.controls.isAvailable("play") Then $wmp.controls.play()
    EndFunc ;==>_Endless

    [/autoit]