• Quick Start
  • Booting
  • Platform
  • Portals
  • References
    • API Reference TOI3
    • IIP Reference
  • Resources
ARRIS Enterprises, Inc. Confidential Information

Teletext Element

Introduction

The teletext element provides DVB teletext stream visualisation and interaction (list pages/subpages, process coloured keys). The element is implemented as windowless (i.e. it does not have its own window, but it draws some data).

Teletext functionality is optional, and is implemented as an external NPAPI runtime plugin.

Embedding

Adding Teletext Support

To add support for teletext, the teletext NPAPI plugin IIP needs to be included in the boot image configuration file:


kreatv-option-npapi-teletext

Embedding teletext in an HTML portal


function embedTeletextPlugin() {
  teletext = document.createElement("embed");
  teletext.id = "teletext";
  teletext.type = "application/x-kreatv-teletext-plugin";
  teletext.style.position = "absolute";
  teletext.style.width = teletextWidth + "px";
  teletext.style.height = teletextHeight + "px";
  teletext.style.top = teletextY + "px"; // has to be 1 rather than 0
  teletext.style.left = teletextX + "px"; // has to be 1 rather than 0
  teletext.style.zIndex = "10";
  document.body.appendChild(teletext);

  return teletext;
}

The API for the teletext element is accessible via an 'api' member variable when using the HTML Browser. See the general use example below. A complete HTML portal example is also included in the kit.

Programming API

inputDigit(short digit) Process input of one digit for a page selection. Digit should be 0-9
inputRedKey()
inputGreenKey()
inputYellowKey
inputCyanKey()
Process colored key press.
gotoIndexPage() Switch to page 100.
gotoNextPage() Navigate to the next page.
gotoPreviousPage() Navigate to the previous page.
gotoNextSubpage() Navigate to the next subpage. This only works if the controllableSubPages property is set to true
gotoPreviousSubpage() Navigate to the previous subpage. This only works if the controllableSubPages property is set to true
toggleHold() Method for toggling the hold state. When the hold state is active, the automatic updating of the subpage is disabled, otherwise it is enabled. Holding is inactive by default, and it will toggle between activated and deactivated when calling this method.
toggleZoom() Method for toggling the zoom state. If called when in the normal zoom size, this will first display the upper half of the current page in double size. On the next call it will display the lower half of the current page in double size. On the third call it will restore the normal size. It is in normal size by default.
toggleReveal() Method for toggling the reveal state. When the reveal state is active, hidden text will be shown. It is inactive by default, and it will change between inactive and active when calling this method.
transparent

If this property is true then the teletext background is transparent, allowing you to see the portal or video graphics behind it, otherwise it is opaque.

This affects only colored areas of teletext, i.e. if some screen are is to be drawn transparent (suge as teletext subtitles on page 888) it is always transparent.

stretch If true then teletext is scaled to fullscreen, otherwise teletext is scaled by keeping original aspect ratio(720:576) and a margin may be left on left/right or top/bottom. The default value is true

stretch=false will result in compressed teletext on the analog video output.

controllableSubPages If true, the sub-pages navigation controls are enabled, otherwise subpages are switched automatically. The default value is false. Some teletext pages can contain several subpages which are displayed one-by-one after some delay. When subpage navigation is enabled, a counter appears in the top left corner, next to the page number, like 2(5), and the sub-pages are switched using gotoPreviousSubpage() and gotoNextSubpage() calls, and the automatic updating is disabled.

Examples

Set teletext visibility


function setVisible(isVisible) {
  if (isVisible) {
    teletext.style.visibility = "visible";
  } else {
    teletext.style.visibility = "hidden";
  }
}

General usage example


function onKeyTeletext(keyCode) {
  switch(keyCode) {
    case KEY_LEFT:
      teletext.api.gotoNextPage();
    break;
    case KEY_RIGHT:
      teletext.api.gotoPreviousPage();
    break;
    case KEY_INDEX:
      teletext.api.gotoIndexPage();
    break;
    case KEY_RED:
      teletext.api.inputRedKey();
    break;
    case KEY_GREEN:
      teletext.api.inputGreenKey();
    break;
    case KEY_YELLOW:
      teletext.api.inputYellowKey();
    break;
    case KEY_BLUE:
      teletext.api.inputCyanKey();
    break;
    case KEY_TRANSPARENT:
      //toggles transparent background of teletext
      teletext.api.transparent = !teletext.api.transparent;
    break;
  }

  if (keyCode >= KEY_0 && keyCode <= KEY_9) {
    teletext.api.inputDigit(getDigitValue(keyCode));
  }
}

5.1.1.p8

Copyright (c) 2018 ARRIS Enterprises, LLC. All Rights Reserved. ARRIS Enterprises, LLC. Confidential Information.