Hallo,
ich hatte vor einiger Zeit einen Script geschrieben:
Spoiler anzeigen
#cs ----------------------------------------------------------------------------
[/autoit] [autoit][/autoit] [autoit]AutoIt Version: 3.3.1.1 (beta)
Author: myName
Script Function:
Template AutoIt script.
#ce ----------------------------------------------------------------------------
[/autoit] [autoit][/autoit] [autoit]; Script Start - Add your code below here
[/autoit] [autoit][/autoit] [autoit]#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <String.au3>
#include <Inet.au3>
$Form1 = GUICreate("Last.FM Player", 800, 800)
GUIRegisterMsg($WM_ACTIVATE, "_ReDraw")
$Label1 = GUICtrlCreateLabel("Interpret:", 8, 8, 46, 17)
$Input1 = GUICtrlCreateInput("Rise Against", 64, 8, 121, 21)
$Label2 = GUICtrlCreateLabel("Song:", 8, 40, 32, 17)
$Input2 = GUICtrlCreateInput("Tip the Scales", 64, 40, 121, 21)
$Button1 = GUICtrlCreateButton("Ok", 208, 40, 75, 25)
GUICreate("", 300, 222, 10, 70, $WS_CHILD, -1, $Form1)
GUISetBkColor(0x000c)
$oIE = ObjCreate("Shell.Explorer.2")
$GUIActiveX = GUICtrlCreateObj($oIE, -10, -15, 310, 237)
$oIE.navigate(@TempDir & "\Temp.html")
$oIE.document.body.style.border = "0px"
$oIE.document.body.scroll = "no"
GUISetState()
[/autoit] [autoit][/autoit] [autoit]GUISetState(@SW_SHOW, $Form1)
[/autoit] [autoit][/autoit] [autoit]_user32_RedrawWindow($Form1, BitOR($RDW_ERASE, $RDW_INVALIDATE, $RDW_ALLCHILDREN, $RDW_UPDATENOW))
[/autoit] [autoit][/autoit] [autoit]While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
_Anfrage()
Case $Input2
_Anfrage()
EndSwitch
WEnd
Func _Anfrage()
GUICtrlSetState($Button1, $GUI_Disable)
$Fopen = FileOpen(@TempDir & "\Temp.html", 2)
$Interpret = GUICtrlRead($Input1)
$Song = GUICtrlRead($Input2)
$Source = _LastFM_Get_Player_Source(_LastFM_Generate_Url($Interpret, $Song) & "?autostart")
If $Source <> -1 Then
FileWrite($Fopen, $Source)
FileClose($Fopen)
$oIE.navigate(@TempDir & "\Temp.html")
$oIE.document.body.style.border = "0px"
$oIE.document.body.scroll = "no"
Else
MsgBox(0, "Fehler", "Musik nicht gefunden!")
EndIf
GUICtrlSetState($Button1, $GUI_Enable)
EndFunc ;==>_Anfrage
Func _user32_RedrawWindow($hWnd, $Flag)
$Ret = DllCall("User32.dll", "int", "RedrawWindow", "hwnd", $hWnd, "int", 0, "int", 0, "uint", $Flag)
Return $Ret[0]
EndFunc ;==>_user32_RedrawWindow
Func _LastFM_Generate_Url($LF_Interpret, $LF_Song)
Local $LF_URL = "http://www.lastfm.de/music/" & $LF_Interpret & "/_/" & $LF_Song
Return StringReplace($LF_URL, " ", "+")
EndFunc ;==>_LastFM_Generate_Url
Func _LastFM_Get_Player_Source($LF_URL)
Local $LF_Source = _INetGetSource($LF_URL), $Loop
Local $LF_S_Bet = _StringBetween($LF_Source, '<object type="application/x-shockwave-flash"', '</object>')
For $Loop = 0 To UBound($LF_S_Bet)
If IsArray($LF_S_Bet) Then
If StringInStr($LF_S_Bet[$Loop], "lfmPlayer.swf") Then
Return '<object type="application/x-shockwave-flash"' & $LF_S_Bet[$Loop] & '</object>'
EndIf
EndIf
Next
Return -1
EndFunc ;==>_LastFM_Get_Player_Source
Func _ReDraw($hWnd, $Msg, $wParam, $lParam)
_user32_RedrawWindow($Form1, BitOR($RDW_ERASE, $RDW_INVALIDATE, $RDW_ALLCHILDREN, $RDW_UPDATENOW))
EndFunc ;==>_ReDraw
mit der man einzelne Songs von Last.FM hören kann. Jetzt versuche ich gerade auch, diesen Playereinzufügen. Doch irgendwie wird kein Player angezeigt. Warum nicht?
<object type="application/x-shockwave-flash" data=" http://cdn.last.fm/webclient/slideshow/11/Slideshow.swf " codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0"
id="lfmSlideshow" name="lfmSlideshow" style="visibility:hidden;"
width="568" height="320">
<param name="movie" value=" http://cdn.last.fm/webclient/slideshow/11/Slideshow.swf " />
<param name="flashvars" value="animation=1" />
<param name="allowScriptAccess" value="always" />
<param name="allowNetworking" value="all" />
<param name="allowFullScreen" value="true" />
<param name="quality" value="high" />
<param name="bgcolor" value="000" />
<param name="wmode" value="opaque" />
<param name="menu" value="true" />
</object>
Alles anzeigen