react-native-vision-camera
react-native-vision-camera copied to clipboard
Feature | Support onBytesWrittenVideo to receive bytes on JS while recording Video
What
This PR Adds the onBytesWrittenVideo callback in order to receive the bytes of the video while it is being recorded.
Changes
IOS
- Implementing
DispatchSourceTimeron Ios in order to read the file size from the FileSystem every 400 ms, that will be executed after the video has started and when finished the timer is cleaned. - Adding
onBytesWrittenVideoEventasRCTDirectEventBlockin order to send events to JS inRCTViewManager
Android
- Creating BytesWrittenVideoEvent class
- Adding
onBytesWrittenVideoon thegetExportedCustomDirectEventTypeConstantsand all the logic to treat that as an Event and send data to JS - Send the data directly from
VideoRecordEvent.Statusas it is available there
TSX/TS
- Adding types and JS Docs
- Adding the onBytesWrittenVideo and destructuring the
NativeEventto just expose(bytes: number) => void
Docs
- Add an example on video page
Tested on
- iPhone 8
- Samsung Galaxy S24 FE
Related issues
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| react-native-vision-camera | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Jun 12, 2025 1:23am |
cool!