iceddev / chromecast

ChromeCast implementation for Node.js
MIT License
122 stars 15 forks source link

sample with playing a youtube video doesn't work #6

Open capaj opened 8 years ago

capaj commented 8 years ago

I have this code:

var chromecast = require('chromecast')();
chromecast.discover();

chromecast.on('device', function(device){
  // device is the chromecast device
  console.log('discovered', device)
  device.launch('YouTube', {
    v: 'cKG5HDyTW8o'
  });
});
discovered Device {
  location: 'http://172.20.10.5:8008/ssdp/device-desc.xml',
  applicationUrl: 'http://172.20.10.5:8008/apps/',
  name: 'Chromecast8565',
  model: 'Eureka Dongle',
  info: 
   { deviceType: 'urn:dial-multiscreen-org:device:dial:1',
     friendlyName: 'Chromecast8565',
     manufacturer: 'Google Inc.',
     modelName: 'Eureka Dongle',
     UDN: 'uuid:7d71fe6a-8d04-08dd-7a96-622d57b78c08',
     iconList: { icon: [Object] },
     serviceList: { service: [Object] } },
  connectionUrl: [Function: connectionUrl] }
rest.js: client.chain() is deprecated, use client.wrap() instead
Potentially unhandled rejection [3] {"request":{"path":"http://172.20.10.5:8008/apps/YouTube","method":"POST","entity":{"v":"cKG5HDyTW8o"},"headers":{"Content-Type":"application/x-www-form-urlencoded.js","Accept":"application/x-www-form-urlencoded.js, application/json;q=0.8, text/plain;q=0.5, */*;q=0.2"}},"error":"mime-unknown"} (WARNING: non-Error used)
mskogly commented 7 years ago

I got:

node chromecast.js discovered Device { location: 'http://192.168.1.71:8008/ssdp/device-desc.xml', applicationUrl: 'http://192.168.1.71:8008/apps/', name: 'Stua2', model: 'Eureka Dongle', info: { deviceType: 'urn:dial-multiscreen-org:device:dial:1', friendlyName: 'Stua2', manufacturer: 'Google Inc.', modelName: 'Eureka Dongle', UDN: 'uuid:f1d349f6-c8e4-ffe7-979d-a39266323421', iconList: { icon: [Object] }, serviceList: { service: [Object] } }, connectionUrl: [Function: connectionUrl] } rest.js: client.chain() is deprecated, use client.wrap() instead Potentially unhandled rejection [3] {"request":{"path":"http://192.168.1.71:8008/apps/YouTube","method":"POST","entity":{"v":"cKG5HDyTW8o"},"headers":{"Content-Type":"application/x-www-form-urlencoded.js","Accept":"application/x-www-form-urlencoded.js, application/json;q=0.8, text/plain;q=0.5, /;q=0.2"}},"error":"mime-unknown"} (WARNING: non-Error used)

deanputney commented 7 years ago

This problem appears to be related to the dial module included in this repo. A little investigation turns up this issue: https://github.com/iceddev/dial/issues/4

Looks like DIAL used to be used to discover Chromecasts, but is no longer functional. That may mean that discovery needs to be done in a different manner.