Template Modes
  • 15 Oct 2024
  • 1 Minute to read

Template Modes


Article summary

The usual purpose of a template is to show some dynamic content on a player/display, as part of a channel and playlist.

However, in the life cycle of template-based content, there are a number of different cases where the template is called to action. In most cases, the template does not need to worry about which mode it is being invoked, but if it wants to adapt its behavior it may query the DataHelper getter player.viewMode to find out. Note that this is not a pure value returned from the Player, but a property which determines the “view mode“ programmatically.

View Mode

Description

local

Standard playback in full-fledged Dise Player.

edit

Preview in CMS while user is creating/editing content.

preview

Preview of single content object or playlist in CMS.

server

Preview of player/display in CMS or running in "Web mode" on a SOC-device.

thumb

Thumbnail generation.

debug

Playback in PlayerSimulator during development.

Note that these values are the internal-values of the enum ViewMode, which is defined like this:

export const enum ViewMode {
    Edit = 'edit',
    Preview = 'preview',
    LocalChannel = 'local',
    WebChannel = 'server',
    Debug = 'debug',
    Thumbnail = 'thumb',
}

Hence, you should use e.g. Dise.ViewMode.Thumbnail for comparison and not rely on the value.


Was this article helpful?

What's Next
Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.