INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: New Display View: Html/Javascript with automation (progress bar, next track, ...  (Read 29989 times)

cncb

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3122

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).
Logged
-Craig    MO 4Media remote and player:  Android/TV/Auto | iOS | Windows 10/UWP

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42441
  • Shoes gone again!

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.
Logged
Matt Ashland, JRiver Media Center

cncb

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3122

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.  
Logged
-Craig    MO 4Media remote and player:  Android/TV/Auto | iOS | Windows 10/UWP

danrien

  • Galactic Citizen
  • ****
  • Posts: 371
  • Chillin

This is pretty cool! Good work!
Logged
http://davidvedvick.info

"Always be yourself. Unless you can be Batman. Always be Batman." - Anonymous

foopower

  • Member
  • *
  • Posts: 2

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!
Logged

foopower

  • Member
  • *
  • Posts: 2

Actually, the song tries to refresh with the right title and song but then flips to object error a second into the song.
Logged

Efjay

  • World Citizen
  • ***
  • Posts: 189

A quick question. I'd like to detach the display to show on another monitor. I'm using Ultramon to enable the second monitor. My main monitor where JRiver opens in 1920x1080 (24"). The monitor I want to send it to is 1024x768 (14"). When I detach and maximize on the other monitor the info text does not display. If the window is stretched to fill the secreen but not maximized, all the info shows properly. If I tell it to hide borders, the info disappears as well. Though, oddly, next track info always displays. Is there a setting or somthing else I can change to allow it to be maximized on the other screen and display all of the info?

Any help is appreciated
Logged

Domi

  • Junior Woodchuck
  • **
  • Posts: 70

Unfortunately, this display plug in doesn't work any more for me with new build MC 18.0.90.
Logged

cncb

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3122

Sorry, a few years late but I finally fixed the issues with this if anyone still wants to use it (download the attached file in the first post).
Logged
-Craig    MO 4Media remote and player:  Android/TV/Auto | iOS | Windows 10/UWP

Ekpen

  • Citizen of the Universe
  • *****
  • Posts: 686

Sorry, a few years late but I finally fixed the issues with this if anyone still wants to use it (download the attached file in the first post).

Greetings:

I am on MC 19.114, windows 8.1 64 biy.
I could not get it to work.
I got  "types----" registered successfully and registration succeeded".
I went to Options and services if the plug in will show as others would. It was not there, also it did not display  under the tree.
I played music, with Display view.. and right click, I got nothing.

Thanks again,

George.
Logged

cncb

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3122

It only shows in the right-click context menu displayed for Display View as shown below.  If you don't see it there it is possible it didn't register properly.  Do you have the .NET Framework 3.0 enabled in Windows 8.1?
Logged
-Craig    MO 4Media remote and player:  Android/TV/Auto | iOS | Windows 10/UWP

bspachman

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 896

Worked for me in Win8.1. I got it going with both the IE and Chromium engines. I did have to quit MC (& the Server) to get the right-click menu option to appear in display view.

brad
Logged

Ekpen

  • Citizen of the Universe
  • *****
  • Posts: 686

It only shows in the right-click context menu displayed for Display View as shown below.  If you don't see it there it is possible it didn't register properly.  Do you have the .NET Framework 3.0 enabled in Windows 8.1?


I acted on the advice of brad, exited the media server, then I got it to work. But it locked up my entire system, MC 19 became unstable. I had to power down the htpc, then re-installed 19.114. It is acting stable for now.
Thanks.
George
Logged

Efjay

  • World Citizen
  • ***
  • Posts: 189

Thanks for the update. This remains my favorite display view.
Logged

cncb

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3122

Thanks for the update. This remains my favorite display view.

You're welcome.  Were you ever able to resolve your detached display issue?
Logged
-Craig    MO 4Media remote and player:  Android/TV/Auto | iOS | Windows 10/UWP

Efjay

  • World Citizen
  • ***
  • Posts: 189

You're welcome.  Were you ever able to resolve your detached display issue?

Sort of. I only had the issue when I attempted to detach to a 4:3 monitor. When detaching to a 16:9 monitor it detaches and works properly. So I switched monitors around.
Logged

cncb

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3122

Sort of. I only had the issue when I attempted to detach to a 4:3 monitor. When detaching to a 16:9 monitor it detaches and works properly. So I switched monitors around.

I just posted a new version that should fix this.  I did not have the css configured so that overflow text was handled properly.  Also see the first post if you would rather have a scrollbar to be able to see all the text rather than having the part of the text that overflows not shown.  The layout and spacing probably is still not ideal for 4:3 displays so you may want to modify display.css further.
Logged
-Craig    MO 4Media remote and player:  Android/TV/Auto | iOS | Windows 10/UWP

SkGe

  • Galactic Citizen
  • ****
  • Posts: 433

Installed and works fine but, but i think it have some bugs, each 5sec interval the display move from the left to right or from down or up.
Logged

cncb

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3122

Installed and works fine but, but i think it have some bugs, each 5sec interval the display move from the left to right or from down or up.

Edit "options.js" in a text editor and you will see how to disable this "screensaver" option.
Logged
-Craig    MO 4Media remote and player:  Android/TV/Auto | iOS | Windows 10/UWP

Efjay

  • World Citizen
  • ***
  • Posts: 189

Actually, after trying it on a 4:3 screen, it looks pretty good. What would I need to do to make the playing now album art smaller?
Logged

cncb

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3122

Actually, after trying it on a 4:3 screen, it looks pretty good. What would I need to do to make the playing now album art smaller?

In display.css, decrease the height value of the #COVER item.
Logged
-Craig    MO 4Media remote and player:  Android/TV/Auto | iOS | Windows 10/UWP

Efjay

  • World Citizen
  • ***
  • Posts: 189

Thanks.
Logged

Efjay

  • World Citizen
  • ***
  • Posts: 189

Any chance of an update for MC21? It doesn't seem to be working (though user error could be the issue...). Thanks.
Logged

cncb

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3122

Did you re-run the registration step after you upgraded MC?
Logged
-Craig    MO 4Media remote and player:  Android/TV/Auto | iOS | Windows 10/UWP

Efjay

  • World Citizen
  • ***
  • Posts: 189

Did you re-run the registration step after you upgraded MC?

I did. It's a fresh Windows install though .net is version 4.5. While I get basic framework of the view, the specific artist and track info and timer aren't shown. I'll give it another try tomorrow and see if I did something in error but I did get the 'successfully registered' message.
Logged

cncb

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3122

I did. It's a fresh Windows install though .net is version 4.5. While I get basic framework of the view, the specific artist and track info and timer aren't shown. I'll give it another try tomorrow and see if I did something in error but I did get the 'successfully registered' message.

It might be the .net version.  Did you have to modify the regasm path to get it to register?  You would have to enable .net 3.0 if so, or I could try to build it with 4.5.
Logged
-Craig    MO 4Media remote and player:  Android/TV/Auto | iOS | Windows 10/UWP

Efjay

  • World Citizen
  • ***
  • Posts: 189

It might be the .net version.  Did you have to modify the regasm path to get it to register?  You would have to enable .net 3.0 if so, or I could try to build it with 4.5.

No. I typed your code exactly as written.
Logged

cncb

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3122

What OS are you running?  You have to specifically enable .NET 3.0 for Windows 8 and 10.  At what point is it not working?  Are you able to choose it as the Display View?
Logged
-Craig    MO 4Media remote and player:  Android/TV/Auto | iOS | Windows 10/UWP

Efjay

  • World Citizen
  • ***
  • Posts: 189

What OS are you running?  You have to specifically enable .NET 3.0 for Windows 8 and 10.  At what point is it not working?  Are you able to choose it as the Display View?

Using Win 7, 32 bit. I am able to register it and select it in the Now Playing screen. However while it displays, it doesn't show the info. I attached a screenshot: 

And thanks in advance for the help.
Logged

cncb

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3122

Sorry, I'm not using v21 so I'm not really in a position to test.  It seems like it is never making the connection to MC's automation object.  Did you "install" the plugin fresh from the zip file (to rule out any modification of the .css or other source files as the problem)?
Logged
-Craig    MO 4Media remote and player:  Android/TV/Auto | iOS | Windows 10/UWP

Efjay

  • World Citizen
  • ***
  • Posts: 189

I did. I'll start the process over and see what happens.
Logged

Efjay

  • World Citizen
  • ***
  • Posts: 189

Quick update: After running updates on the fresh install, this now works. Would love to see more of these types of projects as well. Thanks again...
Logged

kurushi

  • Citizen of the Universe
  • *****
  • Posts: 683

I assume it's not working on mac?
Logged

William-NM

  • World Citizen
  • ***
  • Posts: 115

This is pretty nice - I had missed it until now. Installed and running fine on Win10/MC21 here.
I'm always impressed by the creative things MC users cook up!
William
Logged

kurushi

  • Citizen of the Universe
  • *****
  • Posts: 683

Nice skin  ;D
Off topic:
Beetween us i have updated it so you can delete this one it's really outdated :)
Schearch for the red updated post

On topic:
If it's work on Mac does it's possible to change the colour of the progress bar?
It's the only thing i want to change others area are perfect,very clean skin!
Logged

Inquisition

  • World Citizen
  • ***
  • Posts: 216

Ive integrated this View yesterday in my jriver mc21 and its great.

Thank for this view.

I change some things, i set the shift Frequency in the optionsfile from 5 to 0 seconds, and i moved the contend in the display.css  top from 0 to 50 and left from 0 to 300.
So on my TV the contend is viewed in the middle of the screen.

It works great and looks very fine. ;D
Logged
My English is not perfect, so be merciful with me

Inquisition

  • World Citizen
  • ***
  • Posts: 216

Hello,

does this Screen work on new 64Bit Version?

I tryid it but it doesnt work. But i had both Versions on my PC at this moment, 32 and 64Bit JRiver.
Logged
My English is not perfect, so be merciful with me

Inquisition

  • World Citizen
  • ***
  • Posts: 216

Hi,

now I have only the 64bit Version of jriver running.

This new Screen doesn't work.  Have anyone a solution? It is an really great screen and will be sad when it can be reactivated on 64bit.

Thanks
Logged
My English is not perfect, so be merciful with me

Inquisition

  • World Citizen
  • ***
  • Posts: 216

So, heres the modified File for all who want use this screen in 64bit MC

Description is in zip file

http://filehorst.de/d/cqwiuylF



Hope its OK for cncb that i modify the file
Logged
My English is not perfect, so be merciful with me

Inquisition

  • World Citizen
  • ***
  • Posts: 216

Here little more simple for all who have already used this on 32bit. 

"C:\Windows\Microsoft.NET\Framework64\v2.0.50727\RegAsm.exe" /codebase "UNZIPDIR\MC.HtmlAutoDisplayView.dll" (replacing UNZIPDIR with the correct directory)

This is the new command to register file for 64bit MC23.
Logged
My English is not perfect, so be merciful with me

Inquisition

  • World Citizen
  • ***
  • Posts: 216

So, with this zip it must be possible to use 32 and 64bit mc parallel and on both versions this playing now Screen.

For the 32bit Version use the description in first contribution from cncb in this thread.

For the 64bit Version parallel use Download shown down. Description is in zip file.
Logged
My English is not perfect, so be merciful with me

roque

  • Member
  • *
  • Posts: 4

This is awesome!
I wanted to use some stuff form this on my own track info template but it was too advanced for me. Could there be at least a way to add the comment tag? I just canīt find a way to do this

Atachaments are my original info track view
Logged

roque

  • Member
  • *
  • Posts: 4

Nevermind about adding the comment tag, ii made it.
Anyways, If someone like my trak info and wanted to add some display view attributes it would be great
Logged
Pages: [1]   Go Up