Connecting multiple laptops using chrome to chromecast - google-cast

I have set up the project much like the tictactoe sample game. However, when using the chrome sender, I can only connect one at a time. If I connect the second laptop using the chrome sender, then it kills the first session and restarts a session.
Is it possible to connect multiple chrome tabs/browsers to the same chromecast?

Does TicTacToe work for you? If it does, you need to follow the same pattern for handling incoming senders. If it doesn't, file a bug with that project on our GitHub repo with the details.

Related

Maintaining a persitant connection in a MV3 Chrome Extension

I'm trying to build a chrome extension that updates its badge every time some event happens on my server- in this case, my server is receiving a webhook from Zoom and then informing my chrome extension that the event occurred. From there my chrome extension will update a counter on its' badge, to show that the event occured. I'm trying to build it according to the chrome extension Manifest V3 but I can't find any info on how to do this correctly.
To my understanding, in Manifest V3 all client-side scripts must run in a service worker. That service worker starts up, runs some code, and then shuts down again. I was planning to open a websocket in my background script, which would have been fine under manifest v2, but I don't think you can do that any more.
My question is: How do I maintain a connection to receive data in my chrome extension? When I say data in this case I really just mean an event informing my chrome extension to update the counter on its badge.
Are there other routes besides keeping a websocket open in the background? I've looked around at things like Google Cloud Messaging but I don't think that was intended for what I would like to use it for.
Try to use an offscreen API, it was introduced some time ago by Google. You just need to check in which browser version this API is available.
This would give you an opportunity on having long living WS connection and communicate with service worker e.g. by runtime API.
EDIT:
offscreen API is available since Chrome 109

Chrome Extension Native Messaging with same extension installed across multiple chrome profiles

This feels like a shot in the dark but...
Should a single Native Messaging host be able to communicate with the same extension installed on multiple chrome profiles?
I'm working on an extension which is installed to both my personal and work profiles. But it seems that the Native Messaging host only sends messages to the most recently connected instance of the extension.
I don't believe this is addressed in the Native Messaging documentation and I've run out of search ideas, thanks in advance for any help!
When nativeMessaging API is used it starts an instance of native app each time a connection is created by the extension so such an instance can communicate with its "parent" extension only. Consequently, there should be no problem.
In case you want to use chrome.runtime.onConnectNative to do the reverse (to connect from a native app to an extension which will work even when Chrome is closed) see crbug.com/967262 for more info or create a new issue there asking for details. Judging by the bits I see this feature is available only on ChromeOS and it's even disabled by default.

Can i use Chromecast as a server?

Studying the possibility to achieve the following:
We have a CMS that from time to time posts to a web hook a media URL (video) (public internet hosted)
This web hook post we would like to post directly to a ChromeCast which is plugged in to a TV
Questions:
1. Can a web server like nodeJS be installed on a chrome cast?
2. Is it possible to use for example DynamicDNS to link the Chromecast to a domain name so the post from the web hook can be made?
ChromeCast has a sender API which allows you to "send" content to a specific Chromecast. Right now, the sender API works on Android, IOS and Chrome OS. You can read more about it here: https://developers.google.com/cast/docs/sender_apps.
And, here's how a receiver application that would receive your content on the ChromeCast would work: https://developers.google.com/cast/docs/receiver_apps or if you're content is a standard type, then you can use a prebuilt receiver application without building your own.
To answer your specific questions:
Can a web server like nodeJS be installed on a chrome cast?
No, not without enormous hacking and development yourself to basically take over the hardware somehow and get your own stuff to run on it.
Is it possible to use for example DynamicDNS to link the Chromecast to
a domain name so the post from the web hook can be made?
Not that I know of.
The chromecast has an android like google chrome operating system. It is possible to root it, but you will not be able to (to my knowledge) get a server on it. I would suggest taking a look at the Raspberry Pi. You should be able to run a slim server on it. After you get that set up it might be feasible to pass command line commands to chrome or another web browser to display the data you like. A browser is not necessary, but I'm not sure if you know of any other way to display the media.
A different approach would be to have a server anywhere (could be in your home) and have something like the raspberry pi (any computer for displaying the content) connect to a webpage hosted with that server. Using websockets something like socket.io, you could set it up so that the server could send messages (url of video) to the browser session you have open. The javascript of your webpage would then use that message to open that url.

Remote control a Chrome Extension

I've written a non-published (personal) Chrome extension that performs page checking and then performs actions such as opening new tabs if certain conditions are met. I would like to be able to "remote control" it from my phone though, e.g. turn on or off or adjust settings when I'm away from my desk.
I considered if the extension can read/write to a file in Dropbox, which I could then edit from my phone too, or any other device. But I'm not sure if extensions are allowed to arbitrarily read/write in the filesystem, or only "apps". Any other suggestions?
Assuming you can't directly connect to your computer (otherwise wOxxOm's answer is valid)..
You could make a companion phone app and use GCM push messages; your phone would message your server via it (which can be hosted on a free App Engine tier easily if it's just for your private use) and the server will push out the message.
Though it'll probably be much easier to just have said App Engine server up and providing a WebSocket endpoint that your extension can connect to to receive commands in real-time, and some sort of API / control panel on the web (authenticated, of course).
Any free webserver-based solution would lag, as bad as 500ms, I think.
Try making a complementary native PC program: mobile apps for remote control usually have their PC part running as a background service or an application with just a shelltray icon. Such program opens a TCP/UDP port on PC and listens for commands from the mobile app, and can communicate with your extension via Chrome's native messaging API.

(webrtc) chrome with mozilla not connecting please any idea how to do it

I use (https://github.com/webRTC/webrtc.io-demo) and can't connect different browsers mozilla with mozilla working good, chrome with chrome working good, but chrome with mozilla not connecting please any idea how to do it
The project on GitHub does not look very active (the latest commits are about one year old).
Considering that webRTC is still developing, it would be surprising if there were not issues at all.
I'd recommend you to use another (more recent) webRTC demo, for example one of the demos provided by easyRTC: https://github.com/priologic/easyrtc
Furthermore, it is typically not possible to access the web cam with two browsers in parallel (just in case you are testing only using one machine).

Resources