Android Question B4A + FireTV Stick + Youtube

FabioAlbaneseTv

Member
Licensed User
Hello to all,
I'm trying to build an Amazon Fire TV app to show some YouTube videos I've made.

What have I done:

On an activity I’ve put a Webview and I used WebView.LoadHtml to "load" a html+javascript code generated by the app to use Youtube Player API
And this works.

In order to simulate the click to start the video, I’ve used the SendInput library (indeed autoplay doens't work)
And also this works fine

But I have to solve two problems:

1. If I press the “SELECT” button FireTV Stick control (the round big one), it stops the video, but I wish to avoid any interaction by the user with the content of the WebView. I’ve tried different ways to solve it, but nothing has worked. With Activity_KeyPress I can check all the buttons on FireTV Stick control but not the “SELECT” one. Even if I put a transparent panel over the Webview and use Panel1_click event, it doesn’t “intercept” the click made by the user.

2. I need to get an event when then video has finished so I can start a new video.

Any idea ?
Thank you in advance!
Fabio
 

FabioAlbaneseTv

Member
Licensed User
Why aren't you using YouTube library?

Hi. thank you for your suggestion. I didn't know the existence of Youtube library.
I will try, but I've noticed that it requires an API Developer Key. And I wish to avoid it because it has an usage quota and I don't know what will happen when this quota has expired. I would prefere to use a normale javascript embedding code to play the video. But I will try.

Fabio
 
Upvote 0
Top