
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
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)
The npm package react-redux-chromecast-sender receives a total of 0 weekly downloads. As such, react-redux-chromecast-sender popularity was classified as not popular.
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.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.