JS on the Big Screen: Making TV Apps

Rate this content
Bookmark
JavaScript is a versatile language now making its way into TV app development. JavaScript frameworks like React, Preact, and Lightning.js are commonly used for creating interactive TV apps. React Native tvOS enables developers to build universal TV apps for multiple platforms including Android TV, tvOS, and Fire TV. The fragmented landscape of TV operating systems, such as Tizen and WebOS, poses unique challenges. Focus management and performance optimization are crucial for TV apps due to the lower hardware specifications of TVs compared to mobile devices. Specialized frameworks like Lightning.js and tools like React Gibbon help in optimizing TV app performance. Understanding spatial navigation and memory optimization can significantly improve the user experience in TV apps.

From Author:

The ever-expanding landscape of JavaScript applications has now reached the big screen - yes, you heard it right, you can build TV apps with JavaScript! 


The TV operating space is a mess; there’s more fragmentation than the Android ecosystem, and that’s saying something. Each manufacturer has tried to reinvent the wheel by making their own OS. At the moment, the main players are Android TV, tvOS, WebOS, Tizen, among a whole myriad of others. 


This makes it a unique place where Javascript and web technologies can become a uniting factor and save you from the stress of trying to develop and maintain handfuls of apps for the big screen. 


We’ll talk about how to build TV apps, what JS frameworks can help in this, and explore the challenges that come hand-in-hand with TV app development, namely performance bottlenecks and focus management using remote controls.

This talk has been presented at JSNation 2024, check out the latest edition of this JavaScript Conference.

FAQ

The speaker of the session is Mo, who heads the mobile team in the UK of Theodore and Bam.

More than 99% of web pages use JavaScript today.

Tools like Cordova, Ionic, and React Native allow JavaScript to create native applications for mobile phones.

The TV market is dominated by several operating systems, including Android TV (41% market share), Tizen (Samsung), WebOS (LG), Fire OS (Amazon), Roku, and tvOS (Apple).

The two main groups of TV operating systems are native-based and web-based operating systems.

Common JavaScript frameworks for TV applications include React, Preact, Solid, and Lightning.js.

User interaction on TV is primarily done using a remote control with a D-pad (left, right, up, down arrows), unlike the cursor on web or touch on mobile.

Two big considerations when building TV apps are user interactions and focus management, and performance optimization.

Performance optimization is crucial for TV apps because TVs generally have much lower hardware specifications compared to modern laptops and mobile phones.

A common challenge in focus management for TV apps is determining which element to focus on next when the user navigates using the remote control, especially in complex layouts like grids.

Mo Khazali
Mo Khazali
22 min
17 Jun, 2024

Comments

Sign in or register to post your comment.

Video Transcription

1. Introduction to JavaScript on the big screens

Short description:

I'm very excited to be talking about JavaScript on the big screens and how you can make TV apps using JavaScript. JavaScript is absolutely everywhere. Today, more than 99% of web pages use JavaScript. It's everywhere. JavaScript has found its way into the mobile development world. JavaScript has become an integral part of the mobile ecosystem as well. And even backend, right? We've been seeing more and more backend runtimes of JavaScript or server-side runtimes of JavaScript. So JavaScript can effectively be used across the entire stack.

♪ Hi, everyone. Thank you for joining this session. I'm very excited to be talking about JavaScript on the big screens and how you can make TV apps using JavaScript. I'm very excited to be here with you at JS Nation this year.

A little bit about me. My name is Mo. I head the mobile team in the UK of Theodore and Bam. Theodore Group is a group of about 700 digital experts, and Bam is the mobile specialist team within that. We've been in the mobile space since about 2015 and very early adopters of React Native, and we've been doing React for a very long time as well. I've been very involved in the JavaScript ecosystem for quite a while and excited to be talking and sharing some of our learnings with you today.

JavaScript is absolutely everywhere. So it started from the web, and I found this very cool picture of a book talking about Netscape JavaScript in version 1.2. I think this book is from the late 90s. Today, more than 99% of web pages use JavaScript. It's everywhere. You cannot get away with building a web app without JavaScript. And more and more JavaScript frameworks have arisen over the years and are being used out in the wild, and we're very familiar with these. On the other side, JavaScript has found its way into the mobile development world. This is a quote that I always keep on referring back to, which is from Steve Jobs in 2007 when he's announcing the iPhone 3G, where he lays out the vision basically for PWAs. And it's really interesting to see that there is always this idea that JavaScript could be used to build really good apps on mobile phones. And that vision moved forward despite native app adoption through tools like Cordova, later Ionic on top of that, and React Native, which allows you to create native applications using JavaScript. So JavaScript has become an integral part of the mobile ecosystem as well. And even backend, right? We've been seeing more and more backend runtimes of JavaScript or server-side runtimes of JavaScript. So JavaScript can effectively be used across the entire stack.

2. JavaScript's Role in the TV Ecosystem

Short description:

But, you know, as you're sitting at home browsing on your phone, looking through your laptop, and all of these experiences of JavaScript, there's one more experience that's sitting in the background that is also powered by JavaScript. So let's take a quick aside, and then I want to go back into understanding where does JavaScript fit with TV. TVs are interacted with primarily by a remote. The TV operating system landscape is incredibly fragmented. The web-based operating systems can be targeted with any JavaScript application. It's very common for TV applications to use React.

But, you know, as you're sitting at home browsing on your phone, looking through your laptop, and all of these experiences of JavaScript, there's one more experience that's sitting in the background that is also powered by JavaScript. And that is the TV. And you'd be surprised to understand how much of the TV ecosystem is being powered by JavaScript.

So let's take a quick aside, and then I want to go back into understanding where does JavaScript fit with TV. But to set some of the prerequisites and the groundwork for this talk, I just want to quickly cover what some of the core components of a TV app are. So if we look at a blank screen, we've got a... In any TV app, we've got a top-level navigation, and then you've got a grid or a set of carousels. And the key factor here is that TVs are interacted with primarily by a remote, effectively.

So if you look at the TV operating system landscape, what you'll find is that it's actually incredibly fragmented far beyond anything that you see in mobile apps. And in terms of web browsers, web browsers are typically very much in feature parity and heavily Chromium-dominated these days. Whereas in the TV space, you've got so many different operating systems, each with large market shares. So there's so many different operating systems for TVs, and you can't really just target one of them. You really need to target almost all of them in order to have a strong media presence.

Now, web is pretty self-explanatory, right? The web-based operating systems can be targeted with any JavaScript application. They run HTML-based, JavaScript-based applications. So it's very common for TV applications to use React. But people also have started to use Preact quite extensively. Similarly, Solid. And interestingly, there is actually a TV specialized framework, which I'll get into in a little bit more detail later on, called Lightning.js. And Lightning.js actually uses Solid to define the UI of your application. So there's a lot of usage and there's a lot of focus as well on optimization.

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

Vite: Rethinking Frontend Tooling
JSNation Live 2021JSNation Live 2021
31 min
Vite: Rethinking Frontend Tooling
Top Content
Vite is a next-generation build tool that leverages native ES modules for improved performance. It eliminates the need for bundling and improves hot module replacement. Vite provides an opinionated default configuration while still allowing advanced customization through plugins. It is framework agnostic and can be used for React and other applications. Vite is being adopted by Next.js and Create React App, and integration with Nuxt 3 offers significant speed improvements.
Building Better Websites with Remix
React Summit Remote Edition 2021React Summit Remote Edition 2021
33 min
Building Better Websites with Remix
Top Content
Remix is a web framework built on React Router that focuses on web fundamentals, accessibility, performance, and flexibility. It delivers real HTML and SEO benefits, and allows for automatic updating of meta tags and styles. It provides features like login functionality, session management, and error handling. Remix is a server-rendered framework that can enhance sites with JavaScript but doesn't require it for basic functionality. It aims to create quality HTML-driven documents and is flexible for use with different web technologies and stacks.
React Compiler - Understanding Idiomatic React (React Forget)
React Advanced Conference 2023React Advanced Conference 2023
33 min
React Compiler - Understanding Idiomatic React (React Forget)
Top Content
Watch video: React Compiler - Understanding Idiomatic React (React Forget)
Joe Savona
Mofei Zhang
2 authors
The Talk discusses React Forget, a compiler built at Meta that aims to optimize client-side React development. It explores the use of memoization to improve performance and the vision of Forget to automatically determine dependencies at build time. Forget is named with an F-word pun and has the potential to optimize server builds and enable dead code elimination. The team plans to make Forget open-source and is focused on ensuring its quality before release.
Speeding Up Your React App With Less JavaScript
React Summit 2023React Summit 2023
32 min
Speeding Up Your React App With Less JavaScript
Top Content
Watch video: Speeding Up Your React App With Less JavaScript
Mishko, the creator of Angular and AngularJS, discusses the challenges of website performance and JavaScript hydration. He explains the differences between client-side and server-side rendering and introduces Quik as a solution for efficient component hydration. Mishko demonstrates examples of state management and intercommunication using Quik. He highlights the performance benefits of using Quik with React and emphasizes the importance of reducing JavaScript size for better performance. Finally, he mentions the use of QUIC in both MPA and SPA applications for improved startup performance.
Full Stack Documentation
JSNation 2022JSNation 2022
28 min
Full Stack Documentation
Top Content
The Talk discusses the shift to full-stack frameworks and the challenges of full-stack documentation. It highlights the power of interactive tutorials and the importance of user testing in software development. The Talk also introduces learn.svelte.dev, a platform for learning full-stack tools, and discusses the roadmap for SvelteKit and its documentation.
SolidJS: Why All the Suspense?
JSNation 2023JSNation 2023
28 min
SolidJS: Why All the Suspense?
Top Content
Suspense is a mechanism for orchestrating asynchronous state changes in JavaScript frameworks. It ensures async consistency in UIs and helps avoid trust erosion and inconsistencies. Suspense boundaries are used to hoist data fetching and create consistency zones based on the user interface. They can handle loading states of multiple resources and control state loading in applications. Suspense can be used for transitions, providing a smoother user experience and allowing prioritization of important content.

Workshops on related topic

Building WebApps That Light Up the Internet with QwikCity
JSNation 2023JSNation 2023
170 min
Building WebApps That Light Up the Internet with QwikCity
Featured WorkshopFree
Miško Hevery
Miško Hevery
Building instant-on web applications at scale have been elusive. Real-world sites need tracking, analytics, and complex user interfaces and interactions. We always start with the best intentions but end up with a less-than-ideal site.
QwikCity is a new meta-framework that allows you to build large-scale applications with constant startup-up performance. We will look at how to build a QwikCity application and what makes it unique. The workshop will show you how to set up a QwikCitp project. How routing works with layout. The demo application will fetch data and present it to the user in an editable form. And finally, how one can use authentication. All of the basic parts for any large-scale applications.
Along the way, we will also look at what makes Qwik unique, and how resumability enables constant startup performance no matter the application complexity.
Build Modern Applications Using GraphQL and Javascript
Node Congress 2024Node Congress 2024
152 min
Build Modern Applications Using GraphQL and Javascript
Featured Workshop
Emanuel Scirlet
Miguel Henriques
2 authors
Come and learn how you can supercharge your modern and secure applications using GraphQL and Javascript. In this workshop we will build a GraphQL API and we will demonstrate the benefits of the query language for APIs and what use cases that are fit for it. Basic Javascript knowledge required.
Back to the Roots With Remix
React Summit 2023React Summit 2023
106 min
Back to the Roots With Remix
Featured Workshop
Alex Korzhikov
Pavlik Kiselev
2 authors
The modern web would be different without rich client-side applications supported by powerful frameworks: React, Angular, Vue, Lit, and many others. These frameworks rely on client-side JavaScript, which is their core. However, there are other approaches to rendering. One of them (quite old, by the way) is server-side rendering entirely without JavaScript. Let's find out if this is a good idea and how Remix can help us with it?
Prerequisites- Good understanding of JavaScript or TypeScript- It would help to have experience with React, Redux, Node.js and writing FrontEnd and BackEnd applications- Preinstall Node.js, npm- We prefer to use VSCode, but also cloud IDEs such as codesandbox (other IDEs are also ok)
Using CodeMirror to Build a JavaScript Editor with Linting and AutoComplete
React Day Berlin 2022React Day Berlin 2022
86 min
Using CodeMirror to Build a JavaScript Editor with Linting and AutoComplete
Top Content
WorkshopFree
Hussien Khayoon
Kahvi Patel
2 authors
Using a library might seem easy at first glance, but how do you choose the right library? How do you upgrade an existing one? And how do you wade through the documentation to find what you want?
In this workshop, we’ll discuss all these finer points while going through a general example of building a code editor using CodeMirror in React. All while sharing some of the nuances our team learned about using this library and some problems we encountered.
Building a Shopify App with React & Node
React Summit Remote Edition 2021React Summit Remote Edition 2021
87 min
Building a Shopify App with React & Node
Top Content
WorkshopFree
Jennifer Gray
Hanna Chen
2 authors
Shopify merchants have a diverse set of needs, and developers have a unique opportunity to meet those needs building apps. Building an app can be tough work but Shopify has created a set of tools and resources to help you build out a seamless app experience as quickly as possible. Get hands on experience building an embedded Shopify app using the Shopify App CLI, Polaris and Shopify App Bridge.We’ll show you how to create an app that accesses information from a development store and can run in your local environment.
Build a chat room with Appwrite and React
JSNation 2022JSNation 2022
41 min
Build a chat room with Appwrite and React
WorkshopFree
Wess Cope
Wess Cope
API's/Backends are difficult and we need websockets. You will be using VS Code as your editor, Parcel.js, Chakra-ui, React, React Icons, and Appwrite. By the end of this workshop, you will have the knowledge to build a real-time app using Appwrite and zero API development. Follow along and you'll have an awesome chat app to show off!