-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enable communication with reciever #2
base: master
Are you sure you want to change the base?
Conversation
This will enable a custom sender using this app ID to communicate with the website if this website supports it. https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage I might write a way for the receiver website to communicate with the sender too.
What's your use case for this? Do you have an example of a website that allows messages from any origin? |
I'm pretty sure I was trying to make a sort of remote desktop application for Chromecast so I could browse to web videos I couldn't get a direct link to. I was extremely dissatisfied with casting a chrome tab clearly. The origin wildcard is probably me who didn't really understand what I was doing |
heh. I was thinking that once you've added support for postMessage and/or the message event handler that it might just be simpler to get a dedicated appId and use the cast API instead. I think it's easier to cast videos these days (many inline players have cast support), but yes I agree: those without are annoying. Unfortunately due to cross-origin safety it's not possible to remote control a page once it's loaded, which is often required to start the video |
I was also very much against paying for an appid for some reason. Dunno, it was 3 years ago. But I was pretty much only doing this to use KissAnime and I have better ways to watch anime now. Strange how inspiration works. Too bad with the origins thing though, my idea of remote browser could actually have been quite interesting |
btw, this should be possible to do without using the Chromecast specific API today with the Presentation API instead. Demos: |
You would think so, but the Presentation API, as implemented in Chrome, creates a hidden tab and the streams a video capture of that tab to the Chromecast. It doesn't actually load the page on the Chromecast itself. That's fine if all you want to do is show something on the screen, but if you need to, for example, test JavaScript or HTML or CSS on the actual Chromecast device before shipping a product, the Presentation API isn't that. |
This will enable a custom sender using this app ID to communicate with the website if this website supports it.
https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage
I might write a way for the receiver website to communicate with the sender too.