Hallo,
ist mir ein bisschen unangenehm, wenn ich so eine Frage stelle, weil ich mir sicher bin, dass die Antwort so simpel ist.. ![]()
Ich stehe vor folgendes Problem.
Mein Videoplayer soll das Video ändern, sobald in der Combobox etwas neues ausgewählt wird.
Jedoch findet diese Änderung nicht statt.
Hier ist mein Beispielcode:
Spoiler anzeigen
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ComboConstants.au3>
#include <IE.au3>
$url1 = "http://www.youtube.com/v/8BiYYJTC1lw" ;Startvideo
$url2 = "http://www.youtube.com/v/8BiYYJTC1lw" ;Startvideo
$HTML = '<body style="margin: 0px; padding: 0px;"><object style="height:100%; width: 100%; margin: 0px; padding: 0px;">' & _
'<param name="movie" value="'&$url1&'"><param name="allowFullScreen" value="true">' & _
'<param name="allowScriptAccess" value="always"><embed src="'&$url2&'" ' & _
'type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="100%" height="100%"></object></body>'
$oIE = _IECreateEmbedded()
$Form1 = GUICreate("Player", 300, 297, 192, 124)
$Combo1 = GUICtrlCreateCombo("", 72, 256, 161, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "Video1|Video2")
$ActiveX = GUICtrlCreateObj($oIE,0,0,300,250)
_IENavigate($oIE,"about:blank",1)
_IEBodyWriteHTML($oIE,$HTML)
$oIE.document.body.scroll = "no"
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Combo1
_exproc()
EndSwitch
WEnd
Func _exproc()
if GUICtrlRead($Combo1) = "Video1" Then ;wenn Video1 ausgewählt wurde...
Guictrlsetdata($url1, "http://www.youtube.com/v/watch?v=qgjf9LUU3UY")
Guictrlsetdata($url2, "http://www.youtube.com/v/watch?v=qgjf9LUU3UY")
$html = GUICtrlRead($HTML)
_IENavigate($oIE, $html)
EndIf
EndFunc
[/autoit]Die Videos habe ich mir jetzt willkürlich ausgesucht.
Das Hauptproblem wie erwähnt ist, dass das Video nicht geändert wird, wenn "Video1" in der Combobox ausgewählt wurde.