FireTV: Support for Amazon Fling

Amazon provides a service similar to Google Cast that can be used to control the FireTV remotely for media playback:

https://developer.amazon.com/public/apis/experience/fling/docs/understanding-the-amazon-fling-service

It would be great to see this supported in HA so that no external process is required (firetv-server).

Example for an iOS app that uses it: Fetch

Was browsing my apps on the TV in settings and was wondering what this service was. Now I know. Upvoted as this would be a possible avenue for notifications as well.

1 Like

From what I gather from public information, their SDK is available only for Android & iOS. Besides that they haven’t disclosed specs/source code how to implement that by yourself, so it would require reverse engineering the lib or finding otherwise how the communication should be done.

So I wouldn’t be holding my breath with this one, although it’d be nice not to require adb & separate python2 dependency for firetv.

I already had a closer look at this. It looks like a Thrift-based protocol. This should be rather easy once we reversed the thrift file, shouldn’t it?

Maybe… No idea honestly. I’m wondering that’d allow launching applications by name too? Because if not, it won’t be a complete replacement for python-firetv (see https://github.com/home-assistant/home-assistant/pull/4963).

I’m all for getting rid of an external process (and py2 dependency), but fling support is orthogonal to that.

Nope, it’s about casting only. Why would you think it’s orthogonal? =)

I was able to packet capture the thrift conversation between the iOS SDK and the FireTV and discovered the RPC call to fling videos is named “setMediaSource”

I also found this project on GitHub which makes the same HTTP/Thrift request with a custom URL payload: https://github.com/Sor3nt/Amazon-Fire-TV-Stream/blob/master/FireTv.js

Cool, thanks for sharing! Should not be too hard to put this into a module and avoids the overhead of a real Thrift client.

Not sure if it would be accepted by upstream though.