top

Getting Started

This topic describes how you can develop an ambient content application, which displays content when the Samsung TV is in ambient mode.

You can create Samsung ambient content applications for Samsung TVs supporting ambient mode. An ambient content application can display customizable decorative and basic informational content that blends in with the environment around the TV. Ambient content applications is available after Samsung Ambient Store is open.

Ambient content applications can be developed using the Tizen .NET TV framework. Features specific to ambient content applications are implemented using the OpenTKContentAppBase class of the Tizen.TV.Service.Ambient namespace. You can also implement OpenGL® features in the application using the OpenTK library.

Creating Ambient Content Applications

To create a new ambient content application project:

  1. Launch Visual Studio.
  2. In the Visual Studio menu, select "File > New > Project".
    The "New Project" dialog opens.
  3. Select "Templates > Visual C# > Tizen Samsung TV", and select the "Blank App (OpenTKContentApp)" template.
    Define the project properties and click "OK". You can enter the name and location.
    Figure 1. "New Project" dialog

    Figure 1. "New Project" dialog


    The project is created. It contains basic code for a sample ambient content application.
    Figure 2. Ambient content application project

    Figure 2. Ambient content application project

  4. Build and launch the application.
    Figure 3. Sample ambient content application

    Figure 3. Sample ambient content application

Configuring Ambient Content Applications

Before testing and publishing your ambient content application, make sure that the appropriate meta data keys have been defined in the "tizen-manifest.xml" file.

The following meta data keys are applicable to ambient content applications.

Table 1. Ambient application meta data
Key Value Description
"http://samsung.com/tv/metadata/ambient.screen.support" "true" or "false" Enable or disable ambient mode support.
Must be "true" for ambient content applications.
"http://samsung.com/tv/metadata/ambient.screen.use.frame" Enable or disable the shadow frame feature.
""http://samsung.com/tv/metadata/ambient.screen.use.wallpaper"" Enable or disable the ambient wallpaper feature.
"http://samsung.com/tv/metadata/display.hidden" Enable or disable hiding the display.
Must be "true" for ambient content applications.
"http://samsung.com/tv/metadata/use.network" Enable or disable checking the network connection when the application is launched.

Implementing Ambient Content Features

To implement ambient content application features:

  • The methods of the OpenTKContentAppBase class enable you to manage the background music and font color, and respond to key presses:

    protected override void OnEvent(object sender, TemplateAppEventArgs e)
    {
      base.OnEvent(sender, e);
        if (e.eventType == EContentAppEvent.E_EVENT_BG_MUSIC_START)
      {
        // Behavior when background music starts
      }
      else if (e.eventType == EContentAppEvent.E_EVENT_BG_MUSIC_END)
      {
        // Behavior when background music ends
      }
      if (e.eventType == ETemplateAppEvent.E_EVENT_FONT_COLOR_CHANGED)
      {
        EFontStyle fontColor = GetFontColor();
        // Update text color
      }
      else if (e.eventType == ETemplateAppEvent.E_EVENT_KEY_RECEIVED)
      {
        if (e.value == "Return")
        {
          // Behavior when Return key is pressed
        }
      }
    }
    

    Ambient content applications can respond to "Left", "Right", and "Return" remote control key presses.

  • To start and stop background audio playback:

    OpenTKContentAppBase.PlayAudio("res/temp.mp3",true);
    OpenTKContentAppBase.StopAudio();
    
  • If the user has enabled the high-contrast feature on the TV, show a high-contrast UI in your ambient content application:

    protected virtual void OnHighContrastChanged(bool isHighContrast)
    {
      if (isHighContrast)
      {
        // Change your UI to support high-contrast
      }
      else
      {
        // Return your own GUI
      }
    }