Dev.to WebDev 🛠 Dev 👁 0 📖 3 min read

React Meets Broadcast TV: Building Interactive Apps for Smart TVs

One of the most interesting things about television in Brazil is the fact that every Brazilian has access to free over-the-air (OTA) broadcast TV. You can watch your favorite soccer team or unwind with one of Brazil's fa

React Meets Broadcast TV: Building Interactive Apps for Smart TVs

One of the most interesting things about television in Brazil is the fact that every Brazilian has access to free over-the-air (OTA) broadcast TV. You can watch your favorite soccer team or unwind with one of Brazil's famous soap operas (novelas). The point is that broadcast TV is deeply embedded in Brazilian culture, and now, React is part of it.

Brazil loves OTA TV

Recent data from Kantar IBOPE shows that 70% of video consumption in Brazil still comes from broadcast TV, while the remaining 30% is split across streaming platforms like YouTube and Netflix.

It's very convenient for users when their favorite soccer team's match is live on broadcast TV completely free, or when a blockbuster movie airs on a Sunday.

This shows that Brazilians still prefer watching entertainment content through a democratic, free service. That raises a key question: how do we modernize this model and keep it relevant? Even more importantly, how can broadcast TV compete and bring streaming-like features to the living room? That is where Ginga comes in.

A web app on TVs

Ginga is the middleware of the Brazilian digital TV system. This architecture enables TVs to support JavaScript APIs, HTML and CSS applications. It allows developers to use this stack to build interactive web apps that load as soon as the channel is tuned in. There is no need to download anything from a TV app store, and channels simply build and deliver their own apps tied to the broadcast transmission.

Ginga transmission architecture

Basically, Ginga is the middleware that allows traditional OTA channels to deliver their own web apps to their users. A compatible TV (2021 or newer) receives an application URL, and the middleware loads it if the TV is connected to the internet. Within seconds, users can watch the channel while interacting with the application.

The name Ginga was chosen to represent struggle, and the equality of the Brazilian people. It is a reference to the fundamental movement of Capoeira, celebrating the art and resilience of our culture.

In the beginning, the first interactivities were very simple, just a complement to the main content on the channel. During a news program, for example, viewers would see text summaries of the latest headlines. Meanwhile, during a soccer match, the scores from other games were available on screen.

SBT channel application during the news program

SBT channel application during the news program

Soccer scores on Globo channel

Soccer scores on Globo channel

Today, interactive applications for broadcast TVs are far more powerful, and Globo has taken this ecosystem to another level.

Micro front-end is the secret

When my team and I were planning the architecture to build the interactive experiences at Globo, one of the most important points to consider was performance. A web application running on older browsers and a wide range of Smart TVs must be lightweight and load quickly. There's no loading feedback or indication of whether the app is running. It just happens.

A single React app usually works fine for small projects, but at Globo, we need to offer a wide variety of interactive features, ranging from sports to movies. Furthermore, these experiences are independent applications that have their own business rules and functionalities. Because of that, a micro-frontend architecture was chosen for this.

Micro-frontend architecture in Globo application

Lineup interactivity structure

Webpack's Module Federation allows you to define a host app and remote modules that are loaded into the main application at runtime. This ensures you can maintain each micro-app as an independent project with its own, or shared dependencies. With these micro-apps, we can load specific experiences on demand depending on the program currently airing on the channel.

Besides that, this architecture allows us to share UI components and common dependencies within a monorepo structure, simplifying both the management and development of these features.

The result is a high-performing app that delivers a clean Home screen where users can explore and interact with the experiences whenever they want.

And the future is...

With the advancement of Ginga technologies and government regulation of the DTV (Digital Television) protocol in Brazil, more and more features will become available for over-the-air TVs. I would venture to say that next step is delivering streaming content both live and on-demand (VOD) directly within the broadcast experience. In that future, there will be no need to download apps: viewers will simply pick up their remote control and start interacting.

📰 Read the original article on Dev.to WebDev

Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.