toonboon Posted December 7, 2008 Share Posted December 7, 2008 (edited) I am creating some sort of music player for myself, which uses a last.fm account. I do not want to load the all but-ugly webpage, but I have narrowed it down to just the player itself. The problem is now, I save the player as a .html file on the user's harddisk, but I fail to open that file in the embedded IE... Help me please? EDIT: code was kinda messing up.. download attachment to see the code. codeexample.au3 Edited December 7, 2008 by toonboon [right]~What can I say, I'm a Simplistic person[/right] Link to comment Share on other sites More sharing options...
martin Posted December 7, 2008 Share Posted December 7, 2008 I am creating some sort of music player for myself, which uses a last.fm account. I do not want to load the all but-ugly webpage, but I have narrowed it down to just the player itself. The problem is now, I save the player as a .html file on the user's harddisk, but I fail to open that file in the embedded IE... Help me please? EDIT: code was kinda messing up.. download attachment to see the code. codeexample.au3Add fileclose($file) after you have finished writing the file then IE can read it. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
Zedna Posted December 7, 2008 Share Posted December 7, 2008 (edited) Try this: #include <windowsConstants.au3> #include <IE.au3> _IEErrorHandlerRegister() $oIE = _IECreateEmbedded() $GUI = GUICreate("Last.fm Player", 640, 580, _ (@DesktopWidth - 640) / 2, (@DesktopHeight - 580) / 2, _ $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS) $GUIActiveX = GUICtrlCreateObj($oIE, 10, 40, 500, 400) GUISetState() ;Show GUI _IENavigate($oIE, "http://www.last.fm/listen/user/toonboon/personal") $username = "toonboon" If Not FileExists(@ScriptDir & "\Url") Then DirCreate(@ScriptDir & "\Url") $FileName = @ScriptDir & "\Url\" & $username & ".html" $File = FileOpen($FileName,2) MsgBox(0,'',$File) FileWrite($File, '<object type="application/x-shockwave-flash" data="http://cdn.last.fm/webclient/s12n/s/3/lfmPlayer.swf" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0"' & @CRLF & ' id="lfmPlayer" name="lfmPlayer" align="middle"' & @CRLF & ' width="300" height="221">' & @CRLF & ' <param name="movie" value="http://cdn.last.fm/webclient/s12n/s/3/lfmPlayer.swf" />' & @CRLF & ' <param name="flashvars" value="lang=en&lfmMode=radio&FOD=true&expanded=true&url=lastfm%3A%2F%2Fuser%2F' & $username & '%2Fpersonal&autostart=true" />' & @CRLF & ' <param name="allowScriptAccess" value="always" />' & @CRLF & ' <param name="allowNetworking" value="all" />' & @CRLF & ' <param name="allowFullScreen" value="true" />' & @CRLF & ' <param name="quality" value="high" />' & @CRLF & ' <param name="bgcolor" value="fff" />' & @CRLF & ' <param name="wmode" value="transparent" />' & @CRLF & ' <param name="menu" value="true" />' & @CRLF & '</object></noscript>' & @CRLF & '</div>' & @CRLF & '' & @CRLF & '' & @CRLF & '<script>' & @CRLF & 'var lfmPlayer_params = {"movie":"http:\/\/cdn.last.fm\/webclient\/s12n\/s\/3\/lfmPlayer.swf","flashvars":"lang=en&lfmMode=radio&FOD=true&expanded=true&url=lastfm%3A%2F%2Fuser%2F' & $username & '%2Fpersonal&autostart=true","width":300,"height":221,"majorversion":7,"build":"0","allowscriptaccess":"always","allownetworking":"all","allowfullscreen":"true","quality":"high","bgcolor":"#fff","wmode":"transparent","menu":"true","id":"lfmPlayer","setcontainercss":false,"swliveconnect":"true","name":"lfmPlayer","align":"middle"};' & @CRLF & 'UFO.create(lfmPlayer_params, "lfmPlayer_container");' & @CRLF & '</script>') FileClose($File) _IENavigate($oIE,$FileName) While 1 Sleep(1000) WinSetTitle($GUI, '', StringReplace($oIE.document.title, " - Last.fm", "")) WEnd Edited December 7, 2008 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
toonboon Posted December 7, 2008 Author Share Posted December 7, 2008 oi, thanks much =) could you formulate what the problem was? [right]~What can I say, I'm a Simplistic person[/right] 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