Camerakit-android: setCameraListener method was changed ?

Created on 21 Nov 2017  路  11Comments  路  Source: CameraKit/camerakit-android

Is this a bug report?

Maybe Yes it is

for 0.12 update, setCameraListener function is not there. android studio give an error, " resolved method" as it.

Most helpful comment

Hi!
Change setCameraListener to addCameraKitListener and implement new interface:

private CameraKitEventListener cameraListener = new CameraKitEventListener() {
        @Override
        public void onEvent(CameraKitEvent cameraKitEvent) {
            switch (cameraKitEvent.getType()) {
                case CameraKitEvent.TYPE_CAMERA_OPEN:
                    canTakePicture = true;
                    break;

                case CameraKitEvent.TYPE_CAMERA_CLOSE:
                    canTakePicture = false;
                    break;
            }
        }

        @Override
        public void onError(CameraKitError cameraKitError) {

        }

        @Override
        public void onImage(CameraKitImage cameraKitImage) {
            cameraKitImage.getJpeg(); // will return byte[]
        }

        @Override
        public void onVideo(CameraKitVideo cameraKitVideo) {

        }
    };

All 11 comments

Hi!
Change setCameraListener to addCameraKitListener and implement new interface:

private CameraKitEventListener cameraListener = new CameraKitEventListener() {
        @Override
        public void onEvent(CameraKitEvent cameraKitEvent) {
            switch (cameraKitEvent.getType()) {
                case CameraKitEvent.TYPE_CAMERA_OPEN:
                    canTakePicture = true;
                    break;

                case CameraKitEvent.TYPE_CAMERA_CLOSE:
                    canTakePicture = false;
                    break;
            }
        }

        @Override
        public void onError(CameraKitError cameraKitError) {

        }

        @Override
        public void onImage(CameraKitImage cameraKitImage) {
            cameraKitImage.getJpeg(); // will return byte[]
        }

        @Override
        public void onVideo(CameraKitVideo cameraKitVideo) {

        }
    };

thanks i use this. its working for captureImage. but onVideo not work with captureVideo().

i try this code

cameraView.addCameraKitListener(new CameraKitEventListener() {
@Override
public void onVideo(CameraKitVideo cameraKitVideo) {
System.out.println("working?");

       }
   });

   cameraView.captureVideo();

its not give a result.

change to
cameraView.captureImage(new CameraKitEventCallback() {
@Override
public void callback(CameraKitImage event) {
byte[] jpeg = event.getJpeg();
}
});

This is exactly what i need thanks. I think someone should change the Documentation

Will update the documentation soon! Thanks @watire @DaCrAn

Just wanted to bump this and remind the devs to update the documentation. I was upgrading my API from "com.flurgle:camerakit:0.9.17" and although it wasn't hard to find this post, I think new users might be inconvenienced with outdated docs. Thanks for this library!

Thanks @brianliyang we will update existing documentation on this. @emersoncloud will handle shortly.

Definitely give the 1.0.0 PR a go too!

@brianliyang I've updated the documentation to reflect the latest image and video capture methods. Let me know if you have any other comments or concerns. Thanks for bringing this to our attention!

This dosen't give me a result, can anyone tell me what i'm doing wrong. I just updated from com.flurgle.camerakit. The camerakiteventlistener also dosen't get called

cameraView.captureVideo(new CameraKitEventCallback<CameraKitVideo>() {
                    @Override
                    public void callback(CameraKitVideo cameraKitVideo) {

                        Log.d("Video","recorded");

                    }
                });

I'm using implementation 'com.wonderkiln:camerakit:0.13.1'

Am I looking at an old website? This issue says that the documentation was updated, but this still says to use CameraListener. http://docs.camerakit.website/#/?id=camerakit-for-android

@lights-a5 Yes, the website that you linked is outdated. To avoid any more confusion I am saving documentation changes for one entirely new set in the coming weeks. For now, check the PR notes for basic usage details #318.

I've created a new issue for documentation changes and you can watch for updates there! #374

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nethergrim picture nethergrim  路  5Comments

mhwu1103 picture mhwu1103  路  6Comments

austinkettner picture austinkettner  路  6Comments

rt-bloombees picture rt-bloombees  路  6Comments

pinigtech picture pinigtech  路  4Comments