Group Group Group Group Group Group Group Group Group

raywenderlich.com Forums

Beginning tvOS Development with TVML Tutorial

Learn how to create your first tvOS app for the Apple TV in this TVML tutorial for complete beginners!


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/1579-beginning-tvos-development-with-tvml-tutorial

I don’t think anyone will stop you from doing it, as long as you’re not copying and pasting our materials :slight_smile:

I’m glad this tutorial helped. Always happy to hear what readers think!

Cheers,
Kelvin

Can we play an m3u8 file on TVOS ?
I try to play an m3u8 file in a native tvos app but it’s not working. I have try to enable https and allow arbitrary loads but nothing work

Anyone can explain it why ??

AppleTV has a strict spec for HLS, see https://developer.apple.com/library/tvos/documentation/General/Reference/HLSAuthoringSpec/Requirements.html#//apple_ref/doc/uid/TP40016596-CH2-SW1.

Thanks Kelvin. Your tutorial was a good starting point in our project. May we know how can we get the AppleTV setting on “Subtitle Language” under the “Audio and Video” setting page, Swift/Object-C code is fine?

Can we use either swift or Objective C while using TVML/TVJS?

Yup, both languages work.

Hi,

I am looking for some tvOS SDKs or API’s used for payments like Braintree and Stripe which are being used on iOS. As there is no Apple pay feature on Apple TV/ tvOS, how can payments be processed?

Thanks,

What would be the best approach if I need to make REST API calls to retrieve the content to display? Can I still use TVML type of apps to make REST API calls to retrieve data?

Hi kelvin,

I am beginner to tvOS and following your tutorials on TVOS, all are very helpful.
I am getting following error while running the hello world program which you explained in above article:
ITML : SyntaxError: Unexpected token ‘<’…{
line = 1;
sourceURL = “http://localhost:9001/js/application.js”;
}

I found following link over the web but this article did not help:
.http://stackoverflow.com/questions/39188648/tvml-syntax-error-unexpected-token
Please provide me any solution for this issue

Thanks,

Hi Kelvin, thanks for creating this tutorial. I’m a complete beginner to Xcode, Swift and tvOS development and your tutorial was helpful to get off the ground. I’m using XCode 8 and the latest Swift version and noticed that the API has changed a bit since the tutorial was published. Specifically the line where you grab the bounds of the main screen in the didFinishLaunchingWithOptions function have changed:

What was:

window = UIWindow(frame: UIScreen.mainScreen().bounds)

Is now:

window = UIWindow(frame: UIScreen.main.bounds)

Small thing I know and code-complete (or whatever it’s called in Xcode) helped a lot but took a novice like me some time to confirm my change was correct.

Steve

Hey Steve!

Thanks for pointing that out. I’ve made the following changes:

  • Updated the final RWDevCon project to Swift 3
  • Updated the application(didFinishLaunchingWithOptions:) text to match the changes

Sorry for the trouble, I totally understand the frustration of finding out how to migrate old code to new code.

Kelvin

Hey nmatiyali1!

JavaScript is not our friend :frowning:

My advice is to make sure you’ve got the " ` " character at the right place. When I was writing this, missing that was a frequent cause of errors. Otherwise, it’s likely you’ve just missed an angle bracket when declaring your elements in createAlert of application.js.

Hi Kelvin,

Thanks for sharing tutorial. Its explained in full detail ,was able to understand all itsy-bitsy of apple Tv development. However as I am referring other tutorials too, they are suggesting tvml and tvjs for development. And I am an ios developer ,will be developing apple TV app for first time, so can you please guide me about choice of language for TV development? Can I use swift,Obj-C and TVJS all together? or what would you recommend if my app uses servers and custom databases , should I be opting for TVML and TVJS or develping with swift is fine? As my app has third party library references too which are written in swift and payment gateway integration. Please do guide me with your expertise.

Still a great tvOS starter. For anyone finding it 2 years later… here is the updated URL for the videos (fix in your template file): https://wolverine.raywenderlich.com/rwdevcon.com/2015/videos/<mp4 file name here.

Does TVML support Fairplay DRM properly? We are unable to play DRM protected files due issues in loadAssetID? Has any one tested TVML Fairplay?

This tutorial is more than six months old so questions are no longer supported at the moment for it. Thank you!