
Research
/Security News
npm Author Qix Compromised via Phishing Email in Major Supply Chain Attack
npm author Qix’s account was compromised, with malicious versions of popular packages like chalk-template, color-convert, and strip-ansi published.
react-redux-chromecast-sender
Advanced tools
React/Redux helpers for Chromecast communication (sender)
BETA: Do not use in production
Helper to communicate with the Google Chromecast, keeping current state in redux.
For more detailed instructions follow the guide in the Cast developer documentation.
Note: For universal applications only include the cast middleware on the client
After installing you probably want to create some middleware to translate the raw messages to whatever is applicable to your application.
import {createStore, applyMiddleware} from 'redux';
import {castSender} from 'react-redux-chromecast';
// sender
const middleware = [castSender(
'<app id>', // app id assigned by Google
'<namespace>' // namespace for communication (namespace must match on receiver)
)];
const store = applyMiddleware(...middleware)(createStore);
<script async src="//www.gstatic.com/cv/js/sender/v1/cast_sender.js" charset="utf-8"></script>
All events are fired as redux actions.
Constants:
import {
API_AVAILABLE,
RECEIVER_AVAILABLE,
...
} from 'react-redux-chromecast';
API_AVAILABLE
Chromecast API is available (will only work in Chrome with the Chromecast extension installed)
API_UNAVILABLE
Chromecast API not available (e.g., browser not supported)
RECEIVER_AVAILABLE
Chromecasts detected. Use this to show the chromecast button.
Note that this happens asynchronously and can occur later in the lifecycle of the app, for instance if the user changes wifi network to the same one as the Chromecast is on.
RECEIVER_UNAVAILABLE
No Chromecasts detected. Use this to hide the button.
Note that even if chromecasts were detected before they can disappear. This action fires if this happens.
SESSION_CONNECTING
Connecting to Chromecast. Show an animated chromecast icon.
SESSION_CONNECTED
Session established. Show the lit icon.
SESSION_DISCONNECTING
User has requested to disconnect the session.
SESSION_DISCONNECTED
Chromecast is not connected.
SESSION_CONNECT_ERROR
An error occurred while trying to connect.
SESSION_DISCONNECT_ERROR
An error occurred while trying to disconnect.
MESSAGE_SENDING
A message is being sent.
MESSAGE_SENT
A message was succesfully sent.
MESSAGE_ERROR
An error occurred while trying to send a message.
MSG_RECEIVED
A message was received.
Commands to Chromecast as triggered by firing redux actions.
Constants:
import {
SESSION_CONNECT,
SESSION_DISCONNECT,
...
} from 'react-redux-chromecast/commands';
SESSION_CONNECT
Try to establish a connection.
Fires actions asynchronously:
SESSION_CONNECT
|- Event: SESSION_CONNECTING
...
|- Success
| |- SESSION_CONNECTED
|- Failed
|- SESSION_CONNECT_ERROR
SESSION_DISCONNECT
Disconnect current session. Doesn't do anything if not connected.
Fires actions asynchronously:
SESSION_DISCONNECT
|- Event: SESSION_DISCONNECTING
...
|- Success
| |- SESSION_DISCONNECTED
|- Failed
|- SESSION_DISCONNECT_ERROR
FAQs
React/Redux helpers for Chromecast communication (sender)
We found that react-redux-chromecast-sender demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
npm author Qix’s account was compromised, with malicious versions of popular packages like chalk-template, color-convert, and strip-ansi published.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.