WebEngine SDK: Difference between revisions

From wiki.jriver.com
Jump to navigation Jump to search
No edit summary
No edit summary
Line 3: Line 3:
Media Center 15 introduced the ability to browse, control, or play from a library on a phone or other Internet connected device using [[WebPlay]] and [[WebRemote]].
Media Center 15 introduced the ability to browse, control, or play from a library on a phone or other Internet connected device using [[WebPlay]] and [[WebRemote]].


Both [[WebPlay]] and [[WebRemote]] are fully customizable.
Both [[WebPlay]] and [[WebRemote]] are fully customizable. This includes both the appearance and the functionality.


== Location ==
== Location ==

The files used to customize WebPlay and WebRemote are located at:
* WebPlay: [Media Center Install Path]\Data\WebPlay\[Name]
* WebRemote: [Media Center Install Path]\Data\WebRemote\[Name]

The default appearances are called 'Default'. They offer a good starting point. You can make a copy of the 'Default' folder and name it anything you like.

You will then be able to select your new customization in Options > Media Network inside the program.

== Web Template Language ==

The HTML files in a customization are sent through a rendering engine that allows several things:

'''Tokens'''
Any text between square braces will be considered a 'token'. Tokens are replaced by their corresponding values.

Tokens have the formatting:
[Name]
[Name(Index)]
[Class.Name(Index]]
[Class(Index).Name]
[Class(Index).Name(Index)]

'''Translation'''
Any text in curly braces {} will be translated using the current translation.

'''Loops'''
Loops provide a way to use far less HTML code for redundant sections. Showing an example is probably the easiest way to see how they work:

<!-- begin: loop(z, 0, min(4, [TopSongCount] - 1)) -->
<li>[TopSong.TrackName([z])]</li>
<!-- end: loop →

You can use any loop variable you like. Above, we use the letter z.

You can use basic math and other tokens in the to and from range for the loop. Above, you can see it uses the function min(...), the token [TopSongCount], and subtraction.


== Functionality ==
== Functionality ==


The functionality to play, pause, etc. is provided by the [[Web Service Interface]], called MCWS. Please see the documentation for the web service to learn about the possible functionality.
The functionality to play, pause, etc. is provided by the [[Web Service Interface]], called MCWS. Please see the documentation for the web service to learn about the possible functionality.

The default skins use AJAX to do some processing. For example, this allows the 'Playing Now' screen to update periodically using information from the server without requiring page reloads.


== More ==
== More ==

Revision as of 20:19, 23 June 2010

Introduction

Media Center 15 introduced the ability to browse, control, or play from a library on a phone or other Internet connected device using WebPlay and WebRemote.

Both WebPlay and WebRemote are fully customizable. This includes both the appearance and the functionality.

Location

The files used to customize WebPlay and WebRemote are located at:

  • WebPlay: [Media Center Install Path]\Data\WebPlay\[Name]
  • WebRemote: [Media Center Install Path]\Data\WebRemote\[Name]

The default appearances are called 'Default'. They offer a good starting point. You can make a copy of the 'Default' folder and name it anything you like.

You will then be able to select your new customization in Options > Media Network inside the program.

Web Template Language

The HTML files in a customization are sent through a rendering engine that allows several things:

Tokens Any text between square braces will be considered a 'token'. Tokens are replaced by their corresponding values.

Tokens have the formatting: [Name] [Name(Index)] [Class.Name(Index]] [Class(Index).Name] [Class(Index).Name(Index)]

Translation Any text in curly braces {} will be translated using the current translation.

Loops Loops provide a way to use far less HTML code for redundant sections. Showing an example is probably the easiest way to see how they work:

  • [TopSong.TrackName([z])]