question

ryan avatar image
ryan asked

How to find URL of currently playing video in fire app builder for amazon fire stick

Basically, I want to send my server the URL of the currently playing video within my android app (using the base fire app builder example) on the fire tv.

EDIT: I have found the method (within TVUIComponent -> uamp -> ui), which looks like it is called when a new video is loaded:

public void changeContent(Content content) { }

but when i try to add my code within this method, my server doesnt seem to get the post request, im assuming because this code isnt called? my code to make a connection to my server works when i put it somewhere else, for example when startup of the ui is loaded, but doesnt seem to work in other places, is this because the network utils create http connection method will not work after a certain point, or some state needs to be applied for the code to run, any help would be appreciated or perhaps the TVUIComponent does not have access to make web requests like other classes?.

any help would be appreacicated

I have to following code to make a post request to my server:

HttpURLConnection urlConnection = null;urlConnection = NetworkUtils.createHttpConnection(NetworkUtils.POST, "http://domain/", "url-here","Content-Type", "text/html");
int statusCode = urlConnection.getResponseCode();

I see from here: https://developer.amazon.com/blogs/post/804cf680-9643-40da-8372-36cc45d73707/developing-for-the-living-room-how-to-build-an-android-app-for-fire-tv-part-6

that you can retreive the URL of a custom app using movie.getVideoUrl() but this is for a custom android app and not using the fire app builder, I would like to find the correspond method using the fire app builder.
But I am having trouble going through the fire app builder code to find where the video is loaded, and what the url or id of it is. If anyone can help navigate through the code to find where this happens it would be greatly appreciated :)
fire tvandroidfire app builder
10 |3000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Ross@Amazon avatar image
Ross@Amazon answered

Ryan,

Have you tried playing the video using the Amazon Media Player Component?

10 |3000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.