-
Notifications
You must be signed in to change notification settings - Fork 187
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
Add Digital PTZ via mouse and touch #491
Add Digital PTZ via mouse and touch #491
Conversation
Some combinations of options behave unexpectedly. I'll make a second pass tonight. |
I've been testing it for a couple of days and have polished a couple of rough edges. |
I think I'm satisfied now. I made a (hopefully) last round of cleanup, simplifications and optimisations. |
Great work, 1.I've been testing this for a week and it works great on my phone and in regular preview on my computer. Unfortunately in full screen mode on PC it doesn't work for me. I tested on two computers, in chrome and opera. My settings:
|
Hey @zelo66,
ui: true
|
Hey @AlexxIT I assume you just haven't had time yet, but let me know if there is something about the code you'd like to be implemented differently (e.g changing defaults, explaining something with comments, ...) I understand that it is not a very small PR, I just can't find a way to make this more compact without compromising readability or corner cases (like handling full screen video). |
Of course, I have set By it not working I meant that the image zooms in just a little. I have recorded a gif. On my main camera the image zooms in even less (there is a zoom effect which disappears after about 0.5 seconds. I checked chrome, opera and firefox. In Chrome and Opera zooming in full screen has the effect as in the gif. In Firefox the zoom works very well, but the |
Do you have any custom styles by any chance? |
No, everything is in the default settings. I have now checked in one more instance of HA, plus on another computer. Same effect. It zooms in a bit, looks like the aspect ratio changes and blocks further zooming. |
I can't reproduce this so I am not sure what could be happening. Please share the yaml of the card and go2rtc stream you are using for the example. Also version of HA and OS of the pc you recorded the gif with. |
It's probably windows related. I don't have a windows machine to debug it. Do you think it is a blocker for merging? |
Hi @dbuezas. Just had time to look at your work. Two things bother me:
|
Hi @AlexxIT, 1. Multiple filesI think the browser will reuse the same http connection to grab all files efficiently. I read it is only discouraged if the dependency tree is very deep, and I am afraid my code will make the webrtc-camera.js too big to work comfortably with. But anyway, your repo your rules :) What do you prefer?
2. Modern javascript syntaxI checked the browser versions required for each modern operator:
So it looks like we are safe. Again, your repo, so if you just don't like a particular operator I can remove it. Let me know and I'll apply your request on the weekend. |
|
…ions, made touch_drag_pan default to false
…e aspect ratio of the video is important
49cac43
to
d0829c0
Compare
Also, don't prevent scrolling on touch drag unless zoom scale != 1
d0829c0
to
1e15ec0
Compare
Hey @AlexxIT,
Let me know if you find something else you'd like to be done differently. I obviously like the feature so I enabled it by default, but you may prefer it to be disabled by default instead and require writing |
Hey Alex! |
No. I'm planning to include this in next release. Just needs some time. |
Just as I thought - the iOS12 test did not pass. I know it's a very old browser. But Hass somehow works in it. And WebRTC somehow works in it. And with these innovations, the whole WebRTC card is falling down :( PS. What you think about external "HACS Frontend plugin" for WebRTC card? Maybe it's possible to add plugins functionality to WebRTC card. |
Oh, no! |
I have left many comments to code |
I don't see them yet. Maybe is the review not marked as finished? |
Ok, it should work now. Sorry for that |
503641b
to
ed5450c
Compare
I applied all fixes and moved initialisation to its own member function so it is consistent with the rest of your code. |
Looks like all works fine now. But pinch action enables full screen on iPhone. But it is not your problem :) |
Thanks to you, I have researched ESLinter and will add it to the next release. It will help to avoid such compatibility problems. |
That's a very good idea! |
I don't want to implement any JS build stage to my projects yet. It will unnecessary increase complexity. PS. I'm using prettier from PyCharm. |
True, it does add a step. I mostly work with typescript so I'm very used to it. |
I didn't consider people using style transforms themselves. I'll try adding a wrapper element around the video and transform that one instead this way they should be able to coexist. |
They use it only for rotation and changing aspect ratio |
Adds configurable Digital (local, fake, css-based) zoom and panning via mouse and touch.
The viewport setup can be persisted so it survives page reloads, and seamlessly adapts between landscape, portrait and full screen modes.
The navigation gestures are the same as in google maps and can be disabled one by one.
For you to consider:
I enabled all gestures by default.This may make scrolling difficult for people that has multiple videos in the same panel.It may be more reasonable to enable only these by defaultI'm quite happy with how it feels and find it quite useful myself. I'm looking forward to your feedback :)