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

essential: Fixes Preview Frames on Android #30

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

AdaLollA
Copy link

closes #27 by dereferencing the stored preview frame configurations and actually applying them when necessary. Without this code there is no "stackPosition":"front" possible. Imo this is essential functionality.

Lorenz Graf added 2 commits September 14, 2020 11:44
width and height was already set as pixel values but for some reason x and y were ignored and therefore used as is.
@AdaLollA
Copy link
Author

Another weird bugfix: width and height was already set as pixel values but for some reason x and y were ignored and therefore used as is. 4c8fc9c fixes this x and y positioning bug for android.

@ilbertt
Copy link

ilbertt commented Feb 11, 2021

@AdaLollA your code works and makes the Camera view appearing over my app on Android, but it ignores the borderRadius property I set in the previewFrames options. It also stretches the video to stay inside the width and height I set, instead of cutting it off as it happens in the web implementation. Do you think it could be resolved?

@AdaLollA
Copy link
Author

@Luca8991 hey there, i might have to look into this, maybe it is a quickfix. To be honest tho we dropped this library / feature because the original authors were in no way responding to any of our pull requests and / or issues. you would definetly be better off looking for another package.

that being said i might still look into it to get the things you mention fixed. but don't get your hopes up too much - it has been some time...

@ilbertt
Copy link

ilbertt commented Feb 11, 2021

@AdaLollA I looked around for other packages but I didn't find anything that does the work (as simply as) this plugin does. Did you?
Anyway, it would be great if you could take a look at it!

P.S. Have you considered going on with the development on your fork? This plugin has a great potential also because of its simplicity of use, it would be a shame if it wasn't maintained anymore.

@AdaLollA
Copy link
Author

@Luca8991 Yeah we didn't find anything else that looked much promising either. It wasn't a necessity to begin with to be frank.

Since it has been like half a year since i last checked anything about the project i assumed that there was more progress on other forks out there already. If that isn't the case i might want to really look into getting this code going again.

On the other hand, if there is no need for development / progress on this package i would no longer develop it - i don't use it personally or commercially. So i don't have any horse in the race as far as this codebase goes.

@ilbertt
Copy link

ilbertt commented Feb 11, 2021

Only this fork seems to have had some relevant activity, but until June 2020, which is before your last activity...
I could also help you out somehow to keep the code going, if it is necessary, but I'm not so experienced in native plugins

@AdaLollA
Copy link
Author

@Luca8991 just checked about the borderRadius property and the camera distortion:

  • The borderRadius property is literally unused in the android implementation
  • The distortion that occurs in the preview can be worked around by using any 16:9 (or 4:3 ?) format. I know that can hardly be called a workaround - more of a compromise - but that is all i can help you with short term.

An example for a non-distorted preview frame:

  config: VideoRecorderPreviewFrame = {
    id: 'video-record',
    stackPosition: 'front',
    width: 225,  // 900 divided by 4
    height: 400, // 16000 divided by 4
    x: 100,
    y: 100,
    borderRadius: 10
  };

Furthermore: it seems that https://github.com/triniwiz/fancycamera is the code base behind the plugin. Here is again no notice of any border radius. This points to a lot of work if you want that feature to get implemented into this package. I also can not see any sort of fix for the distortion effect within that package. Didn't spend much time on it tho to be fair.

Hope that helps, if you have any more questions or other feature requests for this plugin let me know. If they are possible i might include them.

@ilbertt
Copy link

ilbertt commented Feb 12, 2021

Another problem I see is that, after initializing the VideoRecorder, this message:

I/Capacitor/Console: File: http://localhost:8100/tab2-tab2-module.js - Line 205 - Msg: onVolumeInput was fired [object Object]
V/Capacitor/VideoRecorder: Notifying listeners for event onVolumeInput

keeps logging at a very high rate, even after calling VideoRecorder.destroy(). It's annoying, because it makes the Android Studio log console unusable

@ilbertt
Copy link

ilbertt commented Feb 12, 2021

@Luca8991 just checked about the borderRadius property and the camera distortion:

  • The borderRadius property is literally unused in the android implementation
  • The distortion that occurs in the preview can be worked around by using any 16:9 (or 4:3 ?) format. I know that can hardly be called a workaround - more of a compromise - but that is all i can help you with short term.

An example for a non-distorted preview frame:

  config: VideoRecorderPreviewFrame = {
    id: 'video-record',
    stackPosition: 'front',
    width: 225,  // 900 divided by 4
    height: 400, // 16000 divided by 4
    x: 100,
    y: 100,
    borderRadius: 10
  };

Furthermore: it seems that https://github.com/triniwiz/fancycamera is the code base behind the plugin. Here is again no notice of any border radius. This points to a lot of work if you want that feature to get implemented into this package. I also can not see any sort of fix for the distortion effect within that package. Didn't spend much time on it tho to be fair.

Hope that helps, if you have any more questions or other feature requests for this plugin let me know. If they are possible i might include them.

@AdaLollA what I was aiming to recreate in my app is a feature similar to the Video messages of Telegram, especially the recording interface, but I think this could not be done with this plugin yet...

@AdaLollA
Copy link
Author

Another problem I see is that, after initializing the VideoRecorder, this message:

I/Capacitor/Console: File: http://localhost:8100/tab2-tab2-module.js - Line 205 - Msg: onVolumeInput was fired [object Object]
V/Capacitor/VideoRecorder: Notifying listeners for event onVolumeInput

keeps logging at a very high rate, even after calling VideoRecorder.destroy(). It's annoying, because it makes the Android Studio log console unusable

Just checked the code for this. This is something i might be able to fix. But as you said - the plugin has many other issues that would also have to be fixed to work for your specific stylized use case.

Base automatically changed from master to main March 9, 2021 15:56
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

Successfully merging this pull request may close these issues.

Camera view is not showing on android
2 participants