juliansteenbakker / mobile_scanner

A universal scanner for Flutter based on MLKit. Uses CameraX on Android and AVFoundation on iOS.
BSD 3-Clause "New" or "Revised" License
745 stars 444 forks source link

feat: add pause feature #994

Open fumin65 opened 1 month ago

fumin65 commented 1 month ago

related to #195

This PR introduces a pause feature. pause() method stops the camera, but does not release the texture. And It takes the following state transitions.

stateDiagram-v2
    [*] --> Start
    Start --> Pause
    Pause --> Start
    Pause --> Stop
    Start --> Stop
    Stop --> [*]

If this feature is useful and fits the concept of this library, please consider merging it.

navaronbracke commented 1 month ago

Thanks for the contribution! I don't yet have time for a full review (I will see if I can get that sorted in the coming week), but could you look into the following as well?

1) Can we implement pause for MacOS too, since it is similar to iOS? 2) Can we implement pause for the web? Not sure if the MediaStream would support this

fumin65 commented 1 month ago

Thanks for your reply. I will try these for now. However, I am new to MacOS and MediaStream, so it will probably take some time.

fumin65 commented 1 month ago

@navaronbracke I implemented pause for MacOS and web. Please review if you have time.