Windows > Third Party Plug-ins, Programs, and Skins

New Display View: Html/Javascript with automation (progress bar, next track, ...

(1/9) > >>

cncb:
This is a Display plugin that gives MC Automation access to javascript in an html page.  It uses Internet Explorer to render the html content.

Setup

* Shut down MC if it is running.
* Make sure you have the .NET Framework v3.0 installed (should already be the case for Win 7 and maybe Vista).
* Download the attached zip file and extract the contents to a directory.
* Open a Command Prompt (*must 'Run As Administrator' if using Vista or Win 7) and run the following command making sure to include the quotes:
"C:\Windows\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe" /codebase "UNZIPDIR\MC.HtmlAutoDisplayView.dll" (replacing UNZIPDIR with the correct directory)
It will give you a warning but the last lines of text must say "registration succeeded" and "Types registered successfully".  If it doesn't then you will need to change the paths in the above command to match your setup and try again.
* Start MC, start playing some music, open display view, right-click and select "Html With Automation" to see the new display.
The default sample has the following features:

* Playing Now count and time-of-day
* Current track cover art and info text (editable expression)
* Progress bar
* Next track cover art and info text (editable expression)
* Shifts content around screen as a kind of "screensaver" (can be disabled)
* Scales font sizes based on screen height (can be disabled)
To edit much of the behavior (font sizes, info expressions, etc.) open "options.js" in the unzipped folder in a text editor and carefully edit the values.  You can also edit "display.css" to modify the styles.  If you want a scrollbar so you can see longer text instead of it just being cut off, rename "display.css" to "display_default.css" and rename "display_scrollbar.css" to "display.css".


Custom Display Page

You can, of course, use your own html page created from scratch.  It has to be named "display.html" and be located in the unzipped directory.  You also need a javascript function named "init" with one argument that is the main MC automation object that can be assigned to a global variable and used later (see the default sample).

Matt:
This is really neat.

I wonder, would it be possible to use MCWS instead of automation from the javascript?  This would remove the need for a custom display plugin, and would dove-tail nicely with the web service work we've been doing.  I'm imagining merging the Track Info system and WebRemote / WebPlay engine.

Thanks for sharing.

cncb:
Thanks.  It shouldn't be too hard to modify it to use MCWS.  The only thing it uses from automation that is not supported by MCWS is the template filling function for the file info/html strings.

I didn't take the MCWS approach since it updates every second and I thought local automation should be faster.  I also didn't want to have to turn on the server/sharing locally when using it on a Library Server client.  And, unfortunately, I am not able to connect to MC through a TrackInfo page ( GetObject() fails as we discussed in the development forum) so I had to create a Display plugin for this.  

danrien:
This is pretty cool! Good work!

foopower:
Installed the excellent view...but for some reason, when the song moves to the next one, I keep getting an [object error]. Any help in resolving this would be most helpful, as I can see using this every day for my custom display view.

Thanks in advance for your help!

Navigation

[0] Message Index

[#] Next page

Go to full version