Children’s learning shows try to engage kids by showing them content and then prompting them to respond back before continuing with the rest of the content. Dora the Explorer is a great example. Dora will ask “How many apples can I fit in my bag?” and the video will pause to allow kids at home to answer. Then the video will continue on the same track regardless of whether the answer given by the kids was correct.
This is already how kids interact with the content and how publishers release the content–the pause effect right now is just arbitrary. This is where we make it interactive. The intent is to provide an interactive TV experience for kids where the content only moves forward if the kids interact with it using their voice, and different clips are played based on responses.
As we all know, Apple is already a giant in the electronic mobile gadgets arena. They have recently come up with the idea of creating applications for their Apple TV service. For developers to be able to play around with Apple TV apps, Apple has provided tvOS, which is a huge thrill.
Parents may want to provide their kids with an interactive way to learn, such as through videos will call and response features. Apple has provided various tools (TV Simulators) and instruments (Performance Optimization) to create these kinds of applications using tvOS.
According to Apple: “We’ve reimagined the TV experience with tvOS — an innovative TV platform that redefines what can be done in the living room. The new Apple TV features a built-in App Store making it more entertaining than ever. Now you can deliver incredible and immersive apps and games on the big screen using the tvOS SDK.”
Now we can begin to create something interactive for kids for tvOS SDK.
Now the big question: how does it work?
As the diagram above illustrates, we create a web service that takes voice as an input, converts it into text, and sends it as a response.
The tvOS application looks up to the web service for a response and plays different clips based on the response:
Tools Used: Xcode 7.1 beta with tvOS SDK.
Steps:
There are a few mandatory methods for playing a video on tvOS:
The tvOS application looks up to the web service for a response and plays different clips based on the response:
AVPlayer Object: initialize it using the video URL
-(void)addObserver: In this method, use addObserver on AVPlayer on specific intervals that correspond to the questions asked in the video. We are calling the service using the URL at those specific times.
-(void)connectionMade:(Completionhandler)handler: This method returns the string that we say into the browser. We can check that the string has been returned through this method whether it is correct or not. If correct, the video plays on and keeps asking new questions. If wrong, the video skips the part in which it says the correct answer and asks a new question. No response, and the video will be played in a loop in which only background music is playing and we check the connection. The method will continue in a recursive manner until we get an answer.
Below is a demo video showing the functions of the interactive app.
tvOS was recently launched by Apple. Though we can create applications for Apple TV, as far as we have found, we can’t provide voice input to our tvOS application. Yes, Apple provides a dual mic in their TV remote, so we can get the voice input by using these mics. However, the problem is that Apple only provided the hardware, the mic, not the API to get the callback to listen the voice input into our application. They have provided the voice input for Siri only.
However, we have come up with a work-around to overcome this challenge. We can make an iOS application that can be used as a communication medium between the user of our application and AppleTV. For example, kids can speak into their iphone, iPad, or iPod and the iOS application will convert the voice into text and send it to the tvOS app.
Android TV apps follow the same structure as those for phones and tablets except for the application theme. This means that we can modify our existing apps to run on TV devices or create new apps based on what you already know about building apps for the Android platform.
The following are the main components we must use to create an app that runs on TV hardware/devices:
Before we begin building apps for TV, we must have the following tools and API in our development environment:
There are four major classes in project modeling:
We created a VideoPlayerActivity class to control the video playback as per our need. So when a user clicks on the app launcher icon, this activity gets started and plays video.
Like a tvOS app, our Android TV app also connects with the server for voice input. For server communication we are using the OKHTTP library. The code for communication with the server is as follows:
There are two classes: HTTPBackgroundTask and HTTPUtil, which completely handles communication operation.
This HTTPBackgroundTask class is responsible for continuously looking up the server response. As soon as it gets a server response, it gives a call back to the video controller to play the video accordingly.
On an actual device (Android TV):
After app installation, you will see the app launcher icon on the app launcher area. Click on the launcher icon and your app will run immediately.
There are three ways to install an app on Google TV:
On a virtual device (simulator):
The AVD (Android Virtual Device) Manager in the Android SDK provides the device definitions that allow you to create virtual TV devices for running and testing your applications.
To create a virtual TV device:
Have questions about building tvOS apps or apps for Android TV? Let me know in the comments section below.
Hi,
I am an iOS application developer, i have some applications which are developed for iPhone and iPad now i need to extend them for tvOS. Can you please guide me how to extend my existing project to support tvOS without building it from scratch?
Hi Deepak,
I would love to help you for the same.
Lets get connected!
Email: diwakar.mishra@3pillarglobal.com
Skype: talk2.dm