Nativescript Camera Plus无法更改默认相机

我正在尝试使用nativescript-camera-plus插件。除了不能将前置摄像头设置为默认摄像头之外,大多数功能似乎都可以正常工作。

我尝试设置默认相机usingdefaultCamera="front",但这无效。我也尝试过toggleCamera()函数,但这似乎也无济于事。我能够切换相机的唯一方法是双击相机预览。

这是我的代码的片段。

<CameraPlus height="100%" verticalAlignment="top" :visibility="showCamera" ref="CameraPlus"  id="camPlus"
                    defaultCamera="front"
                    saveToGallery="true"      
                    showCaptureIcon="false"
                    showGalleryIcon="false"
                    showToggleIcon="false"       
                    showflashIcon="false"
                    debug="true"
                    enableVideo="false"
                    confirmVideo="false"
                    doubletapCameraSwitch="false" 
                    @loaded="onCameraLoaded"
                    @photoCapturedEvent="photoCaptured($event)"
                    @errorEvent="onCameraError">     
                </CameraPlus>

onCameraLoaded(result) {
                this.cam = result.object;
                //Have tried this.cam.toggleCamera();
},takePhotoButton() {
                this.image = this.cam.takePicture({ saveToGallery: false });               
                //This code and the code from photoCaptured work just fine.
            },

使用此代码,我希望可以选择前置摄像头。在android上,可以选择前置摄像头。但是在IOS上,我进入前置摄像头的唯一方法是双击摄像头。

任何帮助将不胜感激。

zhangdh_nwnu 回答:Nativescript Camera Plus无法更改默认相机

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3140639.html

大家都在问