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

Question about contributing this feature? #41

Closed
ibz0q opened this issue Apr 21, 2024 · 7 comments
Closed

Question about contributing this feature? #41

ibz0q opened this issue Apr 21, 2024 · 7 comments

Comments

@ibz0q
Copy link

ibz0q commented Apr 21, 2024

Hi, I was looking for a something which uses browsers GamePad API to control PTZ cameras via Onvif PTZ.

The difficulty would be in transalating movements non linearly and only supporting main set of controllers (maybe just Xbox).

I may have some free time to work on this, as this plugin is a custom component, would you be open to the idea of me adding a lovelace js plugin and me submitting changes to custom component to act as a reverse proxy to any stored camera config.

@dbuezas
Copy link
Owner

dbuezas commented Apr 21, 2024

Sure, as long as it is optional and doesn't break webrtc card support.

Btw, wouldn't it be easier to add gamepad support to that frontend component instead? That's where I added some features to make better use of the APIi

@ibz0q
Copy link
Author

ibz0q commented Apr 21, 2024

I think adding it to frontend component would be better, fortunately from my tests Game API is widely supported.

As for custom component because of browser CORS, there would need to be a "proxy" to bypass this. I'd write a very basic http proxy that injects allow cross origin headers. The onvif API expects POST to ptz endpoints. This will be optional, webserver won't start unless specified. Will look at other security considerations (only allow reqs from Home Assistant etc)

Any suggestions where this could be best fit would be helpful.

@dbuezas
Copy link
Owner

dbuezas commented Apr 21, 2024

Uhm... I really think you'd be better off implementing it inside the webrtc card. You'll need no proxy, it would work with other cameras, go2rtc would provide standard support for all kinds of streams, etc.

I'd rather not add a proxy that opens a hole in home assistant to this component :/

But this is open source, so you can fork it! :)

@ibz0q
Copy link
Author

ibz0q commented Apr 21, 2024

That's a fair point. I think this is quite a niche feature and would risk bloating this component/plugin though it does share the same goals of ptz control.

I'll look at webrtc or could potentially consider a separate component. Thanks for for suggestions.

@ibz0q ibz0q closed this as completed Apr 21, 2024
@dbuezas
Copy link
Owner

dbuezas commented Apr 21, 2024

I think it will be a lot easier there too.
Maybe you can use this very related MR as a guide:
AlexxIT/WebRTC#520

If you plug the game API to the same callbacks you should be good to go.

Happy to help

@ibz0q
Copy link
Author

ibz0q commented Apr 24, 2024

thanks for the MR as guide it's really helpful.

PS i realised:

I think adding it to frontend component would be better, fortunately from my tests Game API is widely supported.

Sounded as if I wanted to add a frontend component to this repo, It should belong to the frontend repo as you suggested.

I will be working on this very soon in a seperate repo :) and will submit a PR with features to WebRTC at some stage.

@dbuezas
Copy link
Owner

dbuezas commented Apr 24, 2024

Oh I see!
Cool, feel free to write back if you get stuck

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

No branches or pull requests

2 participants