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

[BUG] lockCaptureOrientation not work on IOS real devices #197

Closed
heshesh2010 opened this issue Sep 12, 2023 · 16 comments
Closed

[BUG] lockCaptureOrientation not work on IOS real devices #197

heshesh2010 opened this issue Sep 12, 2023 · 16 comments
Labels
p: iOS This issue only happens on iOS platform. s: bug Something isn't working s: UI This issue is related with UI or layout. ⏳WEEK This issue is scheduled to be solved within one week.

Comments

@heshesh2010
Copy link

heshesh2010 commented Sep 12, 2023

Hi ,
using latest release , when device going to landscape , I found the camera capture button is disappeared when going to landscape , when I return to portrait again the camera button shows again .

  await CameraPicker.pickFromCamera(
      context,
      pickerConfig: const CameraPickerConfig(
        
        maximumRecordingDuration: Duration(minutes: 1),
        shouldAutoPreviewVideo: true,
        enableRecording: true,
        lockCaptureOrientation: DeviceOrientation.portraitUp,
        enableTapRecording: true,
        resolutionPreset: ResolutionPreset.medium,
        textDelegate: EnglishCameraPickerTextDelegate(),
      ),
    )
@heshesh2010 heshesh2010 added the await investigate The issue is waiting for further investigation. label Sep 12, 2023
@AlexV525
Copy link
Member

This might be also addressed by #218.

@AlexV525 AlexV525 added await response Issue require customer's further response. and removed await investigate The issue is waiting for further investigation. labels Oct 26, 2023
@heshesh2010
Copy link
Author

@AlexV525 I got many error on iOS

[VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: A CameraController was used after being disposed.
Once you have called dispose() on a CameraController, it can no longer be used.
#0 ChangeNotifier.debugAssertNotDisposed.
change_notifier.dart:179
#1 ChangeNotifier.debugAssertNotDisposed
change_notifier.dart:186
#2 ChangeNotifier.notifyListeners
change_notifier.dart:382
#3 ValueNotifier.value=
change_notifier.dart:530
#4 CameraController.lockCaptureOrientation
camera_controller.dart:793

@AlexV525
Copy link
Member

PR updated.

@heshesh2010
Copy link
Author

heshesh2010 commented Oct 26, 2023

@AlexV525 I got too many logs like
[CameraPicker - LOG] X:3.3882041931152345 Y:8.489745483398439 Z:3.4073643493652344

also pls see this screen recording

https://drive.google.com/file/d/1U3OnaexXuCdIWC9utYvgRQi2-WSsMbtS/view?usp=sharing

also when I make screen in landscape the camera button disappear and camera view gets rotated and inverted and this is wrong , the camera shouldn't be converted or any thing , just show the record button in both portrait and landscape mode like normal camera app.

@AlexV525
Copy link
Member

Is your device orientation setting locked or unlocked?

@heshesh2010
Copy link
Author

heshesh2010 commented Oct 26, 2023 via email

@AlexV525
Copy link
Member

https://drive.google.com/file/d/1U3OnaexXuCdIWC9utYvgRQi2-WSsMbtS/view?usp=sharing

You didn't grant access to this video. :)

@heshesh2010
Copy link
Author

@AlexV525
Copy link
Member

https://drive.google.com/file/d/1U3OnaexXuCdIWC9utYvgRQi2-WSsMbtS/view?usp=sharing

This should be fixed with the updated PR. Please check again.

And please provide a record of your first comment: I found the camera capture button is disappeared when going to landscape.

@heshesh2010
Copy link
Author

@AlexV525 here is new video after pr update

https://drive.google.com/file/d/1WfdsNFRxV0nAK6UOhCJzFMOmGz2NuxPA/view?usp=sharing

the device Orientation lock is off

and package setting is
lockCaptureOrientation:
DeviceOrientation.portraitUp,

@AlexV525
Copy link
Member

Could you try the example of our plugin with your changes instead of a custom implementation and then produce another recording? Thanks for your feedback again.

@AlexV525 AlexV525 added s: bug Something isn't working await investigate The issue is waiting for further investigation. p: iOS This issue only happens on iOS platform. s: UI This issue is related with UI or layout. ⏳WEEK This issue is scheduled to be solved within one week. await test The issue/PR is waiting for further tests. labels Oct 29, 2023
@heshesh2010
Copy link
Author

Could you try the example of our plugin with your changes instead of a custom implementation and then produce another recording? Thanks for your feedback again.

here is with latest pr updated https://drive.google.com/file/d/1dvjBmyC4SEqpmx0ELbhoKqvqQKzisGdX/view?usp=sharing

@AlexV525 AlexV525 removed await response Issue require customer's further response. await test The issue/PR is waiting for further tests. labels Oct 29, 2023
@AlexV525
Copy link
Member

PR updated again. After flutter/packages#5261 is published, inverted cases on iOS should be fixed.

@AlexV525 AlexV525 removed the await investigate The issue is waiting for further investigation. label Oct 30, 2023
@heshesh2010
Copy link
Author

PR updated again. After flutter/packages#5261 is published, inverted cases on iOS should be fixed.

@AlexV525 ok great work , but why when I use
lockCaptureOrientation:
DeviceOrientation.portraitUp,

I didn't notice any change , it should prevent me from landscape mode , but I see it's moving to landsacape,

also there is error when I stopped the recorder

[VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: Null check operator used on a null value
#0 CameraPickerState.controller (package:wechat_camera_picker/src/states/camera_picker_state.dart:53:53)
#1 CameraPickerState.stopRecordingVideo (package:wechat_camera_picker/src/states/camera_picker_state.dart:979:10)
#2 Timer._createTimer. (dart:async-patch/timer_patch.dart:18:15)
#3 _Timer._runTimers (dart:isolate-patch/timer_impl.dart:398:19)
#4 _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:429:5)
#5 _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:189:12)

AlexV525 added a commit that referenced this issue Oct 30, 2023
@AlexV525
Copy link
Member

I didn't notice any change , it should prevent me from landscape mode , but I see it's moving to landscape,

It only locks the capture orientation, not the preview one.

@Holofox
Copy link

Holofox commented Jan 26, 2024

@AlexV525, How to lock preview? The capture button disappears when rotated, and the device's position sensors begin to work in reverse (only on iOS).

wechat_camera_picker: ^4.2.0-dev.3
Flutter (Channel stable, 3.16.8, on macOS 14.1.1 23B81 darwin-x64, locale ru-RU)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p: iOS This issue only happens on iOS platform. s: bug Something isn't working s: UI This issue is related with UI or layout. ⏳WEEK This issue is scheduled to be solved within one week.
Projects
None yet
Development

No branches or pull requests

3 participants