Giter Site home page Giter Site logo

superhawk610 / multicast Goto Github PK

View Code? Open in Web Editor NEW
213.0 19.0 28.0 3.58 MB

:green_heart: A persistent solution to presenting content across multiple Chromecast devices.

Home Page: https://superhawk610.github.io/multicast-site/

License: MIT License

JavaScript 64.97% HTML 26.63% CSS 8.32% Shell 0.08%
chromecast-device multicast receiver mdns node

multicast's Introduction

MultiCast v2.0

npm version

๐Ÿ’š A persistent solution to presenting content across multiple Chromecast devices, inspired by Greenscreen.

Developed with Node, Express, and Mongo.

Usage

Home

home

From the home page, you can manage displays via Chromecasts, manage all available content via Channels, create and trigger alerts via Push Alerts, or takeover all display by starting a Takeover.

Channels

channels

All content is managed via Channels, which are unique URLs that can be assigned to each individual device. There is no limit on the number of Channels you can have available at any one time, and you can freely switch between them on a per-device basis.

To access Channels, select Channels from the homepage, or click Channels in the top right of the interface.

channel

A channel consists of a Name and Layout. The channel's name will be used to refer to it throughout the interface, but will never be displayed on the actual device when it is being cast. The channel's layout allows one or more URLs to be embedded (via iframe) into the page that will be cast. Two layouts are provided, though creating additional layouts is not especially difficult (see Creating Layouts).

Devices

devices

Chromecast devices are now interfaced with as mDNS devices via the new Castv2 API. This removes the Chrome/Chromium browser restriction that previously existed with Chromecast devices, and even allows Multicast to be run remotely from a headless server (see Setup).

All Chromecast devices on the same network as the host will display here. Devices can be registered to be activated as Multicast receivers and assigned a channel, receive push alerts, and so on.

To register a device, click on the device's name or click Register Chromecast.

register

A device's name will be whatever the Chromecast's name was when it was set up. A device's Location can be set to anything you would like to clarify where it is located. Make sure to choose something descriptive, as this will make Channel management easier down the line.

You can choose not to select a Channel when registering a device - doing so will leave the device on the default registration screen until a Channel is selected.

device

Once a device has been registered, you can select its name from the Devices list to change the Channel it is displaying, refresh its Channel content, or Reconnect it if loses connection.

Push Alerts

push

Push Alerts are useful for displaying small pieces of information to all receiver devices. Alerts will begin displaying on all connected receivers as soon as they are created, and will continue to display until their set duration is reached or the receiver is reset.

Channel Takeover

takeover

A Channel Takeover allows all receiver devices to be temporarily, indefinitely redirected to a single channel. A Takeover will begin immediately after it is started, and will last until it is manually stopped from the homepage.

*Takeovers will also affect devices that are registered after they have begun.

Getting Started

Prerequisites

This project requires Node.js and NPM (bundled with Node), as well as a MongoDB server. Since Node is cross-platform, it should work on Windows, MacOS, and Linux.

This project depends on node_mdns, which in turn requires a mDNS stack. Follow the installation instructions here for whichever platform you are on to install a mDNS stack. If you're on Linux, this is as simple as

Debian/Ubuntu

sudo apt-get install build-essential libavahi-compat-libdnssd-dev

RedHat/Fedora/CentOS

sudo yum install gcc gcc-c++ avahi avahi-compat-libdns_sd avahi-compat-libdns_sd-devel nss_mdns

Setup

If you don't already have access to a MongoDB server installation, follow the guide here.

Grab the latest stable copy of Node/NPM from here or install it via nvm.

In order to access the Chromecast API, you need to register as a Cast developer (it costs $5).

Once you've done this, log in to the Cast Developer SDK Console and click Add New Application. Choose Custom Receiver, then name it Multicast and set the Receiver Application URL to http://YOUR_LOCAL_IP:3944/landing. Disable Guest Mode and then Save.

NOTE: Make sure to use your LAN IP here (192.168.1.xx or similar), not your WAN/external IP. This should resolve to your server only within your local network.

You now need to register your Chromecast devices as developer devices. For each device, locate the Serial Number (located on the back of the device and on the box), click Add New Device, and enter the Serial Number and a brief Description. (NOTE: This may take up to 15 minutes to take effect. Go grab a cup of coffee and then head back.)

Installation is a snap with NPM.

npm i multicast -g
multicast config
multicast start

Head over to http://YOUR_LOCAL_IP:3944/ in your browser to get started, then simply follow the Usage guide to get off the ground.

For development, you can install locally via Github - clone this repository to your local machine, then head into the cloned directory and create a .config file for your setup.

git clone https://github.com/superhawk610/multicast
cd multicast
cp .config.template .config
vim .config

NOTE: You should leave mongoAuthSource and mongoPort set to their default unless you know what you're doing.

Install Node modules

npm install

Build files using Gulp

gulp

Run the application

node .

Firewall Settings

In order for a Chromecast to establish and maintain a connection with a Cast sender, the sender must open two ports:

1900/UDP (DIAL) 5353/UDP (mDNS)

Make sure that the device running MultiCast has these ports open, as well as the standard HTTP ports

80/TCP/UDP (HTTP) 443/TCP/UDP (HTTPS)

Flags

--serve-only - Do not attempt to connect to any devices, just serve files via Express. Useful for debugging.

Having Trouble?

Common Errors

*** WARNING *** The program 'nodejs' uses the Apple Bonjour compatibility layer
of Avahi. *** WARNING *** Please fix your application to use the native API of
Avahi! *** WARNING *** For more information see
http://0pointer.de/avahi-compat?s=libdns_sd&e=nodejs *** WARNING *** The program
'nodejs' called 'DNSServiceRegister()' which is not supported (or only supported
partially) in the Apple Bonjour compatibility layer of Avahi. *** WARNING ***
Please fix your application to use the native API of Avahi! *** WARNING *** For
more information see
http://0pointer.de/avahi-compat?s=libdns_sd&e=nodejs&f=DNSServiceRegister

Don't worry about this. This warning shows up in all Node apps on Linux that depend on libavahi-compat-libdnssd-dev. You can safely ignore it.

Can't launch after installing via NPM? Make sure your NODE_PATH environment variable correctly includes the global store for node dependencies. On Linux:

export NODE_PATH=/opt/lib/node_modules

Multicast can't find your devices? Make sure they've already been setup and powered on and the display that they're connected to is powered on and displaying their output.

If you can view them from other Cast-enabled apps but not from Multicast, its likely an issue with your firewall. Make sure you configured your firewall correctly (see Firewall Settings).

Using Node 8.6+?

EDIT: This has been patched as of node_mdns 2.3.4. This fix is no longer required.

The most recent version of node_mdns has an incompatibility with v8.6 due to changed syntax for a method (see this pull request). Until it is fixed in the main branch, you will need to patch it yourself. Edit node_modules/mdns/lib/resolver_sequence_tasks.js and make the following change (roughly line 115):

   function getaddrinfo_0_11(host, family, cb) {
     var req = new cares.GetAddrInfoReqWrap()
-      , err = cares.getaddrinfo(req, host, family)
+      , err = cares.getaddrinfo(req, host, family, 0, false)
       ;
     req.oncomplete = function oncomplete(err, addresses) {
         getaddrinfo_complete(err, addresses, cb);

Running CentOS and Seeing This Error?

Error: getaddrinfo -3008

Make sure you have nss_mdns installed:

sudo yum install nss_mdns

Issues

If you run into any problems while using this, please report them here.

Authors

superhawk610 Aaron Ross - author - superhawk610

Brekmister Brekmister - contributor

ocelotsloth Mark Stenglein - contributor - ocelotsloth

andrewpryor Andrew Pryor - contributor - andrewpryor

Contributing

  • NEW: Use a code editor that supports Prettier and the included .prettierrc.yml
  • Follow the existing code formatting (2 spaces, not tabs, no hanging brackets, no semicolons, etc)
  • Comment your code to explain anything more complex than a routine action
  • Provide rationale for any changes you request
  • Use thorough commit/pull request messages

Active Branches

main (stable) all features in this branch are fully implemented and ready to go

api (unstable) this branch implements receiver grouping and remote control by splitting all functions out into an independent REST API

rotation (stable) this branch adds the ability to display channels at 90/180/270 degress of rotation

authentication (unstable) this branch adds a login page and POST/DELETE request verification

logging (unstable) this branch adds real-time logging & monitoring of all console/page-load errors from receiver devices back to Multicast's web interface

Creating Layouts

Creating a channel layout is simple, and consists of two things:

CSS Layout

Copy app/views/layouts/template.pug and change the name to your new channel layout name (e.g. - my-layout.pug).

Change the class applied to the body to the name of your channel layout (e.g. - body.my-layout).

In build/css/channel.css, add rules to style each iframe in your layout, prefixing each with body.layout-name, replacing layout-name with your layout name. Refer to the existing rules for inspiration.

NOTE: Channel sections are currently limited to 4 per channel. To increase this, change maxSectionCount on app/views/channel.pug.

CSS Icon Design

In app/views/channel.pug, add a div under #channel-layout with the class layout and layout-name, again replacing layout-name with your layout name. Make sure this div has the class active when the channel is using your layout, as such:

.layout.layout-name(class=(channel && channel.layout == 'layout-name' ? 'active' : ''))

Style this div in build/css/channel-edit.css to conform to the existing channel layouts:

width: 250px;
height: 150px;
border: 1px solid rgb(202, 206, 215);

Once you finish, don't forget to gulp everything to apply your new layout.

Security Disclosure

This project relies on node-castv2 which uses an outdated version of protobuf. I am in the process of getting this vulnerability patched - current status is tracked here. Details of the vulnerability can be found here.

License

This project is licensed under the MIT License - see LICENSE for more details.

Acknowledgments

Special thanks to Greenscreen and the team over at Groupon for inspiring this product.

multicast's People

Contributors

brekmister avatar chrisjpowers avatar dependabot[bot] avatar jevonearth avatar jyrno42 avatar ocelotsloth avatar superhawk610 avatar yuzawa-san avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

multicast's Issues

Feature Request: Grouping of Chromecasts

This generally can be solved by having multiple instances of MultiCast but, It would be very nice when we have large deployments to separate out different areas/departments but, notify everyone if there is a big issue.

In such case: My work wants to have digital signage for customers but, we also want to have wall mounted monitors as our war room dashboard. If there is a safety alert, we want to broadcast to all Chromecasts however, if any one of my bosses needs to hold a meeting or have an announcement, We only want to show that on our war room monitors.

EDIT: We already have war room monitors with Virtual Machines casting to these. But, we want something better than that such as this project

Cleaner channel takeover for video

We use a channel takeover every morning to play a short video, and currently that video plays at different times across the various chromecasts, also some of them will lag perhaps due to increased bandwidth on the server hosting the video file.

Looking for some way to clean this up. My thought is for the multicast server to proxy/buffer the video and wait for all takeovers to complete before starting playback. Perhaps even setup some kind of multicast stream (not to be confused with the name of the project...) to scale better for more chromecasts.

Clearing out Mongo

Some how I ended up with a chromecast registered with some missing information. When I view the /devices screen, I see an off line chromecast with no name. The URL is "/devices/undefined/edit".

Is there a simple way I can flush MongoDB and start over configuring things? Maybe a message I can post to mongoDB or a URL I can request?

Can this be used with chromecasts over public internet?

We have screens across multiple physical locations, (how) would it be possible to set up Multicast on a public server and control these screens? The screens would be in separate LANs, behind routers & possibly firewalls.

v3.0 Release Schedule - Details

Goals

The UI will be rewritten in React + TypeScript + Apollo Client.

The backend will be rewritten with Apollo Server + TypeScript.

The data layer will use SQLite instead of Mongo to facilitate simpler deploys.

Progress

You can track progress on the master branch. The latest stable version will remain available on the v2.x branch.

  • UI
    • skeleton
    • channels
    • devices
    • push alerts
    • takeovers
  • Requested Features
    • tags
    • variable page zoom
    • CORS access warning
    • configuration UI
    • authentication
    • force clear page cache
    • variable channel timing
  • Backend
    • skeleton
    • device scanning
    • GraphQL resolvers
    • data layer interface
    • X-Frame-Options proxy
    • rotation timer
    • switch from mdns to multicast-dns
    • patch protobuf vulnerability upstream (tracking in superhawk610/node-castv2#1)
  • Data Layer
    • skeleton
    • sandbox mode w/ seeds
  • Misc
    • README rewrite
    • common location for config/sqlite files (~/.multicast)

LAUNCH_ERROR

Hi,
I was trying out Multicast and got following error in my command line (mac OS X)

โžœ ~ multicast start

MultiCast is live!
listening at port 3944...
LAUNCH_ERROR
relaunching hub...
LAUNCH_ERROR
LAUNCH_ERROR

The webgui works, I can register my chromecast etc but when I try to launch a channel nothing happens? Any idea what could cause this? Thanks a lot for the effort on this!

'Reconnect' doesn't appear to re-establish connection?

Context:
We're using this awesome tool in several meeting rooms. We've got 4 Sony Bravia Android TVs with Chromecast enabled on them (all running latest software). At the start of the day, we restart multicast, and they all show a calendar. However, during the day people navigate off the chromecast mode to do things like connect their laptop (which is fine).

Problem
When multicast starts, it appears to reconnect all Chromecast-enabled TVs and they all display as they're supposed to. However, once they've had something else on them, they cannot 'switch back' to multicast without a restart of multicast. This isn't ideal as all chromecasts refresh (which then takes over the TV). One would assume that this is what the 'reconnect' button is supposed to do, but it doesn't do anything? Ideally I'd like to reconnect a single chromecast, rather than all of them (if possible).

Am I incorrect in assuming that this is what the 'reconnect' button is supposed to do? Or is this a bug, or a quirk with Chromecast-enabled TVs?

Chromecast is listed in the device page but the IP address of the host is my laptop

Hi there. I am facing a problem that the IP address of my host is IP of my laptop instead of IP of my Chromecast. This leads to the channel is not able to be casted to the correct device. Connected client with host : 192.168.1.35 is shown only when I enter the landing page (:3944/landing), but not immediately after launching the multicast (multicast start). When I exit the landing page, it will disconnect directly to the host. Most importantly, 192.168.1.35 is the address of my laptop! It seems that it is connecting to the wrong device! I have "LAUNCHED_ERROR" with the reason "NOT_FOUND"
Can anyone help me out ? Thanks !

Unrecognized Device

Hi all,

I have configured channel and registered chromecast in multicast, but the TV output unrecognized device name and the device id is n/a. My chromecast device has been already registered as developer device. Here is my environment:

Ubuntu 16.04 with firewall disabled (same network with chromecast device)
Node 6.14.2
MongoDB 3.6.5

Appreciate your help, many thanks

old cache appears

I have a channel with two URLs in one section.

  • First one is just page from internal server which shows some generated picture (building plan with statuses of equipment). (lets name it A)
  • Second one is just a published Google Spreadsheet. (lets name it B) Published spreadsheet update period is less then 5 minutes. I have added few formulas to spreadsheet to see current time of spreadsheet when it was republished.

What i see on my channel for example when data is recently updated and url to published spreadsheet already have new data:

  1. A
  2. updated B
  3. A
  4. old B
  5. A
  6. updated B
  7. A
  8. old B
  9. and so on.

So, it looks like Multicast have issues with caching page content. How to force expire cache?

Feature Request: Optionally Pull Configuration from Environment Variables

A couple benefits:

  • This would make #11 quite a bit simpler to implement and maintain moving forward
  • Giving the option to not store the database credentials in plaintext is also beneficial

All it needs to do is check process.env for the configuration keys and override anything in the .config file. I can take this issue if you'd like.

I think that at this stage it isn't worth the extra dependency, but the config npm package is pretty good in my experience.

Cross-origin iframe access

Hi,

I'm just starting to deploy this in my business (it's great) but i've run into an issue that I can't find an easy solution for:

โฉ $('iframe')[0].contentWindow.document
โš  SecurityError: Permission denied to access property "document" on cross-origin object

This is causing the "Frame loading blocked" message to display on my TV.

I'm trying to load a dashboard from another IP in the same network as the multicast server.
I've set Access-Control-Allow-Origin: * on my dashboard page, but it doesn't seem to make any difference.
Am I missing something obvious? ๐Ÿ˜…

Timing of content

I'm currently using multicast (THANK YOU!) to display a 4 TV menu. I would like to add a feature request for 3.x that would allow different timing for different slides, or maybe this is something I can edit in the current version? For example I want to show the Menu 90% of the time and then for the 10% create burn-in prevention content that also would advertise products.

I just cannot install multicast

Hello,
all I et is this errors:

mike@ubuntu:/$ sudo npm i multicast -g
/usr/bin/multicast -> /usr/lib/node_modules/multicast/index.js

> [email protected] install /usr/lib/node_modules/multicast/node_modules/mdns
> node-gyp rebuild

gyp ERR! clean error 
gyp ERR! stack Error: EACCES: permission denied, rmdir 'build'
gyp ERR! System Linux 4.15.0-29-generic
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/lib/node_modules/multicast/node_modules/mdns
gyp ERR! node -v v11.2.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/mike/.npm/_logs/2018-11-23T21_56_22_630Z-debug.log

What is going on here?

Thank you.

Feature Request: Error Page when Channel fails to load

As I mentioned in #18, if the given URL doesn't load/exist/resolve, all we get for feedback is a blank white screen. A quick JS script to detect this failure mode and change the page to show a simple error message explaining why the channel didn't load would be super helpful for diagnostics.

I'll write something next week and push it up.

Releases

Before any more Pull Requests are merged, I very strongly suggest that @superhawk610 makes an actual GitHub release marking what he has done.

While these pull requests may contain very good points, they may not necessarily be perfect. It already works, so let's mark it as the starting point before it stops working.

@superhawk610 If you need help understanding or implementing this, PM me.

Allow variable page zoom

Chrome tries its best to determine the correct level of page zoom and generally gets it right, but on more than one occasion, a page that renders correctly on desktop will be too large or too small on the Chromecast's display.

Each channel should have a zoom control (that defaults to 100%) to allow for fine tweaking of this fit to display.

Have a configuration page at first launch and/or DB error

I apologize for adding to the stack of things that can be worked on but, In order to cleanly get issue #11 completed, I need to have the configuration and starting the service into the same command.

What I prefer to happen is to add a configuration page that pops up when you first access Multicast from a webpage. (Wordpress is an awesome example of this)

Also, have the page pop up again if multicast is having issues with the Database.

Apart from enabling the use of Docker, it's probably a more user-friendly option to have a webpage explaining what Multicast needs to know.

v1.1 Release Schedule - Details

This issue will serve as a hub for tracking/discussion relating to the 1.1 release milestone.

Due Date: December 10, 2017

The next minor release will clean up some iffy code and add in system-wide error handling for debugging through the GUI.

This should close the following issues:

  • toString error when assigning newly-created channels to a device (#26)
  • add error page when Chromecast fails to load hub app or loses connection (#19)
  • display error message when iframe cannot load due to X-Frame-Options header (#1)

Feature Request: Authentication

I've got this deployed at a high school showing on all the hallway televisions, which lends some fairly clear reasons to want some form of authentication.

If the solution to this is just to include documentation on how to set up a reverse proxy with Nginx/Apache combined with HTTP Basic Authentication then I can write that up pretty quickly.

That said, enabling LDAP authentication would be a nice thing to have, and express has some Middleware that can be used for that.

Opinions?

Only alerts

Hi,
I've used this project recently at home and it worked well enough. Now I'm trying to use it at work, and I only get alerts and a white screen. I'm not a JS/node guy and I'm not sure where to start. I have determined that no content is being sent, only JS/CSS and a mostly empty "toast" div. The "title" also comes through. I've used some very basic channels, such as google.com, static images, etc. The title changes, but the screen remains white. Alerts work great. I thought I was on to something in app/routes/devices.js, but it seems I'm not getting the setup page, rather I'm getting the right page with no content. :(
Can you give me a push in the right direction?
Thank you!

Feature Request: Slide Deck Template

I've got a functioning html page that does a really good job of rendering a powerpoint slide deck on the chrome casts. Using anything with any real motion or complicated transitions ends up rendering at 5 or so frames per second, which is really not very impressive.

Since it's a modified fork of another project, I'm waiting to see if the original author is willing to apply an open license to the project (benc-uk/simple-slides#1) so that we can legally distribute modified source code. Any ๐Ÿ‘'s to that issue would be appreciated. I'm not sure if he noticed the email notification when I opened the issue on his repository, so additional comments from others wouldn't hurt.

If/when he licenses the project, I'll start working to incorporate my solution directly into the project. If another week or two goes by without anything happening then I'll look for other options.

Here's an example of what it looks like: http://ultron.stengle.in/slides.html

The Real Question

I've been doing a fair bit of thinking about this and I suspect that an entirely separate application would be a better way of implementing this feature set. All it would need to do is provide channels links that can be used by multicast. An integration between the two could even be established.

Because this requires managing and uploading (possibly even generating from raw pptx files if a task runner can be set up on a Windows machine) PNG files, I suspect this would be a bit much to try and force into this application. That said, let me know what y'all think. I'm already planning on building something like this that'll have a much heavier feature set then will make sense to put into multicast, but if it would be helpful to have a simpler version that can happen.


All the simpler version would need for configuration is the url to the folder where the slides get put as well as a second field to set the delay between slide transitions. End users will need to figure out on their own how to setup a web server to serve the files. Adequate documentation will be necessary to explain how to use it.

If that sounds like something neat to have I'll start working on it in a few days.

Config Initialisation

Whenever I run node .config, it gets an unexpected token error. I've only changed the mongo user/pass and Chromecast app ID.

{
"appId": "XXXX1234",
"mongoUser": "fionn",
"mongoPass": "atestpassword",
"mongoAuthSource": "admin",
"mongoHost": "127.0.0.1",
"mongoPort": 27017
}

Here's the full stack trace:

C:\dev\repos\multicast.config:2
"appId": "XXXX1234",
^

SyntaxError: Unexpected token :
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:599:28)
at Object.Module._extensions..js (module.js:646:10)
at Module.load (module.js:554:32)
at tryModuleLoad (module.js:497:12)
at Function.Module._load (module.js:489:3)
at Function.Module.runMain (module.js:676:10)
at startup (bootstrap_node.js:187:16)
at bootstrap_node.js:608:3

Feature Request: Option to adjust alert font size

Alternatively the font size could just be increased. The TV's I'm deploying this to are mounted on the wall in hallways so the existing font size in the push notifications is pretty impossible to read from farther than a couple meters.

Feature Request: Error pages

I think it would be useful to know whether if something is broken or not. I can think of several ways of doing this.

Someone else can figure how this should work.

Periodic crash

Hi all,

On my two Ubuntu and Debian machines Multicast works great, although after about fifteen minutes of operation the process crashes with the below error:

/usr/lib/node_modules/multicast/node_modules/castv2/lib/client.js:128
  this.ps.send(buf);
          ^

TypeError: Cannot read property 'send' of null
    at Client.send (/usr/lib/node_modules/multicast/node_modules/castv2/lib/client.js:128:11)
    at Channel.send (/usr/lib/node_modules/multicast/node_modules/castv2/lib/channel.js:34:12)
    at Timeout.d.pulse.setInterval [as _onTimeout] (/usr/lib/node_modules/multicast/app/lib/connection.js:51:32)
    at ontimeout (timers.js:466:11)
    at tryOnTimeout (timers.js:304:5)
    at Timer.listOnTimeout (timers.js:264:5)

The Chromecasts continue to display the last dashboard loaded on them, and reconnect when Multicast is relaunched. I'm simply keeping the processes alive at the moment, but it would be great to fix this.

Way to sign in on restricted pages

So, I have a dilemma.

How the heck am I supposed to sign in to webpages such as this on the Chromecast?

screenshot from 2017-10-15 17-30-43

Do I need a proxy that will do the kerberos sign in for me? or can we have a step recorder on the preview page on the channel? or Do I make a custom template that posts the credentials then fetches the page? Tell me, I would like to know.

Side Note: this is what I am trying to get to display on a TV/monitor

screenshot from 2017-10-15 17-53-32

Error: getaddrinfo -3008

After patching the resolver_sequence_tasks.js issue highlighted on the main page I now get the following error:

MultiCast is live!
listening at port 3944...
events.js:182
      throw er; // Unhandled 'error' event
      ^

Error: getaddrinfo -3008
    at errnoException (/root/.nvm/versions/node/v8.7.0/lib/node_modules/multicast/node_modules/mdns/lib/resolver_sequence_tasks.js:199:11)
    at getaddrinfo_complete (/root/.nvm/versions/node/v8.7.0/lib/node_modules/multicast/node_modules/mdns/lib/resolver_sequence_tasks.js:112:10)
    at GetAddrInfoReqWrap.oncomplete (/root/.nvm/versions/node/v8.7.0/lib/node_modules/multicast/node_modules/mdns/lib/resolver_sequence_tasks.js:120:9)

Any insights to this would be welcomed as I am new to using node and I am quite excited about this project, thanks.

Error thrown in Devices Page: TypeError: Cannot read property 'emit' of undefined

First, awesome project!

I'm running this on a headless Ubuntu system, and am having some difficulty actually getting the channels to push out to the devices.

Node Version: v6.11.4

Under the Devices page, when I try to click any of the buttons after registering a new Chromecast, I get the following error printed to the terminal, and nothing happens.

ocelotsloth@alpine:~/multicast$ node .
*** WARNING *** The program 'node' uses the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see <http://0pointer.de/avahi-compat?s=libdns_sd&e=node>
*** WARNING *** The program 'node' called 'DNSServiceRegister()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see <http://0pointer.de/avahi-compat?s=libdns_sd&e=node&f=DNSServiceRegister>
MultiCast is live!
listening at port 3944...
LAUNCH_ERROR
LAUNCH_ERROR
TypeError: Cannot read property 'emit' of undefined
    at app.get (/home/ocelotsloth/multicast/app/main.js:271:70)
    at Layer.handle [as handle_request] (/home/ocelotsloth/multicast/node_modules/express/lib/router/layer.js:95:5)
    at next (/home/ocelotsloth/multicast/node_modules/express/lib/router/route.js:137:13)
    at Route.dispatch (/home/ocelotsloth/multicast/node_modules/express/lib/router/route.js:112:3)
    at Layer.handle [as handle_request] (/home/ocelotsloth/multicast/node_modules/express/lib/router/layer.js:95:5)
    at /home/ocelotsloth/multicast/node_modules/express/lib/router/index.js:281:22
    at param (/home/ocelotsloth/multicast/node_modules/express/lib/router/index.js:354:14)
    at param (/home/ocelotsloth/multicast/node_modules/express/lib/router/index.js:365:14)
    at Function.process_params (/home/ocelotsloth/multicast/node_modules/express/lib/router/index.js:410:3)
    at next (/home/ocelotsloth/multicast/node_modules/express/lib/router/index.js:275:10)
    at urlencodedParser (/home/ocelotsloth/multicast/node_modules/body-parser/lib/types/urlencoded.js:91:7)
    at Layer.handle [as handle_request] (/home/ocelotsloth/multicast/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/home/ocelotsloth/multicast/node_modules/express/lib/router/index.js:317:13)
    at /home/ocelotsloth/multicast/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/home/ocelotsloth/multicast/node_modules/express/lib/router/index.js:335:12)
    at next (/home/ocelotsloth/multicast/node_modules/express/lib/router/index.js:275:10)

I'm going to be investigating this a bit on my own to try and better define the problem and try and work towards a solution, but I wanted to post the issue also for anyone else experiencing it.

how to edit app/lib/connections.js

Hi
think this is a great project and testing for my work.
but I have the CORS issue, because my webpage uses <script>

I want to make this change to avoid the visual error:

# app/lib/connection.js
addError: (device, message) => {
+  return
  // you can pass a tag directly instead of a device

but where can I find this (ubuntu server)
normally it would be in the var/web but cant find the file anywere.

Is it all stored in the mongodb? and then how do I edit the connection.js file?

Is there another way to avoid
"Error! Frame loading blocked due to cross-origin prevention"

when using <script>?

Im not getting content from other urls.

Multiple URL support

Is there a plan to support GreenScreen like multiple URL and duration setting in channel?

Thank you

Feature Request: Make project a global NPM package with cli

There are several advantages of this:

  1. Configuration - set the App ID, mongo DB credentials and host (and verify these are valid)
  2. Start detached or daemonize it
  3. Unified cli command: 'multicast ...'
  4. 'npm install -g multicast' boom done

Point being, This is where I think multicast should go. I can probably get started on a thing this weekend to merge in. No guarantees though.

Feature Request: Dockerfile

I'm going to be writing this anyway so I'll make a pull request in the next day or so if there's interest for it. Combined with a docker-compose file to pull in mongo, it'll make deployment a breeze.

How can I actually cast my web page?

Hello,
so I registered my TV Cheromecvast and added local webpage as a chanell. How can I cast it to my TV? When I click preview in Devices or Channels, I can only see my wewbpage in the browser only.

Thank you.

Feature Request: Local DNS Resolution for Channels

I could be wrong, but from my testing it looks like the Chromecasts are't using the DNS settings offered by DHCP (I'm guessing they use 8.8.8.8), which means that the only way to show channels deployed internally is to hardcode the IP address. I'll be pushing a PR next week updating the documentation to explicitly mention that you cannot use internal dns names when setting the launch URL in the Chromecast SDK. If anyone else got that working I'd love to know how, but as far as I can tell they just aren't pulling local DNS for anything.

I'd like to be able to set the internal DNS name for the web server in case it ever changes in the future.

I think that a possible way to do this is to use along with some Javascript to do the following:

  • Before the Iframe loads, check if the given DNS name resolves to anything.
    • If it does, load the iFrame as is and move on.
    • If it does not:
      • Use https://github.com/aaron-em/dns.js or similar to try and resolve the DNS name using a preconfigured DNS server (ie. the onsite dns), and replace the iFrame URL with the local IP address. Then try to load the iFrame again. If it still doesn't load, change it to show an error screen saying the the given URL is invalid for insert reason here. Right now it just shows a fairly unhelpful white screen.

Feature Request: Add support for HTTPS

Good idea to add support and configuration for HTTPS?

I can think of a couple things:

  • publishing an app for redistribution and hosting (Digital signage to Chromecasts as a service, something my work may be very happy to do)
  • Security and placing it in front of the web for whatever reason. (Also addressed in issue )

Here's how I think we can do it:
Add filepath options to the keys and certs, if not specified then just do regular http. Or we can add a page to configure all of this like WordPress.

v2.0 Release Schedule - Details

This issue will serve as a hub for tracking/discussion relating to the 2.0 release milestone.

Tentative Due Date: December 14, 2017

The next major release will add channel rotation (in every sense of the word) - showing multiple URLs on a schedule, and displaying channels at 90/180/270 degrees of rotation.

This should close the following issues:

  • screen rotation (#8)

This will permanently merge the rotation branch with master.

  • merge rotation with master

RPi version

Hello

how could i install on raspberry pi B 3 ?

Usage question on OSX

Sorry, Im not sure what Im missing to get this setup.
I have the node module installed and configured. I can check in mongo that the chromecast and channels are setup. However, on my TV the URLs configured on the channel are not showing up.

If I cast my Tab directly then I can see whats on the screen (which is what it should do), but Im not sure what I need to do to get the URLs to appear when the channel is configured.

OSX probably has mDNSResponder built in , so I had no issues installing node_mdns also.

Steps:

  1. Installed multicast and ran configure. Started multicast
  2. Registered the application using the local url and set it to http://ip:3944/landing
  3. Visited the page on browser at http://ip:3944
  4. Setup a channel to display the Nyan
  5. Since the chromecast was in the same network, it automatically appeared on my "devices" link. I edited to add the channel that was setup above.

Im assuming at this point, the chromecast should switch to show the URL, but its not. There is no firewall setup on my machine either.

I will try with Linux tomorrow, but just wanted to see if Im missing something basic.

Thanks
raja

Fails to assign channel to new Chromecast Device

It's not actually throwing an error when I add the device, but it looks like when I try to add a new device, it doesn't actually assign the channel. It looks something like this:

screen shot 2017-10-11 at 7 12 44 am

I've registered the "IT Office" Chromecast, but it does not say the name of the channel nor "no channel."


This causes an additional problem when you attempt to view the device page, as the Pug rendering expects there to be a value in the Channel position:

TypeError: /home/ocelotsloth/multicast/app/views/device.pug:35
    33|         option(selected, disabled, value='') Choose a Channel...
    34|         each c in channels
  > 35|           if device && device.channel && (c._id.toString() == device.channel._id.toString())
    36|             option(value=c._id, selected)= c.name
    37|           else
    38|             option(value=c._id)= c.name

Cannot read property 'toString' of undefined
    at eval (eval at wrap (/home/ocelotsloth/multicast/node_modules/pug-runtime/wrap.js:6:10), <anonymous>:381:72)
    at eval (eval at wrap (/home/ocelotsloth/multicast/node_modules/pug-runtime/wrap.js:6:10), <anonymous>:414:4)
    at template (eval at wrap (/home/ocelotsloth/multicast/node_modules/pug-runtime/wrap.js:6:10), <anonymous>:924:72)
    at Object.exports.renderFile (/home/ocelotsloth/multicast/node_modules/pug/lib/index.js:428:38)
    at Object.exports.renderFile (/home/ocelotsloth/multicast/node_modules/pug/lib/index.js:418:21)
    at View.exports.__express [as engine] (/home/ocelotsloth/multicast/node_modules/pug/lib/index.js:465:11)
    at View.render (/home/ocelotsloth/multicast/node_modules/express/lib/view.js:135:8)
    at tryRender (/home/ocelotsloth/multicast/node_modules/express/lib/application.js:640:10)
    at EventEmitter.render (/home/ocelotsloth/multicast/node_modules/express/lib/application.js:592:3)
    at ServerResponse.render (/home/ocelotsloth/multicast/node_modules/express/lib/response.js:1008:7)
    at Channel.find.sort.exec (/home/ocelotsloth/multicast/app/main.js:314:13)
    at /home/ocelotsloth/multicast/node_modules/mongoose/lib/query.js:3017:18
    at tryCatcher (/home/ocelotsloth/multicast/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/home/ocelotsloth/multicast/node_modules/bluebird/js/release/promise.js:512:31)
    at Promise._settlePromise (/home/ocelotsloth/multicast/node_modules/bluebird/js/release/promise.js:569:18)
    at Promise._settlePromise0 (/home/ocelotsloth/multicast/node_modules/bluebird/js/release/promise.js:614:10)

Once in this state I have to drop the database and restart the app in order to do anything with that device.

Move CORS warning logic server-side to prevent false positives

Currently the CORS warning shows up on nearly every page, which is obviously not intended. The current logic is hacky at best, so I plan to remove it and instead have the server send out an OPTIONS request any time a channel is added or updated and check for CORS headers then.

Specific Chromes on the Network are not connecting

Hi,

I have been going through trying to understand why two devices are not working. I have checked, and there are established network sessions to port 8009 to all chromecast IP's, yet they are not actually displaying anything and multicast doesn't display a connection message in the log. I have added a line for additional logging, and this is a sample of what I received:

Jan 23 15:57:59 multicast multicast[3488]: 1548259079057 'RECEIVER_STATUS' { requestId: 0,
Jan 23 15:57:59 multicast multicast[3488]:   status:
Jan 23 15:57:59 multicast multicast[3488]:    { applications: [ [Object] ],
Jan 23 15:57:59 multicast multicast[3488]:      userEq: {},
Jan 23 15:57:59 multicast multicast[3488]:      volume:
Jan 23 15:57:59 multicast multicast[3488]:       { controlType: 'attenuation',
Jan 23 15:57:59 multicast multicast[3488]:         level: 1,
Jan 23 15:57:59 multicast multicast[3488]:         muted: false,
Jan 23 15:57:59 multicast multicast[3488]:         stepInterval: 0.05000000074505806 } },
Jan 23 15:57:59 multicast multicast[3488]:   type: 'RECEIVER_STATUS' }
Jan 23 15:58:00 multicast multicast[3488]: 1548259080435 'RECEIVER_STATUS' { requestId: 1,
Jan 23 15:58:00 multicast multicast[3488]:   status:
Jan 23 15:58:00 multicast multicast[3488]:    { applications: [ [Object] ],
Jan 23 15:58:00 multicast multicast[3488]:      userEq: {},
Jan 23 15:58:00 multicast multicast[3488]:      volume:
Jan 23 15:58:00 multicast multicast[3488]:       { controlType: 'attenuation',
Jan 23 15:58:00 multicast multicast[3488]:         level: 1,
Jan 23 15:58:00 multicast multicast[3488]:         muted: false,
Jan 23 15:58:00 multicast multicast[3488]:         stepInterval: 0.05000000074505806 } },

Do you have any ideas what might be causing this at all? All ports are open and devices are registered, so I am not sure what might be causing this.

---EDIT---
I was a muppet, entered the S/Ns wrong into the SDK -_-

Thanks

Another error that causes multicast to crash often

Recently I've begun getting this error after starting Multicast. The whole service halts. The Chromecasts continue to show the last content sent to them but I can't alter the content as I can't interact with the web environment.

`events.js:112
throw er; // Unhandled 'error' event
^

Error: dns service error: unknown
at MDNSService.on_resolver_done (/usr/lib/node_modules/multicast/node_modules/mdns/lib/resolver_sequence_tasks.js:19:30)
at SocketWatcher.MDNSService.self.watcher.callback (/usr/lib/node_modules/multicast/node_modules/mdns/lib/mdns_service.js:18:40)`

Any way I can just get multicast to ignore the error (whatever it is) and continue without halting?

Channel Preview Issue

screen shot 2017-10-06 at 3 49 21 pm

I'm running the app locally and trying to use the "Preview" feature on the Channels page. It pulls up the preview page, but an error from the cast_receiver.js Google lib is hosing the page. It's trying to connect to a WebSocket port on 8008, but I'm not sure where that's supposed to be coming from?

It's worth noting there are not any Chromecasts on the network currently, but I assumed I could preview a channel regardless.

Have you seen this issue before?

Chromecasts started showing 'Brain Freeze' when trying to run Multicast

Just recently after some WiFi issues in the office all our Chromecast connections started showing 'Brain freeze' when trying to run Multicast.

It is running off a Raspberry Pi, and no matter what variation of running Multicast I use (global npm, or direct) the problem is still present. If anyone else has had this issue, or has any thoughts that would be a great help.

Multicast version: 2.0.2
All Chromecasts updated to latest firmware
WiFi/network not running IPv6 as far as I know
No errors shown in console

Any more information that may help please let me know.

Channel URL dissapears

I'm having issues with the Channel URLs. If the app has been running for a little while (say a couple of hours) and I head over to the Channel the URL textbox will not appear. Refreshing the page does nothing.

If I save the Channel the URL will be overriden with a blank and the Chromecasts will lose the connection.

The only resolution to this is to restart MultiCast.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.