Beginner developer asks for help T.T

Hi everyone,
I ask for your help to understand what I’m doing wrong.
I have a website similar to youtube and would like to create an app for samsung tvs.
I did some research and found that the most effective way to avoid having to update apps on devices is to create a hosted app which then loads the website through the browser.

I created the app that connects to the site without too much difficulty but navigation via the TV remote control does not work but only through the click of the mouse.

Can someone explain to me what I’m doing wrong and how can I fix it?
Thank you <3

It’s possible that the navigation issue you’re experiencing is related to the way your app is handling input from the Samsung TV remote control. The remote control for Samsung TVs typically sends key events to the TV, which are then passed on to the browser running on the TV. If your app is not properly handling these key events, it may not respond correctly to user input from the remote control.
To resolve this issue, you may need to add support for key events in your hosted app. This can be done using JavaScript and the keydown and keyup events, which allow you to detect when a key on the remote control has been pressed or released.
document.addEventListener(‘keydown’, function(event) {
// Handle key press event
if (event.keyCode === 38) {
// Up arrow key pressed
// Add your navigation code here
} else if (event.keyCode === 40) {
// Down arrow key pressed
// Add your navigation code here
} else if (event.keyCode === 13) {
// Enter key pressed
// Add your navigation code here
document.addEventListener(‘keyup’, function(event) {
// Handle key release event
I hope my idea will help you.