Framework

TVMLKit JS

Create tvOS client-server apps using web technologies. Stream media and respond to events.

Overview

Using the TVMLKit JS Framework

The TVMLKit JS framework provides you with the means to display client-server apps created with the Apple TV Markup Language (TVML) on tvOS. You use other classes in the framework to stream media and respond to events.

The TVMLKit JS framework incorporates the following standard Document Object Module classes, which are not documented here. For information on these classes, see World Wide Web Consortium.

  • CharacterData

  • Comment

  • CustomEvent

  • Document

  • DocumentFragment

  • DOMException

  • DOMImplementation

  • DOMImplementationLS

  • DOMImplementationRegistry

  • DOMParser

  • Element

  • Event

  • EventException

  • EventTarget

  • HTMLCollection

  • LSException

  • LSInput

  • LSParser

  • LSSerializer

  • NamedNodeMap

  • Node

  • NodeList

  • ParentNode

  • ParsingElement

  • Text

  • XMLSerializer

  • XPathEvaluator

  • XPathException

  • XPathExpression

  • XPathResult

Topics

Classes

App

The App class provides access to and a means to respond to app life cycle events.

DataItem

An object that associates JSON objects to DOM objects.

Beta
Device

A Device instance provides information about an Apple TV and apps installed on the device.

EventListenerObject

An event listener object listens for developer created events. You can add and remove event listeners.

Keyboard

A Keyboard instance enables you to retrieve user inputs from search fields and text fields.

MediaItem

A MediaItem object contains information about a single audio or video item. Media items are contained in a playlist. The Player object is used to play the MediaItem objects contained within the Playlist object.

MenuBarDocument

A MenuBarDocument class instance provides functions for setting and retrieving documents associated with a menu item.

NavigationDocument

The NavigationDocument class provides functions that you use to control the document stack that holds the individual TVML documents for a client-server app.

NSError

Information about an error condition including a domain, a domain-specific error code, and application-specific information.

Beta
Playlist

The Playlist object is an array of media items that are to be played in an Apple TV client-server app. The player (Player object) accesses the playlist to play the designated media objects.

Player

A Player object contains a playlist and displays the UI for playing video and audio in an Apple TV client-server app. After you create a new player, you need to associate the player with a playlist that contains media items.

Restrictions

Use the Restrictions class to retrieve rating restriction information. Different countries often allow different levels of content to be shown. This class also allows you to specify the maximum and minimum rankings for content.

Settings

A Settings class instance provides access settings information for a device.

Slideshow

The Slideshow class provides developers with a way to display images on the Apple TV in a slideshow format.

Storage

The Storage class provides functions that you use to store key-value pair information.

TVError

A TVError object encapsulates richer and more extensible error information than is possible when you use only an error code or error string. The core attributes of a TVError object are an error domain (represented by a string), a domain-specific error code, and a user info dictionary containing app-specific information. See User Info Dictionary Keys and Error Domains.

UserDefaults

A UserDefaults object contains information which allows the application to customize its behavior to match a user’s preferences.

XMLHttpRequest

An XMLHttpRequest instance enables you to retrieve data from a URL without having to do a page refresh.

Reference

TVMLKit JS Functions

The functions contained in this reference can be used globally in your app. They are not associated with a particular class.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software