TVML apps on the Apple TV allow developers to build limited single page apps using templates and JavaScript. TVML apps are served from a developer's server as XML (TVML) or JavaScript (TVJS) and include a subset of DOM and JavaScript APIs supported by tvOS. While options are limited compared to full web views, TVMLKit provides an easy way to get media and content onto the Apple TV.
2. Hi, I’m Matt. I mostly build things on the web, but
also for iOS and now tvOS. I work at Kisko Labs.
(and maybe for OS X in the near future)
→ matiaskorhonen.fi
→ Twitter: @matiaskorhonen
→ Blog: randomerrata.com
6. Beer Styles
The 2015 and 2008 beer, cider, and mead style
guidelines from the Beer Judge Certification Program.
The style guidelines describe what each style of
beer, cider, and mead should taste, look, and smell
like.
beerstyles.co
7.
8. Piranhas (for iOS)
Save money by comparing book prices between
Amazon stores, the Book Depository, and Wordery.
Available on iOS and the web.
piranhas.co
12. “Prior to Apple’s commercial release of Apple TV,
you agree not to publicly write about, review, or
display the Apple TV Developer Kit.”
— Apple TV dev kit NDA
13. Whoops
Apple Bans iFixit Developer Account and Removes
App After Apple TV Teardown
— MacRumors / iFixit blog1
1
macrumors.com/2015/09/30/apple-bans-ifixit-developer-account-apple-tv
15. Web stuff on
the Apple TV
You may have heard that there’s
no UIWebView or WKWebView on the
Apple TV.
There isn’t.2
2
developer.apple.com/library/prerelease/tvos/
releasenotes/General/tvOS90APIDiffs/
16. Regardless of this, there is an Apple sanctioned way
to create apps using web tech
25. CoffeeScript
But at least nothing stops you from using
CoffeeScript if it makes you happier… It makes me
happier.
App.onLaunch = (options) ->
alertString = """<?xml version="1.0" encoding="UTF-8" ?>
<document>
<alertTemplate>
<title>#{title}</title>
<description>#{description}</description>
</alertTemplate>
</document>
"""
parser = new DOMParser
alertDoc = parser.parseFromString(alertString, "application/xml")
navigationDocument.presentModal(alertDoc)
26. There’s a DOM and XMLHttpRequest
It should feel pretty familiar to any web developer.
→ There is a document object
→ There isn’t a window object
27. Can I use JS libraries?
Yes. As long as they work with the subset of the
DOM/JavaScript APIs that tvOS implements.
28. Can I use jQuery?
No, at least not out of the box.
For one thing it tries to call document.createElement,
which doesn’t exist on tvOS.
30. It’s pretty limited
If you’re not building an app that’s primarily a media
consumption app, it’s probably the wrong choice.
31. “Built-in”
templates
There are a number of ready
templates you can use5
5
https://developer.apple.com/library/prerelease/tvos/
documentation/LanguagesUtilities/Conceptual/
ATV_Template_Guide/TextboxTemplate.html
53. Aside: divTemplate
If you are crazy, I’m think you could try to build a
sort of terrible canvas with JavaScript and 2,073,600
(=1920×1080) divTemplate tags.
If you do this let me know how the Apple TV likes
having ~2 million elements on screen!
55. It its very essence, TVMLKit let you build limited
Single Page Apps for tvOS. If you want to get a bunch
of videos or images onto the Apple TV, this is a great,
low effort way to get that done.
56. Why is TVMLKit on the Apple TV but actual web views aren’t?
57. My pet theory
→ To prevent terrible web player wrappers
→ An easy path onto tvOS
→ It was already there