Building a tvOS Application

25
Building a tvOS Application using TVJS & TVML

Transcript of Building a tvOS Application

Building a tvOS Applicationusing TVJS & TVML

Michiel De Mey

Navigation

tvOS App TV Markup Language

<?xml version="1.0" encoding="UTF-8" ?><document>

<descriptiveAlertTemplate><title>Terms of Service</title><description>Lorem ipsum (…)</description><row>

<button><text>Accept</text>

</button><button>

<text>Decline</text></button>

</row></descriptiveAlertTemplate>

</document>

TV Markup Language

tvOS App TV Javascript Framework

TV Javascript Framework• Supports some standard DOM classes

DOMParser

Event

XMLSerializer

• Has some tvOS specific classes you can work with

XMLHttpRequest

MediaItem

Storage

• Not through HTML <audio> or <video> element

<audio> element is for background audio

• Through Javascript

var player = new Player();var playlist = new Playlist();var mediaItem = new MediaItem("audio", audioURL);

player.playlist = playlist;player.playlist.push(mediaItem);player.present();

TV Javascript FrameworkPlaying Video/Audio?

• `Window` object is non-existent

Use `App` variable instead.

• No `Promise` support

Use core-js

https://github.com/zloirock/core-js

• JavaScript inconsistencies

Math.random().toString(36)

TV Javascript Framework

Example App

Authentication

The Stack

• Browserify (Bundling)

• Babel (ES6)

• Hogan.js (mustache templating)

Debugging

Source Code• Xcode Project:https://github.com/MichielDeMey/cumulus-tv-xcode

• Client Project: https://github.com/MichielDeMey/cumulus-tv

• OAuth Server: https://github.com/MichielDeMey/tvos-oauth-flow

Thank You