Skip to content
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

Chromecast support #262

Open
MichaelAronsen opened this issue May 26, 2016 · 20 comments
Open

Chromecast support #262

MichaelAronsen opened this issue May 26, 2016 · 20 comments

Comments

@MichaelAronsen
Copy link

Platform & OS Version
Android

What is the nature of your issue
Enhancement

Details
What are the chances of zmNinja growing chromecast support for montage and single camera views?

I'm loving the app already, but being able to cast my baby cam to a tv would make it even better.

Thanks!

@pliablepixels
Copy link
Member

Hmm, I'd love to do that too - I'll look and see - last I checked chrome cast plugins were spotty in cordova but I'll check again. Don't expect it anytime soon, but if I find an easy way, it might land up soon :)

@pliablepixels
Copy link
Member

Hmm https://github.com/ConnectSDK/Connect-SDK-Cordova-Plugin -- I'll check how that works, after I return from my brief vacation next week

@jbraun27
Copy link

@pliablepixels do you use Videogular as the video player? I thought I read that in an FAQ. If so, they have a 3rd party plugin for Chromecast: https://github.com/benjipott/videogular-chromecast

@pliablepixels
Copy link
Member

pliablepixels commented May 31, 2016

@jbraun27 - that's cool - I did some basic integration with https://github.com/ConnectSDK/Connect-SDK-Cordova-Plugin -- it seems easy to send a video or media file, but I can't quite see any APIs to export a screen - I guess I'll need to export screens for montage view (many pictures). Also live view involved refreshing the auth key every 5-6 mins. As of today, most of ZM is non video - only the experimental branch has video

@MichaelAronsen
Copy link
Author

@pliablepixels for me at least, being able to cast a single live view monitor would cover ~90% of my use.

@pliablepixels
Copy link
Member

@MichaelAronsen - I'll need a bit of education here. Hope you can help:
a) Are you on Android? If so, does Android automatically provide chrome cast options in any system menu for all apps?
b) Do you expect the feed to continue displaying on the TV even after you exit the app ?

@MichaelAronsen
Copy link
Author

@pliablepixels I am on Android, yes

re A)
There is the option to cast the whole screen and all audio from the phone, but this means that if the screen is turned off, the tv goes black - also changing apps or receiving calls disrupts the feed.

re B)
Yes, the feed should continue, this is usually how chromecast works - it does not receive from the phone, but would rather receive the video/mjpeg stream directly from the zoneminder server, leaving the phone free to do other things. It may require some server side support though - I would be happy to try to help here if need be.

@pliablepixels
Copy link
Member

Hmm thanks. Some researching is in order here. Here are the various ways ZM streams footage:

a) As of today and in the near future, even when h264 video branch is merged, live view is always streamed as a series of JPEG images over a TCP connection -- you display it via a usual <img src=""> tag and the image keeps changing (html's img tag takes care of that)

b) When it comes to montage live view, its multiple <img src> tags on one page, arranged

c) When it comes to event playback, it also uses the same logic as a)
c.1) with the exception of h264-videobranch where it uses an mp4 file

c.1) is very easy to do, even if the app is not alive - just point it to the mp4 file and it will stream directly from the server.

a), b) and c) are more tricky - while its easy to send it the URL of the image, there is an auth key that is passed - something like img src="myzm/zm/cgi-bin/nph-zms?auth=xxxxxxxx". This xxxxx needs to be computed at the start of the stream and re-computed every few minutes (depending on PHP timeout) so the stream continues. So if the app exits, its possible the stream freezes after a while unless we have a means to re-compute the auth key. As of today, zmNinja runs a timer that recomputes every 5 minutes just to keep things simple.

@MichaelAronsen
Copy link
Author

Ok, so for the auth key, there might need to be an option to create static keys or keys that live as long as the client keeps the connection open.

For viewing montage, the dashkiosk project might be interesting to look at, at least for inspiration:
https://github.com/vincentbernat/dashkiosk

To use chromecast devices, you need to register a web app with google that the chromecast can connect to, I believe sending the is very simple using that.

@MichaelAronsen
Copy link
Author

I'm going to set up dashkiosk, disable zoneminder auth and use basic auth via webserver.

I'm hoping this will allow me to create dashboards using zoneminder feeds, which require username and password, but does not time out.

This is just to test things out, for my girlfriend to use this feature, it would be much nicer to have it in ZMNinja rather than some NodeJS app :)

@pliablepixels
Copy link
Member

Got the very basics working - live stream from one monitor from zmNinja (I'm on iOS)
img_3164

@MichaelAronsen
Copy link
Author

That's awesome, much work to port that to android?

@pliablepixels
Copy link
Member

theoretically, it should work, but practically, it seems to be crashing on Android. I've added a note to an existing issue here ConnectSDK/Connect-SDK-Cordova-Plugin#43 . I guess if it doesn't work, I'm going to have to park this for now

@stale
Copy link

stale bot commented Mar 8, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale
Copy link

stale bot commented May 18, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label May 18, 2018
@bradc87
Copy link

bradc87 commented May 24, 2018

This would be amazing functionality, in combination with a few other supporting services like node red, you could have someones bedroom tv actually come on automatically if there was motion noticed outside at night

@stale
Copy link

stale bot commented Oct 19, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@andye2801
Copy link

I appreciate this is a really old thread but what about https://github.com/jellyfin/cordova-plugin-chromecast? I would love to be able to cast a camera feed to my Google Nest Hub

@ghost
Copy link

ghost commented Jun 18, 2021

Bump

@PrplHaz4
Copy link

was also going to recommend the jellyfin chromecast cordova plugin - it is actively used and maintained

if you're using jellyfin you can add rtsp sources to live tv (in an .m3u) and i think cast that way, but it is definitely a bit more clunky

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants