- 15 Oct 2024
- 1 Minute to read
- Print
Template Modes
- Updated on 15 Oct 2024
- 1 Minute to read
- Print
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.