Plex Blog

November 2, 2015

Plex on the new Apple TV!

Note: The Plex app requires the new fourth generation Apple TV, as Apple does not make the app store available on older models of the device.

There truly isn’t any other platform we’ve wanted to be on for as long as we have the Apple TV. Today’s the day, and we’re celebrating. The app is free in the app store for everyone, and requires the latest media server (note: you may need to download and install the very latest server manually for now on certain NAS devices).

First released way back in 2007 (the same year Plex started), the original Apple TV didn’t support any apps beyond the ones Apple provided. Three years later, in 2010, the second generation of the device was released and subsequently jailbroken, and a barebones third party Plex app was written. It was by no means easy to install, but it was technically impressive, and we ended up hiring both of the main people involved with the project.

Three years later, people discovered a way to run custom Apple TV “channels” on the device. Channels were the official way content partners added apps to the device, written in a custom markup language and Javascript. Coupled with a rather silly DNS trick, you could run the Trailers app on the Apple TV and have it run your custom channel. Enter three smart guys (and a surprising dearth of Frankincense) and all of a sudden it was possible to run a Plex app on a device without any jailbreaking. Over the years, Plex Connect was heavily developed, with a large user base.

Now over the years, we heard numerous rumors that Apple was going to open up their platform, and add a real app store. Every single WWDC the rumors heated up, we got excited (along with half the Internet), and then our hopes ended up dashed on some fairly sharp rocks. With no rum.

That being said, an app store on the device seemed an inevitability. Roku, Google TV, Android TV (essentially every other top streaming device) had them. How long could Apple hold out?

Turns out, until about 6 weeks ago.

The instant the fourth generation Apple TV was announced with an app store, we here at Plex pumped our fists in the air with excitement, as we raced to download the new Xcode and read the developer documentation. Our immediate goal was to be on the platform at launch, which means we didn’t have much time. What we did have was a clean modern iOS codebase for our new app.

Before we pull back the curtain on a few technical details around how we got here, let’s take a minute to appreciate this great-looking new app:

shelf-setup
movies-browse
movies-preplay
movies-reviews
tvshows-season
tvshows-show
music-browse
music-artist
music-album
music-playlist
music-videos-similar
photos-album

We had some tough choices to make. The new platform allowed for two very different ways to build apps, each with distinct advantages and disadvantages. The easiest was TVML, which is a custom markup language evolved from the earlier version present on previous generations of the device. TVML is a markup language for media interfaces, meaning that it’s incredibly easy to make the beautiful screens you’re accustomed to seeing in the Apple apps. On the other hand, they allowed running full native code, which was obviously essential for games, and provided the highest level of control.

We timeboxed two days of prototyping using both technologies, and quickly realized that a beautiful native-looking UI build with the native SDK would take much longer than using TVML. On the other hand, the limitations around the TVML media players led us to want to use our native code from the iOS app.

Fortunately, Apple makes it incredibly easy to bridge between the TVML/Javascript world, and the native world. So we worked hard to combine the best parts of both into the nascent app. We formed a small team which combined a handful of engineers and designers across four countries and as many timezones, who literally worked around the clock (thanks, round planet!).

The other important decision to make was how we would generate the TV Markup Language. After a bit of experimentation, we settled on a clever mechanism whereby we’d request XML from the media server, and then transform it using XSLT into TVML. Said with fewer acronyms and more gesticulating, we essentially transform the output from a Plex Media Server directly into the beautiful screens you see on the Apple TV. (And yes, we had to make a few small tweaks to the API, which is why we require a brand new media server for the new app.)

We’re incredibly proud of this new app, which is essentially one of the richest apps we’ve built feature-wise, built in just five short weeks. Feast your eyes on the screens, and then go download the new app. It’s completely free for everyone, and it’s awesome.

Thanks, Apple, for a great new device, a powerful new way of building apps for the big-screens, and an exciting future on the platform! Barkley really appreciates it.

IMG_3315

The Best of Plex

Plex Pass gives you exclusive access to awesome new features and apps.

Learn More

The Best of Plex

Plex on the new Apple TV! is a premium feature and requires a Plex Pass subscription.

Learn More

Level up your music library with 60 million high-quality songs.

TIDAL is seamlessly integrated with your existing music library — beautifully organized right in Plex.