sor3nt / amazon-fire-tv-stream Goto Github PK
View Code? Open in Web Editor NEWA simple NodeJs Module that allows to stream a video to any Fire TV device.
A simple NodeJs Module that allows to stream a video to any Fire TV device.
I noticed many of the bytes of the setMediaSource command are listed as "unknown code" in the source, so here's some basic documentation as seen via WireShark packet capture.
First is a setMediaSource for an image:
Thrift Protocol
CALL[ version:0x8001, seqid:0, method:setMediaSource]
Version: 0x8001
Message type: CALL (1)
Length: 14
Method: setMediaSource
Sequence Id: 0
Data
Type: T_UTF7 (11)
Field Id: 1
Length: 53
UTF7 String: http://dapjudmz9fhj0.cloudfront.net/splash-firetv.png
Type: T_UTF7 (11)
Field Id: 2
Length: 27
UTF7 String: {"title":"Video & TV Cast"}
Type: T_BOL (2)
Field Id: 3
Boolean: TRUE (1)
Type: T_BOL (2)
Field Id: 4
Boolean: FALSE (0)
Type: T_UTF7 (11)
Field Id: 5
Length: 226
UTF7 String [truncated]: {\n "Manufacturer" : "Apple",\n "FlingSDKVersion" : "iOS-1.3.1",\n "Uuid" : "3e7317172YNPY0Z2ASJ0LAKNLN2ZRVFP",\n "OSVersion" : "iOS-10.3.2",\n "DeviceModel" : "iPhone8,1",\n "PackageName" : "iOS-de.2kit.cast
Type: T_STOP (0)
and another for a video:
Thrift Protocol
CALL[ version:0x8001, seqid:0, method:setMediaSource]
Version: 0x8001
Message type: CALL (1)
Length: 14
Method: setMediaSource
Sequence Id: 0
Data
Type: T_UTF7 (11)
Field Id: 1
Length: 33
UTF7 String: http://2kit.de/cast/demovideo.mp4
Type: T_UTF7 (11)
Field Id: 2
Length: 98
UTF7 String: {"title":"http:\/\/2kit.de","noreplay":true,"description":"http:\/\/2kit.de\/cast\/demovideo.mp4"}
Type: T_BOL (2)
Field Id: 3
Boolean: TRUE (1)
Type: T_BOL (2)
Field Id: 4
Boolean: FALSE (0)
Type: T_UTF7 (11)
Field Id: 5
Length: 226
UTF7 String [truncated]: {\n "Manufacturer" : "Apple",\n "FlingSDKVersion" : "iOS-1.3.1",\n "Uuid" : "3e7317172YNPY0Z2ASJ0LAKNLN2ZRVFP",\n "OSVersion" : "iOS-10.3.2",\n "DeviceModel" : "iPhone8,1",\n "PackageName" : "iOS-de.2kit.cast
Type: T_STOP (0)
I'm checking your code. It crashes for me since you use in line 65 the value 1 which cannot be converted to upper case. When I use instead the value 'IN' which will be resolved to 1 it does not return any data.
Any idea how I can make you code working? Btw please add your package.json so that we can know the versions you are using.
Hi, thanks for writing this library!
I noticed the port is hard coded, and wanted to suggest how to find the correct port. The FireTV advertises a bonjour service named _amzn-wplay._tcp
. Using any bonjour browser app or library will show this service and the correct port.
For example, on macOS you can run:
$ dns-sd -B _amzn-wplay._tcp local
Browsing for _amzn-wplay._tcp.local
DATE: ---Tue 06 Jun 2017---
10:01:38.843 ...STARTING...
Timestamp A/R Flags if Domain Service Type Instance Name
10:01:38.843 Add 2 4 local. _amzn-wplay._tcp. amzn.dmgr:649079E36FF650C95604A3397843E704:QZT4YaSve2:325301
$ dns-sd -L "amzn.dmgr:649079E36FF650C95604A3397843E704:QZT4YaSve2:325301" _amzn-wplay
Lookup amzn.dmgr:649079E36FF650C95604A3397843E704:QZT4YaSve2:325301._amzn-wplay._tcp.local
DATE: ---Tue 06 Jun 2017---
10:02:02.821 ...STARTING...
10:02:02.822 amzn\.dmgr:649079E36FF650C95604A3397843E704:QZT4YaSve2:325301._amzn-wplay._tcp.local. can be reached at 10-0-1-108.local.:53725 (interface 4)
s=0 at=JG69s/Dch8Tp n=Aman\'s\ Fire\ TV\ stick tr=tcp sp=54118 pv=1 mv=2 v=2 a=0 u=649079E36FF650C95604A3397843E704 ad=A2LWARUGJLBYEW dpv=1 t=8 f=0
and see that "Aman's Fire TV stick" is available on 10.0.1.108:53725
can be reached at 10-0-1-108.local.:53725
Hey there, do you know how to stop the playback and return to home screen?
Great work, many thanks for investigation of the protocol!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.