View Full Version : Winamp HTML
shaneh
16th August 2004, 09:08
Wanna see something cool?
Something I am working on for a new version of Toaster, but it could be put to a lot of different uses. Its definetly not for production use in its present form, but cool to check out.
Basically, using this plugin you can script Winamp using DHTML/Javascript etc. This has already been somewhat possible with the Winamp COM plugin, or using Wasabi or whatever, but I think using Javascript and hosting the browser is a little easier, and also means it runs in process. Plus it will let .htm creators much more flexibility, depending on how rich I eventually make window.external.
Anyway, Im planning on adding heaps of different events and properties and methods etc, to support just about anything. It will also support using window.external to do stuff like fade in the window, resize it, perhaps run programs (assuming I can secure it ok) etc.
It will mean making a cool 'Toaster' style interface really easy - you could for example have nice images with highlight effects for rating songs etc.
Anyway, check it out if you like. Dont bother with bug reports 'cause its just prototype stuff at the moment. But if you have any cool ideas for it or create a nice .html file let me know.
shaneh
16th August 2004, 14:30
Ive worked out a neat way to get full activeX/script etc access without giving the same control to any website you visit in the web browser.
This means you can use the shell activex object plus others to copy files, shutdown you computer or pretty much whatever you like without giving that access to any web site you visit in the plugin. Coupled with the ability to respond to winamp events and query winamp for all sorts of information, I think its pretty cool. You can whip up a quick 'shutdown computer after 10 song plays' or whatever 'plugin' in HTML/Javascript in a matter of minutes.
Or popup a window which has a button which lets you delete the file, or rate it, or download a cover image or whatever with a couple lines of javascript.
I'll update it tomorrow sometime when I get it done, with a couple example .html files which demonstrate the power of something like this.
I may embed it into the media library, but I also want to have a 'toaster' style fading popup, so Im not sure how Ill handle that yet. When using it 'toaster style', the actual popup will be controlled in the HTML/JS something similar to
window.external.OnTrackChange()
{
window.external.setsize_and_pos(...)
window.external.FadeIn(100);
//setup a timer to do the fadeout
}
So that it could be used however you like. I think this, coupled with the ability to set the window style (normal with title etc, popup window) and the ability to have multiple different windows with different .htms open would solve the problem.
inthegray
19th August 2004, 19:51
shaneh, you plan on posting those demonstrations soon? i'm really interested in seeing "in action" what kind of applications you can get from this.
shaneh
20th August 2004, 02:30
Yeah oops... had a few delays. Was working on a new point release of Toaster. 0.5b4 is up now, but its a little bit buggy on windows 2000 so I'll probably have to do another relase :P Only a couple minor fixes to it Im afraid.
As for this, I actually have all the code working fine, I am just trying to consider some design issues. As a demo, I'll probably just make it a window in the media library for now. I'll try get something done quick today, but I cant make any garauntees, plus ive got a few things to do tonight. Dont worry, I have forgotten it :P
Update: Sorry.. wont be happening today :( Ive only got about 10minutes available when I thought I would have a few hours :( will see if I can do something up tomorrow, with a hangover no less.
shaneh
21st August 2004, 15:05
Sigh... its proving a bit more complicated to get a few things done, especially with regard to stacked events and frames etc. So I'll just post a screenshot showing it embedded in the media library.
I have managed to get the lax security settings working ok, (ie the ability to use wscript.shell, to do pretty much anything, the example being running calculator). But it needs a bit more work to prevent embeded frames from also having this privilege.
Id like to use this as an easy way to script Winamp, but I need to make sure I am not just duplicating the ability of something like wasabi/maki or whatever it is. Most likely I will just make a simple 'Now Playing' replacement initially.
billyvnilly
21st August 2004, 15:56
could this be used to apply id3tag info to files? i was thinking like of how godfather (http://users.otenet.gr/~jtcliper/tgf/) can get info from allmusic.com....of course since allmusic changed their website, godfather hasnt been working too well for me.
very cool idea shaneh
inthegray
21st August 2004, 20:18
hmm.. i'd like to use something like this to just automatically load up a web page, like mp3blogs.org. i know i could use Now Playing as a browser, but it reloads another page whenever it plays a new song. would a quick plug-in where you can open up a pane that loads up a user-set page be possible?
shaneh
22nd August 2004, 06:01
@billyvnilly: I do intend to make setting id3 tag info part of the 'API', so theres no reason why you couldnt write a script to load the site in a frame and parse the results etc, as the security settings allow cross site scripting. Though im not sure how well this would work with things other than .mp3s. However, IMHO you would be better off using musicbrainz.org. Although I just took a look at Godfather and it looks pretty neat.
This is not meant to be a replacement for a fully fledged program like that, but more a means for anyone, including non-programmers to quickly and easily write little scripts to accomplish things.
@inthegray: Eventually I will make child items on the tree which will essentially be 'bookmarks' so you can go to your own pages or remote sites. Im not too sure how Im going to do anything at the moment, theres quite a few design decisions.
One day I'm going to write a plugin which lets you execute programs/visit web sites based on ATF from the playlist. So you can do stuff like .
iexplore.exe http://site.com/?q=%artist%
or..
mp3albumartdownload.exe -folder %dir%
etc.. from a drop down list of configurable items. This would be quite easy to do, but I just havent got around to it...
d3x7r0
22nd August 2004, 20:24
This looks really cool, maybe now I'll be able to costumize a bit more my winamp without having to actualy learn c++ or any coding language (aldo I want to, I just can't seem to get a good starting point :( ).
I'll be on top of this, I'm really interested in this.
CaAl
24th August 2004, 08:52
Originally posted by shaneh
One day I'm going to write a plugin which lets you execute programs/visit web sites based on ATF from the playlist. So you can do stuff like .
iexplore.exe http://site.com/?q=%artist%
or..
mp3albumartdownload.exe -folder %dir%
That's exactly what I've been looking for for quite some time. :)
shaneh
24th August 2004, 09:02
Try gen_action posted in this forum.. The Program field can actually specify a filename or web site and it will be 'shelled' with the default program.. ie.
Program2=%dir%\folder.jpg
Command2=
Title2=View album image
inthegray
2nd September 2004, 15:21
shaneh, i know you've been working on a ton of other stuff (winamp scripting, gen_action, audioscrobbler stuff), but any chance of posting another build of this? that last screenshot you posted looked like it had some serious potential for my evil purposes...
shaneh
2nd September 2004, 16:31
Just adding a web browser pane to the media library is no problem, and as you can see Ive already done that. But I also wanted to add scripting support. In this plugin, it was done through the window.external object.
However, I have run into a problem that there is no clean way of exposing this to safe pages, but blocking it from unsafe pages (ie the web). The proper way is to have an object which the page requests to use, rather than something the hosting environment offers up to every page it hosts. There is a way around it, but it causes other problems.
What I can do however, is make the winamp scripting project the object which the pages use. This would give me more control over what pages can use the object or not.
So basically, the winamp scripting project will have the ability to create the browser in the media library and script it, and the two projects will merge (as will gen_action). Thus my efforts are currently focused on winamp scripting, as it will allow quite a few things.
saivert
3rd September 2004, 07:49
Do you use ATL (Active Template Librare) together with ActiveX Template Library to create the WebBrowser control on the new Media Library page?
I have always wanted to do WebBrowser stuff, but couldn't seem to get it right. Even tried it in Delphi using Delphi's powerful ActiveX/COM support but wasn't easier there.
Can you upload msvcr71.dll and the rest of the 7.1 runtime, so I can use the plug-in?
shaneh
3rd September 2004, 12:32
AFAIK there is just ATL, active template library, there isnt a 'activex template library'. I did all in just plain ATL, you just implement IWebBrowserEvents, IDocUIHostHandler and a bunch of other interfaces, create the browser object and hook it all up. heh, unfortuantly it is a fair bit trickier than it sounds, especially when you want to customize it heaps with special permissions and external objects etc.
The msvcr71 is available as a redistributable. It would come with the .net sdk, with microsofts free compiler or its probably on your disk somewhere in an app directory anyway. I could just compile this using the library statically, however its in a slightly broken state at the moment. I couldnt be bothered fixing it as my winamp scripting plugin will have this functionality in built and will combine the two things.
neFAST
29th December 2004, 15:21
Originally posted by shaneh
Or popup a window which has a button which lets you delete the file, or rate it, or download a cover image or whatever with a couple lines of javascript.
Easy rating is something i'm still looking for ! winactive, toaster and now this plugin : it seems you always have very good ideas !!
in fact I didn't manage to make your plugin work (it doesn't appear in the "general plugin" list) but I wonder if your play/pause... button would work from an external browser ?
shaneh
30th December 2004, 01:35
This has basically been merged into the ActiveWinamp plugin. You can't invoke ActiveWinamp from a web site without lowering the security settings with good reason.
However you can make a .hta 'web document' thingy which basically does this. Look at and modify notify.hta from AW. I had planned on having a plugin with custom html hosting in the media library, which would allow ActiveWinamp usage. Itd be good for making a much more powerful and customizable version of the 'currently playing' page/s. I had also planned on 'webifying' toaster to do basically the same thing. Not too sure whether either will go ahead though, as Toaster and AW currently do all I need to do.
vBulletin® v3.8.6, Copyright ©2000-2013, Jelsoft Enterprises Ltd.