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

Camera view is not showing on android #27

Open
makinox opened this issue Jun 8, 2020 · 7 comments · May be fixed by #30
Open

Camera view is not showing on android #27

makinox opened this issue Jun 8, 2020 · 7 comments · May be fixed by #30

Comments

@makinox
Copy link

makinox commented Jun 8, 2020

I followed all the steps, and the video view or controlers are not showing, only can see the audio log captured with 'onVolumeInput' event listener

    const config: VideoRecorderPreviewFrame = {
      id: 'video-record',
      stackPosition: 'front',
      width: 'fill',
      height: 'fill',
      x: 0,
      y: 0,
      borderRadius: 0,
    };
    Plugins.VideoRecorder.initialize({
      camera: VideoRecorderCamera.FRONT,
      previewFrames: [config],
    }).then(() => {
      // Plugins.VideoRecorder.switchToPreviewFrame({ id: 'video-record' });
      Plugins.VideoRecorder.startRecording()
    });

This is the code i'm using, any help?

@makinox makinox changed the title Camera view is no showing on android Camera view is not showing on android Jun 10, 2020
@rbenzing
Copy link

I use "back" stackPosition and overlay my elements on top of the recorder view:
image

I also run it through the Plugins importing it like this:
import { VideoRecorderCamera, VideoRecorderPreviewFrame } from '@teamhive/capacitor-video-recorder'; import { Plugins, Capacitor } from '@capacitor/core'; const { VideoRecorder } = Plugins;

Then I run this in my construct:
VideoRecorder.initialize({ camera: VideoRecorderCamera.FRONT, previewFrames: [this.config] });

Then i have a overlay button on my recorder view that runs:
VideoRecorder.startRecording()

@AdaLollA
Copy link

Having the exact same issue here. What i found out is that the stackPosition attribute doesn't work on android - here it will always place the camera view at the very back. Anybody have any input on whether that is intentional behaviour and how to work around that?

It does work on iOS without problems.

@AdaLollA
Copy link

Has anybody gotten stackPosition: 'front' to work on android yet? Or is this not intended to be supported?

@mueslirieger
Copy link

Any news here? I'm having the exact same issues as @AdaLollA. Somehow the view of the camera gets placed behind ion-content even though I'm using stackPosition: 'front.

AdaLollA pushed a commit to AdaLollA/TeamHive-capacitor-video-recorder that referenced this issue Sep 9, 2020
@AdaLollA
Copy link

AdaLollA commented Sep 9, 2020

Here is arepository that showcases the issue on the most minimal implementation possible. If you clone it and change between native- and web-implementation (its just one line in the MainActivity and described in detail in the README of the repo) you will see the discrepancies between them (preview does not work on native).

AdaLollA pushed a commit to AdaLollA/capacitor-video-recorder that referenced this issue Sep 14, 2020
@AdaLollA AdaLollA linked a pull request Sep 14, 2020 that will close this issue
@AdaLollA
Copy link

@rbenzing and @makinox if you still need to use the stackPosition front property: I just created a pull request to this repository. If they don't respond (like they did for a month now) you can just copy the MainActivity from my repository over the current faulty MainActivity.

If you have trouble getting this to work feel free to ask.

@ilbertt
Copy link

ilbertt commented Feb 11, 2021

I use "back" stackPosition and overlay my elements on top of the recorder view:
image

I also run it through the Plugins importing it like this:
import { VideoRecorderCamera, VideoRecorderPreviewFrame } from '@teamhive/capacitor-video-recorder'; import { Plugins, Capacitor } from '@capacitor/core'; const { VideoRecorder } = Plugins;

Then I run this in my construct:
VideoRecorder.initialize({ camera: VideoRecorderCamera.FRONT, previewFrames: [this.config] });

Then i have a overlay button on my recorder view that runs:
VideoRecorder.startRecording()

@rbenzing I don't think this could be a good solution, as the UX may be affected. I think @AdaLollA reached a better one in #30. I'd advise to take it into account

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 a pull request may close this issue.

5 participants