Skip to content

Commit b412b29

Browse files
author
Felipe Rodriguez Esturo
committed
fix lint issues
1 parent 8922601 commit b412b29

File tree

5 files changed

+12
-11
lines changed

5 files changed

+12
-11
lines changed

package/android/src/main/java/com/mrousavy/camera/react/Events.kt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,11 @@ class CameraCodeScannedEvent(surfaceId: Int, viewId: Int, private val data: Writ
102102
const val EVENT_NAME = "topCameraCodeScanned"
103103
}
104104
}
105-
class BytesWrittenVideoEvent(surfaceId: Int, viewId: Int, private val data: WritableMap) :
106-
Event<BytesWrittenVideoEvent>(surfaceId, viewId) {
107-
override fun getEventName() = EVENT_NAME
108-
override fun getEventData() = data
109-
companion object {
110-
const val EVENT_NAME = "bytesWrittenVideoEvent"
111-
}
105+
class BytesWrittenVideoEvent(surfaceId: Int, viewId: Int, private val data: WritableMap) :
106+
Event<BytesWrittenVideoEvent>(surfaceId, viewId) {
107+
override fun getEventName() = EVENT_NAME
108+
override fun getEventData() = data
109+
companion object {
110+
const val EVENT_NAME = "bytesWrittenVideoEvent"
111+
}
112112
}

package/ios/React/CameraView+RecordVideo.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ extension CameraView: AVCaptureVideoDataOutputSampleBufferDelegate, AVCaptureAud
2929
onError: { error in
3030
callback.reject(error: error)
3131
},
32-
onBytesWritten: self.onBytesWrittenVideo
32+
onBytesWritten: onBytesWrittenVideo
3333
)
3434
} catch {
3535
// Some error occured while initializing VideoSettings

package/src/Camera.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ export class Camera extends React.PureComponent<CameraProps, CameraState> {
9292
super(props)
9393
this.onViewReady = this.onViewReady.bind(this)
9494
this.onAverageFpsChanged = this.onAverageFpsChanged.bind(this)
95-
this.onBytesWrittenVideo = this.onBytesWrittenVideo.bind(this)
9695
this.onInitialized = this.onInitialized.bind(this)
9796
this.onStarted = this.onStarted.bind(this)
9897
this.onStopped = this.onStopped.bind(this)
@@ -103,6 +102,7 @@ export class Camera extends React.PureComponent<CameraProps, CameraState> {
103102
this.onPreviewOrientationChanged = this.onPreviewOrientationChanged.bind(this)
104103
this.onError = this.onError.bind(this)
105104
this.onCodeScanned = this.onCodeScanned.bind(this)
105+
this.onBytesWrittenVideo = this.onBytesWrittenVideo.bind(this)
106106
this.ref = React.createRef<RefType>()
107107
this.lastFrameProcessor = undefined
108108
this.state = {

package/src/NativeCameraView.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import type { ErrorWithCause } from './CameraError'
44
import type { CameraProps, OnShutterEvent } from './types/CameraProps'
55
import type { Code, CodeScanner, CodeScannerFrame } from './types/CodeScanner'
66
import type { Orientation } from './types/Orientation'
7+
import type { OnBytesWrittenVideoEvent } from './types/VideoFile'
78

89
export interface OnCodeScannedEvent {
910
codes: Code[]
@@ -35,6 +36,7 @@ export type NativeCameraViewProps = Omit<
3536
| 'codeScanner'
3637
| 'fps'
3738
| 'videoBitRate'
39+
| 'onBytesWrittenVideo'
3840
> & {
3941
// private intermediate props
4042
cameraId: string
@@ -58,6 +60,7 @@ export type NativeCameraViewProps = Omit<
5860
onShutter?: (event: NativeSyntheticEvent<OnShutterEvent>) => void
5961
onOutputOrientationChanged?: (event: NativeSyntheticEvent<OutputOrientationChangedEvent>) => void
6062
onPreviewOrientationChanged?: (event: NativeSyntheticEvent<PreviewOrientationChangedEvent>) => void
63+
onBytesWrittenVideo?: (event: NativeSyntheticEvent<OnBytesWrittenVideoEvent>) => void
6164
}
6265

6366
// requireNativeComponent automatically resolves 'CameraView' to 'CameraViewManager'

package/src/types/CameraProps.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,8 +418,6 @@ export interface CameraProps extends ViewProps {
418418
codeScanner?: CodeScanner
419419
/**
420420
* Used to get the bytes written to the video file on real time while it is being recorded
421-
*
422-
* @see See [the Code Scanner documentation](https://react-native-vision-camera.com/docs/guides/code-scanning) for more information
423421
* @example
424422
* ```tsx
425423
* const onBytesWrittenVideo = (bytes: number) => {

0 commit comments

Comments
 (0)