yocontra / nodecast

Node interface to DIAL/RAMP/ChromeCast
MIT License
162 stars 23 forks source link

Get the current running application #12

Closed vincentbernat closed 10 years ago

vincentbernat commented 10 years ago

Hi!

It seems that it is currently not possible to get the running application. This information is available by querying /apps/.

yocontra commented 10 years ago

@vincentbernat For which device?

vincentbernat commented 10 years ago

On Chromecast.

yocontra commented 10 years ago

@vincentbernat Nice - I'll check this out and and a method for this when I have a minute. Thanks for the report

vincentbernat commented 10 years ago

Getting the active app with curl:

$ curl -iL http://192.168.116.19:8008/apps/
HTTP/1.1 302 Found
Location: http://192.168.116.19:8008/apps/00000000-0000-0000-0000-000000000000
Content-Length: 0

HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 456

<?xml version="1.0" encoding="UTF-8"?>
<service xmlns="urn:dial-multiscreen-org:schemas:dial">
  <name>00000000-0000-0000-0000-000000000000</name>
  <options allowStop="true"/>
  <state>running</state>
  <link rel="run" href="web-2"/>
  <servicedata xmlns="urn:chrome.google.com:cast">
  </servicedata>
  <activity-status xmlns="urn:chrome.google.com:cast">
    <description>Chromecast Home Screen</description>
  </activity-status>
</service>
yocontra commented 10 years ago

This is added in 0.0.9 as chromecast.running(function(err, app){}); for chromecast devices. I've also added chromecast.details(function(err, info){}); which has some fun stuff in it like geolocation, wifi info, timezones, etc.

I'll also be updating and fixing some of the existing APIs for the v2 stuff. Expect this to be released tonight

vincentbernat commented 10 years ago

Great, thanks!

yocontra commented 10 years ago

@vincentbernat Can you try what's currently in git before I push to npm and see if it fits your needs?

vincentbernat commented 10 years ago

@contra Both new methods are working for me. It fits my need. Thanks!

yocontra commented 10 years ago

Published, thanks