Вы находитесь на странице: 1из 250

JMACX: JavaScript Media Access Control Extensions

API specification

March 2010

Copyright JMACX: JavaScript Media Control Extensions: API specification March 2010 Issue 108 2010 Amino Communications Ltd. The generally available software versions at the time of issue are as follows:

Platform 103 110 110-H 500 130/130M 130-H 530 125

Software release version 0.15.1 0.15.10 0.15.10 0.15.10 0.16.7 0.16.7 0.10.21 0.16.7

CPU IBM Vulcan

ST 71xx

TI - DM6443 or DM6441 (DaVinci)

Amino, AmiNET, AssetHouse, Mood and the Amino logo are trademarks of Amino Communications Ltd. All other trademarks are the property of their respective owners. This document describes components that undergo continual development. The information in this document is subject to change without notice at any time. There may be visual deviations between graphics in the manuals and the released software. Comments about the documentation are welcome. Please submit feedback to the Amino support site at http://stbsupport.aminocom.com using the Request Support > Submit Feedback option. For further information about Amino or Amino products, please e-mail info@aminocom.com.

Amino Communications Ltd. 2010

INDEX

CONTENTS

Contents

Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 About Amino . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 About this document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 Document conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Document structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Document history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Chapter 1Introduction to JMACX functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 1.1 1.2 1.3 1.4 1.5 1.6 1.7 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 2.10 2.11 3.1 3.2 4.1 4.2 5.1 5.2 6.1 Browser support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Hardware platform support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Support for other build options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Using the API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Event handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Deprecated functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 Using this manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 ASTB date functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 ASTB system information functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 ASTB power management functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 ASTB mouse pointer functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 ASTB channel functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 ASTB network functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 ASTB upgrade functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 ASTB trusted domains functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 ASTB configuration functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 ASTB VLAN configuration functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 ASTB miscellaneous functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 AVMedia event-handler attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 AVMedia functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 Picture-in-graphics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 VideoDisplay functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 AudioControl Event handling functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159 AudioControl control functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160 Browser functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
INDEX CONTENTS ii

Chapter 2ASTB. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

Chapter 3AVMedia . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75

Chapter 4VideoDisplay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113

Chapter 5AudioControl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159

Chapter 6Browser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175

Amino Communications Ltd. 2010

SET-TOP BOX CONFIGURATION GUIDE

Chapter 7AminoGeneric . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185 7.1 7.2 8.1 8.2 8.3 8.4 A.1 A.2 B.1 B.2 C.1 C.2 AminoGeneric class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185 AminoGeneric functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186 TVI event-handler attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189 Return codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190 TVI functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190 Generic interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216 Remote key values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221 List of action codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225 ASTB, AVMedia, VideoDisplay general example . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229 Mapping actions and channels to remote control buttons . . . . . . . . . . . . . . . . . . . . . 231 Media source types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233 Media source attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236

Chapter 8TVI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189

Appendix AKey codes and action codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221

Appendix BExample code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229

Appendix CMedia source URLs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233

Appendix DObsolete functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241

iii

CONTENTS

INDEX

Amino Communications Ltd. 2010

Introduction

About Amino
Amino Communications (http://www.aminocom.com) is the specialist in digital entertainment products. Aminos range of software and set-top box systems can be tailored for telecom, broadcast and hospitality firms to offer highly scalable and targeted services. The award-winning AmiNET and Mood range is used by leading service operators in over 80 countries. Amino's 'AssetHouse' technology opens the door for content producers, telecoms companies, broadcasters and web TV firms to maximise opportunities through better services, targeted content and greater choice and taking IPTV to the next level by allowing clients such as BT Vision to think like retailers and package, personalize and refresh extra revenue-generating services to viewers. Amino Communications and AssetHouse are wholly owned subsidiaries of Amino Technologies PLC. Listed on the London Stock Exchange AIM, symbol AMO. Amino's HQ is based near Cambridge, UK, with offices in the US, China and Sweden.

About this document


This document introduces the JMACX API a set of JavaScript extensions designed to enable interaction with the components that an AmiNET set-top box communicates with and controls. Details of the available functions are supplied here. The document assumes some familiarity with JavaScript. It also assumes an understanding of the AmiNET set-top box operation and management. For an introduction to set-top box operation and administration and for alternative ways of controlling settop boxes, see the Amino Set-Top Box Configuration Guide. Note: This document details the functionality available for the software versions listed on the copyright page. For information on functionality that is no longer supported, you should refer to previously released versions of the JMACX API Specification. This document introduces the Javascript Media Access Control eXtensions (JMACX) API a set of Javascript extensions designed to enable interaction with the components that an AmiNET set-top box communicates with and controls and provides details of the available functions. The document assumes familiarity with Javascript. It also assumes an understanding of the AmiNET set-top box operation and management. For an introduction to set-top box operation and administration and for alternative ways of controlling set-top boxes, see the Amino Set-Top Box Operations Guide.

Amino Communications Ltd. 2010

INDEX

CONTENTS

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Document conventions
The following document conventions are in use: Formatting < ...> [ ...] ... | ... code font Usage Indicates a value that you need to replace with a system specific value (except where used in HTML or XML examples, where it is used in tags, as normal). Indicates optional parameters - for example in commands or functions. Indicates choices - for example where an input can take one of a number of values. Indicates input and output values (for example, at a command line), as well as function, configuration, parameter and file names. Used for emphasis and to indicate specific key presses. For example: Press the Esc key. Indicates that the function is deprecated. Cross-reference (this is a clickable hyperlink if you are viewing the document electronically).

bold text grey text


blue text

Document structure
This document contains the following chapters: Chapter Introduction Outline This chapter continues by providing general information about the contents of the manual and how to use it.

Chapter 1, Introduction to JMACX Lists the available functionality and details the functions platforms, browsers and other build options that functionality is available on. Chapter 2, ASTB Chapter 3, AVMedia Chapter 4, VideoDisplay Chapter 5, AudioControl Chapter 6, Browser Chapter 7, AminoGeneric Chapter 8, TVI Appendix A Appendix B Appendix C Appendix D Lists the remote control keycodes and the actions associated with them. Provides example code for JMACX API use. Provides information on constructing media stream URLs. Provides a list of deprecated functions. These chapters list the functions and event handling attributes available in each class.

CONTENTS

INDEX

Amino Communications Ltd. 2010

INTRODUCTION

Document history
Version 108 107 Date issued March 2010 November 2009 Changes Minor updates and corrections. TVI Generic functions updated. Galio support information removed. Please see earlier versions of this document for information relating to the Galio browser. Information relating to deprecated functions updated. 106 105 November 2009 August 2009 Updated for Opera 9. Additional information for several functions. TVI Generic functions added. Return types for functions amended. Function prototypes changed to JavaScript form. Corrections to several functions. 104 June 2009 Removed confidentiality requirement. Update of browser support information throughout. Many functions deprecated for Opera 9. 103 January 2009 Corrections to several functions. TVI Chapter updated. Appendix D added. Media source attributes updated. 102 November 2008 Functions supported by legacy versions of browsers added. Browser support identified for each function. Document created.

101

November 2008

Amino Communications Ltd. 2010

INDEX

CONTENTS

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

CONTENTS

INDEX

Amino Communications Ltd. 2010

Chapter 1Introduction to JMACX functions

JMACX support for browser, hardware platform and some other functionality areas is dictated by whether the functionality is included in the software build. Other functionality is dependent on the software version. The table in this chapter and notes in the function descriptions indicate which functions are supported by each browser as well as indicating whether the function is limited to particular hardware platforms or build options.

1.1

Browser support

The JMACX extensions are actually several separate APIs, for communication with the Fresco, Opera 8.5 and Opera 9 browsers.

1.2

Hardware platform support

Support for some functions is also limited to certain hardware platforms. For example, the TVI functionality for controlling a television is only available on hospitality set-top boxes that have a TVI port.

1.3

Support for other build options

In addition to browser and hardware platform, other functionality is also enabled or disabled as part of a software or hardware build.

1.4

Using the API

The JMACX extensions are designed to be embedded in HTML pages loaded by the set-top box. Navigation to the page that the set-top box loads is handled by the browser. Examples of the JMACX API calls in HTML code are available in Appendix B of this document. Use of the JMACX API, and development of your own GUI, is covered in the Amino Portal Developers Guide.

1.5

Event handling

Class-specific event handlers are defined for some classes. In these cases, the event handlers generally include an Event attribute that can be used as a callback to retrieve the event code and an onEvent attribute that allows you to specify an event-handler function to call.

Amino Communications Ltd. 2010

INDEX

CONTENTS

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

1.6

Deprecated functions

Where functions are described as Deprecated, this means that the function still exists and is available to support backwards compatibility, but development of this aspect of functionality has ceased, and the function should not be called in new versions. Deprecated functions are displayed in grey text. If a function is completely removed and is no longer supported on any platform it will be listed as obsolete in Appendix D . Where a new function now supports the functionality, this is indicated in the description of the function.

1.7

Using this manual

Within each chapter the functions are displayed as follows:

JMACX.Function( )
Description
A text description of the function.

Prototype
The function prototype. See also Event handling.

Supported browsers
Browsers which support the function. See Browser support

Parameters
Details of any parameters.

Returns
The return type, if any, and values. In the tables below, Y indicates that the function is supported by a particular browser. Functions are listed in alphabetical order. Each of the supported functions is given in blue text, indicating that it is a link to the more detailed description of that function in the relevant chapter. The arrow to the right of the function name is a link back to relevant section of this chapter.

CONTENTS

INDEX

Amino Communications Ltd. 2010

INTRODUCTION TO JMACX FUNCTIONS

1.7.1

ASTB class
Fresco Opera 8.5 Opera 9 Restrictions Details

See Chapter 2, ASTB for full descriptions of these functions.

Function/attribute

ASTB - date ASTB.GetDate( ) ASTB.GetRTCTime( ) Y Y Y Y Deprecated Deprecated

ASTB - system information ASTB.GetBrowser( ) ASTB.GetHardwareVersion( ) ASTB.GetHardwareInfo( ) ASTB.GetLocked( ) ASTB.GetMacAddress( ) ASTB.GetSerialNumber( ) ASTB.GetSoftwareVersion( ) ASTB.GetStats( ) ASTB.GetSystemInfo( ) ASTB.GetSystemManufacturer( ) ASTB.GetSystemModel( ) ASTB.GetSystemSubmodel( ) ASTB.GetUSBInfo( ) Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Not A103 Deprecated Y Y Y Deprecated Y Y Y Deprecated

ASTB - power management ASTB.GetPowerState( ) ASTB.GetPowerState( ) Y Y Y Y Y Y

ASTB - mouse pointer control ASTB.GetMouseState( ) ASTB.SetMouseState( ) Y Y Y Y Y Y

ASTB - channel information ASTB.GetChannel( ) Y Y Y

Amino Communications Ltd. 2010

INDEX

CONTENTS

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Fresco

Opera 8.5

Opera 9

Restrictions

Details

Function/attribute

ASTB.GetNextChannel( ) ASTB.SaveChannels( ) ASTB.SelectChannel( ) ASTB.SetChannel( ) Y Y Y Y Y Y

Y Y Y Y

ASTB - network ASTB.GetAddress( ) ASTB.GetDHCP( ) ASTB.GetDHCPAddress( ) ASTB.GetDHCPDNS( ) ASTB.GetDHCPDomain( ) ASTB.GetDHCPGateway( ) ASTB.GetDHCPLease( ) ASTB.GetDHCPNetmask( ) ASTB.GetDHCPRebind( ) ASTB.GetDHCPRenew( ) ASTB.GetDNS( ) ASTB.GetDomain( ) ASTB.GetGateway( ) ASTB.GetIPAddress( ) ASTB.GetNetmask( ) Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Deprecated Deprecated Deprecated Deprecated Deprecated Deprecated Deprecated Deprecated Deprecated Deprecated Deprecated Deprecated Deprecated Deprecated Deprecated

ASTB - upgrade ASTB.GetDI( ) ASTB.GetUpgradeAddress( ) ASTB.GetUpgradeDI( ) ASTB.GetUpgradePort( ) ASTB.Upgrade( ) Y Y Y Y Y Y Y Y Y Y Y Deprecated Deprecated Deprecated Deprecated

ASTB - Trusted domains ASTB.GetTrustedDomain( ) ASTB.GetTrustedDomain_Domain( ) ASTB.GetTrustedDomain_Javascript( ) Y Y Y Y Y

CONTENTS

INDEX

Amino Communications Ltd. 2010

INTRODUCTION TO JMACX FUNCTIONS

Fresco

Opera 8.5

Opera 9

Restrictions

Details

Function/attribute

ASTB.GetTrustedDomain_Macrovision( ) ASTB.SaveTrustedDomains( ) ASTB.SetTrustedDomain( ) Y Y

Y Y Y Y Y

ASTB - configuration ASTB.CommitConfig( ) ASTB.GetBrowserConfig( ) ASTB.GetConfig( ) ASTB.SetBrowserConfig( ) ASTB.SetConfig( ) Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y

ASTB - VLAN Configuration ASTB.Enable2ndEthernetPort( ) ASTB.EnableVLANTagging( ) ASTB.GetExternalVLANid( ) ASTB.GetInternalVLANid( ) ASTB.GetPortRateLimit( ) ASTB.SetExternalVLANid( ) ASTB.SetInternalVLANid( ) ASTB.SetPortRateLimit( ) Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y H models only H models only H models only H models only H models only H models only H models only H models only

ASTB - miscellaneous ASTB.BlastCode( ) ASTB.DebugString( ) ASTB.DefaultKeys( ) ASTB.DeleteAllBookmarks( ) ASTB.DeleteAllCookies( ) Y Y Y Y Y Y Y Y Y Deprecated Deprecated Y Y H models only

Amino Communications Ltd. 2010

INDEX

CONTENTS

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Fresco

Opera 8.5

Opera 9

Restrictions

Details

Function/attribute

ASTB.DeleteAllHistory( ) ASTB.ErrorString( ) ASTB.FileExists( ) ASTB.GCluster( ) ASTB.GetLEDState( ) ASTB.LoadCodeSet( ) ASTB.Reboot( ) ASTB.Reflash( ) ASTB.SaveKeyFunctions( ) ASTB.SetKBDelay( ) ASTB.SetKBRepeat( ) ASTB.SetKeyFunction( ) ASTB.SetLEDState( ) ASTB.SetRemoteType( ) ASTB.Sleep( ) ASTB.VNC( ) ASTB.WithChannels( )

Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y

Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y H models only Y Y H models only Y

Deprecated Deprecated

Deprecated

Deprecated

Deprecated Deprecated

Deprecated

1.7.2

AVMedia class
Fresco Opera 8.5 Opera 9 Restriction Details

See Chapter 3, AVMedia for full descriptions of these functions.

Function/attribute

AVMedia event-handling AVMedia.Event AVMedia.EventString AVMedia.onEvent Y Y Y Y Y Y Y Y Y

AVMedia functions AVMedia.Continue( ) AVMedia.EOMFreeze( ) Y Y Y Y Y Y

10

CONTENTS

INDEX

Amino Communications Ltd. 2010

INTRODUCTION TO JMACX FUNCTIONS

Fresco

Opera 8.5

Opera 9

Restriction

Details

Function/attribute

AVMedia.GetAudioPID( ) AVMedia.GetAudioPIDList( ) AVMedia.GetAudioPIDs( ) AVMedia.GetContentName( ) AVMedia.GetCurrentSpeed( ) AVMedia.GetDefaultRTSPServer( ) AVMedia.GetDuration( ) AVMedia.GetFormat( ) AVMedia.GetMSecPos( ) AVMedia.GetMSecPosition( ) AVMedia.GetPMTPID( ) AVMedia.GetPmtProgramInfo( ) AVMedia.GetPos( ) AVMedia.GetPosition( ) AVMedia.GetPrimaryAudioLanguage( ) AVMedia.GetPrimarySubtitleLanguage( ) AVMedia.GetProgramInfo( ) AVMedia.GetProtocol( ) AVMedia.GetSecondaryAudioLanguage( ) AVMedia.GetSecondarySubtitleLanguage( ) AVMedia.GetVideoPID( ) AVMedia.Kill( ) AVMedia.Pause( ) AVMedia.Play( ) AVMedia.PlaySound( ) AVMedia.SetAudioPID( ) AVMedia.SetDefaultRTSPServer( ) AVMedia.SetHighDef( ) AVMedia.SetMSecPos( ) AVMedia.SetMSecPostion( ) AVMedia.SetPos( ) AVMedia.SetPostion( ) AVMedia.SetPrimaryAudioLanguage( )

Y Y

Y Y Y Y Y Y Y

Y Y Y Y Y

Y Y Y

Y Y Y Y

Y Y Y

Y Y Y Y Y Y Y Y Y Y Y Y Y

Y Y Y Y Y Y Y Y Y Y Y Y Y Y

Y Y Y Y Y Y Deprecated Y Y Y Y Y Y Y Y Y Deprecated

Y Y Y Y Y Y Y Y

Y Y

Y Y Y Y Y

Y Y Y Y Y

Amino Communications Ltd. 2010

INDEX

CONTENTS

11

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Fresco

Opera 8.5

Opera 9

Restriction

Details

Function/attribute

AVMedia.SetPrimarySubtitleLanguage( ) AVMedia.SetSecondaryAudioLanguage( ) AVMedia.SetSecondarySubtitleLanguage( ) AVMedia.SetSpeed( ) AVMedia.Stop( ) AVMedia.VideoHide( )

Y Y Y Y Y Y

Y Y Y Y Y Y

Y Y Y Y Y Y

1.7.3

VideoDisplay class
Fresco Opera 8.5 Opera 9 Restriction Details

See Chapter 4, VideoDisplay for full descriptions of these functions.

Function/attribute

VideoDisplay.DefaultUnloadVideo( ) VideoDisplay.FullScreen( ) VideoDisplay.GetAlphaLevel( ) VideoDisplay.GetAPS( ) VideoDisplay.GetAspect( ) VideoDisplay.GetAVAspect( ) VideoDisplay.GetChromaKey( ) VideoDisplay.GetClosedCaption( ) VideoDisplay.GetMacrovision( ) VideoDisplay.GetOutputFmt( ) VideoDisplay.GetPIG( ) VideoDisplay.GetPIGPosition( ) VideoDisplay.GetPIGScale( ) VideoDisplay.GetPIGx( ) VideoDisplay.GetPIGy( ) VideoDisplay.GetRFModFrequencyTable( ) VideoDisplay.GetRFModState() VideoDisplay.GetSubtitles( )

Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y

Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y

Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y

VideoDisplay.GetSubtitlesPreferredLanguage( ) Y VideoDisplay.GetSubtitlesSecondaryLanguage( ) Y

12

CONTENTS

INDEX

Amino Communications Ltd. 2010

INTRODUCTION TO JMACX FUNCTIONS

Fresco

Opera 8.5

Opera 9

Restriction

Details

Function/attribute

VideoDisplay.GetTeletext( ) VideoDisplay.GetTeletextFullscreen( ) VideoDisplay.GetTVStandard() VideoDisplay.GetVideoWindow()

Y Y

Y Y Y Y Not supported on A530

Y Y

VideoDisplay.GetUHFChannel( ) VideoDisplay.IgnoreSlaveUpdates( ) VideoDisplay.IgnoreUpdates( ) VideoDisplay.MaxWindows( ) VideoDisplay.RetainAlphaLevel( ) VideoDisplay.RetainMouseState( ) VideoDisplay.SetAlphaLevel( ) VideoDisplay.SetAlphaRect( ) VideoDisplay.SetAPS( ) VideoDisplay.SetAspect( ) VideoDisplay.SetAVAspect( ) VideoDisplay.SetAVAspectSwitching( ) VideoDisplay.SetChromaKey( ) VideoDisplay.SetClosedCaption( ) VideoDisplay.SetClosedCaptionOutput( ) VideoDisplay.SetMacrovision( ) VideoDisplay.SetOutputFmt( ) VideoDisplay.SetPIG( ) VideoDisplay.SetPIGPosition( ) VideoDisplay.SetPIGScale( ) VideoDisplay.SetRFModFrequencyTable( ) VideoDisplay.SetRFModState( ) VideoDisplay.SetSubtitles( )

Y Y

Y Deprecated

Y Y Y Deprecated Deprecated Y Deprecated Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Deprecated

Y Y Y

Y Y Y Y

Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y

Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y

VideoDisplay.SetSubtitlesPreferredLanguage( ) Y VideoDisplay.SetSubtitlesSecondaryLanguage( ) VideoDisplay.SetTeletext( ) VideoDisplay.SetTeletextFullscreen( ) VideoDisplay.SetUHFChannel( ) Y Y Y

Amino Communications Ltd. 2010

INDEX

CONTENTS

13

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Fresco

Opera 8.5

Opera 9

Restriction

Details

Function/attribute

VideoDisplay.UnloadVideo( )

1.7.4

AudioControl class
Fresco Opera 8.5 Opera 9 Restriction Details

See Chapter 5, AudioControl for full descriptions of these functions.

Function/attribute callback

Event Handling AudioControl.Event AudioControl.onVolumeChange( ) Control Functions AudioControl.GetAC3DownMix( ) AudioControl.GetAC3DRC( ) AudioControl.GetAC3Dualmono( ) AudioControl.GetAC3Outmode( ) AudioControl.GetDefaultVolume( ) AudioControl.GetMaxVolume( ) AudioControl.GetMinVolume( ) AudioControl.GetMute( ) AudioControl.GetVolume( ) AudioControl.SetAC3Downmix( ) AudioControl.SetAC3DRC( ) AudioControl.SetAC3Dualmono( ) AudioControl.SetAC3Outmode( ) AudioControl.SetAudioMix( ) AudioControl.SetDefaultVolume( ) AudioControl.SetMaxVolume( ) AudioControl.SetMinVolume( ) AudioControl.SetMute( ) AudioControl.SetRFAudioBoost( ) AudioControl.SetVolume( ) Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Deprecated Deprecated

14

CONTENTS

INDEX

Amino Communications Ltd. 2010

INTRODUCTION TO JMACX FUNCTIONS

1.7.5

Browser class
Fresco Opera Opera 9 Restriction Details

See Chapter 6, Browser for full descriptions of these functions.

Function/attribute

Browser.Action( )

Supported in Opera 9 from 0.15.0 onwards.

Browser.CacheFlush( ) Browser.FrameLoadResetsState( ) Browser.GetToolbarState( ) Browser.GoBack( ) Browser.GogiAction( ) Browser.GoHome( ) Browser.Lower( ) Browser.PopConfig( ) Browser.PushConfig( ) Browser.Raise( ) Browser.SetToolbarState( ) Browser.SpatialNavigation( ) Y Y Y Y Y

Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y

1.7.6

AminoGeneric class
Fresco Opera 8.5 Opera 9 Restrictions Details

See Chapter 7, AminoGeneric for full descriptions of these functions.

Function/attribute

AminoGeneric.Call( ) AminoGeneric.onEvent<service_id>

Y Y

Y Y

Y Y

Amino Communications Ltd. 2010

INDEX

CONTENTS

15

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

1.7.7

TVI class
Fresco Opera 8,5 Opera 9 Restrictions Details

See Chapter 8, TVI for full descriptions of these functions.

Function/attribute

Event handling TVI.onEvent TVI functions TVI.Configure( ) Y Y Y H models only. Philips only. TVI.CustomCommand( ) TVI.DetectTV( ) TVI.DisplayNumber( ) Y Y Y Y Y Y Y Y H models only H models only H models only. Philips only TVI.DisplayText( ) TVI.GetFeatures( ) TVI.GetIsTvOn( ) TVI.GetMaxVolume( ) TVI.GetMinVolume( ) TVI.GetMute( ) TVI.GetStartupVolume( ) TVI.GetVersion( ) TVI.GetVolume( ) TVI.ProcessUnhandledKey( ) TVI.RemoteFormatIn( ) Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y H models only H models only H models only H models only H models only H models only H models only H models only H models only H models only H models only. Philips only Y Y H models only

16

CONTENTS

INDEX

Amino Communications Ltd. 2010

INTRODUCTION TO JMACX FUNCTIONS

Fresco

Opera 8,5

Opera 9

Restrictions

Details

Function/attribute

TVI.SelectTeletext( ) TVI.SetChannel( ) TVI.SetInput( ) TVI.SetKeyLock( ) TVI.SetMaxVolume( ) TVI.SetMinVolume( ) TVI.SetMute( ) TVI.SetOSD( ) TVI.SetStartupVolume( ) TVI.SetTvType( ) TVI.SetupClosedCaption( )

Y Y Y Y Y Y Y Y Y Y Y

Y Y Y Y Y Y Y Y Y Y Y

Y Y Y

H models only H models only H models only H models only

Y Y Y

H models only H models only H models only H models only

Y Y Y

H models only H models only H models only. Not Zenith. H models only H models only H models only H models only H models only H models only

TVI.SetVolume( ) TVI.SystemInfo( ) TVI.TVOff( ) TVI.TVOn( ) TVI.VolumeDown( ) TVI.VolumeUp( ) Generic TVI functions TVI.Setup( ) TVI.Send( )

Y Y Y Y Y Y

Y Y Y Y Y Y

Y Y Y Y Y Y

Y Y

Y Y

Y Y

H models only H models only

Amino Communications Ltd. 2010

INDEX

CONTENTS

17

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Fresco

Opera 8,5

Opera 9

Restrictions

Details

Function/attribute

TVI.Event( )

H models only

18

CONTENTS

INDEX

Amino Communications Ltd. 2010

Chapter 2ASTB

The primary function of the STB is to display Video on Demand (VoD). Amino software provides the ASTB class which allows interaction with general set-top box functionality, giving the ability to control and receive a video stream, Internet browsing on the attached TV Set and delivery of other services such as Broadcast TV (as part of multicast streams). The software is engineered to run a variety of customer specific application software and middleware.

2.1

ASTB date functions

The following ASTB date functions are supported.

ASTB.GetDate( )
Description
Deprecated. Returns the current date as a string.

Prototype
string ASTB.GetDate()

Supported browsers
Ant Fresco Opera 8.5

Parameters
None.

Returns
The set-top boxs date as a string in the format dd/mm/yyyy. For example, 28/03/2009.

Amino Communications Ltd. 2010

INDEX

CONTENTS

19

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

ASTB.GetRTCTime( )
Description

Deprecated. Returns the date and time from the real-time clock (RTC), whether the RTC is
enabled and what it is set to is a customer-specific setting. By default, the RTC is not enabled, so in this case the date and time returned will not be correct.

Prototype
string ASTB.GetRTCTime()

Supported browsers
Ant Fresco Opera 8.5

Parameters
None.

Returns
Fresco: Nothing if the Fresco kernel version is not 26. Otherwise, the function returns a date and time string in the format: dd/mm/yyyy hh:mm:ss, or BAD TIME\n. Opera: A date and time string in the format: dd/mm/yyyy hh:mm:ss, or BAD TIME\n. Note: Calls to this function on platforms other than the AmiNET 500 will return either BAD TIME\n or null, as these platforms do not have a real-time clock.

2.2

ASTB system information functions

System information includes details such as version number, MAC address and middleware. The following system information functions are supported.

ASTB.GetBrowser( )
Description
Returns the name of the browser software.

Prototype
string ASTB.GetBrowser()

20

CONTENTS

INDEX

Amino Communications Ltd. 2010

ASTB

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
None.

Returns
A browser name such as fresco or opera.

ASTB.GetHardwareVersion( )
Description
Returns the PCB hardware version.

Prototype
string ASTB.GetHardwareVersion()

Supported browsers
Opera 8.5 Opera 9

Parameters
None.

Returns
A hardware version string such as 1 or returns FAIL on error.

ASTB.GetHardwareInfo( )
Description
Returns details of the hardware type associated with the STB.

Prototype
string ASTB.GetHardwareInfo(string type)

Amino Communications Ltd. 2010

INDEX

CONTENTS

21

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
Parameters type Allowed values cputype cpuspeed sdram flash romtype Description The type of parameter to return.

Returns
Returns the value associated with the type of parameter to return. For example ASTB.GetHardwareInfo(sdram) could return 89332kB.

ASTB.GetLocked( )
Description

Deprecated. Returns the lock status (whether the locking bit is set) of the NOR flash. You are
recommended to use ASTB.GetConfig(NORFLASH.LOCK ) as a replacement for this function.

Prototype
string ASTB.GetLocked()

Supported browsers
Ant Fresco Opera 8.5

Parameters
None.

Returns
0 for unlocked, 1 for locked, or FAIL on error.

22

CONTENTS

INDEX

Amino Communications Ltd. 2010

ASTB

ASTB.GetMacAddress( )
Description
Returns the MAC address of the set-top box.

Prototype
string ASTB.GetMacAddress()

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
None.

Returns
the MAC address as a string or returns FAIL on error.

ASTB.GetSerialNumber( )
Description
Returns the serial number of the set-top box.

Prototype
string ASTB.GetSerialNumber()

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
None.

Returns
a serial number string such as 104605D312633 or returns FAIL on error.

Amino Communications Ltd. 2010

INDEX

CONTENTS

23

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

ASTB.GetSoftwareVersion( )
Description
Returns the full software version string.

Prototype
string ASTB.GetSoftwareVersion()

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
None.

Returns
a software version string such as 0.15.4-aminet110-frescoj27-ami_wm, or returns FAIL on error.

ASTB.GetStats( )
Description

Deprecated. Returns statistics on memory and processes running on the set-top box. The
strings returned can be evaluated using the JavaScript eval function, and their contents accessed as objects, as described in the Return section.

Prototype
string ASTB.GetStats(number opt)

Supported browsers
Ant Fresco Opera 8.5

Parameters
Parameters opt Allowed values 1 memory statistics 2 process statistics Description The type of statistics to retrieve.

24

CONTENTS

INDEX

Amino Communications Ltd. 2010

ASTB

Returns
Attribute Type[0,1] Type object Description Array of 2 objects. The first object - Type[0] contains values for RAM. The second - Type[1] is for Swap memory values. Total memory in set-top box (KB). Used memory in set-top box (KB). Free memory in set-top box (KB).

Type[x].Total string Type[x].Used Type[x].Free Process statistics: string string

{proc:[{PID:<pid_no>},VmSize:<???_size>,VmRSS: <mem_used>,VmExe:<exe_size>,VmData:<mem_data>,VmStack: <stack_size>,Name:<process_name>}], entries:<count_of_PIDs>} Usage examples Retrieve memory statistics: var memstr = ASTB.GetStats(1); var memobj = eval( ( + memstr + ) ); //memobj can then be accessed as follows: // return value for total memory: var total = memobj.Type[0].Total // return value for Free Swap: var free = memobj.Type[1].Free Retrieve process statistics: var psstr = ASTB.GetStats(0); var psobj = eval( ( + psstr + ) ); //psobj can then be accessed as follows: // return total number of entries in the array var psentries = psobj.entries // return ID of first process in the array psobj.proc[0].PID // return name of first process in the array psobj.proc[0].Name

ASTB.GetSystemInfo( )
Description
Returns an XML string containing version information.

Prototype
string ASTB.GetSystemInfo()

Amino Communications Ltd. 2010

INDEX

CONTENTS

25

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
None.

Returns
FAIL on error. Otherwise, it returns a string with content in the following format (note that line breaks are only included here to make it easier to read, they are not included in the return string): <xml> <aminoVersion>version_string</aminoVersion> <aminoCVersion>custom_resources_string</aminoCVersion> <oemVersion>contents_of_oemversion_file</oemVersion> </xml> Note that if there is no oemversion file in /mnt/nv, then the string will not include <oemVersion>...</oemVersion>. Example of return string: <xml> <aminoVersion>0.11.0-A130-opera-gogi-cc</aminoVersion> <aminoCVersion>0.11.0-A130-gogi</aminoCVersion> </xml> If you are adding an oemversion file to a set-top box, you will need to do it as part of the process of creating the software image that is installed on the set-top box. See the Amino Installation and Upgrade Guide for more information on this, and on the build and customisation processes.

ASTB.GetSystemManufacturer( )
Description
Returns the name of the set-top box manufacturer.

Prototype
string ASTB.GetSystemManufacturer()

26

CONTENTS

INDEX

Amino Communications Ltd. 2010

ASTB

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
None.

Returns
Amino Communications Ltd or returns FAIL on error.

ASTB.GetSystemModel( )
Description
Returns the set-top box type.

Prototype
string ASTB.GetSystemModel()

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
None.

Returns
a box type such as aminet130 or returns FAIL on error.

Amino Communications Ltd. 2010

INDEX

CONTENTS

27

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

ASTB.GetSystemSubmodel( )
Description

Returns the sub model of the main AmiNET product. For instance, aminet130M as a submodel of the AmiNET130.

Prototype
string ASTB.GetSystemSubmodel()

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
None

Returns
a sub-model type such as aminet130M or returns FAIL on error.

ASTB.GetUSBInfo( )
Description
Deprecated. Returns the configuration of a device plugged into the USB.

Prototype
string ASTB.GetUSBInfo()

Supported browsers
Ant Fresco Opera 8.5 Not AmiNET 103.

Parameters
None.

Returns

28

CONTENTS

INDEX

Amino Communications Ltd. 2010

ASTB

the device descriptor, product ID and other configuration as a string, (for example, Ver= 1.10 Cls=00(>ifc) Sub=00 Prot=00 MxPS= 8 #Dfgs 1Vendor=04d8 ProdID=0001 Rev= 0.00Manufacturer=Home ElectronicsProduct=tira-3 (beta)). Returns an empty string if there is no USB device plugged into the board.

2.3
2.3.1
Active

ASTB power management functions


Power management

The following power management function are supported.

The ASTB defines the following modes of operation: Stand-by Off (this state is dependant on mains power, and so is not under the control of the set-top box software, note also that this state is PCB and processor-dependent).

2.3.1.1 Stand-by state


In this state, the screen output and LED are switched off, and power consumption is reduced to a minimum level. The box can be switched between stand-by and active/idle using the Power button on the IR remote control and by the ASTB.GetPowerState( ) function: State POWER_STANDBY POWER_ACTIVE Integer 2 4

ASTB.GetPowerState( )
Description
Retrieves the current state of the set-top box.

Prototype
number ASTB.GetPowerState()

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
None.

Amino Communications Ltd. 2010

INDEX

CONTENTS

29

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Returns
nothing if this functionality is not compiled. Otherwise, it returns one of the set-top box state constants listed in "Stand-by state" on page 29 according to the state of the set-top box.

ASTB.SetPowerState( )
Description
Changes the state of the set-top box.

Prototype
ASTB.SetPowerState(number state)

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
Parameters state Allowed values 2 standby 4 active Description The power state required.

Returns
nothing.

30

CONTENTS

INDEX

Amino Communications Ltd. 2010

ASTB

2.4

ASTB mouse pointer functions

Mouse pointer functions allow you to change the visibility of the mouse pointer or determine the current visibility state.

ASTB.GetMouseState( )
Description
Returns the current visibility state for the mouse pointer.

Prototype
number ASTB.GetMouseState()

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
None.

Returns
0 if the mouse pointer is invisible, 1 if it is visible.

ASTB.SetMouseState( )
Description
Makes the mouse pointer visible or invisible. After the mouse pointer is made invisible, it is displayed again either by using this function to reset it or by navigating to another page.

Prototype
ASTB.SetMouseState(number displaystate)

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Amino Communications Ltd. 2010

INDEX

CONTENTS

31

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Parameters
Parameters displaystate Allowed values 1 or 0 Description Set 1 to make the mouse pointer visible, otherwise, set 0.

Returns
nothing.

2.5

ASTB channel functions

Channel functions allow you to change the channel on the set-top box, set new channels and determine information associated with channels. The following channel functions are supported.

ASTB.GetChannel( )
Description
Retrieve the URL associated with the specified channel number.

Prototype
string ASTB.GetChannel(number channel_number)

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
Parameters channel_number Allowed values 0 - 999 Description Channel number to retrieve URL for.

Returns
nothing if there is an error parsing the parameter entered. otherwise, the function returns a URL string (null if there is an error).

32

CONTENTS

INDEX

Amino Communications Ltd. 2010

ASTB

ASTB.GetNextChannel( )
Description
Selects the next channel in the channels list.

Prototype
number ASTB.GetNextChannel(number current_channel, number direction)

Supported browsers
Opera 9

Parameters
Parameters direction Allowed values -1 or +1 Description A value of -1 indicates that the channel number is decreased, a value of +1 indicates that the channel number is increased. The current channel number.

current_channel

0-999

Returns
the value of the next channel number.

ASTB.SaveChannels( )
Description
Saves the current channel list to the chnls.txt file, so that the values in the list are preserved when the set-top box reboots. Note: The channels list is in:/mnt/nv/.

Prototype
string ASTB.SaveChannels()

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
None.

Amino Communications Ltd. 2010

INDEX

CONTENTS

33

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Returns
OK if the list is saved successfully or FAIL if there is an error.

ASTB.SelectChannel( )
Description
Change the channel to the specified channel number.

Prototype
number ASTB.SelectChannel(number channel_number)

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
Parameters channel_number Allowed values 0 - 999 Description The channel number to change to.

Returns
nothing if there is an error parsing the parameter entered. Otherwise, the function returns 0 if the specified channel exists in the channel list, or returns -1 on error.

ASTB.SetChannel( )
Description
Associates the specified channel number with the specified URL.

Prototype
string ASTB.SetChannel(number channel_number, string url)

Supported browsers
Ant Fresco Opera 8.5 Opera 9

34

CONTENTS

INDEX

Amino Communications Ltd. 2010

ASTB

Parameters
Parameters channel_number url Allowed values 0 - 999 Description Channel number that you want to set the URL for. URL to associate with the channel number.

Returns
nothing if there is an error parsing the parameter entered. Otherwise, the function returns OK if the change is successful, or FAIL if there is an error.

2.6

ASTB network functions

Network information includes details such as IP addresses, domain name server and other network components, as well as currently assigned DHCP values. A number of functions enable access to this information, depending on whether DHCP is enabled or disabled in the set-top box. For each parameter there is a function to access it if DHCP is disabled, and a function to access it DHCP is enabled, including DHCP-specific values. and determining whether DHCP is enabled. The values are generally derived from values in the NOR flash or the settings file.

ASTB.GetAddress( )
Description
Deprecated. Returns the statically configured IP address.You are recommended to use

ASTB.GetConfig("NETCONF.IPADDR") for static or ASTB.GetConfig("DHCPC.IPADDR")for DHCP configured IP address.

Prototype
string ASTB.GetAddress()

Supported browsers
Ant Fresco Opera 8.5

Parameters
None.

Returns
a string containing the IP address (null if none set).

Amino Communications Ltd. 2010

INDEX

CONTENTS

35

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

ASTB.GetDHCP( )
Description

Deprecated. Finds out whether DHCP is enabled for a set-top box. This is useful to determine
how to request other network settings whether to request DHCP assigned values or statically configured values. You are recommended to use ASTB.GetConfig("NETCONF.DHCP")as a replacement for this function.

Prototype
string ASTB.GetDHCP()

Supported browsers
Ant Fresco Opera 8.5

Parameters
None.

Returns
n if DHCP is disabled, y or other string value if it is enabled (since any value other than n in configuration enables DHCP). The function returns null if the value has not been set.

ASTB.GetDHCPAddress( )
Description

Deprecated. Returns the IP address assigned by the DHCP server. You are recommended to
use ASTB.GetConfig("DHCPC.IPADDR") as a replacement for this function in order to determine the DHCP configured IP address

Prototype
string ASTB.GetDHCPAddress()

Supported browsers
Ant Fresco Opera 8.5

Parameters
None.

36

CONTENTS

INDEX

Amino Communications Ltd. 2010

ASTB

Returns
a string containing the IP address (null if no value retrieved from DHCP server).

ASTB.GetDHCPDNS( )
Description
Deprecated. Returns the DNS IP address assigned by the DHCP server. You are recommended to use ASTB.GetConfig("DHCPC.DNS") as a replacement for this function.

Prototype
string ASTB.GetDHCPDNS()

Supported browsers
Ant Fresco Opera 8.5

Parameters
None.

Returns
a string containing the IP address (null if no value retrieved from DHCP server).

ASTB.GetDHCPDomain( )
Description

Deprecated. Returns the domain name assigned by the DHCP server. You are recommended
to use ASTB.GetConfig("DHCPC.DOMAIN") as a replacement for this function

Prototype
string ASTB.GetDHCPDomain()

Supported browsers
Ant Fresco Opera 8.5

Parameters
None.

Amino Communications Ltd. 2010

INDEX

CONTENTS

37

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Returns
a string containing the domain name (null if no value retrieved from DHCP server).

ASTB.GetDHCPGateway( )
Description

Deprecated. Returns the gateway IP address assigned by the DHCP server. You are recommended to use ASTB.GetConfig("DHCPC.GATEWAY") as a replacement for this function

Prototype
string ASTB.GetDHCPGateway()

Supported browsers
Ant Fresco Opera 8.5

Parameters
None.

Returns
a string containing the IP address (null if no value retrieved from DHCP server).

ASTB.GetDHCPLease( )
Description

Deprecated. Returns the lease time assigned by the DHCP server. You are recommended to
use ASTB.GetConfig("DHCPD.LEASETIME") as a replacement for this function.

Prototype
string ASTB.GetDHCPLease()

Supported browsers
Ant Fresco Opera 8.5

38

CONTENTS

INDEX

Amino Communications Ltd. 2010

ASTB

Parameters
None.

Returns
a string containing the lease time in seconds (null if no value is retrieved from DHCP server).

ASTB.GetDHCPNetmask( )
Description

Deprecated. Returns the netmask assigned by the DHCP server. You are recommended to
use ASTB.GetConfig("DHCPC.NETMASK") as a replacement for this function.

Prototype
string ASTB.GetDHCPNetmask()

Supported browsers
Ant Fresco Opera 8.5

Parameters
None.

Returns
a string containing the netmask (null if no value is retrieved from DHCP server).

ASTB.GetDHCPRebind( )
Description

Deprecated. Returns the rebind time assigned by the DHCP server. You are recommended
to use ASTB.GetConfig("DHCPD.REBINDTIME") as a replacement for this function.

Prototype
string ASTB.GetDHCPRebind()

Supported browsers
Ant Fresco Opera 8.5

Amino Communications Ltd. 2010

INDEX

CONTENTS

39

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Parameters
None.

Returns
a string containing the rebind time in seconds (null if no value is retrieved from the DHCP server).

ASTB.GetDHCPRenew( )
Description

Deprecated. Returns the renew time assigned by the DHCP server. You are recommended to use ASTB.GetConfig("DHCPD.RENEWALTIME") as a replacement for this function.

Prototype
string ASTB.GetDHCPRenew()

Supported browsers
Ant Fresco Opera 8.5

Parameters
None.

Returns
a string containing the renew time in seconds (null if no value is retrieved from the DHCP server).

ASTB.GetDNS( )
Description

Deprecated. Returns the statically configured DNS IP address. You are recommended to use
ASTB.GetConfig("NETCONF.DNS") as a replacement for this function.

Prototype
string ASTB.GetDNS()

Supported browsers
Ant Fresco Opera 8.5

40

CONTENTS

INDEX

Amino Communications Ltd. 2010

ASTB

Parameters
None.

Returns
a string containing the DNS IP address (null if none set).

ASTB.GetDomain( )
Description

Deprecated. Returns the statically configured domain name. You are recommended to use
ASTB.GetConfig("NETCONF.DOMAIN") as a replacement for this function.

Prototype
string ASTB.GetDomain()

Supported browsers
Ant Fresco Opera 8.5

Parameters
None.

Returns
a string containing the domain name (null if none set).

ASTB.GetGateway( )
Description

Deprecated. Returns the statically configured gateway IP address. You are recommended to
use ASTB.GetConfig("NETCONF.GATEWAY") as a replacement for this function.

Prototype
string ASTB.GetGateway()

Supported browsers
Ant Fresco Opera 8.5

Amino Communications Ltd. 2010

INDEX

CONTENTS

41

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Parameters
None.

Returns
a string containing the gateway IP address (null if none set).

ASTB.GetIPAddress( )
Description

Deprecated. Returns the current IP address. You are recommended to use ASTB.GetConfig("NETCONF.IPADDRESS") as a replacement for this function.

Prototype
string ASTB.GetIPAddress()

Supported browsers
Ant Fresco Opera 8.5

Parameters
None.

Returns
a string containing the current IP address (for example, 234.56.78.9) or returns FAIL on error.

ASTB.GetNetmask( )
Description
Deprecated.Returns the statically configured netmask. You are recommended to use
ASTB.GetConfig("NETCONF.NETMASK") as a replacement for this function.

Prototype
string ASTB.GetNetmask()

Supported browsers
Ant Fresco Opera 8.5

42

CONTENTS

INDEX

Amino Communications Ltd. 2010

ASTB

Parameters
None.

Returns
a string containing the netmask (null if none set).

2.7

ASTB upgrade functions

Upgrade functions allow you to upgrade the set-top box software and to determine information associated with upgrading software. The following upgrade functions are supported.

ASTB.GetDI( )
Description

Deprecated. Retrieves the deployment index (DI) of the software currently installed on the
set-top box, from the NOR flash. You are recommended to use ASTB.GetConfig("NORFLASH.DI") as a replacement for this function.

Prototype
string ASTB.GetDI()

Supported browsers
Ant Fresco Opera 8.5

Parameters
None.

Returns
a string containing the deployment index. The function returns FAIL if the DI is a null (that is, no value is set).

ASTB.GetUpgradeAddress( )
Description

Deprecated. Returns the IP address that the set-top box can read upgrades from (from the
DHCP server). You are recommended to use ASTB.GetConfig("DHCPC.MULTICAST_FS_ADDR") as a replacement for this function.

Amino Communications Ltd. 2010

INDEX

CONTENTS

43

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Prototype
string ASTB.GetUpgradeAddress()

Supported browsers
Ant Fresco Opera 8.5

Parameters
None.

Returns
a string containing the IP address. The function returns FAIL if this is null (no value set).

ASTB.GetUpgradeDI( )
Description

Deprecated. Returns the deployment index (DI) of the available upgrade (as specified in the
DHCP configuration file with the AMINO.dindex_min vendor option). You are recommended to use ASTB.GetConfig("DHCPC.DI") as a replacement for this function.

Prototype
string ASTB.GetUpgradeDI()

Supported browsers
Ant Fresco Opera 8.5

Parameters
None.

Returns
a string containing the DI number of the upgrade. The function returns FAIL if this is not retrieved or is null (that is, no value is set).

44

CONTENTS

INDEX

Amino Communications Ltd. 2010

ASTB

ASTB.GetUpgradePort( )
Description

Deprecated. Returns the port that the set-top box can read upgrades from (from the DHCP
server). You are recommended to use ASTB.GetConfig("DHCPC.MULTICAST_FS_PORT") as a replacement for this function.

Prototype
string ASTB.GetUpgradePort()

Supported browsers
Ant Fresco Opera 8.5

Parameters
None.

Returns
a string containing the port number. The function returns FAIL if this is null (that is, no value is set).

ASTB.Upgrade( )
Description

Instructs the set-top box to upgrade its software using the software upgrade carousel transmitted by the multicast server (only multicast upgrade is supported). If addr and port are not supplied, that is ASTB.Upgrade() then the STB will check for an addr and port value from the DHCP lease that is has been given (AMINO.addr and AMINO.port vendor options in the fisys class). If no values are available via the DHCP lease, an ASTB.Reflash( ) will be performed. Note: If addr and port are supplied as empty strings, for example, ASTB.Upgrade(, ) then the STB will perform a REFLASH.

Prototype
number ASTB.Upgrade([string addr, string port])

Supported browsers
Ant Fresco Opera 8.5

Amino Communications Ltd. 2010

INDEX

CONTENTS

45

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Opera 9

Parameters
Parameters addr port Allowed values Description Multicast upgrade IP address. Multicast upgrade port number.

Returns
nothing if there is an error parsing the parameters entered. The function returns -1 if either the address or port entered is null and returns 0 on other error. Otherwise, the upgrade process has started.

2.8

ASTB trusted domains functions

Trusted domains functions allow you to limit browser access to trusted domains. To enable trusted domains, call ASTB.SetBrowserConfig( ) with the value WITH_TRUSTED_DOMAINS. See ASTB.SetBrowserConfig( ) on page 53 for details.

ASTB.GetTrustedDomain( )
Description
Retrieves information about the specified trusted domain.

Note: For Fresco, information about the trusted domains is included in the return value of the function. Note: For Opera, the return value only indicates success or failure.

Prototype
Fresco: object ASTB.GetTrustedDomain(number num) Opera: object ASTB.GetTrustedDomain(number num)

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
Parameters num Allowed values Description Position of trusted domain that you need information about.

Returns

46

CONTENTS

INDEX

Amino Communications Ltd. 2010

ASTB

an object that contains the following attributes. Attribute domain javascript macrovision Type string number number Description The full or partial URL or IP address that is trusted. 1 if JMACX calls are enabled for this domain. 0 if JMACX calls are disabled. 1 if Macrovision is enabled for this domain. 0 if Macrovision is disabled.

Note: If there is an error parsing the parameter entered, the object returned will have a single attribute domain with a NULL as its value

ASTB.GetTrustedDomain_Domain( )
Description

Retrieves the URL or IP address for a trusted domain. A call to this function must follow a call to ASTB.GetTrustedDomain( ), or no value will be held.

Prototype
string ASTB.GetTrustedDomain_Domain()

Supported browsers
Opera 8.5

Parameters
None.

Returns
a string containing the domain URL or IP address if successful, otherwise, the function returns null.

ASTB.GetTrustedDomain_Javascript( )
Description

Whether JavaScript is enabled for a trusted domain. A call to this function must follow a call to ASTB.GetTrustedDomain( ), or no value will be held.

Prototype
number ASTB.GetTrustedDomain_Javascript()

Amino Communications Ltd. 2010

INDEX

CONTENTS

47

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Supported browsers
Opera 8.5

Parameters
None.

Returns
1 if JavaScript calls are enabled for this domain, 0 if they are disabled.

ASTB.GetTrustedDomain_Macrovision( )
Description

Whether Macrovision is enabled for a trusted domain. A call to this function must follow a call to ASTB.GetTrustedDomain( ), or no value will be held.

Prototype
number ASTB.GetTrustedDomain_Macrovision()

Supported browsers
Opera 8.5

Parameters
None.

Returns
1 if Macrovision is enabled for this domain, 0 if it is disabled.

ASTB.SaveTrustedDomains( )
Description
Saves the entered list of trusted domains to NV RAM as /mnt/nv/trsdmns.txt.

Prototype
string ASTB.SaveTrustedDomains(string password)

Supported browsers
Ant Fresco Opera 8.5

48

CONTENTS

INDEX

Amino Communications Ltd. 2010

ASTB

Opera 9

Parameters
Parameters password Allowed values Description The password to enable the operations from the trusted domain (this is a cleartext password, that is, the call could be written as ASTB.SaveTrustedDomains (leaves)). The Management password put into the JavaScript page is therefore in the clear.

Warning: Amino strongly recommends that you change the default passwords when deploying our set-top boxes. See Section 4.4 of the Amino Installation and Upgrade Guide for information on changing these default passwords.

Returns
OK if successful, otherwise, the function returns FAIL password if the password is incorrect or FAIL for other errors.

ASTB.SetTrustedDomain( )
Description
Configures a trusted domain entry at the specified position.

Prototype
string ASTB.SetTrustedDomain(number num, string domain, number js, number macrovision)

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Amino Communications Ltd. 2010

INDEX

CONTENTS

49

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Parameters
Parameters num Allowed values Description Position in the table of trusted domain values to add the trusted domain entry at. The URL or IP address to set as the trusted domain. This can be a full address or a partial address prefixed or postfixed with *. 0 or 1 Set 1 to enable JMACX calls for this domain and 0 to disable JMACX calls. Set 1 to enable Macrovision for this domain and 0 to disable Macrovision.

domain

js

macrovision

0 or 1

Returns
Nothing if there is an error parsing one of the input arguments. Otherwise, the function returns OK on success or FAIL on error.

2.9
Warning:

ASTB configuration functions

Configuration functions allow you to create and set values in the configuration files of the set-top box. Amino strongly recommends that you change the default passwords when deploying our set-top boxes. See Section 4.4 of the Amino Installation and Upgrade Guide for information on changing these default passwords.

The ASTB.SetConfig( ) and ASTB.GetConfig( ) functions can instruct libconfig to set or read any of the values that it can access in the settings file, hostname file, netconf file and NOR flash. See the Amino Set-top Box Configuration Manual for details of the relevant settings. The ASTB.SetBrowserConfig( ) and ASTB.GetBrowserConfig( ) functions can set or read the following browser configuration (both settings and values must be entered as strings): Configuration item WITH_TRUSTED_DOMAINS Description Enable or disable trusted domains (1 or 0, respectively). Not supported on Opera9. HOMEPAGE URL for browser home page. Example: http:// www.aminocom.com URL for help page. Example: http://www.aminocom.com Not supported on Opera9. USE_PROXY Enable or disable proxy server (1 or 0, respectively). Not supported on Opera 9.

HELPPAGE

50

CONTENTS

INDEX

Amino Communications Ltd. 2010

ASTB

Configuration item ACCEPT_COOKIES

Description Accept or do not accept cookies (1 or 0, respectively). Not supported on Opera 9. Disk cache size. Example: 4096 Not supported on Opera 9.

DISK_CACHE

RAM_CACHE

RAM cache size. Example: 4096 Not supported on Opera 9.

HTTP_PROXY

HTTP proxy in format <host>:<port>. Example: proxy1:2000 Not supported on Opera 9.

HTTPS_PROXY

HTTPS proxy in format <host>:<port>. Example: proxy2:2000 Not supported on Opera 9.

FTP_PROXY

FTP proxy in format <host>:<port>. Example: proxy3:2000 Not supported on Opera 9.

LEFT_MARGIN RIGHT_MARGIN TOP_MARGIN BOTTOM_MARGIN

Width of left margin (percentage). Example: 4. Width of right margin (percentage). Example: 4. Height of top margin (percentage). Example: 4. Height of bottom margin (percentage). Example: 4. Margin colour (decimal or hexadecimal RRGGBB value). Example: 6303776 (decimal). Opera Gogi only Not supported in Opera9.

COLOUR_MARGIN

ASTB.CommitConfig( )
Description

Commits the changed configuration values to non-volatile storage, so that they persist when the set-top box reboots. This function allows you to change several settings at once with several calls toASTB.SetConfig( ), then commit all the changes at once.

Amino Communications Ltd. 2010

INDEX

CONTENTS

51

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Prototype
number ASTB.CommitConfig()

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
None.

Returns
0 if the changes are successfully stored, otherwise, the function returns -1.

ASTB.GetBrowserConfig( )
Description
Reads the value of the specified browser configuration item. See ASTB configuration functions on page 50 for a list of configuration items.

Prototype
string ASTB.GetBrowserConfig(string config_item)

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters.
Parameters config_item Allowed values Description String containing the name of the configuration item that you want to read the value of. See the ASTB configuration functions on page 50 for a list of configuration item names.

52

CONTENTS

INDEX

Amino Communications Ltd. 2010

ASTB

Returns
The value of the specified configuration item if successful. The function returns [UNKNOWN STRING] if the name of the configuration item is not recognised or returns [BAD KEY] if there is an error in parsing the value assigned to the configuration item.

ASTB.GetConfig( )
Description
Reads the value that the specified libconfig configuration element is set to. Note: This function calls the libconfig-get command.

Prototype
string ASTB.GetConfig(string element)

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
Parameters element Allowed values any string Description The libconfig configuration element (e.g. NORFLASH.DI).

Returns
Nothing if there is an error parsing the parameter entered. Otherwise, the function returns the current value as a string, or FAIL if the element is undefined.

ASTB.SetBrowserConfig( )
Description

Configures specified browser functionality. See ASTB configuration functions on page 50 for configuration settings and their allowed values. Note that settings and values must be entered as strings. If you want the change to persist when the set-top box reboots, you should follow calls to ASTB.SetBrowserConfig with a call to ASTB.CommitConfig( ).

Prototype
string ASTB.SetBrowserConfig(string password, string config_item, string value)

Amino Communications Ltd. 2010

INDEX

CONTENTS

53

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
Parameters password Allowed values Description The password for the mngwrite user, as required for changing settings on the Management pages of the set-top box. See the Amino Set-top box Configuration Guide for more information. String containing the configuration item to set (see ASTB configuration functions on page 50 for list of configuration items and their values). String containing the value to set the specified configuration item. Suitable values depend on the specified config_item.

config_item

value

Returns
nothing if there is an error parsing the first input parameter. Otherwise, the function returns 0K if successful, FAIL password if the password is incorrect, or FAIL on other error. Example: ASTB.SetBrowserConfig(passwd, ACCEPT_COOKIES, 1);

ASTB.SetConfig( )
Description

Changes the value of the specified libconfig configuration element. Note that settings and values must be entered as strings. If you want the change to persist when the set-top box reboots, you should follow calls to ASTB.SetConfig with a call to ASTB.CommitConfig( ).

Prototype
string ASTB.SetConfig(string password, string element, string value

54

CONTENTS

INDEX

Amino Communications Ltd. 2010

ASTB

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
Parameters password Allowed values any string Description The password for mngwrite user. This is only required for changing management page settings. For other settings (e.g. preferences pages) it can be set it to . By default, the password is snake. see the Amino Set-top box Configuration Manual for more information. element any string The libconfig configuration element to set (e.g. SETTINGS.SUBTITLES). The value to set the element to. Suitable values depend on the element you are setting.

value

any string

Warning: Amino strongly recommends that you change the default passwords when deploying our set-top boxes. See Section 4.4 of the Amino Installation and Upgrade Guide for information on changing these default passwords.

Returns
nothing if there is an error parsing the parameter entered. Otherwise, the function returns OK if the value is successfully set, FAIL password if the password is not valid, or FAIL for other errors.

Amino Communications Ltd. 2010

INDEX

CONTENTS

55

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

2.10

ASTB VLAN configuration functions

The following VLAN configuration functions are supported.

ASTB.Enable2ndEthernetPort( )
Description
Enables or disables the second Ethernet port on the set-top box.

Prototype
number ASTB.Enable2ndEthernetPort(number state)

Supported browsers
Ant Fresco Opera 8.5 Hospitality models only.

Parameters
Parameters state Allowed values 0 or 1 Description Set 1 to enable the Ethernet port or 0 to disable it.

Returns
0 if the port is enabled/disabled successfully. Otherwise, the function returns -2 (if the function is called on a set-top box that does not have a second Ethernet port, a message is also output to the debug port).

ASTB.EnableVLANTagging( )
Description

Enables or disables the addition of VLAN tags to the packets transmitted from port 1. If this is enabled, the packets are given the VLAN ID of the port they were received from.

Prototype
number ASTB.EnableVLANTagging(number state)

Supported browsers
Ant Fresco Opera 8.5

56

CONTENTS

INDEX

Amino Communications Ltd. 2010

ASTB

Hospitality models only.

Parameters
Parameters state Allowed values 0 or 1 Description Set 0 to disable VLAN tagging or 1 to enable it.

Returns
0 if successful, otherwise, the function returns -2 on error.

ASTB.GetExternalVLANid( )
Description
Retrieve the ID for the VLAN containing Ethernet port 2.

Prototype
number ASTB.GetExternalVLANid()

Supported browsers
Ant Fresco Opera 8.5 Hospitality models only.

Parameters
None.

Returns
the VLAN ID or returns -2 if there is an error.

ASTB.GetInternalVLANid( )
Description
Retrieves the ID for the VLAN containing the set-top box and Ethernet port 1.

Prototype
number ASTB.GetInternalVLANid()

Amino Communications Ltd. 2010

INDEX

CONTENTS

57

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Supported browsers
Ant Fresco Opera 8.5 Hospitality models only.

Parameters
None.

Returns
the VLAN ID or returns -2 if there is an error.

ASTB.GetPortRateLimit( )
Description
Retrieve the data transfer rate limit for a specified port on the set-top box.

Prototype
number ASTB.GetPortRateLimit(number port)

Supported browsers
Ant Fresco Opera 8.5 Hospitality models only.

Parameters
Parameters port Allowed values 1, 2 or 3 Description The port to read the data transfer rate for. 1 is Ethernet port 1. 2 is Ethernet port 2. 3 is the set-top box.

Returns
the rate limit for both receive and transmit (in units of 32 kilobytes per second (for example, 1 indicates a limit of 32KBps and 2 indicates a limit of 64KBps). This can be a value in the range 0 - 4095. The function returns -2 if there is an error.

58

CONTENTS

INDEX

Amino Communications Ltd. 2010

ASTB

ASTB.SetExternalVLANid( )
Description
Set the ID for the VLAN containing Ethernet port 2.

Prototype
number ASTB.SetExternalVLANid(number id)

Supported browsers
Ant Fresco Opera 8.5 Hospitality models only.

Parameters
Parameters id Allowed values 0 - 4095 Description The VLAN ID to set.

Returns
0 if successful or -2 on error.

ASTB.SetInternalVLANid( )
Description
Set the ID for the VLAN containing the set-top box and Ethernet port 1.

Prototype
number ASTB.SetInternalVLANid(number id)

Supported browsers
Ant Fresco Opera 8.5 Hospitality models only.

Parameters
Parameters id Allowed values 0 - 4095 Description The VLAN ID to set.

Amino Communications Ltd. 2010

INDEX

CONTENTS

59

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Returns
0 if successful or returns -2 on error.

ASTB.SetPortRateLimit( )
Description
Sets the data transfer rate limit for both receive and transmit for the specified port.

Prototype
number ASTB.SetPortRateLimit(number port, number rate)

Supported browsers
Ant Fresco Opera 8.5 Hospitality models only.

Parameters
Parameters port Allowed values 1, 2 or 3 Description The port to set the data transfer rate for: 1 is Ethernet port 1. 2 is Ethernet port 2. 3 is the set-top box. rate 0 - 4095 The rate limit to set, as multiples of 32KBps. 1 indicates a limit of 32KBps. 2 indicates a limit of 64KBps, and so on). Note: The minimum rate for the Ethernet port and the set-top box port is 32KBps. This is automatically set if you try to set a lower value.

Returns
0 if the rate is set successfully, otherwise, the function returns -2 on error.

60

CONTENTS

INDEX

Amino Communications Ltd. 2010

ASTB

2.11

ASTB miscellaneous functions

The following miscellaneous ASTB functionality is supported.

ASTB.BlastCode( )
Description
Sets the key code to be transmitted by the IRBlaster.

Prototype
number ASTB.BlastCode(number code)

Supported browsers
Ant Fresco Opera 8.5 Opera 9 Hospitality models only.

Parameters
Parameters code Allowed values Description The keycode to be transmitted.

Returns
Nothing if there is an error parsing the parameter entered. Otherwise, the function returns 0 if successful or 2 on error.

ASTB.DebugString( )
Description

Writes the specified string as the message for DBG_WARN. This is the warning string that is printed to the debug serial port if debug is enabled during browser compilation.

Prototype
ASTB.DebugString(string msg)

Amino Communications Ltd. 2010

INDEX

CONTENTS

61

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
Parameters msg Allowed values Description The message to write to DBG_WARN.

Returns
nothing.

ASTB.DefaultKeys( )
Description

The fkeys.conf file sets the default actions associated with the buttons on the IR remote control and IR keyboard. For Opera 8.5 only, this function configures whether the browser uses the default key interpretation.

Prototype
ASTB.DefaultKeys(number default_keys)

Supported browsers
Opera 8.5

Parameters
Parameters Allowed values Description Set 1 to enable default key interpretation and 0 to disable it.

default_keys 1 or 0

Returns
nothing.

62

CONTENTS

INDEX

Amino Communications Ltd. 2010

ASTB

ASTB.DeleteAllBookmarks( )
Description
Deprecated. Deletes all the bookmarks stored by the browser.

Prototype
number ASTB.DeleteAllBookmarks()

Supported browsers
Ant Fresco Opera 8.5

Parameters
None.

Returns
Fresco: Nothing if AMI_BOOKMARKS_FILE is not set during compilation. Otherwise, the function returns 0 on success or -1 on error. Opera: 0 on success or -1 on error.

ASTB.DeleteAllCookies( )
Description
Deprecated. Deletes all the cookies stored by the browser.

Prototype
number ASTB.DeleteAllCookies()

Supported browsers
Ant Fresco Opera 8.5

Parameters
None.

Returns
0 on success or -1 on error.

Amino Communications Ltd. 2010

INDEX

CONTENTS

63

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

ASTB.DeleteAllHistory( )
Description
Deprecated. Deletes all the history stored by the browser.

Prototype
number ASTB.DeleteAllHistory()

Supported browsers
Ant Fresco Opera 8.5

Parameters
None.

Returns
Fresco: Nothing if AMI_BOOKMARKS_FILE is not set during compilation. Otherwise, the function returns 0. Opera: 0 on success or -1 on error.

ASTB.ErrorString( )
Description
Deprecated. Writes the specified string as the message for DBG_ERR.

Prototype
ASTB.ErrorString(string msg)

Supported browsers
Ant Fresco Opera 8.5

Parameters
Parameters msg Allowed values Description The message to write to DBG_ERR.

Returns
nothing.

64

CONTENTS

INDEX

Amino Communications Ltd. 2010

ASTB

ASTB.FileExists( )
Description
Tests whether the specified file exists.

Prototype
number ASTB.FileExists(string filename)

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
Parameters filename Allowed values Description File name or fully qualified path to test.

Returns
0 if the file does not exist or 1 if it does.

ASTB.GCluster( )
Description

Deprecated. This function hands over control of the set-top box to a Gcluster games library.
The parameter is passed directly into the library and the return string is passed back to JavaScript.

Prototype
string ASTB.GCluster(string gcluster_command)

Supported browsers
Ant Fresco Opera 8.5 PPC platforms only (A103, A110, A110H)

Amino Communications Ltd. 2010

INDEX

CONTENTS

65

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Parameters
Parameters gcluster_command Allowed values Description Command to pass to the Gcluster games library.

Returns
nothing if there is an error parsing the parameter entered. A string passed by the games library on success. FAIL if the set-top box does not support Gcluster, or returns one of the following standard return strings: This STB does not include support for remote games. or This libcclientsso.so does not contain the GGPlayGame call. Note: This function will not return until the games library does (typically on a failed connection or if the user exits the game).

ASTB.GetLEDState( )
Description
Retrieves the state of an LED on the set-top box.

Prototype
number ASTB.GetLEDState(string ledtext)

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
Parameters ledtext Allowed values LEFT, CENTRE or RIGHT Description The LED that you want to see the value of. If the set-top box has only one LED, then use LEFT.

Returns
Fresco: Nothing on error. Otherwise, it returns one of the following values: Value 0 1 Meaning LED off LED on

66

CONTENTS

INDEX

Amino Communications Ltd. 2010

ASTB

Value 2

Meaning LED flashing

Opera: Nothing if there is an error parsing any of the parameters entered or -1 on other error. Otherwise, it returns one of the status values listed above.

ASTB.LoadCodeSet( )
Description
Initialises the IR Blaster.

Prototype
number ASTB.LoadCodeSet(string filename)

Supported browsers
Ant Fresco Opera 8.5 Hospitality models only.

Parameters
Parameters filename Allowed values Description This parameter is not currently used, so enter any non-null string value.

Returns
0 if successful, 1 for file not found, 2 for initialisation error or -1 for other errors.

ASTB.Reboot( )
Description
Reboots the set-top box.

Prototype
number ASTB.Reboot()

Supported browsers.
Ant Fresco Opera 8.5

Amino Communications Ltd. 2010

INDEX

CONTENTS

67

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Opera 9

Parameters
None.

Returns
1 on error and -1 on fail. If the reboot is successful, then the function returns 0. However, the return code may not be passed because the set-top box is in the process of killing processes (including the browser and its JMACX interpreter) and restarting.

ASTB.Reflash( )
Description

Deprecated. Removes the files from the NAND flash and reboots the set-top box. Note that
on success, the set-top box will restart and attempt to download new bootstrap and upgrade images via the multicast upgrade system (that is, the DHCP server and multicast server).You should use ASTB.Upgrade( ) as a rplacement for this function.

Prototype
number ASTB.Reflash()

Supported browsers.
Ant Fresco Opera 8.5

Parameters
None.

Returns
0 if successful (but note that on success, the browser processes are closed as part of the reflashing process, so it is likely that no value will be returned); returns non-zero if there is an error.

ASTB.SaveKeyFunctions( )
Description

Saves the key functions set with ASTB.SetKeyFunction to the fkeys.conf file in /mnt/ nv on the set-top box.

Prototype

68

CONTENTS

INDEX

Amino Communications Ltd. 2010

ASTB

ASTB.SaveKeyFunctions()

Supported browsers
Ant Fresco Opera 8.5

Parameters
None.

Returns
nothing.

ASTB.SetKBDelay( )
Description
Deprecated. Sets the keyboard delay rate.

Prototype
number ASTB.SetKBDelay(number delay)

Supported browsers
Ant Fresco Opera 8.5

Parameters
Parameters delay Allowed values 1-4 Description Delay rate. Each integer in the allowed range represents 22.5 centi-seconds. The standard default is 2 (45 centi-seconds).

Returns
-1 if there is an error parsing the parameter entered. Otherwise, the function returns 0 on success or 1 on error.

Amino Communications Ltd. 2010

INDEX

CONTENTS

69

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

ASTB.SetKBRepeat( )
Description

Deprecated. Sets the keyboard repeat rate.You are recommended to use ASTB.GetConfig("SETTINGS.REPEAT_RATE") as a replacement for this function.

Prototype
number ASTB.SetKBRepeat(number repeat)

Supported browsers
Ant Fresco Opera 8.5

Parameters
Parameters delay Allowed values >0 Description Repeat rate, in centi-seconds. The default value is 8.

Returns
-1 if there is an error parsing the parameter entered. Otherwise, the function returns 0 on success or 1 on error.

ASTB.SetKeyFunction( )
Description

Sets the function of the specified remote control key. Use ASTB.SaveKeyFunctions( ) to save the new function mapping to persistent configuration.

Prototype
string ASTB.SetKeyFunction(number key, number action, [string optional_arg])

Supported browsers
Ant Fresco Opera 8.5

70

CONTENTS

INDEX

Amino Communications Ltd. 2010

ASTB

Parameters
Parameters key Allowed values Available keys, as in the separate list of key codes: Remote key values on page 221. Also see ASTB.SetChannel( ) for how to map the number keys to channel URLs. action 1 - 48 See "List of action codes" on page 225 for a separate list of action codes. Note that 1-48 can be used for both Fresco and Opera. 49-58 are Opera only. [optional _arg] Depends on the action set. See "List of action codes" on page 225 for a separate list of action codes which require this additional parameter to be set. Additional parameter required for some actions. The action to associate with the key. Description The key to set the function for.

Returns
nothing on success or if there is an error parsing one of the parameters. The function returns FAIL if the action number entered is greater than the highest action number allowed for the browser type.

ASTB.SetLEDState( )
Description
Sets the state of an LED on the set-top box.

Prototype
number ASTB.SetLEDState(string ledtext, number status, [number flash_on, number flash_off])

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
Parameters ledtext Allowed values LEFT, CENTRE or RIGHT Description The LED that you want to set the value of. If the set-top box has only one LED, then use LEFT.

Amino Communications Ltd. 2010

INDEX

CONTENTS

71

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Parameters status

Allowed values 0 LED off 1 LED on 2 LED flashing

Description The status to set the LED to.

flash_on

0 - 255

The period that the LED is on for, in centi-seconds (if the LED is set to flash). Note: If status = 2, flash_on and flash_off must be specified.

flash_off

0 - 255

The period that the LED is off for, in centi-seconds (if the LED is set to flash).

Returns
0 on success or -1 on error (-1 is only returned in Fresco).

ASTB.SetRemoteType( )
Description

Sets the IR blasting type, depending on the TV system in use. The value is written to /mnt/ nv/irb_keys.txt on the set-top box.

Prototype
ASTB.SetRemoteType(number index)

Supported browsers
Ant Fresco Opera 8.5 Hospitality models only.

Parameters
Parameters index Allowed values Description The IR blasting type suitable for the current TV system.

Returns
nothing if there is an error parsing the parameter entered. Otherwise, the function returns 0 if successful or 2 on error.

72

CONTENTS

INDEX

Amino Communications Ltd. 2010

ASTB

ASTB.Sleep( )
Description

Deprecated. Instructs the set-top box to sleep (that is, to lock the browser and JavaScript interpreter) for the specified time.

Prototype
ASTB.Sleep(string time)

Supported browsers
Ant Fresco Opera 8.5

Parameters
Parameters time Allowed values Description The length of time to sleep for in seconds.

Returns
nothing.

ASTB.VNC( )
Description

Starts a VNC session to the specified session name. There must be a VNC client executable installed on the set-top box in order for this to be successful.

Prototype
ASTB.VNC(string session)

Supported browsers
Ant Fresco Opera 8.5

Parameters
Parameters session Allowed values Description The VNC session name to start.

Amino Communications Ltd. 2010

INDEX

CONTENTS

73

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Returns
nothing.

ASTB.WithChannels( )
Description
Sets whether changing channels with the number keys on the remote control is enabled.

Prototype
ASTB.WithChannels(number channels)

Supported browsers
Ant Fresco Opera 8.5

Parameters
Parameters channels Allowed values 0 or 1 Description Set 1 to enable or 0 to disable.

Returns
nothing.

74

CONTENTS

INDEX

Amino Communications Ltd. 2010

Chapter 3AVMedia

The AV media class allows control over AV media settings and play-back.

3.1

AVMedia event-handler attributes

The following AVmedia functions are supported.

AVMedia.Event
Description

The last event code raised (see the list in "AVMedia event codes" on page 76). Event codes are browser-specific.

Prototype
number AVMedia.Event

Supported browsers
Ant Fresco Opera 8.5 Opera 9

AVMedia.EventString
Description
The string part of the last event code raised. Event strings are browser-specific.

Prototype
string AVMedia.EventString

Amino Communications Ltd. 2010

INDEX

CONTENTS

75

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Supported browsers
Ant Fresco Opera 8.5 Opera 9

AVMedia.onEvent
Description

Enables a JavaScript event handler to be associated with AVMedia events. AVMedia.onEvent is set with a string that contains the event handler function call.

Prototype
string AVMedia.onEvent

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Usage example (Fresco)


AVMedia.onEvent=handle_event();; or AVMedia.OnEvent = handle_event; function handle_event() { alert(Event Code = + AVMedia.Event); }

Usage example (Opera)


AVMedia.onEvent=handle_event(); function handle_event() { alert(Event Code = + AVMedia.Event); }

AVMedia event codes


Code 1 Meaning RTSP_CONNECT_FAILED Failed to connect to the video server. Can be caused by no Ethernet cable to the set-top box, or a network error.

76

CONTENTS

INDEX

Amino Communications Ltd. 2010

AVMEDIA

Code 2 3 4 5 6

Meaning RTSP_SEND_FAILED Failed to communicate with the video server. RTSP_READ_FAILED Timed out whilst waiting for a reply from the video server. RTSP_CONNECTION_DIED The connection to the video server died - loss of network? RTSP_STATUS_LINE RTSP server returned an unhandled STATUS response. RTSP_STATUS_PLAYING Currently playing an RTSP stream. This depends on the keepalive timeout indicated by the RTSP server. Typically, this message will be received every 30 seconds.

RTSP_STATUS_ANNOUNCE Message sent by the RTSP server. The only server messages that does not fall into this category are the end of stream message (Code 8) and start of stream (Code 20) events.

8 9 10

RTSP_STATUS_END_OF_STREAM End of the RTSP stream. RTSP_STATUS_NOT_FOUND Asset not found on the video server. STATUS_NO_VIDEO No video seen. Either the video has been requested from a server that does not exist or the video asset requested does not exist.

11 12 13

IGMP_STATUS_END_OF_STREAM End of IGMP stream. RTSP_CONNECTION_STOPPED The video has been stopped by the user. RTSP_STATUS_AUTHENTICATE The asset requested requires authentication. Either no authentication info was provided in the video options or the wrong information was provided. As this has not been given in the AVMedia.Play call, the asset will not be played.

14

RTSP_STATUS_REDIRECTED The current session has been redirected to a different video server.

15 16 17 18

IGMP_STATUS_PLAYING Currently playing an IGMP stream. UDP_STATUS_END_OF_STREAM End of a unicast UDP stream detected. UDP_STATUS_PLAYING Currently playing a unicast UDP stream. MP3S_STATUS_END_OF_STREAM End of MP3 stream.

Amino Communications Ltd. 2010

INDEX

CONTENTS

77

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Code 19

Meaning AUD_DESCRIP_READY Callback to indicate that the session description of the current asset has been read.

20 21 22

RTSP_STATUS_START_OF_STREAM Start of RTSP stream playback. MP3S_STATUS_START_OF_STREAM Start of MP3 stream playback. RTSP_STATUS_ANNOUNCE_PARTIAL Partial asset ANNOUNCE event received. This occurs with the Kasenna server END_OF_STREAM ANNOUNCE message. In this instance it is possible to resume playing the stream, instead of stopping the stream.

23 24 25 26 27 28 29 30 31 32 33 34 36 37 38 39

STATUS_PMT_CHANGED The PMT in the incoming transport stream has changed. PVRS_STATUS_PLAYING Currently playing a PVR stream. PVRS_STATUS_END_OF_STREAM End of PVR stream. PVRS_READ_FAILED RTSP read failed. PVRS_SEND_FAILED RTSP send failed. PVRS_CONNECTION_FAILED RTSP connection failed. PVRS_CONNECT_FAILED RTSP connect failed. PVRS_CONNECTION_STOPPED RTSP connection stopped. WEBFETCH_STARTED Webfetcher: Started examining the playlist. WEBFETCH_CONNECT_FAILED Webfetcher: Cannot contact one of the servers in the playlist. WEBFETCH_START_STREAMING Webfetcher: Started streaming of the current clip in the playlist. WEBFETCH_END_OF_STREAM Webfetcher: Ended streaming of the current clip in the playlist. WEBFETCH_KILLED Webfetcher: Killed by the client. WEBFETCH_CONNECTING_MMS Webfetcher: Trying to connect to MMS. WEBFETCH_CONNECTING_HTTP Webfetcher: Trying to connect to HTTP. WEBFETCH_CONNECTING_RTSP Webfetcher: Trying to connect to RTSP.

78

CONTENTS

INDEX

Amino Communications Ltd. 2010

AVMEDIA

Code 40 41 42 43

Meaning WEBFETCH_CONNECTING_LOCAL Webfetcher: Trying to connect to local storage. WEBFETCH_CONNECTING_MEDIASERVER Webfetcher: Trying to connect to a Media Server. WEBFETCH_BUFFERING Webfetcher: Buffering report. IGMP_RETUNE_AFTER_PACKET_RECV_CAP IGMP returned after reaching TS packet received cap without channel change. No longer supported.

44 45

IGMP_RETUNE_AFTER_TIME_EXPIRE IGMP returned after time expired without channel change. WEBFETCH_STREAMS_SELECTED Webfetcher: Streams selected.

Amino Communications Ltd. 2010

INDEX

CONTENTS

79

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

3.2

AVMedia functions

The following AVMedia functions are supported.

AVMedia.Continue( )
Description
Restarts the media stream at the position it was paused at (for example, after use of AVMedia.Stop( ) or AVMedia.Pause( )).

Note: If the stream was previously playing at normal speed, this has the same effect as calling AVMedia.SetSpeed(1).

Prototype
AVMedia.Continue()

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
None.

Returns
nothing.

AVMedia.EOMFreeze( )
Description

When switching between streams of different types, say an IGMP stream and an RTSP stream, or stopping a stream AVMedia.EOMFreeze gives the option of either displaying the last frame of the previous stream until the new stream starts, or displaying a blank frame.

Prototype
AVMedia.EOMFreeze(number state)

80

CONTENTS

INDEX

Amino Communications Ltd. 2010

AVMEDIA

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
Parameters state Allowed values 1 or 0 Description Set 1 to enable EOMFreeze Set 0 to disable EOMFreeze.

Returns
nothing.

AVMedia.GetAudioPID( )
Description
Retrieves the audio PID.

Prototype
number AVMedia.GetAudioPID()

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
None.

Returns
the audio PID.

AVMedia.GetAudioPIDList( )
Description

Retrieves details of the audio PIDs. Note that AVMedia.GetAudioPIDs( ) enables similar for Fresco. This acts as an alternate to the AVMedia.GetAudioPIDs( ) used for all other browsers.

Amino Communications Ltd. 2010

INDEX

CONTENTS

81

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Prototype
string AVMedia.GetAudioPIDList()

Supported browsers
Opera 8.5

Parameters
None.

Returns
a string concatenation containing the following for each PID in the current stream: AudioPID=<PID_number>;AudioLanguage=<PID_language_tag>;

AVMedia.GetAudioPIDs( )
Description
Retrieves details of the audio PIDs.

Prototype
object AVMedia.GetAudioPIDs()

Supported browsers
Ant Fresco Opera 9

Parameters
None.

Returns
an object with the following attributes: Attribute pids Array[1 ... pids] pids= value from the line above. Array[x].AudioPID Array[x].AudioLanguage number string Type number object Description Number of audio PIDS for the current stream. Array of objects (this array is only returned if the total number of PIDs is greater than zero). Value of this PID. Language tag associated with this PID.

82

CONTENTS

INDEX

Amino Communications Ltd. 2010

AVMEDIA

Attribute

Type

Description Secondary language tag associated with this PID. One of the following result codes: 0 - success 1 - no program error 2 - bad index error 3 - out of memory error 4 - resource failure error

Array[x].AudioLanguage2 string Result number

AVMedia.GetContentName( )
Description
Retrieves the name of the current media content.

Prototype
string AVMedia.GetContentName()

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
None.

Returns
an empty ("") string if the content has no name (for example, IGMP) or no video is playing. This function is only useful for RTSP streams at present.

AVMedia.GetCurrentSpeed( )
Description
Gets the current play-back speed. This should normally be 1.0 for non-RTSP streams. The current speed is the speed of the streamed resource as supplied by the server.

Prototype
number AVMedia.GetCurrentSpeed()

Amino Communications Ltd. 2010

INDEX

CONTENTS

83

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
None.

Returns
the current play-back speed. Example return values are: 6 6 x normal speed, 5 5 x normal speed, and so on 1 normal play 0.5 half speed 0 pause -1 reverse play -6 reverse at 6 x normal speed

Values can also be 3.75, 1.5, and so on. The floating point default value is -1.0.

AVMedia.GetDefaultRTSPServer( )
Description
Retrieves the name of the default RTSP server.

Prototype
string AVMedia.GetDefaultRTSPServer()

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
None.

Returns
a string containing the name of the default RTSP server (this could be a null string).

84

CONTENTS

INDEX

Amino Communications Ltd. 2010

AVMEDIA

AVMedia.GetDuration( )
Description

Gets the duration of a media stream. The duration is determined from the RTSP DESCRIBE response from the server. Supported message formats are: application/x-rtsp-mh "a=X-duration:..." application/sdp "Duration=..." or "a=range:npt=..."

Prototype
number AVMedia.GetDuration()

Supported browsers
Opera 9

Parameters
None.

Returns
a floating point value in seconds, for example 300.5 or -1 if a server is being used which does not return the duration in one of the expected formats.

AVMedia.GetFormat( )
Description
Retrieves the format of the last played media stream.

Prototype
string AVMedia.GetFormat()

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
None.

Amino Communications Ltd. 2010

INDEX

CONTENTS

85

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Returns
one of the following values: Value PAL NTSC Unknown Meaning PAL encoded video NTSC encoded video Unknown format

AVMedia.GetMSecPos( )
Description
Returns the current position in the media stream in milliseconds.

Prototype
number AVMedia.GetMSecPos()

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
None.

Returns
the current position as a number of milliseconds relative to the start of the stream. If the media stream is in trickplay mode, it returns -2. For all other errors, the function returns -1.

AVMedia.GetMSecPosition( )
Description
Returns the current position in the media stream in milliseconds.

Prototype
number AVMedia.GetMSecPosition()

86

CONTENTS

INDEX

Amino Communications Ltd. 2010

AVMEDIA

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
None.

Returns
the current position as a number of milliseconds relative to the start of the stream. If the media stream is in trickplay mode, it returns -2. For all other errors, the function returns -1.

AVMedia.GetPMTPID( )
Description
Retrieves the Programme ID (PID) from the Programme Map Table (PMT).

Prototype
number AVMedia.GetPMTPID()

Supported browsers
Opera 8.5

Parameters
None.

Returns
the Programme ID (PID) of the PMT or -1 if there is no video stream.

AVMedia.GetPmtProgramInfo( )
Description
Retrieves programme information from the MPEG programme map table (PMT) table.

Prototype
string AVMedia.GetPmtProgramInfo()

Amino Communications Ltd. 2010

INDEX

CONTENTS

87

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
None.

Returns
the programme information as a null-terminated hexadecimal string.

AVMedia.GetPos( )
Description
Returns the current position in the media stream, in seconds.

Prototype
number AVMedia.GetPos()

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
None.

Returns
the current position as a number of seconds relative to the start of the stream. If the media stream is in trickplay mode, the function returns -2. For all other errors, it returns 0.

AVMedia.GetPosition( )
Description
Returns the current position in the media stream, in seconds.

88

CONTENTS

INDEX

Amino Communications Ltd. 2010

AVMEDIA

Prototype
number AVMedia.GetPosition()

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
None.

Returns
the current position as a number of seconds relative to the start of the stream. If the media stream is in trickplay mode, the function returns -2. For all other errors, it returns 0.

AVMedia.GetPrimaryAudioLanguage( )
Description
Returns the primary audio language.

Prototype
string AVMedia.GetPrimaryAudioLanguage([number persist])

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Amino Communications Ltd. 2010

INDEX

CONTENTS

89

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Parameters
Parameters [persist] Allowed values 1 or 0 Description (Optional) The value controls whether the currently used setting is returned or whether the 'saved' configuration setting is returned. Set 1 to read the setting to configuration, otherwise set 0 (the setting is lost on reboot). If this is not set, the default value 0 is used.

Returns
a string containing the ISO 639-2 code for the language (for example, rus or rus/ru), or null if no language is set or the persist parameter is unknown.

AVMedia.GetPrimarySubtitleLanguage( )
Description
Returns the primary subtitle language.

Prototype
string AVMedia.GetPrimarySubtitleLanguage([number persist])

Supported browsers
Ant Fresco Opera 8.5 Opera 9

90

CONTENTS

INDEX

Amino Communications Ltd. 2010

AVMEDIA

Parameters
Parameters [persist] Allowed values 1 or 0 Description (Optional) The value controls whether the currently used setting is returned or whether the 'saved' configuration setting is returned. Set 1 to read the setting to configuration, otherwise set 0 (the setting is lost on reboot). If this is not set, the default value 0 is used.

Returns
a string containing the ISO 639-2 code for the language (for example, rus or rus/ru), or null if no language is set. On error, the function returns one of the following values: Value Failed to read persist parameter Subtitles not supported Meaning The persist parameter was not a valid number. Subtitles support is not present in the release.

AVMedia.GetProgramInfo( )
Description
Retrieves information about an aspect of the current program.

Prototype
string AVMedia.GetProgramInfo(number FLAG)

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Amino Communications Ltd. 2010

INDEX

CONTENTS

91

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Parameters
Parameters FLAG Allowed values Description

A bit flag with the value 1,2,4,8 PROGRAM_INFO_AUDIO or 15. PROGRAM_INFO_VIDEO PROGRAM_INFO_TELETEXT PROGRAM_INFO_SUBTITLE PROGRAM_INFO_ALL

Returns
FAIL on error. The string returned is a JSON string. Therefore the evaluation must be done in the following way:str = AVMedia.GetProgramInfo(AVMedia.PROGRAM_INFO_ALL); eval( '(' + str + ')');

For an AVMedia.GetProgramInfo call


str = AVMedia.GetProgramInfo(tag) Where tag is one of the following: AVMedia.PROGRAM_INFO_AUDIO AVMedia.PROGRAM_INFO_VIDEO AVMedia.PROGRAM_INFO_SUBTITLE AVMedia.PROGRAM_INFO_TELETEXT

It is recommended to only make a request for what is required. These tags can also be combined so as to return both audio and video information. The following is valid:str = AVMedia.GetProgramInfo(AVMedia.PROGRAM_INFO_AUDIO | AVMedia.PROGRAM_INFO_VIDEO); A shortcut for getting all information is also provided:str = AVMedia.GetProgramInfo(AVMedia.PROGRAM_INFO_ALL); The return string from this call is a JSON string. This can be treated as a normal string or can be converted to an object using normal JSON method:obj = eval( '(' + str + ')' ); The following structure is what is returned using the AVMedia.PROGRAM_INFO_ALL call. Depending on the tag parameter used or the information found in the stream part of this tree may not be populated. Audio "stream" ( "PID" , "lang" ) "current" "streamindex" "langindex" Video "stream" ( "PID" , "lang" )

92

CONTENTS

INDEX

Amino Communications Ltd. 2010

AVMEDIA

"current" "streamindex" "langindex"

Subtitle "stream" ( "PID" , "lang" ) "current" "streamindex" "langindex"

Teletext" "stream" ( "PID" , "lang" ) "current" "streamindex" "langindex"

Result value 0 OK -1 error

Each entry in the stream is a collection of PIDs and languages. In the case of dual mono streams a PID can have multiple languages. The streamindex and langindex used for the current is a means of pointing to current language in terms of the collection of languages / PIDs found.

Example JavaScript
This is an example of outputting all possible information about the stream. str = AVMedia.GetProgramInfo(AVMedia.PROGRAM_INFO_ALL); document.write("String from AVMedia.GetProgramInfo is " + str + "<hr>"); // Do the eval obj = eval( '(' + str + ')'); // Check the return code if (obj.result == 0) { // Audio if (obj.audio != undefined) { var currentlang = ""; document.write("<h3>Audio data found</h3>"); if (obj.audio.current != undefined) { var currentstream = obj.audio.stream[obj.audio.current. streamindex]; currentlang = currentstream.lang[obj.audio.current.langindex]; document.write("current PID = " + currentstream.PID + " language = " + currentlang + "<br>"); } numPIDs = obj.audio.stream.length; document.write("There are " + numPIDs + " PIDs in the audio stream <br>");

Amino Communications Ltd. 2010

INDEX

CONTENTS

93

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

for (loop=0; loop < numPIDs; loop++) { thisstream = obj.audio.stream[loop]; document.write("PID index: " + loop + " PID number " + thisstream.PID + "<br>"); document.write("There are " + thisstream.lang.length + " languages in this PID<br>"); for (langloop=0; langloop < thisstream.lang.length; langloop++) { thislang = thisstream.lang[langloop]; document.write("Language " + langloop + " is " + thislang + "<br>"); } } } // Subtitles if (obj.subtitle != undefined) { var currentlang = ""; document.write("<h3>Subtitle data found</h3>"); if (obj.subtitle.current != undefined) { var currentstream = obj.subtitle.stream[obj.subtitle.current. streamindex]; currentlang = currentstream.lang[obj.subtitle.current.langindex]; document.write("current PID = " + currentstream.PID + " language = " + currentlang + "<br>"); } numPIDs = obj.subtitle.stream.length; document.write("There are " + numPIDs + " PIDs in the subtitle stream<br>"); for (loop=0; loop < numPIDs; loop++) { thisstream = obj.subtitle.stream[loop]; document.write("PID index: " + loop + " PID number " + thisstream.PID + "<br>"); document.write("There are " + thisstream.lang.length + " languages in this PID<br>"); for (langloop=0; langloop < thisstream.lang.length; langloop++) { thislang = thisstream.lang[langloop]; document.write("Language " + langloop + " is " + thislang + "<br>"); } } } // Teletext if (obj.teletext != undefined) {

94

CONTENTS

INDEX

Amino Communications Ltd. 2010

AVMEDIA

var currentlang = ""; document.write("<h3>Teletext data found</h3>"); if (obj.teletext.current != undefined) { var currentstream = obj.teletext.stream[obj.teletext.current.// streamindex]; currentlang = currentstream.lang[obj.teletext.current.langindex]; document.write("current PID = " + currentstream.PID + " language = " + currentlang + "<br>"); } numPIDs = obj.teletext.stream.length; document.write("There are " + numPIDs + " PIDs in the teletext stream<br>"); for (loop=0; loop < numPIDs; loop++) { thisstream = obj.teletext.stream[loop]; document.write("PID index: " + loop + " PID number " + thisstream.PID + "<br>"); document.write("There are " + thisstream.lang.length + " languages in this PID<br>"); for (langloop=0; langloop < thisstream.lang.length; langloop++) { thislang = thisstream.lang[langloop]; document.write("Language " + langloop + " is " + thislang + "<br>"); } } } // Video if (obj.video != undefined) { var currentlang = ""; document.write("<h3>Video data found</h3>"); if (obj.video.current != undefined) { var currentstream = obj.video.stream[obj.video.current. streamindex]; document.write("current PID = " + currentstream.PID + " language = " + currentlang + "<br>"); } } } else { document.write("An error occurred while creating the object<br>"); }

Amino Communications Ltd. 2010

INDEX

CONTENTS

95

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

AVMedia.GetProtocol( )
Description
Deprecated. Retrieves the protocol for the current media stream.

Prototype
string AVMedia.GetProtocol()

Supported browsers
Ant Fresco Opera 8.5

Parameters
None.

Returns
one of the following protocol values. Value RTSP MULTICAST Unknown Meaning RTSP media stream IGMP media stream other error

AVMedia.GetSecondaryAudioLanguage( )
Description
Returns the secondary audio language.

Prototype
string AVMedia.GetSecondaryAudioLanguage([number persist])

Supported browsers
Ant Fresco Opera 8.5 Opera 9

96

CONTENTS

INDEX

Amino Communications Ltd. 2010

AVMEDIA

Parameters
Parameters [persist] Allowed values 1 or 0 Description (Optional) The value controls whether the currently used setting is returned or whether the 'saved' configuration setting is returned. Set 1 to read the setting to configuration, otherwise set 0 (the setting is lost on reboot). If this is not set, the default value 0 is used.

Returns
a string containing the ISO 639-2 code for the language (for example, rus or rus/ru), or null if no language is set.

AVMedia.GetSecondarySubtitleLanguage( )
Description
Returns the secondary subtitle language.

Prototype
string AVMedia.GetSecondarySubtitleLanguage([number persist])

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Amino Communications Ltd. 2010

INDEX

CONTENTS

97

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Parameters
Parameters [persist] Allowed values 1 or 0 Description (Optional) The value controls whether the currently used setting is returned or whether the 'saved' configuration setting is returned. Set 1 to read the setting to configuration, otherwise set 0 (the setting is lost on reboot). If this is not set, the default value 0 is used.

Returns
a string containing the ISO 639-2 code for the language (for example, rus or rus/ru), or null if no language is set. On error, returns one of the following values: Value Failed to read persist parameter Subtitles not supported Meaning The persist parameter was not a valid number. Subtitles support is not present in the release.

AVMedia.GetVideoPID( )
Description
Retrieves the video PID of the current media stream.

Prototype
number AVMedia.GetVideoPID()

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
None.

Returns
the PID or null if there is no current media stream.

98

CONTENTS

INDEX

Amino Communications Ltd. 2010

AVMEDIA

AVMedia.Kill( )
Description

Tears down the current session, terminating the current media stream. After calling this function, it is not possible to restart the current video stream (that is, it is not possible to resume video from the current position with AVMedia.Continue( )).

Prototype
AVMedia.Kill()

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
None.

Returns
nothing.

AVMedia.Pause( )
Description

Pauses the media stream and freezes the video on the screen. For RTSP, the session to the server is maintained and the video can be resumed from the current position (with AVMedia.Continue( )). For IGMP, the multicast data is discarded until unpaused. Note that using AVMedia.SetSpeed(0) has a similar effect to this function, except that the previous speed is not retained.

Prototype
AVMedia.Pause()

Amino Communications Ltd. 2010

INDEX

CONTENTS

99

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
None.

Returns
nothing.

AVMedia.Play( )
Description
Plays the media content from the specified source. Note: If the content is under Macrovision control, you must call VideoDisplay.SetMacrovision( ) before trying to play the content.

Prototype
number AVMedia.Play(string src)

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
Parameters src Allowed values src=<URL> Description The URL for the media content (for formats, see Appendix C, Media source URLs ). For example: src=igmp:// 123.4.5.67:11111

Returns
0 on success or if video support is not compiled (or the parameter entered is null). Otherwise the function returns a non-zero value. Returns -1 on error.

100

CONTENTS

INDEX

Amino Communications Ltd. 2010

AVMEDIA

AVMedia.PlaySound( )
Description

Plays a sound from a file. The sound file must be a raw PCM mono sound file with a sample rate of 44,100 and a bit depth of 16. The file size must be no greater then 0.5MB Note: This applies to the AmiNET125 and 130 only.

Prototype
string AVmedia.PlaySound(string filename)

Supported browsers
Opera 8.5 Opera 9

Parameters
Parameters filename Allowed values Description The filename containing the sound to be played.

Returns
OK on success or an error string.

AVMedia.SetAudioPID( )
Description

Sets the audio PID to use for decoding the audio stream as a multimedia stream / video stream / MPEG transport stream.

Prototype
number AVMedia.SetAudioPID(number pid, [number ac3])

Amino Communications Ltd. 2010

INDEX

CONTENTS

101

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
Parameters pid ac3 0 MPEG 1 AC3 Allowed values Description The Programme ID (PID) to use. Stream type. If this parameter is not included, the audio PID type will be auto-detected.

Returns
0 on success. -1 on error. Otherwise, the function returns a non-zero value.

AVMedia.SetDefaultRTSPServer( )
Description
Sets the default RTSP server.

Prototype
number AVMedia.SetDefaultRTSPServer(string videoServer)

Supported browsers
Ant Fresco Opera 8.5 Opera 9

102

CONTENTS

INDEX

Amino Communications Ltd. 2010

AVMEDIA

Parameters
Parameters videoServer Allowed values bitband infovalue mediabase ncube seachange oracle eona smartvision Description The name of the video server to set as the default. Note that these values are not case-sensitive (i.e. you could also enter Bitband or BITBAND).

Returns
0 on success or -1 on error.

AVMedia.SetHighDef( )
Description

Deprecated. Enables or disables high definition mode. In high definition mode, the high frequency pass-through filter is deactivated for normal HD playback. When high definition mode is disabled, standard definition mode is used instead.You are recommended to use ASTB.SetConfig("NORFLASH.OUTPUT_RESOLUTION") as a replacement for this function.

Prototype
number AVMedia.SetHighDef(number state)

Supported browsers
Ant Fresco Opera 8.5

Parameters
Parameters state Allowed values 0 or 1 Description Set 0 to set standard definition mode. Set 1 to enable high definition mode.

Returns
0 on success. Otherwise, the function returns a non-zero value (for example, if the input parameter cannot be parsed).

Amino Communications Ltd. 2010

INDEX

CONTENTS

103

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

AVMedia.SetMSecPos( )
Description

Sets the position in milliseconds, relative to the start of the current media stream. If the media stream is currently pause this call restarts it. It is recommended to check that the position has been set successfully by calling AVMedia.GetMSecPos( ) or AVMedia.GetMSecPosition( ) after trying to set a new position.

Prototype
number AVMedia.SetMSecPos(number position)

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
Parameters position Allowed values Description Position to play from, in milliseconds relative to the current position of the stream.

Returns
the position in milliseconds, relative to the start of the current media stream.

AVMedia.SetMSecPostion( )
Description

Sets the position in milliseconds, relative to the start of the current media stream. If the media stream is currently pause this call restarts it. It is recommended to check that the position has been set successfully by callingAVMedia.GetMSecPos( ) or AVMedia.GetMSecPosition( ) after trying to set a new position.

Prototype
number AVMedia.SetMSecPosition(number position)

104

CONTENTS

INDEX

Amino Communications Ltd. 2010

AVMEDIA

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
Parameters position Allowed values Description Position to play from, in milliseconds relative to the current position of the stream.

Returns
the position in milliseconds, relative to the start of the current media stream.

AVMedia.SetPos( )
Description

Sets the position in seconds, relative to the start of the current media stream. If the stream is currently paused, this call restarts it. It is recommended to check that the position has been set successfully by calling AVMedia.GetPos( ) or AVMedia.GetPosition( ) after trying to set a new position.

Prototype
number AVMedia.SetPos(number position)

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
Parameters position Allowed values Description Position to play from, in seconds, relative to the current position of the stream.

Returns
0 on success or if there is no current media stream. Returns -1 if there is an error parsing the parameter.

Amino Communications Ltd. 2010

INDEX

CONTENTS

105

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

AVMedia.SetPostion( )
Description

Sets the position in seconds, relative to the start of the current media stream. If the stream is currently paused, this call restarts it. It is recommended to check that the position has been set successfully by calling AVMedia.GetPos( ) or AVMedia.GetPosition( ) after trying to set a new position.

Prototype
number AVMedia.SetPosition(number position)

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
Parameters position Allowed values Description Position to play from, in seconds, relative to the start of the stream.

Returns
0 on success or if there is no current media stream. Returns -1 if there is an error parsing the parameter.

AVMedia.SetPrimaryAudioLanguage( )
Description
Sets the primary audio language.

Prototype
AVMedia.SetPrimaryAudioLanguage(string language, [number persist])

Supported browsers
Ant Fresco Opera 8.5 Opera 9

106

CONTENTS

INDEX

Amino Communications Ltd. 2010

AVMEDIA

Parameters
Parameters language Allowed values Description Language to set. Can be any ISO 639-2 code. E.g.: rus or rus/ ru. 1 or 0 Specifies whether the setting is written to the stored configuration of the set-top box. Set 1 to write the setting to configuration, otherwise set 0 (the setting is lost on reboot). If this is not set, the default value 0 is used.

[persist]

Returns
nothing.

AVMedia.SetPrimarySubtitleLanguage( )
Description
Sets the primary subtitle language.

Prototype
string AVMedia.SetPrimarySubtitleLanguage(string language, [number persist])

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Amino Communications Ltd. 2010

INDEX

CONTENTS

107

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Parameters
Parameters language Allowed values Description Language to set. Can be any ISO 639-2 code. E.g.: rus or rus/ ru. 1 or 0 Specifies whether the setting is written to the stored configuration of the set-top box. Set 1 to write the setting to configuration, otherwise set 0 (the setting is lost on reboot). If this is not set, the default value 0 is used.

[persist]

Returns
one of the following values: Value OK Failed to read persist parameter Failed to read language parameter Failed to set subtitles primary language Subtitles not supported Meaning Successfully changed subtitle language. The persist parameter was not a valid number. The language parameter was not a valid string. Subtitle language could not be changed. Subtitles are not enabled in the build.

AVMedia.SetSecondaryAudioLanguage( )
Description
Sets the secondary audio language.

Prototype
AVMedia.SetSecondaryAudioLanguage(string language, [number persist])

Supported browsers
Ant Fresco Opera 8.5 Opera 9

108

CONTENTS

INDEX

Amino Communications Ltd. 2010

AVMEDIA

Parameters
Parameters language Allowed values Description Language to set. Can be any ISO 639-2 code. E.g.: rus or rus/ ru. 1 or 0 Specifies whether the setting is written to the stored configuration of the set-top box. Set 1 to write the setting to configuration, otherwise set 0 (the setting is lost on reboot). If this is not set, the default value 0 is used.

[persist]

Returns
nothing.

AVMedia.SetSecondarySubtitleLanguage( )
Description
Sets the secondary subtitle language.

Prototype
string AVMedia.SetSecondarySubtitleLanguage(string language, [number persist])

Supported browsers
Ant Fresco Opera 8.5 Opera 9 Note: The preferred equivalent for Opera is VideoDisplay.SetSubtitlesSecondaryLanguage( ).

Amino Communications Ltd. 2010

INDEX

CONTENTS

109

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Parameters
Parameters language Allowed values Description Language to set. Can be any ISO 639-2 code. E.g.: rus or rus/ ru. 1 or 0 Specifies whether the setting is written to the stored configuration of the set-top box. Set 1 to write the setting to configuration, otherwise set 0 (the setting is lost on reboot). If this is not set, the default value 0 is used.

[persist]

Returns
one of the following values: Value OK Failed to read persist parameter Failed to read language parameter Failed to set subtitles secondary language Subtitles not supported Meaning Successfully changed subtitle language. The persist parameter was not a valid number. The language parameter was not a valid string. Subtitle language could not be changed. Subtitles are not enabled in the build.

AVMedia.SetSpeed( )
Description
Sets the play-back speed (this takes effect immediately).

Prototype
number AVMedia.SetSpeed(number speed)

Supported browsers
Ant Fresco Opera 8.5 Opera 9

110

CONTENTS

INDEX

Amino Communications Ltd. 2010

AVMEDIA

Parameters
Parameters speed Allowed values The values for this are server dependant. If you require further information on the limits of the playback speed, you should contact your RTSP service provider. Description Speed to set. Positive values are forward play and negative values are reverse play. Examples of possible values are: 6 forward at 6 x normal speed. 5 5 x normal speed, and so on 1 normal play 0.5 half speed 0 pause -1 reverse play -6 reverse at 6 x normal speed Values can also be 3.75, 1.5, and so on. Note that the actual play speeds depend on the video decoder.

Returns
0 on success. Otherwise, the function returns a non-zero value on failure. If the speed cannot be read, the function returns null.

AVMedia.Stop( )
Description

Stops playing the current media stream and removes the video from the screen. The connection to the RTSP server is kept alive, and the video can be resumed from the current position (with AVMedia.Continue( )).

Prototype
AVMedia.Stop()

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
None.

Returns
nothing.

Amino Communications Ltd. 2010

INDEX

CONTENTS

111

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

AVMedia.VideoHide( )
Description

Enables or disables the video plane. Disabling the video plane has the effect of hiding video whilst the stream connection is maintained and audio playback continues. This can be useful, for example, for hiding video whilst drawing overlaid graphics, or if the picture in graphics (PiG) needs to be relocated without any video artefacts. The video layer can be re-enabled by calling this function or by calling AVMedia.Play( ).

Prototype
number AVMedia.VideoHide(number state)

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
Parameters state Allowed values 1 or 0 Description Set 1 to hide video plane output and 0 to display it.

Returns
0 on success and -1 on failure. Otherwise, the function returns a non-zero value.

112

CONTENTS

INDEX

Amino Communications Ltd. 2010

Chapter 4VideoDisplay

Using the VideoDisplay class it is possible to control the scaling and positioning of the video and to determine its relationship to the graphics. Graphics can be overlaid on top of the video, with alphablending, and with chroma-keying (including use of both at the same time). Scaled video can be displayed on top of the graphics, as a picture-in-graphics (PiG) display.

4.1

Picture-in-graphics

Although picture-in-graphics operation is described here, its use is mainly limited to legacy platforms. We recommend that the VideoDisplay.GetVideoWindow() function be used instead, where possible. Scaled video can be displayed on top of the graphics, as a picture-in-graphics (PiG) display. The position of the PiG display can be set via functions in this class, but note that applicable position coordinates depend on the TV output standard and the size of the video display - for example, whether it is full screen. Position coordinates are specified as the position of the top-left corner of the PiG display, in relation to the bottom-left corner of the main screen display. The position of the scaled Picture-in-Graphics window is specified in Picture-in-Graphics space by the top left corner of the scaled video window, where in Picture-in-Graphics space co-ordinates are measured from the bottom left. Note that this is the opposite of the graphics co-ordinate space. To convert picture-in-graphics space co-ordinates to graphics space, subtract the y co-ordinate from the graphics screen height.

Picture in Graphics (PiG) space

y x Figure 4.1 PiG coordinate systems. Note: A Picture-in-Graphics window cannot be positioned such that any corner of it is offscreen.
Amino Communications Ltd. 2010 INDEX CONTENTS 113

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

The graphics plane has to be configured to allow the video plane to be visible via the creation of a picturein-graphics window. This is necessary because the video plane is normally beneath the graphics plane and is thus hidden from view. As a general rule, the x and y coordinates are as follows, but you are recommended to trial settings for optimal positioning: PAL full screen: x maximum is 720 minus the width of the picture-in-graphics window, y maximum is 576 PAL not full screen: x maximum is 640 minus the width of the picture-in-graphics window, y maximum is 518 NTSC full screen: x maximum is 720 minus the width of the picture-in-graphics window, y maximum is 480 NTSC not full screen: x maximum is 640 minus the width of the picture-in-graphics window, y maximum is 438

All minimum values are 0.

4.2

VideoDisplay functions

The following VideoDisplay functions are supported.

VideoDisplay.DefaultUnloadVideo( )
Description

Sets whether video is stopped when a page is unloaded. The value is set in configuration. Note that the value set by VideoDisplay.UnloadVideo overrides the value set by VideoDisplay.DefaultUnloadVideo for the current page.

Prototype
VideoDisplay.DefaultUnloadVideo(number unload)

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
Parameters unload Allowed values 0 or 1 Description Set 1 to stop video while the page is unloaded, otherwise set 0.

Returns
nothing.

114

CONTENTS

INDEX

Amino Communications Ltd. 2010

VIDEODISPLAY

VideoDisplay.FullScreen( )
Description
Enables or disables the full screen video display.

Prototype
VideoDisplay.FullScreen(number state)

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
Parameters state Allowed values 1 or 0 Description Set 1 to enable the full screen video display, 0 or any other number to disable it. In Opera 9 VideoDisplay.FullScreen(1) = VideoDisplay.SetPIG(0). VideoDisplay.FullScreen(0) = VideoDisplay.SetPIG(1)

Returns
nothing.

VideoDisplay.GetAlphaLevel( )
Description
Retrieves the alpha blend level for blending between the full-screen video layer and the graphics layer.

Prototype
number VideoDisplay.GetAlphaLevel()

Amino Communications Ltd. 2010

INDEX

CONTENTS

115

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
None.

Returns
the blend level as a percentage, where 0% means graphics are fully transparent and 100% means graphics are fully opaque.

VideoDisplay.GetAPS( )
Description
Retrieves the Macrovision APS mode.

Prototype
number VideoDisplay.GetAPS())

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
None.

Returns
the mode (this is a value in the range 0 - 3, as per the APS specification). Value 0 1 2 3 Meaning Off, or if Macrovision is not supported. AGC pulses only. Two line colour stripe plus AGC. Four line colour stripe plus AGC.

116

CONTENTS

INDEX

Amino Communications Ltd. 2010

VIDEODISPLAY

VideoDisplay.GetAspect( )
Description
Retrieves the screen display presentation style.

Prototype
number VideoDisplay.GetAspect()

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
None.

Returns
one of the following values, or 0 on error: Value 1 2 3 Meaning 4:3 pan and scan 4:3 letterbox 16:9

VideoDisplay.GetAVAspect( )
Description
Retrieves the current AV (scart pin 8) aspect ratio.

Prototype
number VideoDisplay.GetAVAspect()

Amino Communications Ltd. 2010

INDEX

CONTENTS

117

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
None.

Returns
-1 on error. Otherwise, the function returns one of the following values: Value 0 2 3 Meaning off 4:3 16:9

VideoDisplay.GetChromaKey( )
Description
Retrieves the previously set chroma-key RGB colour value as a decimal.

Prototype
number VideoDisplay.GetChromaKey()

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
None.

Returns
the RGB value as a decimal. For example, 1531086.

118

CONTENTS

INDEX

Amino Communications Ltd. 2010

VIDEODISPLAY

VideoDisplay.GetClosedCaption( )
Description

Retrieves whether the on-screen closed caption display is enabled or disabled. This would also enable the VBI closed captions for builds where there is hardware VBI closed caption support

Prototype
number VideoDisplay.GetClosedCaption()

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
None.

Returns
0 if the closed caption display is disabled or 1 if it is enabled.

VideoDisplay.GetMacrovision( )
Description
Retrieves how the set-top box is set to handle video output under Macrovision control.

Prototype
number VideoDisplay.GetMacrovision()

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
None.

Amino Communications Ltd. 2010

INDEX

CONTENTS

119

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Returns
the mode byte to indicate how video is output under Macrovision control. Possible values for this byte depend on your Macrovision licence. For builds with no Macrovision support this returns 0 (zero).

VideoDisplay.GetOutputFmt( )
Description
Retrieves the video output format.

Prototype
string VideoDisplay.GetOutputFmt([number persist])

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
Parameters [persist] Allowed values 1 or 0 Description (Optional) Sets whether to retrieve the current value or the value stored in the set-top boxs permanent configuration. Set 1 for the permanent configuration settting, 0 for the current setting. If this setting is not included, the default value 0 is used.

Return
one of the following values: Value CVBS-RGBOFF CVBS-RGBON LC-RGBOFF LC-RGBON CVBS-LC CVBS-LBR LBR-CVBS-LC RGB-CVBS-LC Meaning Composite Composite and RGB S-video S-video and RGB Composite and S-Video Composite and Component (YPbPr) Composite, S-Video and Component (YPbPr) Composite, S-Video and RGB

120

CONTENTS

INDEX

Amino Communications Ltd. 2010

VIDEODISPLAY

VideoDisplay.GetPIG( )
Description
Retrieves the state of the picture-in-graphics window.

Although picture-in-graphics operation is described here, its use is mainly limited to legacy platforms. We recommend that the VideoDisplay.GetVideoWindow() function be used instead, where possible.

Prototype
number VideoDisplay.GetPIG()

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
None.

Returns
1 if the PiG is enabled, 0 if it is not.

VideoDisplay.GetPIGPosition( )
Description

Retrieves the position of the top-left corner of the picture-in-graphics display, relative to the bottom-left of the screen. Although picture-in-graphics operation is described here, its use is mainly limited to legacy platforms. We recommend that the VideoDisplay.GetVideoWindow() function be used instead, where possible.

Prototype
string VideoDisplay.GetPIGPosition()

Amino Communications Ltd. 2010

INDEX

CONTENTS

121

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
None.

Returns
the x- and y-coordinates for the picture-in-graphics window, in the format (x,y).

VideoDisplay.GetPIGScale( )
Description
Retrieves the scale factor for the video in the picture-in-graphics display.

Although picture-in-graphics operation is described here, its use is mainly limited to legacy platforms. We recommend that the VideoDisplay.GetVideoWindow() function be used instead, where possible. Note: In practice the scale factor is platform dependant, for the PowerPC platforms the box will only accept 1, 2 and 4 as valid inputs. For the ST platform values up to 6 will resize the window to around /16 of the screen. At values greater than 6 there is no further effect.

Prototype
number VideoDisplay.GetPIGScale()

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
None.

122

CONTENTS

INDEX

Amino Communications Ltd. 2010

VIDEODISPLAY

Returns
-1 on error or if video control has not been enabled. Otherwise, the function returns the scale. This can be one of the following values: Value 1 2 4 Meaning full screen quarter screen
1

/16 screen

VideoDisplay.GetPIGx( )
Description

Retrieves the horizontal position of the top-left corner of the picture-in-graphics display, relative to the bottom-left of the screen. Although picture-in-graphics operation is described here, its use is mainly limited to legacy platforms. We recommend that the VideoDisplay.GetVideoWindow() function be used instead, where possible.

Prototype
number VideoDisplay.GetPIGx()

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
None.

Returns
the x-coordinate for the top-left corner of the picture-in-graphics display.

VideoDisplay.GetPIGy( )
Description

Retrieves the vertical position of the top-left corner of the picture-in-graphics display, relative to the bottom-left of the screen.

Amino Communications Ltd. 2010

INDEX

CONTENTS

123

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Although picture-in-graphics operation is described here, its use is mainly limited to legacy platforms. We recommend that the VideoDisplay.GetVideoWindow() function be used instead, where possible.

Prototype
number VideoDisplay.GetPIGy()

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
None.

Returns
the y-coordinate for the top-left corner of the picture-in-graphics display.

VideoDisplay.GetRFModFrequencyTable( )
Description
Retrieves the RF modulator frequency table.

Prototype
string VideoDisplay.GetRFModFrequencyTable([number persist])

124

CONTENTS

INDEX

Amino Communications Ltd. 2010

VIDEODISPLAY

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
Parameters [persist] Allowed values 1 or 0 Description (Optional) Sets whether to retrieve the current value or the value stored in the set-top boxs permanent configuration. Set 1 for the permanent configuration settting, 0 for the current setting. If this setting is not included, the default value 0 is used.

Returns
a number if there is an error parsing the parameter entered. Otherwise, the function returns the frequency table in use. Values can be CABLE or BROADCAST.

VideoDisplay.GetRFModState()
Description
Retrieves the state of the RF modulator.

Prototype
number VideoDisplay.GetRFModState([number persist])

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Amino Communications Ltd. 2010

INDEX

CONTENTS

125

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Parameters
Parameters [persist] Allowed values 1 or 0 Description (Optional) Sets whether to retrieve the current value or the value stored in the set-top boxs permanent configuration. Set 1 for the permanent configuration settting, 0 for the current setting. If this setting is not included, the default value 0 is used.

Returns
0 if the RF modulator is disabled, 1 if it is enabled.

VideoDisplay.GetSubtitles( )
Description
Retrieves whether the on-screen subtitle display is enabled or disabled.

Prototype
number VideoDisplay.GetSubtitles([number persist])

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
Parameters [persist] Allowed values 1 or 0 Description (Optional) Sets whether to retrieve the current value or the value stored in the set-top boxs permanent configuration. Set 1 for the permanent configuration settting, 0 for the current setting. If this setting is not included, the default value 1 is used.

Returns
0 if the subtitle display is disabled, 1 if it is enabled.

126

CONTENTS

INDEX

Amino Communications Ltd. 2010

VIDEODISPLAY

VideoDisplay.GetSubtitlesPreferredLanguage( )
Description

Retrieves the current setting for the preferred language for subtitles. Note that this is equivalent to AVMedia.GetPrimarySubtitleLanguage( ).

Prototype
string VideoDisplay.GetSubtitlesPreferredLanguage([number persist])

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
Parameters [persist] Allowed values 1 or 0 Description (Optional) Sets whether to retrieve the current value or the value stored in the set-top boxs permanent configuration. Set to 1 for the permanent configuration settting, set to 0 for the current setting. If this setting is not included, the default value 0 is used.

Returns
on error, returns one of the following values: Value Failed to read persist parameter Subtitles not supported Meaning The persist parameter was not a valid number. Subtitles are not enabled in the build.

Otherwise, the function returns the language as a string.

Amino Communications Ltd. 2010

INDEX

CONTENTS

127

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

VideoDisplay.GetSubtitlesSecondaryLanguage( )
Description

Retrieves the current setting for the secondary language for subtitles. Note that this is equivalent to AVMedia.GetSecondarySubtitleLanguage( ).

Prototype
string VideoDisplay.GetSubtitlesSecondaryLanguage([number persist])

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
Parameters [persist] Allowed values 1 or 0 Description (Optional) Sets whether to retrieve the current value or the value stored in the set-top boxs permanent configuration. Set 1 for the permanent configuration settting, 0 for the current setting. If this parameter is not included, the default value 0 is used.

Returns
on error, returns one of the following values: Value Failed to read persist parameter Subtitles not supported Meaning The persist parameter was not a valid number. Subtitles are not enabled in the build.

Otherwise, the function returns the language as a string.

VideoDisplay.GetTeletext( )
Description
Retrieves whether teletext VBI insertion is enabled or disabled.

128

CONTENTS

INDEX

Amino Communications Ltd. 2010

VIDEODISPLAY

Prototype
number VideoDisplay.GetTeletext()

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
None.

Returns
0 if VBI insertion is disabled, 1 if it is enabled.

VideoDisplay.GetTeletextFullscreen( )
Description
Retrieves whether full screen teletext is enabled.

Prototype
number VideoDisplay.GetTeletextFullscreen()

Supported browsers
Opera 8.5 Opera 9

Parameters
None.

Returns
1 full screen teletext is enabled and 0 if it is disabled or not supported.

VideoDisplay.GetTVStandard()
Description
Retrieves the television standard that the set-top box is set to.

Amino Communications Ltd. 2010

INDEX

CONTENTS

129

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Prototype
string VideoDisplay.GetTVStandard()

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
None.

Returns
nothing if video control support is not compiled. Otherwise, the function returns one of the following values: Value PAL-I PAL-M PAL-(C)N PAL-G PAL-B PAL-H PAL-D NTSC-J NTSC-M Unknown Meaning PAL (e.g. UK) PAL (e.g. Brazil) PAL (e.g. Argentina) PAL (Europe) PAL (e.g. Australia, Ghana) PAL (e.g. Belgium) PAL (e.g. China) NTSC (Japan) mode NTSC (US) mode Set-top box is set to an unhandled mode.

VideoDisplay.GetVideoWindow()
Description

Initial call to return a video window object for controlling a video window. The optional index parameter allows for control of video window objects other then the main video window. This main window is the one used if no parameter is supplied and is referred to as having an index of 0. Note: This function is available on recent builds for the AmiNET125 and 0.15.x and later builds for the AmiNET130, but is not available on 0.11.x builds for the AmiNET130.

Prototype
object VideoDisplay.GetVideoWindow([number index])

130

CONTENTS

INDEX

Amino Communications Ltd. 2010

VIDEODISPLAY

Supported browsers
Opera 8.5 Opera 9

Parameters
The object returned back contains the following attributes left, top, width, height This contains the current position of the video window on screen in terms of browser pixel positions. state Contains one of the following: full screen - video is in full screen. window - the video is not full screen but is in a visible window. hidden - the video window is not on screen. This is hardware dependant and not currently supported.

Changing any of the above values will directly change the video window on screen. The returned object also contains the following methods: GetRectangle() This returns a video window descriptor that can be used for non-direct window manipulation. See section below about video window descriptor object SetRectangle(left, top, width, height]) SetRectangle(vwd) Directly set the video window to either numerical values for left top and optionally the width and height, or to pass in a video window descriptor object.

VideoWindow descriptor object


This is an instance of a video window. This means that more than one video window descriptor could exist, where each one defines where the video is in a different part of an electronic program guide (EPG) or portal. This object is returned from a call to GetRectangle( ) and has the following attributes: left, top, width, height These are integer properties describing the video window rectangle. status Is a string based message to indicate the status of last operation ("OK" if succeeded or some other error message). It also has the following methods: ScaleToRectangle(float scale) Updates the width and height values to the needed values based on the scale passed in. Update() As this is a copy of the video window, if the video window changes position, then that change will not be reflected in the copy. This call allows for the top, left, width and height values to be re-synchronised with, where the video window currently is on screen.

Amino Communications Ltd. 2010

INDEX

CONTENTS

131

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Unlike the video window object updates to this object will not have an impact on the current video window object. For the change to take effect, the video window descriptor object needs to be passed into the video window object using the SetRectangle( ) method.

Example usage
Suppose a current physical video window exists and that you wish to change the window position by adding 10 to the value of left and adding 30 to the value of height. x original new window

Window0 =VideoWindow.GetVideoWindow( ); Gets the original window object. Window1 = Window0.GetRectangle( ); Gets the window definition rectangle. Window1.left+=10; Window1.top+=30; Window0.SetRectangle(Window1); Sets the physical video window device (called Window0) to the properties defined by the Video Window Descriptor object called Window1.

Returns
the VideoWindow object. See above.

VideoDisplay.GetUHFChannel( )
Description

Retrieves the channel that the RF modulator is set to (either the current channel or the channel stored in configuration).

Prototype
number VideoDisplay.GetUHFChannel([number persist])

132

CONTENTS

INDEX

Amino Communications Ltd. 2010

VIDEODISPLAY

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
Parameters [persist] Allowed values 1 or 0 Description Sets whether to retrieve the current value or the value stored in the settop boxs permanent configuration. Set 1 for the permanent configuration setting and 0 for the current setting. If this setting is not included, the default value 0 is used.

Returns
a channel number (note that 0 can indicate an error).

VideoDisplay.IgnoreSlaveUpdates( )
Description
Deprecated. Enables or disables whether slave updates are ignored.

Prototype
VideoDisplay.IgnoreSlaveUpdates(number enable, [number id])

Supported browsers
Opera 8.5

Parameters
Parameters enable [id] Allowed values 1 or 0 Description Set 1 to ignore slave updates. Otherwise this is set 0. ID. The default ID is 0.

Returns
nothing.

Amino Communications Ltd. 2010

INDEX

CONTENTS

133

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

VideoDisplay.IgnoreUpdates( )
Description

Disables (or enables) screen updates while a page renders. For example, disable screen updates from within the head of an HTML document, then enable updates again in the body onLoad handler, to re-enable updates and refresh the screen once the page has finished loading.

Prototype
VideoDisplay.IgnoreUpdates(number ignore)

Supported browsers
Ant Fresco Opera 8.5

Parameters
Parameters ignore Allowed values 1 or 0 Description Set 1 to disable updates and 0 to enable updates (any value other than 1 will also enable updates).

Returns
nothing.

VideoDisplay.MaxWindows( )
Description
The maximum number of video windows that the STB supports. The default value is 1.

Prototype
number VideoDisplay.MaxWindows( )

Supported browsers
Opera 8.5 Opera 9

Parameters
None.

134

CONTENTS

INDEX

Amino Communications Ltd. 2010

VIDEODISPLAY

Returns
the maximum number of video windows supported by the system.

VideoDisplay.RetainAlphaLevel( )
Description

Deprecated. Sets whether the current alpha level is retained when moving between pages.
Retaining the alpha level prevents the flashing that occurs when the alpha level is reset when moving to a new page.

Prototype
number VideoDisplay.RetainAlphaLevel(number state)

Supported browsers
Ant Fresco Opera 8.5

Parameters
Parameters state Allowed values false or true Description Set true to retain the alpha level and false to reset the alpha level when a new page is displayed.

Returns
0 on success; -1 on error.

VideoDisplay.RetainMouseState( )
Description

Deprecated. Sets whether the current mouse state is retained when moving between pages.
Retaining the mouse state prevents the flashing that occurs when the mouse cursor is turned on when moving to a new page.

Prototype
number VideoDisplay.RetainMouseState(number state)

Amino Communications Ltd. 2010

INDEX

CONTENTS

135

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Supported browsers
Ant Fresco Opera 8.5

Parameters
Parameters state Allowed values false or true Description Set true to retain the mouse state and false to reset the mouse state when a new page is displayed.

Returns
0 on success or -1 on error.

VideoDisplay.SetAlphaLevel( )
Description

Sets the overall alpha blend level used to control the blending between the full-screen video layer and the graphics layer.

Prototype
string VideoDisplay.SetAlphaLevel(number alpha)

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
Parameters alpha Allowed values 0 - 100 Description Blend level as a percentage, where 0 means graphics are fully transparent and 100 means graphics are fully opaque.

Returns
Failed to read alpha level parameter on error. Otherwise, the function returns OK on success.

136

CONTENTS

INDEX

Amino Communications Ltd. 2010

VIDEODISPLAY

VideoDisplay.SetAlphaRect( )
Description

Deprecated. Sets the alpha rectangle so that video can be displayed through it (that is, via
the PiG).

Prototype
VideoDisplay.SetAlphaRect(number x, number y, number w, number h, number alpha)

Supported browsers
Opera 8.5

Parameters
Parameters x y w h alpha Allowed values Description Horizontal position of top-left corner of rectangle. Vertical position of top-left corner of rectangle. Width of rectangle. Height of rectangle. Alpha blend value.

Returns
nothing.

VideoDisplay.SetAPS( )
Description

Sets the Macrovision APS (Analogue Protection System) mode. This setting is only used when the TV standard is set to NTSC mode.

Prototype
number VideoDisplay.SetAPS(number mode)

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Amino Communications Ltd. 2010

INDEX

CONTENTS

137

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Parameters
Parameters mode Allowed values 0-3 Description The mode to set (as in APS specification).

Returns
-1 if the parameter entered is invalid or if Macrovision is not supported. Otherwise, the function returns 0 on success.

VideoDisplay.SetAspect( )
Description

Sets the screen display presentation style. For screens with 16:9 content presentation style, this has no effect. For 4:3 screens, this sets an override for the 16:9 aspect. If you are in 4:3 mode: Setting 4:3 pan scan will give you a normal picture Setting 4:3 letterbox will give you a letterbox Setting 16:9 has no effect. Setting 4:3 pan scan has no effect Setting 4:3 letterbox has no effect Setting 16:9 has no effect

If you are in 16:9 mode:

Also note this call does not save your changes.

Prototype
string VideoDisplay.SetAspect(number aspect)

Supported browsers
Ant Fresco Opera 8.5 Opera 9

138

CONTENTS

INDEX

Amino Communications Ltd. 2010

VIDEODISPLAY

Parameters
Parameters aspect Allowed values 1 4:3 pan and scan 2 4:3 letterbox 3 16:9 Description Aspect option.

Returns
one of the following values: Value OK Invalid aspect value specified Failed to read aspect parameter Failed to set aspect Video control not supported Meaning Successfully changed aspect. Parameter entered was not in the range 0 - 3. Parameter entered was not a valid number. Aspect could not be changed. Video support is not enabled in the build.

VideoDisplay.SetAVAspect( )
Description
Sets the AV (scart pin 8) aspect ratio. If you are in 4:3 mode: Setting 4:3 will give you a normal picture in a 4:3 aspect screen. Setting 16:9 gives you a stretched 4:3 video image in a 16:9 aspect screen.

If you are in 16:9 mode: Setting 4:3 gives you a squashed width widescreen video image in a 4:3 aspect screen. Setting 16:9 gives a correct widescreen video image in a 16:9 aspect screen.

Changes are not saved.

Prototype
string VideoDisplay.SetAVAspect(number aspect)

Amino Communications Ltd. 2010

INDEX

CONTENTS

139

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
Parameters aspect Allowed values 0 off 1 on (restores previous non-OFF value) 2 4:3 3 16:9 Description The aspect to set.

Returns
one of the following values: Value OK Invalid aspect value specified Meaning Successfully changed aspect. Parameter entered was not in the range 0 - 3.

Failed to read aspect parame- Parameter entered was not a valid numter ber. Failed to set aspect Video control not supported Aspect could not be changed. Video support is not enabled in the build.

VideoDisplay.SetAVAspectSwitching( )
Description

Sets AV (scart pin 8) aspect ratio switching behaviour. When auto-switching is enabled the aspect ratio signalling on scart pin 8 will automatically switch based on the monitor type selected and content type currently playing. When auto-switching is disabled the AV aspect ratio (scart pin 8) will have to be set manually. Changes are not saved.

Prototype
string VideoDisplay.SetAVAspectSwitching(number mode)

140

CONTENTS

INDEX

Amino Communications Ltd. 2010

VIDEODISPLAY

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
Parameters mode Allowed values 0 or 1 Description Set 0 to disable automatic audio-switching and set 1 to enable automatic audioswitching.

Returns
one of the following values: Value OK Invalid aspect value specified Meaning Successfully changed aspect. Parameter entered was not in the range 0 - 3.

Failed to read aspect parame- Parameter entered was not a valid ter number. Failed to set aspect Video control not supported Aspect could not be changed. Video support is not enabled in the build.

VideoDisplay.SetChromaKey( )
Description

Sets the RGB colour to be used for chroma-keying to the given value, as a hexadecimal value. Note: You are recommended to set this at the start of your HTML page.

Prototype
number VideoDisplay.SetChromaKey(number rgb) number VideoDisplay.SetChromaKey(number red, number green, number blue)

Amino Communications Ltd. 2010

INDEX

CONTENTS

141

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
Parameters rgb Allowed values The allowed values for this are 0X000000 to 0XFFFFFF Description The chroma-key value. This must be a hexadecimal value, in the format RRGGBB. For example: VideoDisplay.SetChromaKey(0X603020)(hex) or VideoDisplay.SetChromaKey(6303 776)(decimal) Hexadecimal or decimal equivalent for red colour value. Hexadecimal or decimal equivalent for green colour value. Hexadecimal or decimal equivalent for blue colour value.

red green blue

0 - 255 0 - 255 0 - 255

Returns
0 on success.

VideoDisplay.SetClosedCaption( )
Description

Enables or disables closed caption display on the screen. This is the case for both software rendered, or by the TV via VBI controlled by VideoDisplay.SetClosedCaptionOutput( ). The change takes effect immediately. You should always use 0 and 1 under normal circumstances to handle subtitles and closed captions. Option 2 above should only be used when temporarily bringing up a menu or EPG to hide subtitling/closed captions (otherwise the EPG or menu will be obscured by the captions and may not be visible). Then once the menu/EPG is gone, normal service can be resumed by calling option 3 to return the subtitling to what it was before.

Prototype
string VideoDisplay.SetClosedCaption(number closedcaption)

Supported browsers
Ant Fresco Opera 8.5

142

CONTENTS

INDEX

Amino Communications Ltd. 2010

VIDEODISPLAY

Opera 9

Parameters
Parameters closedcaption Allowed values 0-3 Description Set 0 to disable closed captions Set 1 to enable closed captions Set 2 to force disable of both VBI and software rendered closed captions Set 3 to return VBI and software rendered closed captions to the state they were before they were disabled using 2.

Returns
one of the following values: Value OK Failed to set closed caption Meaning Successfully set closed captions. Closed captions could not be set.

VideoDisplay.SetClosedCaptionOutput( )
Description

Deprecated. Sets the type of closed caption output. Once the output method has been set
using this JMACX call, VideoDisplay.SetClosedCaption( ) must be called. This function is still being used as an on/off switch for closed captions, but now only turns on the relevant methods set by SetClosedCaptionOutput. In order to avoid breaking existing middlewares, the old JMACX call can be used without setting the output method, but will default to turning VBI closed captions on and software rendered closed captions on or off depending on the value of NORFLASH.SUBTITLES. Two usersettings values can be used to control the initial state of closed captions, these are: USERSETTINGS.CC_OUTPUT_VBI and USERSETTINGS.CC_OUTPUT_SOFTCC (Y for on, N for off). These should be added to custom resources if any setting other than the default is required.

Prototype
string VideoDisplay.SetClosedCaptionOutput(number vbi, number softcc)

Amino Communications Ltd. 2010

INDEX

CONTENTS

143

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
Parameters vbi softcc Allowed values 0 or 1 0 or 1 Description Set 1 to enable VBI insertion and 0 to disable it. Set 1 to render closed captions on the STB and 0 to render them via the TV.

Returns
OK on success or an error string.

VideoDisplay.SetMacrovision( )
Description
Sets how the set-top box outputs video under Macrovision control.

This can only be used if the video host is under Macrovision control and has been added to the trusted domains list.

Prototype
VideoDisplay.SetMacrovision(number mode)

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
Parameters mode Allowed values Refer to your Macrovision licence for the values to set for each mode. Description Mode byte to set.

Returns
nothing.

144

CONTENTS

INDEX

Amino Communications Ltd. 2010

VIDEODISPLAY

VideoDisplay.SetOutputFmt( )
Description
Sets the video output format.

Prototype
string VideoDisplay.SetOutputFmt(string format, [number persist])

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
Parameters format Allowed values Description

CVBS-RGBOFF Com- The format to set. The formats available depend on the set-top box type and posite CVBS-RGBON Com- cables connected. posite and RGB LC-RGBOFF S-video LC-RGBON S-video and RGB CVBS-LC Composite and S-Video CVBS-LBR Composite and Component (YPbPr) LBR-CVBS-LC Composite, S-Video and Component (YPbPr) RGB-CVBS-LC Composite, S-Video and RGB

[persist]

1 or 0

Sets whether the value set is stored permanently in the set-top boxs configuration or is only used until the settop box reboots. Set 1 for the setting to be stored in the configuration, otherwise, set 0. If this setting is not included, the default value 0 is used.

Amino Communications Ltd. 2010

INDEX

CONTENTS

145

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Returns
one of the following values: Value OK Invalid output format specified Failed to read format parameter Meaning Successfully changed output format. Parameter entered is not a recognised output format string. Parameter entered could not be read as a valid string.

Failed to read persist parame- Parameter entered could not be read as ter a valid number Failed to set output format Video control not supported Output format could not be changed. Video support is not enabled in the build.

VideoDisplay.SetPIG( )
Description

Enables or disables the picture-in-graphics (PiG) display. The alternative function with additional parameters also sets up the scale and position of the PiG display. Note that position is defined by the position of the top-left corner of the PiG at specified coordinates relative to the bottom-left corner of the screen. See Picture-in-graphics. Note: When SetPIG() is used with a given set of x,y coordinates, this is not guaranteed to be exactly where the PIG is positioned on the screen, due to a combination of factors including hardware limitations, pixel rounding, video format size, and so on. The use of VideoDisplay.GetPIG( ), or VideoDisplay.GetPIGx( ) and VideoDisplay.GetPIGy( ) will provide the actual coordinates the system has used. Although picture-in-graphics operation is described here, its use is mainly limited to legacy platforms. We recommend that the VideoDisplay.GetVideoWindow() function be used instead, where possible.

Prototype
number VideoDisplay.SetPIG(number state) number VideoDisplay.SetPIG(number state, number scale, number x, number y, [number mandisp, [number persist]])

Supported browsers
Ant Fresco Opera 8.5 Opera 9

146

CONTENTS

INDEX

Amino Communications Ltd. 2010

VIDEODISPLAY

Parameters
Parameters state scale Allowed values 1 or 0 -1 use previous value 1 - full screen 2 - quarter screen 4 - /16 screen x See "VideoDisplay functions" on page 114. See "VideoDisplay functions" on page 114. The horizontal position of the PiG display. Set -1 to return to previous value. See Note above. The vertical position of the PiG display. Set -1 to return to previous value. See Note above. Description Set 1 to enable the PiG display and 0 to disable it. The scale factor for the video in the PiG display. Effectively the screen height and width are divided by the scale factor.

[mandisp]

0 automatic configuration Sets whether PiG is manually configured. 1 manual configuration -1 return to previous value Manual specifies whether or not a transparent hole is automatically drawn on the web page at the position of the scaled video. If 'Manual' is set to 1, this does not happen and you have to make a transparent hole yourself in HTML.

[persist]

0 use value until reboot

Note that mandisp must be set if you 1 store value in persistent are setting persist. Persist specifies whether the PiG is configuration automatically turned off when the video -1 return to previous stream is killed. If it is set to 1, the PiG value setting is retained and will be used for future video streams. If set to 0 the PiG is turned off when the stream is killed.

Returns
0 on success, -1 on error (including if video support is not enabled in the build).

VideoDisplay.SetPIGPosition( )
Description

Sets the position of the PiG display. Note that position is defined by the position of the top-left corner of the PiG at specified coordinates relative to the bottom-left corner of the screen. Note: When SetPIGPosition is used with a given set of x,y coordinates, this is not guaranteed to be exactly where the picture-in-graphics display is positioned on the screen, due to a combination of factors including hardware limitations, pixel rounding, video format size, and so on. The use of VideoDisplay.GetPIG( ), or VideoDisplay.GetPIGx( ) and VideoDisplay.GetPIGy( ) will provide the actual coordinates the system has used.

Amino Communications Ltd. 2010

INDEX

CONTENTS

147

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Although picture-in-graphics operation is described here, its use is mainly limited to legacy platforms. We recommend that the VideoDisplay.GetVideoWindow() function be used instead, where possible.

Prototype
number VideoDisplay.SetPIGPosition(number x, number y)

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
Parameters x y Allowed values See "VideoDisplay functions" on page 114. See "VideoDisplay functions" on page 114. Description The horizontal position of the PiG display. See Note above. The horizontal position of the PiG display. See Note above.

Returns
nothing if there is an error parsing one of the parameters entered or if video control is not compiled. Otherwise, the function returns 0 on success and-1 on error.

VideoDisplay.SetPIGScale( )
Description
Sets the scale factor for the video in the PiG display.

Note: In practice the scale factor is platform dependant, for the PowerPC platforms the box will only accept 1, 2 and 4 as valid inputs. For the ST platform values up to 6 will resize the window to around /16 of the screen. At values greater than 6 there is no further effect. Although picture-in-graphics operation is described here, its use is mainly limited to legacy platforms. We recommend that the VideoDisplay.GetVideoWindow() function be used instead, where possible.

Prototype
number VideoDisplay.SetPIGScale(number scale)

148

CONTENTS

INDEX

Amino Communications Ltd. 2010

VIDEODISPLAY

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
Parameters scale Allowed values 1 full screen 2 quarter screen 4 /16 screen Description The scale.

Returns
a number if video control has not been enabled. Otherwise, the function returns 0 on success and -1 on error.

VideoDisplay.SetRFModFrequencyTable( )
Description
Sets the RF modulator frequency table. The change takes effect immediately.

Prototype
string VideoDisplay.SetRFModFrequencyTable(string table, [number persist])

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Amino Communications Ltd. 2010

INDEX

CONTENTS

149

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Parameters
Parameters table [persist] Allowed values 1 or 0 Description Sets whether the value set is stored permanently in the set-top boxs configuration or is only used until the set-top box reboots. Set to 1 for the setting to be stored in the configuration. Otherwise, set to 0. If this setting is not included, the default value 0 is used.

CABLE or BROADCAST The RF modulator frequency table.

Returns
one of the following values: Value OK Failed to read persist parameter Invalid frequency table specified Meaning Successfully set RF frequency table. Value entered for optional persist parameter is not a valid number. Value entered for table parameter is not one of the allowed strings.

Failed to read table parameter Value entered for table parameter cannot be read as a string. Failed to set RF mod frequency table RF control not supported RF frequency table could not be set. RF is not enabled in the build.

VideoDisplay.SetRFModState( )
Description
Enables or disables the RF modulator output. The change takes effect immediately.

Prototype
string VideoDisplay.SetRFModState(number enable, [number persist])

Supported browsers
Ant Fresco Opera 8.5 Opera 9

150

CONTENTS

INDEX

Amino Communications Ltd. 2010

VIDEODISPLAY

Parameters
Parameters enable [persist] Allowed values 0 - 3 1 or 0 Description Set 1 to enable the RF modulator and 0 to disable it. Sets whether the value set is stored permanently in the set-top boxs configuration or is only used until the set-top box reboots. Set to 1 for the setting to be stored in the configuration, otherwise, set to 0. If this setting is not included, the default value 0 is used.

Returns
one of the following values: Value OK Meaning Successfully set RF modulator.

Failed to read persist parame- Value entered for optional persist ter parameter is not a valid number. Failed to read enable parame- Value entered for enable parameter is ter not a valid number. Failed to set RF mod state RF control not supported RF modulator could not be set. RF is not enabled in the build.

VideoDisplay.SetSubtitles( )
Description
Enables or disables subtitle display on the screen. The change takes effect immediately.

You should always use 0 and 1 under normal circumstances to handle subtitles and closed captions. Option 2 above should only be used when temporarily bringing up a menu or EPG to hide subtitling/subtitles (otherwise the EPG or menu will be obscured by the subtitles and may not be visible). Then once the menu/EPG is gone, normal service can be resumed by calling option 3 to return the subtitling to what it was before.

Prototype
string VideoDisplay.SetSubtitles(number enable, [number persist])

Amino Communications Ltd. 2010

INDEX

CONTENTS

151

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
Parameters enable Allowed values 0 to 3 Description Set 0 to disable subtitles. Set 1 to enable subtitles. Set 2 to force disable of both VBI and subtitles. Set 3 to return VBI and subtitles to the state they were before they were disabled using 2. [persist] 1 or 0 Sets whether the value set is stored permanently in the set-top boxs configuration or is only used until the set-top box reboots. Set to 1 for the setting to be stored in the configuration. Otherwise, set to 0. If this setting is not included, the default value 1 is used.

Returns
one of the following values: Value OK Meaning Successfully set subtitles.

Failed to read persist param- Value entered for optional persist eter parameter is not a valid number. Failed to read enable parame- Value entered for enable parameter is ter not a valid number. Subtitles not supported Subtitle support is not enabled in the build.

VideoDisplay.SetSubtitlesPreferredLanguage( )
Description

Sets the preferred language for subtitles. Note that this is equivalent to AVMedia.SetPrimarySubtitleLanguage( ).

Prototype
string VideoDisplay.SetSubtitlesPreferredLanguage(string language), [number persist])

152

CONTENTS

INDEX

Amino Communications Ltd. 2010

VIDEODISPLAY

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
Parameters language [persist] 0 or 1 Allowed values Description The language to set (any ISO 639-2 language string). Sets whether the value set is stored permanently in the set-top boxs configuration or is only used until the set-top box reboots. Set to 1 for the setting to be stored in the configuration, otherwise, set to 0. If this setting is not included, the default value 0 is used.

Returns
one of the following values: Value OK Meaning Successfully set subtitle language.

Failed to read persist param- Value entered for optional persist eter parameter is not a valid number. Failed to read language parameter Failed to set subtitles preferred language Subtitles not supported Value entered for enable parameter is not a valid string. Subtitle language could not be set. Subtitle support is not enabled in the build.

VideoDisplay.SetSubtitlesSecondaryLanguage( )
Description
Sets the secondary language for subtitles. Note: This is equivalent to AVMedia.SetSecondarySubtitleLanguage( ).

Prototype
string VideoDisplay.SetSubtitlesSecondaryLanguage(string language, [number persist])

Amino Communications Ltd. 2010

INDEX

CONTENTS

153

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
Parameters language [persist] 0 or 1 Allowed values Description The language to set (ISO 639-2 language string). Sets whether the value set is stored permanently in the set-top boxs configuration or is only used until the settop box reboots. Set to 1 for the setting to be stored in the configuration, otherwise, set to 0. If this setting is not included, the default value 0 is used.

Returns
one of the following values: Value OK Failed to read persist parameter Failed to read language parameter Meaning Successfully set subtitle language. Value entered for optional persist parameter is not a valid number. Value entered for enable parameter is not a valid string.

Failed to set subtitles sec- Subtitle language could not be set. ondary language Subtitles not supported Subtitle support is not enabled in the build.

VideoDisplay.SetTeletext( )
Description

Enable or disable insertion of teletext data into the analogue VBI. The teletext status is only used at the start of a stream. Modification of the state requires the stream to be restarted.

Prototype
string VideoDisplay.SetTeletext(number enable)

154

CONTENTS

INDEX

Amino Communications Ltd. 2010

VIDEODISPLAY

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
Parameters enable Allowed values 1 or 0 Description Set 1 to enable teletext VBI insertion and 0 to disable it.

Returns
one of the following values: Value OK Failed to read enable parameter Teletext not supported Meaning Successfully set teletext state. Value entered for enable parameter is not a valid number. Teletext support is not enabled in the build.

Failed to set teletext enable Teletext state could not be set.

VideoDisplay.SetTeletextFullscreen( )
Description
Sets whether teletext is full screen.

Prototype
number VideoDisplay.SetTeletextFullscreen(number state)

Supported browsers
Opera 8.5 Opera 9

Amino Communications Ltd. 2010

INDEX

CONTENTS

155

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Parameters
Parameters state Allowed values 0 or 1 Description Set 1 to enable full screen teletext and 0 to disable it.

Returns
nothing if there is an error parsing the parameter entered, or if full screen teletext is not supported. Otherwise, the function returns 0 on success and -1 on error.

VideoDisplay.SetUHFChannel( )
Description
Sets the output channel of the UHF modulator. The change takes effect immediately.

Prototype
string VideoDisplay.SetUHFChannel(number channel, [number persist])

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
Parameters channel [persist] 1 or 0 Allowed values Description The RF output channel Sets whether the value set is stored permanently in the set-top boxs configuration or is only used until the set-top box reboots. Set to 1 for the setting to be stored in the configuration, otherwise, set to 0. If this setting is not included, the default value 0 is used.

Returns
one of the following values: Value OK Invalid persist value specified Meaning Successfully set RF channel. Value entered for persist parameter is not 0 or 1.

156

CONTENTS

INDEX

Amino Communications Ltd. 2010

VIDEODISPLAY

Value Failed to read channel parameter Failed to read persist parameter Failed to set RF mod channel RF control not supported

Meaning Value entered for channel parameter is not a valid number. Value entered for persist parameter is not a valid number. RF channel could not be changed. RF is not enabled in the build.

VideoDisplay.UnloadVideo( )
Description

Sets whether video is stopped when a page is unloaded. The value set is valid for the current page only. Note that the value set by VideoDisplay.UnloadVideo overrides the value set by VideoDisplay.DefaultUnloadVideo( ) for the current page.

Prototype
string VideoDisplay.UnloadVideo(number unload)

Supported browsers
Opera 8.5 Opera 9

Parameters
Parameters unload Allowed values 0 or 1 Description Set to 1 to stop video while the page is unloaded, otherwise set to 0.

Returns
one of the following values: Value OK Meaning Success.

Failed to read unload parame- Value entered for unload parameter is ter not boolean. Video control not supported Video control support is not enabled in the build.

Amino Communications Ltd. 2010

INDEX

CONTENTS

157

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

158

CONTENTS

INDEX

Amino Communications Ltd. 2010

Chapter 5AudioControl

The AudioControl class enables interaction with the set-top boxs audio system

5.1

AudioControl Event handling functions

AudioControl.Event
Description

Deprecated. Callback for the last event code. Event codes are browser-specific integer values.

Prototype
number AudioControl.Event

Supported browsers
Ant Fresco Opera 8.5

AudioControl.onVolumeChange( )
Description

Deprecated. Enables a JavaScript event handler to be associated with set-top box volume
changes. The call is invoked whenever the current volume changes. onVolumeChange is set with a string that contains the JavaScript event-handler function call.

Prototype
string AudioControl.onVolumeChange

Amino Communications Ltd. 2010

INDEX

CONTENTS

159

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Supported browsers
Ant Fresco Opera 8.5

Parameters
None. Usage example (Fresco): AudioControl.onVolumeChange = handle_volume_change(); ; function handle_volume_change() { alert(Volume has been changed ) ; } Usage example (Opera): AudioControl.onVolumeChange = handle_volume_change(); function handle_volume_change() { alert(Volume has been changed.) ; }

5.2

AudioControl control functions

The following audio control functions are supported.

AudioControl.GetAC3DownMix( )
Description
Retrieves the set-top boxs DolbyTM AC-3 downmix mode.

Prototype
string AudioControl.GetAC3Downmix()

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
None.

160

CONTENTS

INDEX

Amino Communications Ltd. 2010

AUDIOCONTROL

Returns
one of the following strings: Value failed stereo dolby stereo Meaning internal error or AC-3 support not compiled in normal stereo output Dolby stereo output (supports Dolby matrix stereo)

AudioControl.GetAC3DRC( )
Description
Retrieves the set-top boxs DolbyTM AC-3 dynamic range control mode.

Prototype
string AudioControl.GetAC3DRC()

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
None.

Returns
one of the following strings: Value failed linestd linemax rftv rfmin Meaning internal error or AC-3 support not compiled in standard line output with full DRC line output without DRC RF TV output mode with internally applied 11dB boost RF Mode with 11dB cut (overrides the normal 11dB boost)

Amino Communications Ltd. 2010

INDEX

CONTENTS

161

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

AudioControl.GetAC3Dualmono( )
Description

Retrieves information on how the two mono channels (if present) are routed to stereo in the settop boxs audio.

Prototype
string AudioControl.GetAC3Dualmono()

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
None.

Returns
one of the following strings: Value failed ll rr stereo mix Meaning internal error in the two mono channel (1+1) stream, the first mono channel is routed to both stereo channels in the 1+1 stream, the second mono channel is routed to both stereo channels in the 1+1 stream, the first mono channel is routed to the left channel and the other to the right channel each mono channel in the 1+1 stream is routed to both stereo channels

AudioControl.GetAC3Outmode( )
Description
Retrieves the set-top boxs AC-3 audio output mode.

Prototype
string AudioControl.GetAC3Outmode()

162

CONTENTS

INDEX

Amino Communications Ltd. 2010

AUDIOCONTROL

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
None.

Returns
one of the following strings: Value failed line rf Meaning error - cannot get AC-3 audio output mode AC-3 Line Mode AC-3 RF Mode

AudioControl.GetDefaultVolume( )
Description

Retrieves the set-top box default volume level (this is 100 if no default volume level has been set).

Prototype
number AudioControl.GetDefaultVolume()

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
None.

Returns
nothing if video control is not compiled. Otherwise, the function returns the volume level. This is a value in the range specified by the minimum and maximum volume levels, or 0 - 100 if these have not been set.

Amino Communications Ltd. 2010

INDEX

CONTENTS

163

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

AudioControl.GetMaxVolume( )
Description

Retrieves the set-top box maximum volume level (this is 100 if no maximum volume level has been set). If the current volume is higher then the max after the max has been set the volume is changed down to the new max. Changing the maximum volume to being higher than the maximum allowed value will not change the current volume.

Prototype
number AudioControl.GetMaxVolume()

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
None.

Returns
Fresco: The volume level. This is a value in the range 0 - 100. Opera: Nothing if video control is not compiled. Otherwise, the function returns the volume level. This is a value in the range 0 - 100.

AudioControl.GetMinVolume( )
Description

Retrieves the set-top box minimum volume level (this is 0 if no minimum volume level has been set). If the current volume is less then the min after the min has been set the volume is increased to the new min. Changing the minimum volume to being less than the minimum allowed value will not change the current volume.

Prototype
number AudioControl.GetMinVolume()

164

CONTENTS

INDEX

Amino Communications Ltd. 2010

AUDIOCONTROL

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
None.

Returns
Fresco: The volume level. This is a value in the range 0 - 100. Opera: Nothing if video control is not compiled. Otherwise, the function returns the volume level. This is a value in the range 0 - 100.

AudioControl.GetMute( )
Description
Retrieves the set-top boxs mute state (mute on or off).

Prototype
number AudioControl.GetMute()

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
None.

Returns
nothing if video control is not compiled. Otherwise, the function returns 0 if audio is not muted and 1 if audio is muted.

Amino Communications Ltd. 2010

INDEX

CONTENTS

165

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

AudioControl.GetVolume( )
Description

Retrieves the current set-top box volume level. See AudioControl.SetVolume( ) for further information on volume control using the IR remote.

Prototype
number AudioControl.GetVolume()

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
None.

Returns
nothing if if video control is not compiled. Otherwise, the function returns the volume level. This is a value in the range specified by the minimum and maximum volume levels, or in the range 0 - 100 if these have not been set.

AudioControl.SetAC3Downmix( )
Description

Sets the set-top boxs Dolby AC-3 downmix mode. Note that Dolby stereo relates to Dolby Pro Logic decoders.

Prototype
number AudioControl.SetAC3Downmix(string ac3downmix)

Supported browsers
Ant Fresco Opera 8.5 Opera 9

166

CONTENTS

INDEX

Amino Communications Ltd. 2010

AUDIOCONTROL

Parameters
Parameters ac3downmix Allowed values stereo stereo output mode dolby stereo Dolby stereo output mode (supports Dolby matrix stereo) Description The AC-3 downmix mode to set.

Returns
nothing if the input string is null or there is an internal JavaScript error. Otherwise, the function returns 0 on success and -1 on error.

AudioControl.SetAC3DRC( )
Description
Sets the set-top boxs Dolby AC-3 DRC (Dynamic Range Control) audio mode.

Prototype
number AudioControl.SetAC3DRC(string ac3drc)

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
Parameters ac3drc Allowed values linestd standard line output with full DRC linemax line output without DRC rftv RF TV output mode with internally applied 11dB boost rfmin RF Mode with 11dB cut (overrides the normal 11dB boost) Description The AC-3 DRC mode to set.

Returns
nothing if the input string is null or there is an internal JavaScript error. Otherwise, the function returns 0 on success and -1 on error.

Amino Communications Ltd. 2010

INDEX

CONTENTS

167

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

AudioControl.SetAC3Dualmono( )
Description
Sets the set-top boxs Dolby AC-3 dual mono output routing.

Prototype
number AudioControl.SetAC3Dualmono(string ac3dualmono)

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
Parameters ac3downmix Allowed values Description

ll in the 1+1 stream, the The AC-3 dual output routing mode first mono channel is routed to set. to both stereo channels rr in the 1+1 stream, the second mono channel is routed to both stereo channels stereo in the 1+1 stream, the first mono channel is routed to the left channel and the other to the right channel mix each mono channel in the 1+1 stream is routed to both stereo channels

Returns
nothing if the input string is null or there is an internal JavaScript error. Otherwise, the function returns 0 on success and -1 on error.

AudioControl.SetAC3Outmode( )
Description
Sets the set-top boxs Dolby AC-3 audio output mode.

Prototype
number AudioControl.SetAC3Outmode(string outmode)

168

CONTENTS

INDEX

Amino Communications Ltd. 2010

AUDIOCONTROL

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
Parameters outmode Allowed values line AC-3 line mode rf AC-3 RF mode Description The audio output mode to set.

Returns
nothing if the input string is null or there is an internal JavaScript error. Otherwise, the function returns 0 on success or -1 on error.

AudioControl.SetAudioMix( )
Description
Sets the mix type for the set-top box audio.

Prototype
number AudioControl.SetAudioMix(string mix)

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
Parameters mix Allowed values stereo both left and right channels left left channel only right right channel only monomix mix left and right channel together Description The audio mix type to set. (Note that the allowed values are not case-sensitive, so variants such as Stereo or STEREO are also allowed.)

Returns
Fresco: 0 on success and non-zero on error.

Amino Communications Ltd. 2010

INDEX

CONTENTS

169

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Opera: Nothing if the parameter entered cannot be parsed or if the mix parameter is null. Otherwise, the function returns 0 on success or non-zero on error.

AudioControl.SetDefaultVolume( )
Description
Sets the default set-top box volume level (this value is preserved across reboots).

Prototype
number AudioControl.SetDefaultVolume(number volume)

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
Parameters volume Allowed values 0 - 100 (actual range dependent on min. and max. values set) Description The volume level to set. This must be a value within the range set for minimum and maximum volume, or 0 - 100 if these values have not been set.

Returns
Fresco: 0 on success and non-zero on error. Opera: Nothing if the parameter entered cannot be parsed. Otherwise, the function returns 0 on success and non-zero on error.

AudioControl.SetMaxVolume( )
Description

Sets the maximum set-top box volume level (this value is preserved across reboots). If the current volume is higher then the max after the max has been set the volume is decreased to the new max. Changing the maximum volume to being higher than the maximum allowed value will not change the current volume.

Prototype
number AudioControl.SetMaxVolume(number volume)

170

CONTENTS

INDEX

Amino Communications Ltd. 2010

AUDIOCONTROL

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
Parameters volume Allowed values 0 - 100 Description The volume level to set. This value should be greater than the minimum value set.

Returns
Fresco: 0 on success and non-zero on error. Opera: Nothing if the parameter entered cannot be parsed. Otherwise, the function returns 0 on success and non-zero on error.

AudioControl.SetMinVolume( )
Description

Sets the minimum set-top box volume level (this value is preserved across reboots). If the current volume is less then the min after the min has been set the volume is increased to the new min. Changing the minimum volume to less than the minimum allowed value will not change the current volume.

Prototype
number AudioControl.SetMinVolume(number volume)

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Amino Communications Ltd. 2010

INDEX

CONTENTS

171

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Parameters
Parameters volume Allowed values 0 - 100 Description The volume level to set. This value should be less than the maximum value set.

Returns
Fresco: 0 on success or if the parameter entered cannot be parsed and returns non-zero on other error. Opera: Nothing if the parameter entered cannot be parsed. Otherwise, the function returns 0 on success and non-zero on other error.

AudioControl.SetMute( )
Description

Mutes or restores the set-top box audio output. When the audio mute is turned off, the volume level prior to muting is restored. Note that muting the audio is similar to setting AudioControl.SetVolume(0) (see "AudioControl.SetVolume( )" on page 173), except that with muting, the previous volume value is retained.

Prototype
number AudioControl.SetMute(number state)

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
Parameters state Allowed values 0 or 1 Description Mute state. Set 0 to un-mute and set 1 to mute.

Returns
nothing if the parameter entered cannot be parsed or non-zero for other error (Fresco only). Otherwise, the function returns 0.

172

CONTENTS

INDEX

Amino Communications Ltd. 2010

AUDIOCONTROL

AudioControl.SetRFAudioBoost( )
Description
Enables or disables the optional 6dB RF audio boost. The RF audio boost is hardware dependant.

Prototype
number AudioControl.SetRFAudioBoost(number add6db)

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
Parameters add6db Allowed values 0 or 1 Description The RF audio boost state. Set 0 to disable the boost and 1 to enable it.

Returns
0 on success or if RF support has not been compiled it returns non-zero on error

AudioControl.SetVolume( )
Description
Sets the current set-top box volume level. Note: The volume control is logarithmic, not linear. Values below 90 may not be audible

Under default conditions, the Amino remote will send out TV commands for the volume control +/- functions. However, if a European grey remote control is used and the brand code is set to 231, the STB will receive the volume control commands. The .AudioControl.GetVolume( )and SetVolume() commands can then be used by a key handler to control the volume output. The default key codes in fkeys.conf are 41 for Up, and 42 for Down. These can be set using the REMOTE_LAYOUT="AMINOTV" setting in the settings file. The above is true for all Amino STBs except for the AmiNET130 and 530 (and newer), which do not support the 231 'workaround'. Neither do non-EU 'grey' remotes nor the newer black AVC remotes.

Amino Communications Ltd. 2010

INDEX

CONTENTS

173

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

The AVC remote can be configured to emit key codes for the volume keys using the Amino IR protocol, which allows them work correctly with the AmiNET130 and newer STBs, and also with any other STB that supports the AVC remote. To configure the AVC remote to emit native Amino code sequences for the volume keys, press and hold the STB button until the STB button flashes. If 9,9,3,Volume Up is now pressed, the remote will emit codes for the STB in all modes. If 9,9,3,Volume Down is now pressed, the remote will emit codes for the STB in the current mode (for example, TV if the TV mode was selected prior to entering programming mode) If 9,9,3,Mode is entered, this will cause the remote to emit volume codes for the selected device in the currently selected mode.

The factory default is to emit codes for the TV code set whilst in STB mode. Opera will now see the following keycodes: 8495 (Volume UP) 8496 (Volume DOWN) AudioControl.SetVolume() / GetVolume() JMACX calls could then be used to implement a volume control. Action codes 41 and 42 in fkeys.conf could also be used, but this would not allow for any visual feedback by returning the currently set volume.

Prototype
number AudioControl.SetVolume(number volume)

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
Parameters type Allowed values 0 - 100 (actual range dependent on min. and max. values set) Description The volume level to set. This must be a value within the range set for minimum and maximum volume (or 0 100 if these values have not been set.)

Returns
Fresco: 0 on success and returns non-zero on error. Opera: 0 on success and returns non-zero on error. Returns nothing if the parameter entered cannot be parsed.

174

CONTENTS

INDEX

Amino Communications Ltd. 2010

Chapter 6Browser

The Browser class allows interaction with the browser to control and customise display content.

6.1

Browser functions

The following browser functions are supported.

Browser.Action( )
Description
Performs the specified action in the browser.

Prototype
Browser.Action(number action_number, [string action])

Supported browsers
Opera 8.5

Parameters
Parameters action_num ber [action] Allowed values Description

1 - 23 or 32 - 58. See separate list of Number that maps to action codes - Appendix A, Key codes and defined action. action codes . Depends on action set. See separate list of action codes for details of which require this additional parameter to be set - Appendix A, Key codes and action codes . Additional parameter required for some of the actions specified with action_number.

Returns
nothing.

Amino Communications Ltd. 2010

INDEX

CONTENTS

175

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Browser.CacheFlush( )
Description
Deletes one level of disk caching.

Prototype
Browser.CacheFlush()

Supported browsers
Ant Fresco Opera 8.5

Parameters
None.

Returns
nothing.

Browser.FrameLoadResetsState( )
Description

Controls whether the Amino browser code resets various page settings when the browser performs partial page loads (such as reloading a frame). With the reset_state set to 1, whenever the browser reloads any page element, the Amino browser code resets values such as the following: JMACX event handlers. Trickplay speed Unloading video (if this is not disabled). Mouse pointer visibility state (if not disabled). Border state (if not disabled). For Opera 8.x this means scrolling. Toolbar state (if not disabled). For Opera 8.x this means loading the status display. Macrovision mode for URL. Whether default keys are used for the URL. Whether channel key processing is used for the URL. The page loading finished code also adds the URL to the history.

This can mean it takes longer to load the page element and can cause behaviour such as losing video unexpectedly. With the reset_state set to 0, these resets are not performed when elements such as frames are reloaded. For this reason, FrameLoadResetsState(0) should normally be used for middleware integration where frames are used to perform partial page loads.

176

CONTENTS

INDEX

Amino Communications Ltd. 2010

BROWSER

The setting changes an internal Opera setting, and the change is valid until the session is terminated (that is, the set-top box is switched off or rebooted).

Prototype
Browser.FrameLoadResetsState(number reset_state)

Supported browsers
Opera 8.5

Parameters
Parameters reset_state Allowed values 0 or 1 Description Set whether frame loads are treated as page loads. Set 0 for the Amino code not to reset page values when a frame loads. Set 1 for the Amino code to treat frame loads as new page loads (this is the default state).

Returns
nothing.

Browser.GetToolbarState( )
Description

Returns the visibility state of the toolbar (only works on browsers that have a toolbar method).

Prototype
number Browser.GetToolbarState()

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
None.

Returns
0 if the toolbar is invisible or hidden and returns 1 if toolbar is visible.

Amino Communications Ltd. 2010

INDEX

CONTENTS

177

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Browser.GoBack( )
Description

Moves the browser back to the previous page (using the browsers bookmarks and/or history). On Opera, it is also possible to specify how many pages to move back through the history.

Prototype
(Fresco) Browser.GoBack() (Opera) Browser.GoBack([number n])

Supported browsers
Ant Fresco Opera 8.5

Parameters
Parameters n Allowed values Description Number of pages to move back through. By default, this is 1.

Returns
nothing.

Browser.GogiAction( )
Description

Passes an action number to the browser. The number indicates the button pressed on an HTML alert or confirm dialogue box.

Prototype
Browser.GogiAction(number action_number)

Supported browsers
Opera 8.5

178

CONTENTS

INDEX

Amino Communications Ltd. 2010

BROWSER

Parameters
Parameters Allowed values or 1001 cancel Description The action number to pass to the browser.

action_number 1000 OK

Returns
nothing.

Browser.GoHome( )
Description
Loads the home page.

Prototype
Browser.GoHome()

Supported browsers
Opera 8.5

Parameters
None.

Returns
nothing.

Browser.Lower( )
Description
Lowers the browser window behind any active subtitle window.

Prototype
Browser.Lower()

Amino Communications Ltd. 2010

INDEX

CONTENTS

179

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
None.

Returns
nothing.

Browser.PopConfig( )
Description

This pushes a stored config and sets values back to those stored values. This would be used for a portal that was exiting to an external website and re-enabling default key behaviour.

Prototype
number Browser.PushConfig()

Parameters
None

Supported browsers
Opera 8.5 Opera 9

Returns
The following string arguments: Returned string OK Failed to get config Description Config was retrieved and behaviour restored. The stack was empty.

Example of use
<body onload="init()" onunload="exit()"> <script type="text/javascript"> function init() { // Use OK from Browser.PushConfig here

180

CONTENTS

INDEX

Amino Communications Ltd. 2010

BROWSER

if ("OK" == Browser.PushConfig()) { VideoDisplay?.SetChromaKey(0x808080); ASTB.SetMouseState(0); Browser.SetToolbarState(0); ASTB.DefaultKeys(0); ASTB.WithChannels(false); } } function exit() { if ("OK" != Browser.PopConfig()) { alert("Error in restoring previous state"); } } // Rest of code goes here....

Browser.PushConfig( )
Description

This stores the current settings for the chromakey, alpha level, toolbar, mouse state, channel popup and keymappings. As this call is designed to be made on a onload handler then to stop multiple registrations of the same page the current URL is checked and the settings are not stored if the last URL matches. This default behaviour can be overridden by setting the optional force argument to 1. It is recommended that this call is only made in the onload handler for the index or top page of a portal and nowhere else.

Prototype
string Browser.PushConfig(number force)

Supported browsers
Opera 8.5 Opera 9

Amino Communications Ltd. 2010

INDEX

CONTENTS

181

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Parameters
Parameters force Allowed values 0 or 1 Description A value of 1 forces the STB to accept the configuration. The default value is 0.

Returns
the following string arguments: Returned string OK Invalid override value specified Failed to store settings Description Configuration was pushed on to the stack correctly. The value entered as the force argument was not able to be parsed. Unable to push the settings on the stack. Generally this means that the settings have been pushed from this page before. This would be seen doing a back from a portal page back to the portal index that calls Browser.PushConfig() in the onload handler.

Browser.Raise( )
Description
Raises the browser window above any active subtitle window. Useful when subtitles are active and you want to see browser graphics.

Prototype
Browser.Raise()

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
None.

Returns
nothing.

182

CONTENTS

INDEX

Amino Communications Ltd. 2010

BROWSER

Browser.SetToolbarState( )
Description
Changes the visibility of the toolbar (only works on browsers that have a toolbar method).

Prototype
Browser.SetToolbarState(number state)

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
Parameters state Allowed values 0 or 1 Description Visibility state. 0 hides the toolbar and 1 enables the toolbar.

Returns
nothing.

Browser.SpatialNavigation( )
Description
Enables or disables spatial navigation on a browser web page.

Prototype
Browser.SpatialNavigation(number nav)

Supported browsers
Opera 9

Amino Communications Ltd. 2010

INDEX

CONTENTS

183

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Parameters
Parameters nav Allowed values 0 or 1 Description Spatial navigation. 0 disables spatial navigation and 1 enables spatial navigation.

Returns
nothing.

184

CONTENTS

INDEX

Amino Communications Ltd. 2010

Chapter 7AminoGeneric

The AminoGeneric API is only for use by partner companies of Amino who are developing software to run on an AmiNET set-top box, using an Amino supplied Software Development Kit. Please also see Amino Technical Note TN024 - Using AminoGeneric, for further information.

7.1

AminoGeneric class

The AminoGeneric class enables messages to be passed between JavaScript and third party software daemons running on the set-top box. In this system, a custom application created with an SDK can communicate over a UNIX domain socket to the web browser (Ant Fresco or Opera). Asynchronous events can also be passed back by the daemon to a suitable JavaScript event handler. This system allows a developer to extend the functionality of the STB and browser without needing to route messages through the entire software stack. Typical uses of AminoGeneric include adding support for remote network devices (such as communicating using VoIP systems with the browser) or adding control for conditional access systems to the browser. The messages passed by AminoGeneric are strings. In order to make parsing easy in the JMACX layer it is recommended that you use XML style tags to enclose strings. AminoGeneric functionality allows browsers to be notified of a new AminoGeneric server at run time even if the browser was started before the server. This requires an additional coding requirement to the server which will be described shortly. Each application using AminoGeneric is assigned an ID. This allows JMACX pages to deal with several clients simultaneously. ID #2 is reserved for testing purposes and can be used safely in custom applications. Applications which are to be distributed to third parties, or in conjunction with standard third party components should use an ID registered with Amino. Partner companies using this API will be assigned a unique service ID for use with it.

Amino Communications Ltd. 2010

INDEX

CONTENTS

185

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

7.2

AminoGeneric functions

The following AminoGeneric functions are supported.

AminoGeneric.Call( )
Description

Sends the xmldata string to a third-party daemon, and blocks further operations until the daemon returns a response.

Prototype
string AminoGeneric.Call(number service_id, string xmldata)

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
Parameters service_id Allowed values 1 - 30 Description Service identifier. Unless Amino has given you a specific service ID, use the test ID value of 2. XML data string to send to the daemon.

xmldata

Returns
nothing if the specified daemon is not present on the set-top box (that is, it is undefined).

AminoGeneric.onEvent<service_id>
Description

Enables a JavaScript event handler to be associated with AminoGeneric events and needs to be set with a string that contains the call to the JavaScript function to use. service_ID is a service identifier integer in the range 1 - 30, unless Amino has given you a specific service ID, use the test ID value of 2. Note: ID 13 is currently used for STBremoteconf EAS (Emergency Alert Service) notifications. See the Amino Set-top Box Configuration Guide for more details.

Prototype
string AminoGeneric.onEvent<service_ID>

186

CONTENTS

INDEX

Amino Communications Ltd. 2010

AMINOGENERIC

Supported browsers
Ant Fresco Opera 8.5 Opera 9

Parameters
Parameters service_ID Allowed values 1 - 30 Description Service identifier. Unless Amino has given you a specific service ID, use the test ID value of 2.

Usage example - Fresco


// The event handler itself function eventhandler(xml_event_string) { alert (Message sent to eventhandler + xml_event_string) ; } // Register the event handler for unique service identifier ID of 2 AminoGeneric.onEvent2=eventhandler ;

Usage example - Opera


// The function definition is the same as for Fresco browsers, but the registration is: AminoGeneric.onEvent2=eventhandler; Otherwise, the function returns a null-terminated string containing the response.

Usage example
// Make a call to a non existent daemon s = AminoGeneric.Call(2, <XML><MSG>Hello</MSG></XML>) ; if ( typeof s == undefined ) alert(No such device); else alert(s) ; Events passed from the customer application are trapped in JMACX using an event handler: function eventhandler(event_string) { alert(event_string); } To call eventhandler via an onEvent call to AminoGeneric ID of 2 from JavaScript would use the following method: For ANT Fresco: AminoGeneric.onEvent2=eventhandler ;

Amino Communications Ltd. 2010

INDEX

CONTENTS

187

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

For Opera Gogi: AminoGeneric.onEvent2="eventhandler" ; Note: Opera9 just passes a callback handler and does not block. An example daemon is supplied in the sampledaemon_1 package with the Amino Software Development Kit (SDK). This handles setting up the UNIX domain sockets and communicating with the browser. It also communicates to a kernel module samplemodule_1 which sends events through sampledaemon to the browser at regular intervals. In Opera the alert box blocks any further communication from server to the browser until the box is closed and then all pending events communicated from the server are displayed faster than normal. However, in Fresco this behaviour does not occur and an alert box can remain active whilst the events are updated at the same time within a text box. In both cases, the keyboard focus remains on the alert box.

188

CONTENTS

INDEX

Amino Communications Ltd. 2010

Chapter 8TVI

The TVI class enables control of a television, via the TVI port on hospitality versions of AmiNET set-top boxes (for example, the AmiNET110H). Please see Amino Technical Note 026 - TVI, for furrther information. Note: The TVI Generic functionality is available from the 0.16.1 build onwards.

8.1

TVI event-handler attributes

TVI.onEvent
Description

Enables a JavaScript event handler to be associated with a TVI event TVI.onEvent is set with a string that contains the JavaScript event handler function call.

Prototype
string TVI.onEvent

Supported browsers
Ant Fresco Opera 8.5 Hospitality platforms only.

Usage example (Fresco)


TVI.onEvent = catchPacket(); ; function catchPacket ( b0, b1, b2 ) { // do stuff }

Usage example (Opera)


function catchpacket() {
Amino Communications Ltd. 2010 INDEX CONTENTS 189

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

b0 = TVI.byte0; b1 = TVI.byte1; b2 = TVI.byte2; alert("TVI handler. Button codes are:- " + b0 + "," + b1 + "," +b2); } // Put the TVI handler code here Note: TVI.onEvent = "catchpacket()". The function catchPacket in Opera builds has no data arguments whereas in Fresco it does.

8.2

Return codes
Value 0 1 2 3 4 8 Meaning LIBTVI_OK LIBTVI_ERROR LIBTVI_TIMEOUT LIBTVI_UNKNOWN LIBTVI_KEYCODE LIBTVI_TOOBIG

The following table lists the codes returned by many of the TVI functions:

8.3

TVI functions
Philips Zenith LG Mate TV-link Samsung

The following table lists the TVI PIC calls implemented for each platform.

Function/attribute TVI.Configure( ) TVI.CustomCommand( ) TVI.DetectTV( ) TVI.DisplayNumber( ) TVI.DisplayText( ) TVI.GetFeatures( ) TVI.GetIsTvOn( ) TVI.GetMaxVolume( ) TVI.GetMinVolume( ) TVI.GetMute( ) TVI.GetStartupVolume( )

Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y

190

CONTENTS

INDEX

Amino Communications Ltd. 2010

TVI

Philips

Zenith

LG

Mate

TV-link

Samsung

Function/attribute TVI.GetVersion( ) TVI.GetVolume( ) TVI.ProcessUnhandledKey( ) TVI.RemoteFormatIn( ) TVI.SelectTeletext( ) TVI.SetChannel( ) TVI.SetInput( ) TVI.SetKeyLock( ) TVI.SetMaxVolume( ) TVI.SetMinVolume( ) TVI.SetMute( ) TVI.SetOSD( ) TVI.SetStartupVolume( ) TVI.SetTvType( ) TVI.SetupClosedCaption( ) TVI.SetVolume( ) TVI.SystemInfo( ) TVI.TVOff( ) TVI.TVOn( ) TVI.VolumeDown( ) TVI.VolumeUp( )

Y Y Y Y Y Y Y

Y Y

Y Y

Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y

Y Y Y

Y Y Y

Y Y Y Y Y Y Y Y Y

Y Y

Y Y

Y Y Y Y

Y Y

Y Y

Y Y

Y Y

Amino Communications Ltd. 2010

INDEX

CONTENTS

191

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

8.3.1

TVI class

The following TVI functions are supported.

TVI.Configure( )
Description
Sends configuration data to the PIC. The data that can be sent depends on the PIC type.

Prototype
number TVI.Configure(number byte1, number byte2)

Supported browsers
Ant Fresco Opera 8.5 Opera 9 Philips protocol only. Hospitality platforms only.

Parameters
Parameters byte 1 byte 2 Allowed values depends on PIC type depends on PIC type Description First data byte. Second data byte.

Returns
nothing if TVI is not compiled or the parameter cannot be parsed. Otherwise, the function returns 0. Usage example (Philips2 PIC code): // Enables forwarding of TV key/command packets by the PIC to the STB TVI.Configure(2,0) ; // Restore default/powerup state to the PIC TVI.Configure(0,0);

TVI.CustomCommand( )
Description

Sends television-specific codes into the TVI PIC for transmission to the television. For example, to set a television mode that cannot be set by a generic call.

192

CONTENTS

INDEX

Amino Communications Ltd. 2010

TVI

Prototype
number TVI.CustomCommand(string data)

Supported browsers
Opera 8.5 Opera 9 Hospitality platforms only.

Parameters
Parameters data Allowed values Description 0 - 255 or 0x00 - 0xff The code to pass into the television. The allowed codes depend on the PIC type. Enter a string formed from sequence of bytes separated by delimiters (such as a comma or a colon) with no spaces. The bytes can be represented in decimal or hexadecimal formats.

Returns
nothing if TVI is not compiled or the parameter cannot be parsed. Otherwise, the function returns one of the following return codes: Description OK Error back from TV Timeout (TV not responding or not there) Unknown or Unexpected data from TV Usage examples: rc = TVI.CustomCommand(0x01,0x05,0x10,0x2b) ; rc = TVI.CustomCommand(1,5,16,43) ; Type Code 0 1 2 3

TVI.DetectTV( )
Description
Detects whether a television is connected to the TVI port.

Prototype
number TVI.DetectTV()

Amino Communications Ltd. 2010

INDEX

CONTENTS

193

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Supported browsers
Ant Fresco Opera 8.5 Opera 9 Hospitality platforms only.

Parameters
None.

Returns
nothing if TVI is not compiled. Otherwise, the function returns one of the standard TVI return codes (see "Return codes" on page 190).

TVI.DisplayNumber( )
Description

Controls the way the television displays a partial or full channel number, as if the user were entering digits on the remote control.

Prototype
number TVI.DisplayNumber(number number, number control)

Supported browsers
Ant Fresco Opera 8.5 Opera 9 Philips protocol only. Hospitality platforms only.

194

CONTENTS

INDEX

Amino Communications Ltd. 2010

TVI

Parameters
Parameters number control Allowed values 0- 999 32 Display channel number 64 Display CHANNEL NOT AVAILABLE 128 Display channel number followed by a dash (-) Description TV channel number. The channel number display mode.

Returns
nothing if TVI is not compiled or the parameter cannot be parsed. Otherwise, the function returns one of the following error codes: Description OK Error back from TV Timeout (TV not responding or not there) Unknown or Unexpected data from TV Type Code 0 1 2 3

TVI.DisplayText( )
Description

Outputs a Hello world string to the television as a test of communication with the TVI port. Note: Implemented for test purposes only.

Prototype
number TVI.DisplayText( )

Supported browsers
Ant Fresco Opera 8.5 Hospitality platforms only. Not available on Philips TVs.

Parameters
None.

Returns
nothing if TVI is not compiled. Otherwise, the function returns a numerical value.

Amino Communications Ltd. 2010

INDEX

CONTENTS

195

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

TVI.GetFeatures( )
Description

Retrieves the PIC features that are active for the TVI port. TVI.GetFeatures can only be called after a successful call to TVI.SystemInfo.

Prototype
number TVI.GetFeatures( )

Supported browsers
Opera 8.5 Hospitality platforms only.

Parameters
None.

Returns
a hexadecimal value indicating the features that are active. The meaning of the value returned depends on the PIC type. TV PIC LG Mate Philips TVLink Zenith Version 1 1 5 1 4 Features 0x83 0x84 0x81 0x85 0x82 Reprogrammable (0x80) LG (0x03) Reprogrammable (0x80) Mate (0x04) Programmable (0x80) Philips (0x01) TVLink(LG) (0x05) Zenith (0x02)

TVI.GetIsTvOn( )
Description
Queries the television to find out its current state.

Prototype
number TVI.GetIsTvOn( )

196

CONTENTS

INDEX

Amino Communications Ltd. 2010

TVI

Supported browsers
Ant Fresco Opera 8.5 Opera 9 Hospitality platforms only.

Parameters
None.

Returns
0 if the television is switched off or 1 if it is switched on.

TVI.GetMaxVolume( )
Description
Retrieves the maximum television volume.

Prototype
number TVI.GetMaxVolume( )

Supported browsers
Ant Fresco Opera 8.5 Opera 9 Hospitality platforms only.

Parameters
None.

Return
nothing if TVI is not compiled. Otherwise, the function returns the current volume (this is a value in the range 0 - 255). Note that 63 is the maximum for Philips TVs. This may not be the case for other TVs. The values are passed without constraint. The range is dependent on the TV connected.

Amino Communications Ltd. 2010

INDEX

CONTENTS

197

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

TVI.GetMinVolume( )
Description
Retrieves the minimum television volume.

Prototype
number TVI.GetMinVolume( )

Supported browsers
Ant Fresco Opera 8.5 Opera 9 Hospitality platforms only.

Parameters
None.

Returns
nothing if TVI support is not compiled. Otherwise, the function returns the current volume (this is a value in the range 0 - 255). Note that 63 is the maximum for Philips TVs. This may not be the case for other TVs. The values are passed without constraint. The range is dependent on the TV connected.

TVI.GetMute( )
Description
Retrieves the current mute state.

Prototype
number TVI.GetMute( )

Supported browsers
Ant Fresco Opera 8.5 Opera 9 Hospitality platforms only.

198

CONTENTS

INDEX

Amino Communications Ltd. 2010

TVI

Parameters
None.

Returns
nothing if TVI is not compiled. Otherwise, the function returns 0 if the current state is non-mute and 1 if the current state is set to mute.

TVI.GetStartupVolume( )
Description

Retrieves the default television volume (this is the volume used when the television is switched on).

Prototype
number TVI.GetStartupVolume( )

Supported browsers
Ant Fresco Opera 8.5 Opera 9 Hospitality platforms only.

Parameters
None.

Returns
nothing if TVI is not compiled. Otherwise, the function returns the default volume (this is a value in the range 0 - 255). Note that 63 is the maximum for Philips TVs. This may not be the case for other TVs. The values are passed without constraint. The range is dependent on the TV connected.

TVI.GetVersion( )
Description

Retrieves the version number of the TVI PIC. TVI.GetVersion can only be called after a successful call to TVI.SystemInfo.

Prototype
number TVI.GetVersion( )

Amino Communications Ltd. 2010

INDEX

CONTENTS

199

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Supported browsers
Opera 8.5 Hospitality platforms only.

Parameters
None.

Returns
the version number.

TVI.GetVolume( )
Description
Retrieves the current television volume..

Prototype
number TVI.GetVolume( )

Supported browsers
Ant Fresco Opera 8.5 Opera 9 Hospitality platforms only.

Parameters
None.

Returns
nothing if TVI functionality his not compiled. Otherwise, the function returns the current volume (this is a value in the range 0 - 255). Note that 63 is the maximum for Philips TVs. This may not be the case for other TVs. The values are passed without constraint. The range is dependent on the TV connected.

TVI.ProcessUnhandledKey( )
Description
Returns key codes sent from a callback that are not handled by the defined system default JavaScript key handler on the current page

200

CONTENTS

INDEX

Amino Communications Ltd. 2010

TVI

Prototype
number TVI.ProcessUnhandledKey(number byte1, number byte2, number byte3)

Supported browsers
Opera 8.5 Hospitality platforms only.

Parameters
Parameters byte1 byte2 byte3 Allowed values 0 - 255 0 - 255 0 - 255 Description Byte value returned from event handler. Byte value returned from event handler. Byte value returned from event handler.

Returns
0 if the full call process is completed. Usage example (example handler for hospitality televisions (Philips)): TVI.onEvent = catchPacket();; function catchPacket() { b0 = TVI.byte0 ; b1 = TVI.byte1 ; b2 = TVI.byte2 ; if ( 0 != catchPacket( b0, b1, b2 ) ) { // Handle this internally TVI.ProcessUnhandledKey( b0, b1, b2 ) ; } } function catchPacket( b0, b1, b2 ) { switch ( b0 ) { case 3:/* digit entered */ digit = ( b1 & 0x0F ) ; TVI.RemoteFormatIn ( 0, digit ) ; return 0 ; break ; case 4:/* Volume control */ if ( b1 & 0x08 ) {

Amino Communications Ltd. 2010

INDEX

CONTENTS

201

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

TVI.RemoteFormatIn ( 0, 13 ) ; return 0 ; } if ( b1 & 0x02 ) { TVI.RemoteFormatIn ( 0, 16 ) ; return 0 ; } if ( b1 & 0x01 ) { TVI.RemoteFormatIn ( 0, 17 ) ; return 0 ; } break ;

/* mute */

/* vol+ */

/* vol- */

} return -1 ;// key not handled here use the default handler }

TVI.RemoteFormatIn( )
Description

Sends a command that the television interprets as if it was generated by pressing a key on the remote control.

Prototype
number TVI.RemoteFormatIn(number system, number keycode)

Supported browsers
Ant Fresco Opera 8.5 Opera 9 Philips protocol only. Hospitality platforms only.

202

CONTENTS

INDEX

Amino Communications Ltd. 2010

TVI

Parameters
Parameters system keycode Allowed values 0 or 7 0 127 Description RC5 system value. Typical values are 0 or 7. RC5 keycode number.

Returns
nothing if TVI is not compiled or the parameter cannot be parsed. Otherwise, the function returns one of the following error codes: Description OK Error back from TV Timeout (TV not responding or not there) Unknown or Unexpected data from TV Usage examples: //Emulates the Vol+ key TVI.RemoteFormatIn(0,16); // Emulates the Vol- key TVI.RemoteFormatIn(0,17); // Emulates the 3 key TVI.RemoteFormatIn(0,3); Type Code 0 1 2 3

TVI.SelectTeletext( )
Description
Controls the televisions teletext decoder via the TVI port.

Prototype
number TVI.SelectTeletext(number mode, [number page])

Supported browsers
Ant Fresco Opera 8.5 Opera 9 Hospitality platforms only.

Amino Communications Ltd. 2010

INDEX

CONTENTS

203

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Parameters
Parameters mode Allowed values 0 off 1 mix 2 on [page] 0 - 899 The teletext page to display. If this parameter is not included, the default value 0 is used. Description Teletext mode.

Returns
nothing if TVI is not compiled or the parameter cannot be parsed. Otherwise, the function returns one of the following error codes: Description OK Error back from TV Timeout (TV not responding or not there) Unknown or Unexpected data from TV Type Code 0 1 2 3

TVI.SetChannel( )
Description
Sets the television channel, via the TVI port.

Prototype
number TVI.SetChannel(number channel, [number mode])

Supported browsers
Ant Fresco Opera 8.5 Opera 9 Hospitality platforms only.

204

CONTENTS

INDEX

Amino Communications Ltd. 2010

TVI

Parameters
Parameters channel [mode] 0 or 1 Allowed values Description The channel to set. The mode that the channel is received in. Set 0 for Broadcast mode and 1 for Cable mode. If this parameter is not included, the default value 0 is used.

Returns
The function returns one of the standard TVI return codes (see "Return codes" on page 190).

TVI.SetInput( )
Description
Sets the television input mode.

Prototype
number TVI.SetInput(number mode)

Supported browsers
Ant Fresco Opera 8.5 Opera 9 Hospitality platforms only.

Amino Communications Ltd. 2010

INDEX

CONTENTS

205

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Parameters
Parameters mode Allowed values 0 TVINPUT_TV 1 TVINPUT_INFO 2 TVINPUT_PAYTV 3 TVINPUT_RADIO 4 TVINPUT_DIGITAL 16 TVINPUT_AV1 17 TVINPUT_AV2 32 TVINPUT_SVIDEO1 33 TVINPUT_SVIDEO2 48 TVINPUT_COMPONENT1 49 TVINPUT_COMPONENT2 Description The input mode to set. Note that actual values available from this list depend on the television type.

Returns
nothing if TVI is not compiled. Otherwise, the function returns one of the standard TVI return codes (see "Return codes" on page 190). Note that if the mode entered is not recognised, the return value is 3 (LIBTVI_UNKNOWN).

TVI.SetKeyLock( )
Description
Sets the key lock on the television to be on or off.

Prototype
number TVI.SetKeyLock(number lockmode)

Supported browsers
Ant Fresco Opera 8.5 Hospitality platforms only.

206

CONTENTS

INDEX

Amino Communications Ltd. 2010

TVI

Parameters
Parameters lockmode Allowed values 0 or 1 Description Key lock mode to set. Set 0 to switch the key lock off and 1 to switch the key lock on.

Returns
nothing if TVI is not compiled. Otherwise, the function returns one of the standard TVI return codes (see "Return codes" on page 190).

TVI.SetMaxVolume( )
Description

Sets the maximum volume level for the television, via the TVI port. Note that if the value you set is less than the minimum volume, the maximum volume is set to be the same as the minimum volume.

Prototype
TVI.SetMaxVolume(number volume)

Supported browsers
Ant Fresco Opera 8.5 Opera 9 Hospitality platforms only.

Parameters
Parameters volume Allowed values 0 - 255 Description The maximum volume. Note that this should be greater than the minimum volume. For example, 63 is the maximum for Philips TVs. This may not be the case for other TVs. The values are passed without constraint. The range is dependent on the TV connected.

Returns
nothing.

Amino Communications Ltd. 2010

INDEX

CONTENTS

207

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

TVI.SetMinVolume( )
Description

Sets the minimum volume level for the television, via the TVI port. Note that if the value you set is greater than the maximum volume, the minimum volume is set to be the same as the maximum volume.

Prototype
TVI.SetMinVolume(number volume)

Supported browsers
Ant Fresco Opera 8.5 Opera 9 Hospitality platforms only.

Parameters
Parameters volume Allowed values 0 - 255 Description The minimum volume. Note that this should be less than the maximum volume. For example, 63 is the maximum for Philips TVs. This may not be the case for other TVs. The values are passed without constraint. The range is dependent on the TV connected.

Returns
nothing.

TVI.SetMute( )
Description
Sets the television volume mute state on or off via the TVI port.

Prototype
number TVI.SetMute(number set)

208

CONTENTS

INDEX

Amino Communications Ltd. 2010

TVI

Supported browsers
Ant Fresco Opera 8.5 Opera 9 Hospitality platforms only.

Parameters
Parameters set Allowed values 0 or 1 Description Set 0 for non-mute and 1 for mute.

Returns
nothing if TVI is not compiled or there is an error parsing the parameter entered. Otherwise, the function returns one of the standard return codes (see "Return codes" on page 190).

TVI.SetOSD( )
Description
Sets or disables the televisions on-screen display.

Prototype
number TVI.SetOSD(number state)

Supported browsers
Ant Fresco Opera 8.5 Hospitality platforms only.

Parameters
Parameters state Allowed values 0 or 1 Description Set 0 to disable the on-screen display and 1 to enable it.

Returns
nothing if TVI is not compiled. Otherwise, the function returns one of the standard TVI return codes (see "Return codes" on page 190).

Amino Communications Ltd. 2010

INDEX

CONTENTS

209

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

TVI.SetStartupVolume( )
Description

Sets the default volume level for the television, via the TVI port. This defines the volume when the television is switched on.

Prototype
TVI.SetStartupVolume(number volume)

Supported browsers
Ant Fresco Opera 8.5 Opera 9 Hospitality platforms only.

Parameters
Parameters volume Allowed values 0 - 255 Description The default volume. For example, 63 is the maximum for Philips TVs. This may not be the case for other TVs. The values are passed without constraint. The range is dependent on the TV connected.

Returns
nothing.

TVI.SetTvType( )
Description

Sets the protocol used by the PIC. The PIC translates commands from the internal serial port to the protocol required for the particular television type.

Prototype
number TVI.SetTvType(number type)

210

CONTENTS

INDEX

Amino Communications Ltd. 2010

TVI

Supported browsers
Ant Fresco Opera 8.5 Opera 9 Hospitality platforms only.

Parameters
Parameters type Allowed values 0 Philips (TVITYPE_PHILIPS) 1 Zenith (TVITYPE_ZENITH 2 LG (TVITYPE_LG) 3 Mate (Sony/Panasonic) (TVITYPE_MATE) 4 LG TVLink. (TVITYPE_TVLINK) 5 Generic (TVITYPE_GENERIC) Description The television type.

Returns
nothing if TVI is not compiled or the parameter cannot be parsed. Otherwise, the function returns one of the following error codes: Description OK Error back from TV Timeout (TV not responding or not there) Unknown or unexpected data from TV Type Code 0 1 2 3

TVI.SetupClosedCaption( )
Description
Controls the televisions closed caption decoder, via the TVI port.

Prototype
number TVI.SetupClosedCaption(number mode)

Amino Communications Ltd. 2010

INDEX

CONTENTS

211

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Supported browsers
Ant Fresco Opera 8.5 Opera 9 Hospitality platforms only. Not supported for Zenith PIC type.

Parameters
Parameters mode Allowed values 0 off 1 Caption channel 1 - field 1 2 Caption channel 2 - field 2 9 Caption channel 1 activated when television set to mute Description Closed caption mode.

Returns
nothing if TVI is not compiled or the parameter cannot be parsed. Otherwise, the function returns one of the following error codes: Description OK Error back from TV Timeout (TV not responding or not there) Unknown or Unexpected data from TV Type Code 0 1 2 3

TVI.SetVolume( )
Description

Sets the television volume level via the TVI port. Note that if the volume you set is less than the minimum volume, the volume is set to the same as the minimum volume. If the volume you set is greater than the maximum volume, the volume is set to the same as the maximum volume.

Prototype
number TVI.SetVolume(number volume)

212

CONTENTS

INDEX

Amino Communications Ltd. 2010

TVI

Supported browsers
Ant Fresco Opera 8.5 Opera 9 Hospitality platforms only.

Parameters
Parameters volume Allowed values 0 - 255 Description The volume to set. This must be a value in the range specified by the minimum and maximum volume settings, or 0 - 255 if these values have not been set. For example, 63 is the maximum for Philips TVs. This may not be the case for other TVs. The values are passed without constraint. The range is dependent on the TV connected.

Returns
nothing if TVI is not compiled or there is an error parsing the parameter entered. Otherwise, the function returns one of the standard TVI return codes (see "Return codes" on page 190).

TVI.SystemInfo( )
Description

Retrieves TVI port system and implementation information. On Opera, all that is retrieved is a return code indicating success or error. On success, the information values can then be retrieved using the TVI.GetVersion and TVI.GetFeatures functions.

Prototype
Fresco and Opera9: object TVI.SystemInfo( ) Opera: number TVI.SystemInfo( )

Supported browsers
Ant Fresco Opera 8.5 Opera 9 Hospitality platforms only.

Amino Communications Ltd. 2010

INDEX

CONTENTS

213

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Parameters
None.

Return
Fresco and Opera 9: Nothing if TVI is not compiled. Otherwise, the function returns an object with the following attributes: Attribute Result Type number Description One of the standard TVI return codes (see "Return codes" on page 190). This is the minimum attribute returned in the object. The remaining attributes are only included if the Result value is 0 (i.e. the system information is retrieved successfully). The current version of the TVI PIC. Hexadecimal value indicating the features that are active. The meaning of the value returned depends on the PIC type.

Version Features

number number

Opera 8.5: 0 (zero). Otherwise returns one of the standard return codes (see "Return codes" on page 190) To access the version and feature values, use the TVI.GetVersion( ) and TVI.GetFeatures( ) functions.

TVI.TVOff( )
Description
Switches the television off via the TVI port.

Prototype
number TVI.TVOff( )

Supported browsers
Ant Fresco Opera 8.5 Opera 9 Hospitality platforms only.

Parameters
None.

Returns
nothing if TVI is not compiled. Otherwise, the function returns one of the standard TVI return codes (see "Return codes" on page 190).

214

CONTENTS

INDEX

Amino Communications Ltd. 2010

TVI

TVI.TVOn( )
Description
Switches the television on via the TVI port.

Prototype
number TVI.TVOn()

Supported browsers
Ant Fresco Opera 8.5 Opera 9 Hospitality platforms only.

Parameters
None.

Returns
nothing if TVI is not compiled. Otherwise, the function returns one of the standard TVI return codes (see "Return codes" on page 190).

TVI.VolumeDown( )
Description

Decrements the television volume by 1, down to the minimum volume set. An error is returned if you try to decrement beyond the minimum volume.

Prototype
number TVI.VolumeDown( )

Supported browsers
Ant Fresco Opera 8.5 Opera 9 Hospitality platforms only.

Parameters
None.

Amino Communications Ltd. 2010

INDEX

CONTENTS

215

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Returns
nothing if TVI is not compiled. Otherwise, the function returns one of the standard return codes (see "Return codes" on page 190).

TVI.VolumeUp( )
Description

Increments the television volume by 1, up to the maximum volume set. An error is returned if you try to increment beyond the maximum volume.

Prototype
number TVI.VolumeUp( )

Supported browsers
Ant Fresco Opera 8.5 Opera 9 Hospitality platforms only.

Parameters
None.

Returns
nothing if TVI is not compiled. Otherwise, the function returns one of the standard return codes (see "Return codes" on page 190).

8.4

Generic interface

The generic TVI type has an asynchronous serial (RS232C) interface and may utilise either the TVI "101010" port or a USB port with a USB-serial adaptor. The benefit of the latter is that it will contain a level convertor/driver to allow direct connection to a TV that conforms to RS232C. For an A130H selection of the TVI interface will initially be determined by the value of SETTINGS.TVI_TYPE. If this is set to a value other than TVI_GENERIC then the PIC will be programmed as appropriate and the TVI port will be used. If TVI_GENERIC is selected then the USB port will be inspected and if a compatible USB serial device is found then the USB port will be used, otherwise the PIC will be programmed for generic RS232C and the TVI port will be used. The new generic TVI protocol (using either the TVI or the USB interface) will accept the TVI.SetTvType( ), TVI.SystemInfo( ), TVI.Setup( ) and TVI.Send( ) commands only. TV responses are passed to the JMACX interface with minimal or no processing and are available as TVI.Event( ) objects; similarly unsolicited data from the TV (if any; many protocols do not support this) will be passed to the JMACX interface as a TVI.Event( ).

216

CONTENTS

INDEX

Amino Communications Ltd. 2010

TVI

On start-up, the STB application will check for the existence of a device in the USB slot and if one is detected, and if it is a recognised serial adaptor, then any TVI communication will use this port. The API for the generic TVI type is much simpler than the standard TVI API but all commands have to be constructed by the developer. For example, the standard JMACX commands TVI.VolumeUp( ) and TVI.VolumeDown( ) will not be available but will have to be created according to the protocol specification of the target TV. The available commands are as follows:

TVI.Setup( )
Description

This allows serial port configuration in terms of baud rate, number of data bits, number of stop bits, parity control, maximum inter-character delay and mode. It is used for setting the RS232 parameters for the USB serial adapter (if seen) or the RS232 PIC code (if that mode has been selected).

Prototype
number TVI.Setup(number Baud_rate, number nbits, number parity, number nStopBits, number Max_iInterCharacter_Time, number Binary_Mode)

Supported browsers
Ant Fresco Opera 8.5 Opera 9 Hospitality platforms only.

Amino Communications Ltd. 2010

INDEX

CONTENTS

217

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Parameters
Parameters Baud_rate Allowed values 0 or 1 Description 0 corresponds to a Baud rate of 9600. 1corresponds to a Baud Rate of 19200. The USB serial adapter can support high baud rates which can be added if required, however the PIC serial driver is a software UART and higher baud rates could be problematic to implement due to the PIC processor instruction cycle time of 200ns. nbits parity nStopBits Max_InterCharater_Time 8 bits No parity 1 Currently not supported. Currently not supported. Currently not supported. The default value is 200ms Binary_Mode 0 or 1 Binary mode has a default value of 0 (off)

0 to 50 in steps of 10ms Gives and effective range of 0 - 500ms.

Returns
0 on success, or 1 on failure.

TVI.Send( )
Description

This allows a series of bytes to be transmitted out of the chosen port to the RS232 interface. For string-based protocols, where the TV is expecting a command in ASCII format, Binary_mode is set to false (see TVI.Setup( ) above). The string entered for the TVI.Send command is passed to the serial driver (PIC or USB) unchanged. Note that commands in stringbased protocols are often terminated with a <CR> control character; in the JavaScript environment this can be appended to the string using the standard '\r' notation. For binary-based protocols, where the TV is expecting a command as raw byte values, Binary_mode is set to true. The command data is entered as a string in the JavaScript environment and this is converted to the binary equivalents in libtvi_1.

Prototype
number TVI.Send(string data)

Supported browsers
Ant Fresco Opera 8.5 Opera 9 Hospitality platforms only.

218

CONTENTS

INDEX

Amino Communications Ltd. 2010

TVI

Parameters
Parameters data Allowed values 0 or 1 Description The string containing the binary values required is entered as follows: If the TV requires a six-byte command with the bytes having the following values: 0x12 0x7a 0x06 0xec 0x39 0x7f then the TVI.Send command is in the following format: TVI.Send("127a06ec397f") Hex a-f may be upper or lower case

Returns
0 on success or 1 on failure.

TVI.Event( )
Description

This event will register a function that takes a single string as an argument that will contain the received asynchronous responses from the TV. For string-based protocols where Binary_mode is set to false, the string argument for TVI.Event is the ASCII string received from the TV. However the JavaScript environment has problems handling strings containing ASCII control codes (they may not be displayed at all) and strings received from the TV may be terminated with <LF> and/or <CR> codes. To overcome this these control codes are converted into displayable characters, as follows: <LF> is converted to the string "\\n" <CR> is converted to the string "\\r" The result of this is that a response from the TV of the form: f 1 OK01x<LF><CR> is displayed on a Javascript test page as: f 1 OK01x\n\r For binary-based protocols where Binary_mode is true, the raw bytes received from the TV are converted to an ASCII representation of the hex values of those bytes, so a four-byte response containing the values: 0x39 0x7d 0x08 0x9f will be converted to the string: "397d089f"

Prototype
object TVI.Event()

Amino Communications Ltd. 2010

INDEX

CONTENTS

219

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Supported browsers
Ant Fresco Opera 8.5 Opera 9 Hospitality platforms only.

Parameters
None.

Returns
the event object

220

CONTENTS

INDEX

Amino Communications Ltd. 2010

Appendix AKey codes and action codes

The following list shows the codes for most of the defined remote control buttons. Not all buttons are present on all remotes. For brevity, some buttons not seen on 'standard' remotes are not listed. The default 'actions' for most buttons can be modified. The action mappings are shown in fkeys.conf, which defines the mapping between the button key code and an action key code, which performs an action within the browser. Those buttons not defined are assigned a browser key value outside of the range normally used by the browser. The codes that will be assigned are listed for each browser. Note: Some buttons, namely Up/Down/Left/Right/OK/Number/Enter/Delete buttons cannot be remapped mapped in fkeys.conf because they are hard- coded to be mapped to certain browser actions. However, these, and all other mappable keys can be remapped from their default browser values by using a JavaScript keyhandler within the browser.

A.1

Remote key values


Internal Code 0x12C 0x12F Opera Code 8492 8494 8495 Fresco Code 0x4000012C 0x4000012E 0x4000012F No Only on AVC remote when set to pass Amino volume, and when using TV Brand code 231 on Grey remote. Only on AVC remote when set to pass Amino volume, and when using TV Brand code 231 on Grey remote. Only on AVC remote when set to pass Amino volume, and when using TV Brand code 231 on Grey remote. Grey AVC Notes remote remote

Key Name Channel up Volume up

Channel down 0x12E

Volume down

0x130

8496

0x40000130

No

Mute

0x131

8497

0x40000131

No

Power

0x132

8498

0x40000132

Amino Communications Ltd. 2010

INDEX

CONTENTS

221

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Video Play

0x133

8499

0x40000133

If remote layout is set to HOSPITALITY then the Play button will return Video Playpause or Video Pause.

Video Forward 0x134 Video Stop Video Reverse Video Record Video Pause Video Playpause Browser Reload www_tv / AV Browser Forward Help Record Browser Back Red Green Yellow Blue Menu Browser Home History Bookmarks Stop Custom Tools Top left Top right Page up Page down Enter / -/-0x135 0x136 0x137 0x138 0x139 0x13A 0x13B 0x13C 0x13D 0x13E 0x13F 0x140 0x141 0x142 0x143 0x144 0x145 0x146 0x147 0x148 0x149 0x14A 0x14B 0x14C 0x14D 0x14E 0x14F

8500 8501 8502 8503 8504 8505 8506 8507 8508 8509 8510 8511 8512 8513 8514 8515 8516 8517 8518 8519 8520 8521 8522 8523 8524 8525 8526 (O-8) 8490 (O-9) 13 (O-8) 8527(O-9)

0x40000134 0x40000135 0x40000136 0x40000137 0x40000138 0x40000139 0x4000013A 0x4000013B 0x4000013C 0x4000013D 0x4000013E 0x4000013F 0x40000140 0x40000141 0x40000142 0x40000143 0x40000144 0x40000145 0x40000146 0x40000147 0x40000148 0x40000149 0x4000014A 0x4000014B 0x4000014C 0x4000014D 0x4000014E 0x4000014F No -/-- on grey remote. Mapped to Opera 'enter' code No No No No No No No No No No No No No No No No No No No No No No No This is the AV Button on AVC remote. No No Use key 318 for Record.

222

CONTENTS

INDEX

Amino Communications Ltd. 2010

KEY CODES AND ACTION CODES

Delete / Last Channel

0x150

8 See Note

Last Channel on Grey remote. P<P on AVC remote. This returns 8 if text_entry is enabled (backspace) If text_entry is false then this returns 8528

Up

N/A

N/A

N/A

These are mapped in IR driver to cursor keys. Cannot be reassigned. These are mapped in IR driver to cursor keys. Cannot be reassigned. These are mapped in IR driver to cursor keys. Cannot be reassigned. These are mapped in IR driver to cursor keys. Cannot be reassigned. These are mapped in IR driver to cursor keys. Cannot be reassigned. No No No No No No No No Mapped to number button in Opera. Mapped to number button in Opera. Mapped to number button in Opera. Mapped to number button in Opera. Mapped to number button in Opera. Mapped to number button in Opera. Mapped to number button in Opera. Use key 336 for Last Channel No Use key 324 for Menu.

Down

N/A

N/A

N/A

Left

N/A

N/A

N/A

Right

N/A

N/A

N/A

Ok

N/A

N/A

N/A

Info Menu Exit Guide Last DTV 0 1 2 3 4 5 6

0x156 0x157 0x158 0x159 0x15A 0x15B 0x15C 0x15D 0x15E 0x15F 0x160 0x161 0x162

8534 8535 8536 8537 8538 8539 48 49 50 51 52 53 54

0x40000156 0x40000157 0x40000158 0x40000159 0x4000015A 0x4000015B

Amino Communications Ltd. 2010

INDEX

CONTENTS

223

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

7 8 9

0x163 0x164 0x165

55 56 57 8566 8567 8568 8569 8570 8571 8572 8573 0x40000176 0x40000177 0x40000178 0x40000179 0x4000017A 0x4000017B 0x4000017C 0x4000017D No No No No No No No No

Mapped to number button in Opera. Mapped to number button in Opera. Mapped to number button in Opera.

|< (Video skip 0x176 back) >| (Video skip 0x177 forward) Back PVR PIP on/off PIP swap Titles Battery Low 0x178 0x179 0x17A 0x17B 0x17C 0x17D

AVC remote only. Sent as a second code after battery detects low power.

224

CONTENTS

INDEX

Amino Communications Ltd. 2010

KEY CODES AND ACTION CODES

A.2

List of action codes


Code 1 Display browser home page. 2 Change to specified page. When using this action, you also need to specify the URL to go to. 3 Go to previous page. 4 Go to next page. 5 Browser stop function. 6 Reload page. 7 Browser Management page. 8 Display bookmarks. 9 Add bookmark. 10 Delete bookmark. 11 Display browser history. 12 Delete browser history. 13 Hide browser toolbar. 14 Display the browser in full screen size. Deprecated: Fresco only. 15 16 Display browser preferences 17 Display browser help page. 18 Browser channel up function. 19 Browser channel down function. FE_ACTION_BROWSER_SCROLL_GFX Browser scroll. GFX Meaning Additional Parameter

Amino Communications Ltd. 2010

INDEX

CONTENTS

225

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

Code 20 21 22

Meaning FE_ACTION_BROWSER_SPECIAL

Additional Parameter

Go to URL. If setting this action, you also need to set the URL URL to go to. Browser scroll up function.

23 Browser scroll down function. 32 Play video. 33 Stop video. 34 Pause video. 35 Forward video. 35 Rewind video. 37 Fast forward video. 38 Fast rewind video. 39 Pause video. 40 Mute audio (on video). 41 Increase volume (on video). 42 43 Miscellaneous power action. 44 Miscellaneous key code. 45 Closed caption toggle on/off. FE_ACTION_VIDEO_VOL_DOWN Decrease volume (on video).

226

CONTENTS

INDEX

Amino Communications Ltd. 2010

KEY CODES AND ACTION CODES

Code 46

Meaning Teletext: change mode. If setting this, you will also need to specify the mode to change to:

Additional Parameter Optional mode to change to. Available modes: 0 TV 1 text 2 mix

If a mode is not set, key presses cycle through the modes in turn. 47 Teletext: display index page. 48 Teletext: display next page. 49 Teletext: display previous page. 50 Teletext: display the specified page. If setting this action, you will also need to set the page number to go to. 51 52 Teletext: green key function. 53 Teletext: yellow key function. 54 Teletext: cyan (blue) key function. 55 Teletext: toggle Hold function. 56 Teletext: toggle Reveal function. 57 58 Teletext: input digit. FE_ACTION_TELETEXT_TOGGLE_ZOOM Teletext: toggle Zoom function. Digit to input FE_ACTION_TELETEXT_KEY_RED Teletext: red key function. Page number

Amino Communications Ltd. 2010

INDEX

CONTENTS

227

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

228

CONTENTS

INDEX

Amino Communications Ltd. 2010

Appendix BExample code

B.1

ASTB, AVMedia, VideoDisplay general example

The following example uses ASTB, AVMedia and VideoDisplay calls to play a media stream and display some information about the set-top box (you will need to replace the media stream URLs in the AVMedia.Play calls with values for streams that your set-top box can access). <html> <head> <title>Simple Javascript Example with Amino JMACX</title> </head> <body text="#ffffff" bgcolor="#00ff00" onload="getdata();"> <form name="simple"> <table border="0" width="100%"> <tr> <td width="5%">Info:</td> <td width="95%"><input type="text" name="information" size="70" value=" "></td> </tr> </table> </form> <script type="text/javascript"> var hb = null ; var videostatus = 0 ; var eventString = "some textual data" ; var continuous = 1 ; AVMedia.onEvent = "handle_event();" ; VideoDisplay.SetChromaKey(0x00ff00) ; VideoDisplay.SetAlphaLevel(50) ; Browser.SetToolbarState(0) ; AVMedia.Play("src=rtsp://mbase04.aminocom.com/LOTR;servertype =MediaBase") ; function getdata() { document.simple.information.value = ("My MAC address is "+ASTB.GetMacAddress()+" and version is "+ASTB.GetSoftwareVersion() ); }

Amino Communications Ltd. 2010

INDEX

CONTENTS

229

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

function handle_event() { videostatus = AVMedia.Event; eventString = AVMedia.EventString; switch (videostatus) { case 0: break; //undefined status case 1: alert("RTSP CONNECT FAILED (1) "+eventString); break; case 2: alert("RTSP SEND FAILED (2) "+eventString); break; case 3: alert("RTSP READ FAILED (3) "+eventString); break; case 4: alert("RTSP CONNECTION DIED (4) "+eventString); break; case 6: break; case 7: if (eventString.search("2104")) { break; } else { alert("RTSP status ANNOUNCE (7) "+eventString); break; } case 8: if (continuous) { document.simple.information.value = ("RTSP status END OF STREAM "+eventString + "restarting..") ; PlayLoop(); } else { alert("RTSP status END OF STREAM "+eventString); } break; case 9: alert("RTSP status NOT FOUND (9) "+eventString); break; case 10:

230

CONTENTS

INDEX

Amino Communications Ltd. 2010

EXAMPLE CODE

alert("status NO VIDEO (10) "+eventString); break; case 11: alert("IGMP status END-OF-STREAM break;

(11) "+eventString);

case 12: alert("RTSP CONNECTION STOPPED (12) "+eventString); break; case 13: alert("RTSP status AUTHENTICATE (13)"); break; case 14: alert("RTSP status REDIRECTED break;

(14)");

case 15: alert("IGMP status PLAYING (15)"); break; case 16: alert("UDP status END OF STREAM break; case 17: alert("UDP status PLAYING break;

(16)");

(17)");

default: alert("Undefined error code - " +videostatus); break; } } function PlayLoop() { VideoDisplay.SetChromaKey(0x00ff00); AVMedia.Play("src=rtsp://mbase04.aminocom.com/LOTR;servertype =Mediabase") ; } </script> </body> </html>

B.2

Mapping actions and channels to remote control buttons

The following example demonstrates how to use ASTB function calls to associate defined actions with button presses on the remote control. Note that it is not possible to change the action associated with the number buttons (0 - 9) using ASTB.SetKeyFunction - the 1 button always displays the channel defined as channel 1, and so on. Instead this example calls ASTB.SetChannel to set the URL for a selection

Amino Communications Ltd. 2010

INDEX

CONTENTS

231

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

of channels. It is only possible to set channels in this way because ASTB.WithChannels is enabled on the page (if this is disabled, then ASTB.SetChannel calls will have no effect). To illustrate how key functionality can be changed, the example also associates new actions with the video stop and play buttons. <html> <head> <title>JMACX Default Button Remapper</title> <script type="text/javascript"> ASTB.WithChannels(1) ; ASTB.SetChannel(0,"rtsp://mbase04.aminocom.com/LOTR;ServerType =MediaBase") ; ASTB.SetChannel(1,"igmp://225.242.100.9:5000") ; ASTB.SetChannel(2,"igmp://239.255.250.6:11111") ; ASTB.SetChannel(3,"http://www.google.com") ; ASTB.SetChannel(8,"http://www.aminocom.com") ; ASTB.SaveChannels(); ASTB.SetKeyFunction(309, 21, "http://www.bbc.co.uk") ; ASTB.SetKeyFunction(307, 21, "igmp://239.255.250.2:11111" ) ; //309 is the code for the the video stop button //307 is the code for the video play button //21 is the code for the set browser URL action ASTB.SaveKeyFunctions(); </script> </head> <body> <H1>JMACX Default Button Remapper page</H1> <h3>This page remaps the channel buttons (if ASTB.WithChannels(1)) and changes default play and stop keys to jump to a certain pages. </H3> </body> </html>

232

CONTENTS

INDEX

Amino Communications Ltd. 2010

Appendix CMedia source URLs

Streamed media will always have a valid, publicly accessible URL. These URLs, with optional attributes, are used to join media sessions. They can be used both in the Amino API functions and in the selected browsers URL bar. A media server is a device that simply stores and shares media. It may be a simple attached storage, such as an external disk drive, or a commercial web server that hosts media for a large web site. It may also be used to run special applications that allow the user(s) to access the media from a remote location via the internet. The only requirement for a media server is a method of storing media and a network connection with enough speed to allow access to that media. Note: If Macrovision is enabled then it is not possible to play a media URL from a toolbar as the Macrovision mode byte can only be set from inside an HTML page. However, JMACX calls could be used to play the content. (This also applies to tshttp URLs.

C.1

Media source types

AmiNET products support various streaming protocols, including Real Time Streaming Protocol (RTSP), Internet Group Management Protocol (IGMP) and User Datagram Protocol (UDP). In some cases, the format of the URL for a media stream depends on the media server, but the following sections give general guidelines on URLs. rtsp:// - Real Time Streaming Protocol, supporting servers from Kasenna, nCube and others.
igmp:// - Multicast UDP streaming with IGMP group membership

http:// - HTTP streaming is supported when using the full BitBand client. tshttp:// - A transport steam downloaded over an HTTP connection. (Can only be used with JMACX calls.) mp3:// - HTTP streaming of MP3 music udp:// - UDP streaming of video tsfile:// - Local file playback

The AmiNET products support the video streaming protocols RTSP, IGMP and UDP, as defined below:

C.1.1

RTSP

URLs for an RTSP stream can have the following format: rtsp://server.domain.com:554/videos/movie.ts rtsp indicates that this is an RTSP URL. server.domain.com is the hostname of the video-on-demand RTSP server in this case, and the port that the server listens on for connections is 554.

Amino Communications Ltd. 2010

INDEX

CONTENTS

233

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

The other information included is a path to the media source and additional attributes. rtsp://server.domain.com:554/videos/movie2.ts;audiopid=4195; pcrpid=4149;videopid=4149;servertype=eona;eomfreeze=yes ;unloadvideo=no Some of these attributes are described in "Media source attributes" on page 236. or rtsp://server.domain.com//server.domain.com/assetname;servertype=eona

C.1.2

Playing an RTSP VOD stream from a Kasenna MediaBase server

In the management pages set the video server type to "Kasenna MediaBase" then use the following URL: rtsp://myServer:554//myServer/myAsset For example rtsp://videoserver:554//videoserver/theMatrix

C.1.3

Playing an RTSP VOD stream from a nCube server

In the management pages set the video server type to "nCube" then use the following URL: rtsp://myServer:554/mds/nvision1/myAsset.mpi For example rtsp://videoserver:554/mds/nvision1/theMatrix.mpi

C.1.4

Playing an RTSP VOD stream from a InfoValue server

In the management pages set the video server type to "InfoValue" then use the following URL: rtsp://rtsp://myServer:554/asset-store/myAsset.mpg For example rtsp://videoserver:554/asset-store/theMatrix.mpg

C.1.5

Playing an RTSP stream, with playback starting a number of seconds into the video

This is done adding the offset=nnn parameter to the RTSP request url, where nnn is the number of seconds into the stream you wish to start. This works on most (all?) compliant RTSP servers. For example To start 5 mins into the video rtsp://<server>:<port>/<path>/<asset>;offset=300

C.1.6

IGMP

URLs for an IGMP (UDP multicast) stream can be as follows: igmp://239.255.250.2:11111 igmp indicates that this is an IGMP stream. The stream has an associated IP address 239.255.250.2

234

CONTENTS

INDEX

Amino Communications Ltd. 2010

MEDIA SOURCE URLS

The URL also includes the port number for the multicast stream - 11111 in the examples. The URL can also include additional attributes if required. For example: igmp://239.255.250.2:11111;audiopid=17;pcrpid=16;videopid=17

C.1.7

Playing a multicast video stream

Assuming your stream is being sent to a valid multicast address and nothing in your network infrastructure stops multicast traffic, then the URL to get the STB to play will be: igmp://:port For example igmp://239.192.128.1:11111

C.1.8

UDP

URLs for a unicast UDP stream can be as follows: udp://192.168.0.1:11111 udp indicates that this is a UDP stream. The stream has an associated unicast source address -192.168.0.1 in the example above . The UDP destination port for the unicast stream is also required-11111 in the example. The URL can also include additional attributes if required. For example: udp://192.168.0.1:11111;audiopid=20 UDP streams will be setup on the server to be sent to the STBs IP address on a particular port. The required parameters in the URL are the source IP address (to correctly title traffic from the source only) and the destination port the content is addressed to.

C.1.9

Playing a unicast video stream

Make sure your streamer is sending data to the IP address of the STB, then use the following URL: udp://:port For example you have an STB 192.168.1.103 and a PC running VLC at 192.168.1.4 The PC would stream to: 192.168.1.103 port 1234 The URL to play the stream would be: udp://192.168.1.4:1234

C.1.10 Streaming MP3s


URLs for a streaming shoutcast format MP3 from an HTTP server have the following format: mp3://server.domain.com:8000/music mp3 indicates that this is a n MP3 URL. server.domain.com is the hostname of the server streaming the MP3s. 8000 is the port that it listens on for connections. Lastly, the pathname of the streaming source or filename is required - music in the example above.

C.1.11 MP3s from a Mediabase server


URLs for an MP3 residing on Mediabase servers have the following format:

Amino Communications Ltd. 2010

INDEX

CONTENTS

235

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

rtsp://server.domain.com:554/assetname;servertype=Mediabase;type=MP3 rtsp indicates that this is an RTSP URL. server.domain.com is the hostname of the video-on-demand RTSP server. The server listens for connections on port 554. assetname is the path to the MP3. The remaining values are attributes that identify the source as an MP3.

C.2

Media source attributes

Attributes can be included in media source URLs to provide additional settings relating to the stream. In the case of audio, video and PCR PIDs, the values are normally autodetected. If you manually specify any PIDs, then this auto-detection system is disabled. src Specifies the URL of a valid media source. For example, src=igmp:// 239.255.250.1:11111' Specifies the type of server the request is being made to. The only value in use is: eona For all other servers it has no effect. video Sets the video PID value. Video PIDs are normally auto-detected. By setting a manual PID the default auto PID detection mechanism is disabled. Note that on IPTV single program transport streams are supported with one video PID. Sets the audio PID value. Audio PIDs are normally auto-selected based on the audio language preferences. By setting a manual PID the default auto PID detection mechanism is disabled. Sets the PCR PID value. Setting eomfreeze to yes closes the server connection at the end of media and freezes the last frame of video. The default setting is no and provides default behaviour of fading down video plane at the end of media. Selects which audio channels are output according to the following values: stereo both left and right channels (default). left left channel only. right right channel only. monomix mix left and right channels together. audiotype The audiotype attribute sets the audio codec to use for the media. Possible types are: aac-latm aac-adts ac3 mpeg1l2 Any codec not matching the above will default to mpeg1l2. This attribute is used when setting an audio PID manually using audiopid.

servertype

audio

pcr eomfreeze

monomix

236

CONTENTS

INDEX

Amino Communications Ltd. 2010

MEDIA SOURCE URLS

type

This is used to define other media sources instead of video. Currently only MP3 is defined which allows for the incoming media to be decoded as MP3 instead of video. Selects which subtitle language to use, if present, in the media source. Selects which teletext language to use, if present, in the media source. Number of seconds to offset into the stream when starting an RTSP asset. Username to log onto servers that require a username before they stream video. Password to log onto servers that require a password before they stream video. Used for streams that use a different transport method. The only supported parameter is for tcp, all other values will be ignored. Used to control how a channel change operates. If this value is set to yes then the video will only start playing when the stream has properly synchronised. However there will be a time delay. When set to no the channel change will be immediate but there is no guarantee that the video will be properly synchronised when it starts playing. It will then synchronise at the earliest opportunity. For PVR builds that can be used to specify what speed the content should be played at. The argument needs to be of type float, for example, 1.0. It is possible to define additional attributes specific to certain video server types using the serverdata attribute. An example is for the Seachange server where supported serverdata extensions include "SeaChange-Version", "SeaChange-MayNotify" and "SeaChange-Server-Data" to set a device ID. This only applies to PPC products.

subpid txtpid offset username

password

transport

avsyncwait

speed

serverdata

rtspping

The rtspping attribute sets the RTSP ping timeout value. The default value used is 30 seconds if no attribute is set. The RTSP ping is used as a 'heartbeat' by the client so that the server will continue to serve video. The stb checks that data is being received from an rtsp server every second and records the last time that video data was received. If the time since the last video data received reaches the rtspping threshold then a ping is sent to the server.

videopid

Sets the video PID value. Video PIDs are normally auto-detected. By setting a manual PID the default auto PID detection mechanism is disabled. Note that on IPTV single program transport streams are supported with one video PID. Sets the video codec. Options include: h264 mp42 mpeg2

videotype

(MPEG4pt2/MPEG4-ASP/H.263)

Any other setting defaults to "mpeg2". This attribute is used when setting a vdeo PID manually using videopid.

Amino Communications Ltd. 2010

INDEX

CONTENTS

237

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

audiopid

Sets the audio PID value. Audio PIDs are normally auto-selected based on the audio language preferences. By setting a manual PID the default auto PID detection mechanism is disabled. Sets the PCR PID value. PCR PIDs are normally auto-detected. By manually setting a PCR PID the auto detection mechanism is disabled.

pcrpid

AmiNET 103, 110, 110H, 500


iframes The iframes attribute is specific to the PPC platforms and is set internally in a PVR scenario to specify whether an asset recorded on disk contains iframes or not. By specifying whether iframes are present, video bring up on channel changes and trickplay modes can be optimised. When the PVR detects that iframes are present, the asset URL generated will set this attribute. The iframes attribute can also be set in non-PVR PPC based products externally in a media source URL to optimise channel change times for content without iframes if this is known. This only applies to PPC products. MPEG-2 TS encapsulated in RTP packets can be played by setting the rtpskip attribute in the URL for the stream to yes. The RTP header is a fixed 12 byte header. This implementation is specific to the PPC platforms and is limited to stripping the fixed 12-byte header only as requested for a specific deployment. The user-agent forms part of an RTSP request and typically includes information such as the application name and version. The useragent attribute allows additional text to be appended to the the user-agent string. This only applies to PPC products. Configures whether the video buffer is prefilled before video is played. Takes the prefill level as string parameter. This only applies to PPC products. The default is 65800 bytes.

rtpskip

useragent

prefill

238

CONTENTS

INDEX

Amino Communications Ltd. 2010

Appendix DObsolete functions

The following JMACX functions are no longer supported. Function AminoGeneric.Register ASTB.Format ASTB.GetCAID ASTB.GetFanState ASTB.GetKeyboardState ASTB.GetSmartCardSN ASTB.GetString ASTB.HDDTest ASTB.SetDate ASTB.SetFanState ASTB.SetKeyboardState ASTB.SetRFChannel ASTB.SetRFPassthrough ASTB.SetRTCTime ASTB.SmartportProgram ASTB.SmartportTest ASTB.TestModem AVMedia.DownloadKey AVMedia.GetDefaultVideoServer AVMedia.GetPlaySpeed AVMedia.onConnectionLost AVMedia.onEndOfMedia AVMedia.SetDefaultVideoServer AVMedia.SetFadeoutTime AVMedia.SetKeyID
Amino Communications Ltd. 2010 INDEX CONTENTS 239

Function Browser.GetCacheSize Browser.IgnoreMargins Browser.SetCacheSize Browser.SetMargins Browser.ShowOldContentPeriod PVR.DeleteAsset PVR.GetAssetInfo PVR.GetSystemInfo PVR.ListAssets PVR.Record PVR.RenameAsset PVR.StopRecording SmartCard.GetATR SmartCard.IsLoggedOn SmartCard.IsPresent SmartCard.Logon VideoDisplay.CheckWindow VideoDisplay.GetChromaRGB VideoDisplay.GetChromaRGB VideoDisplay.GetChromaRGB VideoDisplay.GetMode( ) VideoDisplay.GetOutput( ) VideoDisplay.GetWindow VideoDisplay.ScaleToWindow VideoDisplay.SetChromaRGB VideoDisplay.SetFullScreen VideoDisplay.SetMode VideoDisplay.SetOutput( ) VideoDisplay.SetTVStandard

240

CONTENTS

INDEX

Amino Communications Ltd. 2010

Index

A
Action (Browser function) 175 AminoGeneric.Call 186 AminoGeneric.onEvent 186 ASTB.BlastCode 61 ASTB.CommitConfig 51 ASTB.DebugString 61 ASTB.DefaultKeys 62 ASTB.DeleteAllBookmarks 63 ASTB.DeleteAllCookies 63 ASTB.DeleteAllHistory 64 ASTB.Enable2ndEthernetPort 56 ASTB.EnableVLANTagging 56 ASTB.ErrorString 64 ASTB.FileExists 65 ASTB.GCluster 65 ASTB.GetAddress 35 ASTB.GetBrowser 20 ASTB.GetBrowserConfig 52 ASTB.GetChannel 32 ASTB.GetConfig 53 ASTB.GetDate 19 ASTB.GetDHCP 36 ASTB.GetDHCPAddress 36 ASTB.GetDHCPDNS 37 ASTB.GetDHCPDomain 37 ASTB.GetDHCPGateway 38 ASTB.GetDHCPLease 38 ASTB.GetDHCPNetmask 39 ASTB.GetDHCPRebind 39 ASTB.GetDHCPRenew 40 ASTB.GetDI 43 ASTB.GetDNS 40 ASTB.GetDomain 41 ASTB.GetExternalVLANid 57 ASTB.GetGateway 41 ASTB.GetHardwareInfo 21 ASTB.GetHardwareVersion 21 ASTB.GetInternalVLANid 57 ASTB.GetIPAddress 42 ASTB.GetLEDState 66 ASTB.GetLocked 22 ASTB.GetMacAddress 23 ASTB.GetMouseState 31 ASTB.GetNetmask 42 ASTB.GetNextChannel 33 ASTB.GetPortRateLimit 58 ASTB.GetPowerState 29

ASTB.GetRTCTime 20 ASTB.GetSerialNumber 23 ASTB.GetSoftwareVersion 24 ASTB.GetStats 24 ASTB.GetSystemInfo 25 ASTB.GetSystemManufacturer 26 ASTB.GetSystemModel 27 ASTB.GetSystemSubmodel 28 ASTB.GetTrustedDomain 46 ASTB.GetTrustedDomains_Domain 47 ASTB.GetTrustedDomains_Javascript 47 ASTB.GetTrustedDomains_Macrovision 48 ASTB.GetUpgradeAddress 43 ASTB.GetUpgradeDI 44 ASTB.GetUpgradePort 45 ASTB.GetUSBInfo 28 ASTB.LoadCodeSet 67 ASTB.Reboot 67 ASTB.Reflash 68 ASTB.SaveChannels 33 ASTB.SaveKeyFunctions 68 ASTB.SaveTrustedDomains 48 ASTB.SelectChannel 34 ASTB.SetBrowserConfig 53 ASTB.SetChannel 34 ASTB.SetConfig 54 ASTB.SetExternalVLANid 59 ASTB.SetInternalVLANid 59 ASTB.SetKBDelay 69 ASTB.SetKBRepeat 70 ASTB.SetKeyFunction 70 ASTB.SetLEDState 71 ASTB.SetMouseState 31 ASTB.SetPortRateLimit 60 ASTB.SetPowerState 30 ASTB.SetRemoteType 72 ASTB.SetTrustedDomain 49 ASTB.Sleep 73 ASTB.Upgrade 45 ASTB.VNC 73 ASTB.WithChannels 74 AudioControl.Event 159 AudioControl.GetAC3Downmix 160 AudioControl.GetAC3DRC 161 AudioControl.GetAC3Dualmono 162 AudioControl.GetAC3Outmode 162 AudioControl.GetDefaultVolume 163 AudioControl.GetMaxVolume 164 AudioControl.GetMinVolume 164 AudioControl.GetMute 165 AudioControl.GetVolume 166

Amino Communications Ltd. 2010

INDEX

CONTENTS

241

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

AudioControl.onVolumeChange 159 AudioControl.SetAC3Downmix 166 AudioControl.SetAC3DRC 167 AudioControl.SetAC3Dualmono 168 AudioControl.SetAC3Outmode 168 AudioControl.SetAudioMix 169 AudioControl.SetDefaultVolume 170 AudioControl.SetMaxVolume 170 AudioControl.SetMinVolume 171 AudioControl.SetMute 172 AudioControl.SetRFAudioBoost 173 AudioControl.SetVolume 173 AVMedia event codes 76 AVMedia.Continue 80 AVMedia.Event 75 AVMedia.EventString 75 AVMedia.GetAudioPID 81 AVMedia.GetAudioPIDList 81 AVMedia.GetAudioPIDs 82 AVMedia.GetContentName 83 AVMedia.GetCurrentSpeed 83 AVMedia.GetDefaultRTSPServer 84 AVMedia.GetDuration 85 AVMedia.GetFormat 85 AVMedia.GetMSecPos 86 AVMedia.GetMSecPosition 86 AVMedia.GetPMTPID 87 AVMedia.GetPmtProgramInfo 87 AVMedia.GetPos 88 AVMedia.GetPosition 88 AVMedia.GetPrimaryAudioLanguage 89 AVMedia.GetPrimarySubtitleLanguage 90 AVMedia.GetProgramInfo 91 AVMedia.GetProtocol 96 AVMedia.GetSecondaryAudioLanguage 96 AVMedia.GetSecondarySubtitleLanguage 97 AVMedia.GetVideoPID 98 AVMedia.Kill 99 AVMedia.onEvent 76 AVMedia.Pause 99 AVMedia.Play 100 AVMedia.PlaySound 101 AVMedia.SetAudioPID 101 AVMedia.SetDefaultRTSPServer 102 AVMedia.SetHighDef 103 AVMedia.SetMSecPos 104 AVMedia.SetMSecPosition 104 AVMedia.SetPos 105 AVMedia.SetPosition 106 AVMedia.SetPrimaryAudioLanguage 106 AVMedia.SetSecondaryAudioLanguage 108 AVMedia.SetSecondarySubtitleLanguage 109 AVMedia.SetSpeed 110 AVMedia.Stop 111 AVMedia.VideoHide 112

Browser.Lower 179 Browser.PopConfig 180 Browser.PushConfig 181 Browser.Raise 182 Browser.SetToolbarState 183 Browser.SpatialNavigation 183

C
CacheFlush (Browser function) 176 Call (AminoGeneric function) 186 Channels

ASTB functions (JMACX) 32


See also JMACX classes CommitConfig (ASTB function) 51 Configuration ASTB functions (JMACX) 50 See also JMACX classes Configure (TVI function) 192 Continue (AVMedia function) 80 CustomCommand (TVI function) 192

D
Date

ASTB functions (JMACX) 19


See also JMACX classes DebugString (ASTB function) 61 DefaultKeys (ASTB function) 62 DefaultUnloadVideo (VideoDisplay function) 114 DeleteAllBookmarks (ASTB function) 63 DeleteAllCookies (ASTB function) 63 DeleteAllHistory (ASTB function) 64 DetectTV (TVI function) 193 DisplayNumber (TVI function) 194 DisplayText (TVI function) 195

E
Enable2ndEthernetPort (ASTB function) 56 EnableVLANTagging (ASTB function) 56 ErrorString (ASTB function) 64 Event (AudioControl attribute) 159 Event (AVMedia attribute) 75 Event (Generic TVI function) 219 Event codes (AVMedia) 76 EventString (AVMedia attribute) 75

F
FileExists (ASTB function) 65 FrameLoadResetsState (Browser function) 176 FullScreen (VideoDisplay function) 115

B
BlastCode (ASTB function) 61 Browser.Action 175 Browser.CacheFlush 176 Browser.FrameLoadResetsState 176 Browser.GetToolbarState 177 Browser.GoBack 178 Browser.GogiAction 178 Browser.GoHome 179

G
GCluster (ASTB function) 65 GetAC3Downmix (AudioControl function) 160

242

CONTENTS

INDEX

Amino Communications Ltd. 2010

INDEX

GetAC3DRC (AudioControl function) 161 GetAC3Dualmono (AudioControl function) 162 GetAC3Outmode (AudioControl function) 162 GetAddress (ASTB function) 35 GetAlphaLevel (VideoDisplay function) 115 GetAPS (VideoDisplay function) 116 GetAspect (VideoDisplay function) 117 GetAudioPID (AVMedia function) 81 GetAudioPIDList (AVMedia function) 81 GetAudioPIDs (AVMedia function) 82 GetAVAspect (VideoDisplay function) 117 GetBrowser (ASTB function) 20 GetBrowserConfig (ASTB function) 52 GetChannel (ASTB function) 32 GetChromaKey (VideoDisplay function) 118 GetClosedCaption (VideoDisplay function) 119 GetConfig (ASTB function) 53 GetContentName (AVMedia function) 83 GetCurrentSpeed (AVMedia function) 83 GetDate (ASTB function) 19 GetDefaultRTSPServer (AVMedia function) 84 GetDefaultVolume (AudioControl function) 163 GetDHCP (ASTB function) 36 GetDHCPAddress (ASTB function) 36 GetDHCPDNS (ASTB function) 37 GetDHCPDomain (ASTB function) 37 GetDHCPGateway (ASTB function) 38 GetDHCPLease (ASTB function) 38 GetDHCPNetmask (ASTB function) 39 GetDHCPRebind (ASTB function) 39 GetDHCPRenew (ASTB function) 40 GetDI (ASTB function) 43 GetDNS (ASTB function) 40 GetDomain (ASTB function) 41 GetDuration (AVMedia function) 85 GetExternalVLANid (ASTB function) 57 GetFeatures (TVI function) 196 GetFormat (AVMedia function) 85 GetGateway (ASTB function) 41 GetHardwareInfo (ASTB function) 21 GetHardwareVersion (ASTB function) 21 GetInternalVLANid (ASTB function) 57 GetIPAddress (ASTB function) 42 GetIsTvOn (TVI function) 196 GetLEDState (ASTB function) 66 GetLocked (ASTB function) 22 GetMacAddress (ASTB function) 23 GetMacrovision (VideoDisplay function) 119 GetMaxVolume (AudioControl function) 164 GetMaxVolume (TVI function) 197 GetMinVolume (AudioControl function) 164 GetMinVolume (TVI function) 198 GetMouseState (ASTB function) 31 GetMSecPos (AVMedia function) 86 GetMSecPosition (AVMedia function) 86 GetMute (AudioControl function) 165 GetMute (TVI function) 198 GetNetmask (ASTB function) 42 GetNextChannel (ASTB function) 33 GetOutputFmt (VideoDisplay function) 120 GetPIG (VideoDisplay function) 121 GetPIGPosition (VideoDisplay function) 121 GetPIGScale (VideoDisplay function) 122 GetPIGx (VideoDisplay function) 123 GetPIGy (VideoDisplay function) 123 GetPMTPID (AVMedia function) 87 GetPmtProgramInfo (AVMedia function) 87 GetPortRateLimit (ASTB function) 58 Amino Communications Ltd. 2010

GetPos (AVMedia function) 88 GetPosition (AVMedia function) 88 GetPowerState (ASTB function) 29 GetPrimaryAudioLanguage (AVMedia function) 89 GetPrimarySubtitleLanguage (AVMedia function) 90 GetProgramInfo (AVMedia function) 91 GetProtocol (AVMedia function) 96 GetRFModFrequencyTable (VideoDisplay function) 124 GetRFModState (VideoDisplay function) 125 GetRTCTime (ASTB function) 20 GetSecondaryAudioLanguage (AVMedia function) 96 GetSecondarySubtitleLanguage (AVMedia function) 97 GetSerialNumber (ASTB function) 23 GetSoftwareVersion (ASTB function) 24 GetStartupVolume (TVI function) 199 GetStats (ASTB function) 24 GetSubtitles (VideoDisplay function) 126 GetSubtitlesPreferredLanguage (VideoDisplay function) 127 GetSubtitlesSecondaryLanguage (VideoDisplay function) 153 GetSystemInfo (ASTB function) 25 GetSystemManufacturer (ASTB function) 26 GetSystemModel (ASTB function) 27 GetSystemSubmodel (ASTB function) 28 GetTeletext (VideoDisplay function) 128 GetTeletextFullscreen (VideoDisplay function) 129 GetToolbarState (Browser function) 177 GetTrustedDomain (ASTB function) 46 GetTrustedDomains_Domain (ASTB function) 47 GetTrustedDomains_Javascript (ASTB function) 47 GetTrustedDomains_Macrovision (ASTB function) 48 GetTVStandard (VideoDisplay function) 129 GetUHFChannel (VideoDisplay function) 132 GetUpgradeAddress (ASTB function) 43 GetUpgradeDI (ASTB function) 44 GetUpgradePort (ASTB function) 45 GetUSBInfo (ASTB function) 28 GetVersion (TVI function) 199 GetVideoPID (AVMedia function) 98 GetVideoWindow (VideoDisplay function) 130 GetVolume (AudioControl function) 166 GetVolume (TVI function) 200 GoBack (Browser function) 178 GogiAction (Browser function) 178 GoHome (Browser function) 179

I
IgnoreSlaveUpdates (VideoDisplay function) 133 IgnoreUpdates (VideoDisplay function) 134

J
JMACX classes

AminoGeneric 185 ASTB 19 AudioControl 159 AVMedia 75 Browser 175 TVI 189 VideoDisplay 113

INDEX

CONTENTS

243

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

K
Kill (AVMedia function) 99

S
SaveChannels (ASTB function) 33 SaveKeyFunctions (ASTB function) 68 SaveTrustedDomains (ASTB function) 48 SelectChannel (ASTB function) 34 SelectTeletext (TVI function) 203 Send (Generic TVI function) 218 SetAC3Downmix (AudioControl function) 166 SetAC3DRC (AudioControl function) 167 SetAC3Dualmono (AudioControl function) 168 SetAC3Outmode (AudioControl function) 168 SetAlphaLevel (VideoDisplay function) 136 SetAlphaRect (VideoDisplay function) 137 SetAPS (VideoDisplay function) 137 SetAspect (VideoDisplay function) 138 SetAudioMix (AudioControl function) 169 SetAudioPID (AVMedia function) 101 SetAVAspect (VideoDisplay function) 139 SetAVAspectSwitching (VideoDisplay function) 140 SetBrowserConfig (ASTB function) 53 SetChannel (ASTB function) 34 SetChannel (TVI function) 204 SetChromaKey (VideoDisplay function) 141 SetClosedCaption (VideoDisplay function) 142 SetClosedCaptionOutput (VideoDisplay function) 143 SetConfig (ASTB function) 54 SetDefaultRTSPServer (AVMedia function) 102 SetDefaultVolume (AudioControl function) 170 SetExternalVLANid (ASTB function) 59 SetHighDef (AVMedia function) 103 SetInput (TVI function) 205 SetInternalVLANid (ASTB function) 59 SetKBDelay (ASTB function) 69 SetKBRepeat (ASTB function) 70 SetKeyFunction (ASTB function) 70 SetKeyLock (TVI function) 206 SetLEDState (ASTB function) 71 SetMacrovision (VideoDisplay function) 144 SetMaxVolume (AudioControl function) 170 SetMaxVolume (TVI function) 207 SetMinVolume (AudioControl function) 171 SetMinVolume (TVI function) 208 SetMouseState (ASTB function) 31 SetMSecPos (AVMedia function) 104 SetMSecPosition (AVMedia function) 104 SetMute (AudioControl function) 172 SetMute (TVI function) 208 SetOSD (TVI function) 209 SetOutputFmt (VideoDisplay function) 145 SetPIG (VideoDisplay function) 146 SetPIGPosition (VideoDisplay function) 147 SetPIGScale (VideoDisplay function) 148 SetPortRateLimit (ASTB function) 60 SetPos (AVMedia function) 105 SetPosition (AVMedia function) 106 SetPowerState (ASTB function) 30 SetPrimaryAudioLanguage (AVMedia function) 106 SetRemoteType (ASTB function) 72 SetRFAudioBoost (AudioControl function) 173 SetRFModFrequencyTable (VideoDisplay function) 149 SetRFModState (VideoDisplay function) 150 SetSecondaryAudioLanguage (AVMedia function) 108 SetSecondarySubtitleLanguage (AVMedia function) 109 SetSpeed (AVMedia function) 110 SetStartupVolume (TVI function) 210

L
LED

Flashing codes
List 225 LoadCodeSet (ASTB function) 67 Lower (Browser function) 179

M
MaxWindows (VideoDisplay function) 134 Mouse pointer ASTB functions (JMACX) 31 See also JMACX classes

N
Network

ASTB functions (JMACX) 35


See also JMACX classes

O
onEvent (AminoGeneric attribute) 186 onEvent (AVMedia attribute) 76 onEvent (TVI attribute) 189 onVolumeChange (AudioControl attribute) 159

P
Pause (AVMedia function) 99 Play (AVMedia function) 100 PlaySound (AVMedia function) 101 PopConfig (Browser function) 180 Power management

ASTB functions (JMACX) 29


See also JMACX classes Power mangement 29 ProcessUnhandledKey (TVI function) 200, 214 PushConfig (Browser function) 181

R
Raise (Browser function) 182 Reboot (ASTB function) 67 Reflash (ASTB function) 68 RemoteFormatIn (TVI function) 202 RetainAlphaLevel (VideoDisplay function) 135 RetainMouseState (VideoDisplay function) 135

244

CONTENTS

INDEX

Amino Communications Ltd. 2010

INDEX

SetSubtitles (VideoDisplay function) 151 SetSubtitlesPreferredLanguage (VideoDisplay function) 152 SetSubtitlesSecondaryLanguage (VideoDisplay function) 128 SetTeletext (VideoDisplay function) 154 SetTeletextFullscreen (VideoDisplay function) 155 SetToolbarState (Browser function) 183 SetTrustedDomain (ASTB function) 49 SetTvType (TVI function) 210 SetUHFChannel (VideoDisplay function) 156 SetUp (Generic TVI function) 217 SetupClosedCaption (TVI function) 211 SetVolume (AudioControl function) 173 SetVolume (TVI function) 212 Sleep (ASTB function) 73 SpatialNavigation (Browser function) 183 Stop (AVMedia function) 111 System information ASTB functions (JMACX) 20 See also JMACX classes SystemInfo (TVI function) 213

TVI.TVOff 214 TVI.TVOn 215 TVI.VolumeDown 215 TVI.VolumeUp 216 TVOff (TVI function) 214 TVOn (TVI function) 215

U
UnloadVideo (VideoDisplay function) 157 Upgrade ASTB functions (JMACX) 43 See also JMACX classes Upgrade (ASTB function) 45

V
VideoDisplay.DefaultUnloadVideo 114 VideoDisplay.FullScreen 115 VideoDisplay.GetAlphaLevel 115 VideoDisplay.GetAPS 116 VideoDisplay.GetAspect 117 VideoDisplay.GetAVAspect 117 VideoDisplay.GetChromaKey 118 VideoDisplay.GetClosedCaption 119 VideoDisplay.GetMacrovision 119 VideoDisplay.GetOutputFmt 120 VideoDisplay.GetPIG 121 VideoDisplay.GetPIGPosition 121 VideoDisplay.GetPIGScale 122 VideoDisplay.GetPIGx 123 VideoDisplay.GetPIGy 123 VideoDisplay.GetRFModFrequencyTable 124 VideoDisplay.GetRFModState 125 VideoDisplay.GetSubtitles 126 VideoDisplay.GetSubtitlesPreferredLanguage 127 VideoDisplay.GetSubtitlesSecondaryLanguage 153 VideoDisplay.GetTeletext 128 VideoDisplay.GetTeletextFullscreen 129 VideoDisplay.GetTVStandard 129 VideoDisplay.GetUHFChannel 132 VideoDisplay.GetVideoWindow 130 VideoDisplay.IgnoreSlaveUpdates 133 VideoDisplay.IgnoreUpdates 134 VideoDisplay.MaxWindows 134 VideoDisplay.RetainAlphaLevel 135 VideoDisplay.RetainMouseState 135 VideoDisplay.SetAlphaLevel 136 VideoDisplay.SetAlphaRect 137 VideoDisplay.SetAPS 137 VideoDisplay.SetAspect 138 VideoDisplay.SetAVAspect 139 VideoDisplay.SetAVAspectSwitching 140 VideoDisplay.SetChromaKey 141 VideoDisplay.SetClosedCaption 142 VideoDisplay.SetClosedCaptionOutput 143 VideoDisplay.SetMacrovision 144 VideoDisplay.SetOutputFmt 145 VideoDisplay.SetPIG 146 VideoDisplay.SetPIGPosition 147 VideoDisplay.SetPIGScale 148 VideoDisplay.SetRFModFrequencyTable 149 VideoDisplay.SetRFModState 150 VideoDisplay.SetSubtitles 151

T
Troubleshooting

LED flashing codes


List 225 Trusted domains

ASTB functions (JMACX) 46


See also JMACX classes TVI Generic interface 216 TVI Return Codes 190 TVI.Configure 192 TVI.CustomCommand 192 TVI.DetectTV 193 TVI.DisplayNumber 194 TVI.DisplayText 195 TVI.Event 219 TVI.GetFeatures 196 TVI.GetIsTvOn 196 TVI.GetMaxVolume 197 TVI.GetMinVolume 198 TVI.GetMute 198 TVI.GetStartupVolume 199 TVI.GetVersion 199 TVI.GetVolume 200 TVI.onEvent 189 TVI.ProcessUnhandledKey 200, 214 TVI.RemoteFormatIn 202 TVI.SelectTeletext 203 TVI.Send 218 TVI.SetChannel 204 TVI.SetInput 205 TVI.SetKeyLock 206 TVI.SetMaxVolume 207 TVI.SetMinVolume 208 TVI.SetMute 208 TVI.SetOSD 209 TVI.SetStartupVolume 210 TVI.SetTvType 210 TVI.Setup 217 TVI.SetupClosedCaption 211 TVI.SetVolume 212 TVI.SystemInfo 213

Amino Communications Ltd. 2010

INDEX

CONTENTS

245

JMACX: JAVASCRIPT MEDIA CONTROL EXTENSIONS: API SPECIFICATION

VideoDisplay.SetSubtitlesPreferredLanguage 152 VideoDisplay.SetSubtitlesSecondaryLanguage 128 VideoDisplay.SetTeletext 154 VideoDisplay.SetTeletextFullscreen 155 VideoDisplay.SetUHFChannel 156 VideoDisplay.UnloadVideo 157 VideoHide (AVMedia function) 112 VNC (ASTB function) 73 VolumeDown (TVI function) 215 VolumeUp (TVI function) 216

W
WithChannels (ASTB function) 74

246

CONTENTS

INDEX

Amino Communications Ltd. 2010

Вам также может понравиться