<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Yeasir Arafat on Medium]]></title>
        <description><![CDATA[Stories by Yeasir Arafat on Medium]]></description>
        <link>https://medium.com/@arif91825?source=rss-f3c96d41584------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*qTmX1pwMOKdiaERM</url>
            <title>Stories by Yeasir Arafat on Medium</title>
            <link>https://medium.com/@arif91825?source=rss-f3c96d41584------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 20:35:58 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@arif91825/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to Capture Photos and Record Videos in React Native Using Vision Camera v5]]></title>
            <link>https://medium.com/@arif91825/how-to-capture-photos-and-record-videos-in-react-native-using-vision-camera-v5-f227711ad49e?source=rss-f3c96d41584------2</link>
            <guid isPermaLink="false">https://medium.com/p/f227711ad49e</guid>
            <dc:creator><![CDATA[Yeasir Arafat]]></dc:creator>
            <pubDate>Sat, 16 May 2026 16:49:40 GMT</pubDate>
            <atom:updated>2026-05-16T16:49:40.106Z</atom:updated>
            <content:encoded><![CDATA[<h3>A complete, battle-tested guide with real code and real pitfalls</h3><p>If you’ve tried to implement camera features in React Native recently, you know how fast the ecosystem moves. <strong>react-native-vision-camera v5</strong> completely rewrote its API — and most tutorials online are outdated.</p><p>This guide covers everything I learned building a working photo capture and video recorder from scratch, including the crashes I hit and how I fixed them.</p><h3>What We’re Building</h3><ul><li>📸 <strong>Photo Capture</strong> — Take a photo, preview it in-app using react-native-nitro-image</li><li>🎬 <strong>Video Recorder</strong> — Record a video with a live duration timer, flip camera, and play it back using the system’s native player</li></ul><h3>Stack</h3><p>json</p><pre>&quot;react-native&quot;: &quot;0.84.1&quot;,<br>&quot;react&quot;: &quot;19.2.3&quot;,<br>&quot;react-native-vision-camera&quot;: &quot;^5.0.9&quot;,<br>&quot;react-native-nitro-image&quot;: &quot;^0.14.0&quot;,<br>&quot;react-native-nitro-modules&quot;: &quot;^0.35.6&quot;</pre><h3>Installation</h3><p>bash</p><pre>npm install react-native-vision-camera react-native-nitro-image react-native-nitro-modules</pre><pre># iOS<br>cd ios &amp;&amp; pod install</pre><h3>Android — add permissions to AndroidManifest.xml</h3><p>xml</p><pre>&lt;uses-permission android:name=&quot;android.permission.CAMERA&quot; /&gt;<br>&lt;uses-permission android:name=&quot;android.permission.RECORD_AUDIO&quot; /&gt;</pre><h3>iOS — add to Info.plist</h3><p>xml</p><pre>&lt;key&gt;NSCameraUsageDescription&lt;/key&gt;<br>&lt;string&gt;We need camera access to take photos and videos.&lt;/string&gt;<br>&lt;key&gt;NSMicrophoneUsageDescription&lt;/key&gt;<br>&lt;string&gt;We need microphone access to record audio with videos.&lt;/string&gt;</pre><h3>Part 1 — Photo Capture</h3><p>The v5 API introduces <strong>output hooks</strong> like usePhotoOutput(). You no longer call methods directly on cameraRef for photos.</p><p>jsx</p><pre>import React, { useState, useRef, useEffect } from &#39;react&#39;;<br>import { View, Text, StyleSheet, TouchableOpacity } from &#39;react-native&#39;;<br>import {<br>  Camera,<br>  useCameraDevice,<br>  useCameraPermission,<br>  usePhotoOutput,<br>} from &#39;react-native-vision-camera&#39;;<br>import { NitroImage } from &#39;react-native-nitro-image&#39;;</pre><pre>const PhotoCapture = () =&gt; {<br>  const { hasPermission, requestPermission } = useCameraPermission();<br>  const device = useCameraDevice(&#39;back&#39;);<br>  const cameraRef = useRef(null);<br>  const photoOutput = usePhotoOutput();</pre><pre>  const [capturedPhoto, setCapturedPhoto] = useState(null);<br>  const [isCameraOpen, setIsCameraOpen] = useState(false);</pre><pre>  useEffect(() =&gt; {<br>    (async () =&gt; {<br>      if (!hasPermission) await requestPermission();<br>    })();<br>  }, [hasPermission]);</pre><pre>  const takePhoto = async () =&gt; {<br>    const photo = await photoOutput.capturePhoto(<br>      { enableShutterSound: false, flashMode: &#39;off&#39; },<br>      {},<br>    );</pre><pre>    const path = await photo.saveToTemporaryFileAsync();<br>    console.log(&#39;Saved to:&#39;, path);</pre><pre>    const img = await photo.toImageAsync();<br>    setCapturedPhoto(img);<br>    setIsCameraOpen(false);<br>    photo.dispose(); // ← important! prevents memory leaks<br>  };</pre><pre>  if (!hasPermission) {<br>    return (<br>      &lt;View style={styles.center}&gt;<br>        &lt;Text style={styles.text}&gt;Camera Permission Required&lt;/Text&gt;<br>      &lt;/View&gt;<br>    );<br>  }</pre><pre>  if (!device) {<br>    return (<br>      &lt;View style={styles.center}&gt;<br>        &lt;Text style={styles.text}&gt;No Camera Device Found&lt;/Text&gt;<br>      &lt;/View&gt;<br>    );<br>  }</pre><pre>  return (<br>    &lt;View style={styles.container}&gt;<br>      {/* Camera always mounted in background — only isActive changes */}<br>      &lt;Camera<br>        ref={cameraRef}<br>        style={StyleSheet.absoluteFill}<br>        device={device}<br>        isActive={isCameraOpen}<br>        photo={true}<br>        outputs={[photoOutput]}<br>      /&gt;</pre><pre>      {isCameraOpen &amp;&amp; (<br>        &lt;&gt;<br>          &lt;TouchableOpacity<br>            style={styles.closeButton}<br>            onPress={() =&gt; setIsCameraOpen(false)}<br>          &gt;<br>            &lt;Text style={styles.closeButtonText}&gt;Cancel&lt;/Text&gt;<br>          &lt;/TouchableOpacity&gt;</pre><pre>          &lt;View style={styles.buttonContainer}&gt;<br>            &lt;TouchableOpacity style={styles.captureButton} onPress={takePhoto}&gt;<br>              &lt;View style={styles.captureInnerCircle} /&gt;<br>            &lt;/TouchableOpacity&gt;<br>          &lt;/View&gt;<br>        &lt;/&gt;<br>      )}</pre><pre>      {!isCameraOpen &amp;&amp; (<br>        &lt;View style={styles.mainScreenContainer}&gt;<br>          &lt;View style={styles.imageViewer}&gt;<br>            {capturedPhoto ? (<br>              &lt;NitroImage<br>                image={capturedPhoto}<br>                style={styles.previewImage}<br>                resizeMode=&quot;contain&quot;<br>              /&gt;<br>            ) : (<br>              &lt;Text style={styles.placeholderText}&gt;No Image Captured&lt;/Text&gt;<br>            )}<br>          &lt;/View&gt;</pre><pre>          &lt;TouchableOpacity<br>            style={styles.openCameraButton}<br>            onPress={() =&gt; setIsCameraOpen(true)}<br>          &gt;<br>            &lt;Text style={styles.buttonText}&gt;<br>              {capturedPhoto ? &#39;Take Another Photo&#39; : &#39;Take Photo&#39;}<br>            &lt;/Text&gt;<br>          &lt;/TouchableOpacity&gt;<br>        &lt;/View&gt;<br>      )}<br>    &lt;/View&gt;<br>  );<br>};</pre><pre>export default PhotoCapture;</pre><h3>Key Concepts — Photo</h3><p>ConceptExplanationusePhotoOutput()Creates the photo output handler. Pass it to outputs prop.photoOutput.capturePhoto()Takes the photo. Returns a Photo object.photo.toImageAsync()Converts to a NitroImage for in-app display.photo.dispose()<strong>Always call this</strong> to free native memory.isActive vs unmountCamera stays mounted but isActive={false} pauses it — much faster to resume.</p><h3>Part 2 — Video Recording</h3><p>Video in v5 uses a <strong>Recorder pattern</strong> — you must create a new Recorder instance for every recording. Here&#39;s the correct flow:</p><pre>useVideoOutput({ enableAudio, fileType })<br>    ↓<br>videoOutput.createRecorder({})      ← new instance every time<br>    ↓<br>recorder.startRecording(onFinished, onError)<br>    ↓<br>recorder.stopRecording()            ← async<br>    ↓<br>onRecordingFinished(filePath, reason)</pre><p>jsx</p><pre><br>import React, { useState, useRef, useEffect, useCallback } from &#39;react&#39;;<br>import {<br>  View,<br>  Text,<br>  StyleSheet,<br>  TouchableOpacity,<br>  Alert,<br>} from &#39;react-native&#39;;<br><br>import {<br>  Camera,<br>  useCameraDevice,<br>  useCameraPermission,<br>  useMicrophonePermission,<br>  useVideoOutput,<br>} from &#39;react-native-vision-camera&#39;;<br><br>const VideoCapture = () =&gt; {<br>  // ── Permissions ──────────────────────────────────────────────────────────<br>  const { hasPermission: hasCameraPermission, requestPermission: requestCameraPermission } =<br>    useCameraPermission();<br>  const { hasPermission: hasMicPermission, requestPermission: requestMicPermission } =<br>    useMicrophonePermission();<br><br>  // ── Camera device ─────────────────────────────────────────────────────────<br>  const [cameraPosition, setCameraPosition] = useState(&#39;back&#39;);<br>  const device = useCameraDevice(cameraPosition);<br><br>  // ── Video output (docs অনুযায়ী options এখানে দিতে হবে) ─────────────────<br>  const videoOutput = useVideoOutput({<br>    enableAudio: true,   // microphone on<br>    fileType: &#39;mp4&#39;,     // iOS-এও mp4 হবে; Android-এ default-ই mp4<br>  });<br><br>  // ── Refs ──────────────────────────────────────────────────────────────────<br>  const recorderRef = useRef(null); // Recorder instance রাখব এখানে<br><br>  // ── States ────────────────────────────────────────────────────────────────<br>  const [isCameraOpen, setIsCameraOpen]           = useState(false);<br>  const [isRecording, setIsRecording]             = useState(false);<br>  const [recordedVideoPath, setRecordedVideoPath] = useState(null);<br>  const [recordingDuration, setRecordingDuration] = useState(0);<br><br>  const timerRef = useRef(null);<br><br>  // ── Request permissions on mount ──────────────────────────────────────────<br>  useEffect(() =&gt; {<br>    (async () =&gt; {<br>      if (!hasCameraPermission) await requestCameraPermission();<br>      if (!hasMicPermission)    await requestMicPermission();<br>    })();<br>  }, [hasCameraPermission, hasMicPermission]);<br><br>  // ── Duration timer ────────────────────────────────────────────────────────<br>  useEffect(() =&gt; {<br>    if (isRecording) {<br>      setRecordingDuration(0);<br>      timerRef.current = setInterval(() =&gt; {<br>        setRecordingDuration(prev =&gt; prev + 1);<br>      }, 1000);<br>    } else {<br>      clearInterval(timerRef.current);<br>    }<br>    return () =&gt; clearInterval(timerRef.current);<br>  }, [isRecording]);<br><br>  // ── Format duration as MM:SS ──────────────────────────────────────────────<br>  const formatDuration = (seconds) =&gt; {<br>    const m = Math.floor(seconds / 60).toString().padStart(2, &#39;0&#39;);<br>    const s = (seconds % 60).toString().padStart(2, &#39;0&#39;);<br>    return `${m}:${s}`;<br>  };<br><br>  // ── Start recording ───────────────────────────────────────────────────────<br>  // Docs: প্রতিবার নতুন Recorder বানাতে হবে, পুরনোটা reuse করা যাবে না<br>  const startRecording = useCallback(async () =&gt; {<br>    try {<br>      // Step 1: নতুন Recorder তৈরি করো<br>      const recorder = await videoOutput.createRecorder({});<br>      recorderRef.current = recorder;<br><br>      setIsRecording(true);<br><br>      // Step 2: startRecording-এ দুটো আলাদা callback argument পাস করো<br>      // (options object না — docs-এ clearly দুটো function argument)<br>      await recorder.startRecording(<br>        (filePath, reason) =&gt; {<br>          // onRecordingFinished<br>          console.log(&#39;Recording finished:&#39;, filePath, &#39;| reason:&#39;, reason);<br>          setRecordedVideoPath(filePath);<br>          setIsRecording(false);<br>          setIsCameraOpen(false);<br>          recorderRef.current = null;<br>        },<br>        (error) =&gt; {<br>          // onRecordingError<br>          console.error(&#39;Recording error:&#39;, error);<br>          Alert.alert(&#39;Recording Error&#39;, error.message);<br>          setIsRecording(false);<br>          recorderRef.current = null;<br>        },<br>      );<br>    } catch (error) {<br>      console.error(&#39;startRecording error:&#39;, error);<br>      Alert.alert(&#39;Error&#39;, error.message);<br>      setIsRecording(false);<br>      recorderRef.current = null;<br>    }<br>  }, [videoOutput]);<br><br>  // ── Stop recording ────────────────────────────────────────────────────────<br>  const stopRecording = useCallback(async () =&gt; {<br>    if (!recorderRef.current) {<br>      console.warn(&#39;No active recorder found&#39;);<br>      return;<br>    }<br>    try {<br>      // resolve হলে মানে stop request গেছে;<br>      // file write শেষে onRecordingFinished callback fire হবে<br>      await recorderRef.current.stopRecording();<br>    } catch (error) {<br>      console.error(&#39;stopRecording error:&#39;, error);<br>      Alert.alert(&#39;Error&#39;, error.message);<br>      setIsRecording(false);<br>      recorderRef.current = null;<br>    }<br>  }, []);<br><br>  // ── Flip camera ───────────────────────────────────────────────────────────<br>  const flipCamera = () =&gt; {<br>    setCameraPosition(prev =&gt; (prev === &#39;back&#39; ? &#39;front&#39; : &#39;back&#39;));<br>  };<br><br>  // ── Discard video ─────────────────────────────────────────────────────────<br>  const discardVideo = () =&gt; {<br>    Alert.alert(&#39;Discard Video&#39;, &#39;Are you sure?&#39;, [<br>      { text: &#39;Cancel&#39;, style: &#39;cancel&#39; },<br>      {<br>        text: &#39;Discard&#39;,<br>        style: &#39;destructive&#39;,<br>        onPress: () =&gt; setRecordedVideoPath(null),<br>      },<br>    ]);<br>  };<br><br>  // ── Permission guards ─────────────────────────────────────────────────────<br>  if (!hasCameraPermission || !hasMicPermission) {<br>    return (<br>      &lt;View style={styles.center}&gt;<br>        &lt;Text style={styles.text}&gt;Camera &amp; Microphone Permission Required&lt;/Text&gt;<br>        &lt;TouchableOpacity<br>          style={styles.primaryButton}<br>          onPress={async () =&gt; {<br>            await requestCameraPermission();<br>            await requestMicPermission();<br>          }}<br>        &gt;<br>          &lt;Text style={styles.buttonText}&gt;Grant Permission&lt;/Text&gt;<br>        &lt;/TouchableOpacity&gt;<br>      &lt;/View&gt;<br>    );<br>  }<br><br>  if (device == null) {<br>    return (<br>      &lt;View style={styles.center}&gt;<br>        &lt;Text style={styles.text}&gt;No Camera Device Found&lt;/Text&gt;<br>      &lt;/View&gt;<br>    );<br>  }<br><br>  // ─────────────────────────────────────────────────────────────────────────<br>  return (<br>    &lt;View style={styles.container}&gt;<br><br>      {/* ── Camera: সবসময় ব্যাকগ্রাউন্ডে render, আনমাউন্ট হবে না ── */}<br>      &lt;Camera<br>        style={StyleSheet.absoluteFill}<br>        device={device}<br>        isActive={isCameraOpen}<br>        video={true}<br>        audio={true}<br>        outputs={[videoOutput]}<br>      /&gt;<br><br>      {/* ── Camera open: recording UI ── */}<br>      {isCameraOpen &amp;&amp; (<br>        &lt;&gt;<br>          {/* Duration badge */}<br>          {isRecording &amp;&amp; (<br>            &lt;View style={styles.durationBadge}&gt;<br>              &lt;View style={styles.recordingDot} /&gt;<br>              &lt;Text style={styles.durationText}&gt;{formatDuration(recordingDuration)}&lt;/Text&gt;<br>            &lt;/View&gt;<br>          )}<br><br>          {/* Flip camera (recording না হলে) */}<br>          {!isRecording &amp;&amp; (<br>            &lt;TouchableOpacity style={styles.flipButton} onPress={flipCamera}&gt;<br>              &lt;Text style={styles.flipButtonText}&gt;⟳ Flip&lt;/Text&gt;<br>            &lt;/TouchableOpacity&gt;<br>          )}<br><br>          {/* Cancel button (recording না হলে) */}<br>          {!isRecording &amp;&amp; (<br>            &lt;TouchableOpacity<br>              style={styles.closeButton}<br>              onPress={() =&gt; setIsCameraOpen(false)}<br>            &gt;<br>              &lt;Text style={styles.closeButtonText}&gt;Cancel&lt;/Text&gt;<br>            &lt;/TouchableOpacity&gt;<br>          )}<br><br>          {/* Record / Stop button */}<br>          &lt;View style={styles.buttonContainer}&gt;<br>            &lt;TouchableOpacity<br>              style={[styles.recordButton, isRecording &amp;&amp; styles.recordButtonActive]}<br>              onPress={isRecording ? stopRecording : startRecording}<br>            &gt;<br>              {isRecording ? (<br>                &lt;View style={styles.stopSquare} /&gt;<br>              ) : (<br>                &lt;View style={styles.recordInnerCircle} /&gt;<br>              )}<br>            &lt;/TouchableOpacity&gt;<br>            &lt;Text style={styles.recordLabel}&gt;<br>              {isRecording ? &#39;Tap to Stop&#39; : &#39;Tap to Record&#39;}<br>            &lt;/Text&gt;<br>          &lt;/View&gt;<br>        &lt;/&gt;<br>      )}<br><br>      {/* ── Camera closed: main screen ── */}<br>      {!isCameraOpen &amp;&amp; (<br>        &lt;View style={styles.mainScreenContainer}&gt;<br>          &lt;Text style={styles.screenTitle}&gt;Video Recorder&lt;/Text&gt;<br><br>          &lt;View style={styles.previewBox}&gt;<br>            {recordedVideoPath ? (<br>              &lt;&gt;<br>                &lt;Text style={styles.previewIcon}&gt;🎬&lt;/Text&gt;<br>                &lt;Text style={styles.previewPathText} numberOfLines={3}&gt;<br>                  {recordedVideoPath}<br>                &lt;/Text&gt;<br>                &lt;Text style={styles.successText}&gt;✓ Video saved successfully&lt;/Text&gt;<br>              &lt;/&gt;<br>            ) : (<br>              &lt;&gt;<br>                &lt;Text style={styles.previewIcon}&gt;📹&lt;/Text&gt;<br>                &lt;Text style={styles.placeholderText}&gt;No video recorded yet&lt;/Text&gt;<br>              &lt;/&gt;<br>            )}<br>          &lt;/View&gt;<br><br>          &lt;View style={styles.actionRow}&gt;<br>            &lt;TouchableOpacity<br>              style={styles.primaryButton}<br>              onPress={() =&gt; setIsCameraOpen(true)}<br>            &gt;<br>              &lt;Text style={styles.buttonText}&gt;<br>                {recordedVideoPath ? &#39;Record New Video&#39; : &#39;Start Recording&#39;}<br>              &lt;/Text&gt;<br>            &lt;/TouchableOpacity&gt;<br><br>            {recordedVideoPath &amp;&amp; (<br>              &lt;TouchableOpacity style={styles.dangerButton} onPress={discardVideo}&gt;<br>                &lt;Text style={styles.buttonText}&gt;Discard&lt;/Text&gt;<br>              &lt;/TouchableOpacity&gt;<br>            )}<br>          &lt;/View&gt;<br>        &lt;/View&gt;<br>      )}<br>    &lt;/View&gt;<br>  );<br>};<br><br>export default VideoCapture;<br><br>// ── Styles ─────────────────────────────────────────────────────────────────<br>const styles = StyleSheet.create({<br>  container: {<br>    flex: 1,<br>    backgroundColor: &#39;black&#39;,<br>  },<br>  center: {<br>    flex: 1,<br>    justifyContent: &#39;center&#39;,<br>    alignItems: &#39;center&#39;,<br>    backgroundColor: &#39;#111&#39;,<br>    gap: 16,<br>    paddingHorizontal: 24,<br>  },<br>  text: {<br>    color: &#39;white&#39;,<br>    fontSize: 16,<br>    textAlign: &#39;center&#39;,<br>  },<br>  mainScreenContainer: {<br>    ...StyleSheet.absoluteFill,<br>    backgroundColor: &#39;#f5f5f5&#39;,<br>    alignItems: &#39;center&#39;,<br>    paddingTop: 60,<br>    paddingHorizontal: 24,<br>    zIndex: 10,<br>  },<br>  screenTitle: {<br>    fontSize: 26,<br>    fontWeight: &#39;700&#39;,<br>    color: &#39;#111&#39;,<br>    marginBottom: 30,<br>  },<br>  previewBox: {<br>    width: &#39;100%&#39;,<br>    height: 280,<br>    backgroundColor: &#39;#e0e0e0&#39;,<br>    borderRadius: 12,<br>    justifyContent: &#39;center&#39;,<br>    alignItems: &#39;center&#39;,<br>    marginBottom: 30,<br>    gap: 10,<br>    paddingHorizontal: 16,<br>  },<br>  previewIcon: { fontSize: 56 },<br>  previewPathText: {<br>    fontSize: 11,<br>    color: &#39;#555&#39;,<br>    textAlign: &#39;center&#39;,<br>  },<br>  successText: {<br>    fontSize: 14,<br>    color: &#39;#22c55e&#39;,<br>    fontWeight: &#39;600&#39;,<br>  },<br>  placeholderText: {<br>    color: &#39;#888&#39;,<br>    fontSize: 16,<br>  },<br>  actionRow: {<br>    width: &#39;100%&#39;,<br>    gap: 12,<br>  },<br>  primaryButton: {<br>    backgroundColor: &#39;#007bff&#39;,<br>    paddingVertical: 16,<br>    borderRadius: 10,<br>    alignItems: &#39;center&#39;,<br>  },<br>  dangerButton: {<br>    backgroundColor: &#39;#ef4444&#39;,<br>    paddingVertical: 16,<br>    borderRadius: 10,<br>    alignItems: &#39;center&#39;,<br>  },<br>  buttonText: {<br>    color: &#39;white&#39;,<br>    fontSize: 16,<br>    fontWeight: &#39;700&#39;,<br>  },<br>  durationBadge: {<br>    position: &#39;absolute&#39;,<br>    top: 50,<br>    alignSelf: &#39;center&#39;,<br>    flexDirection: &#39;row&#39;,<br>    alignItems: &#39;center&#39;,<br>    backgroundColor: &#39;rgba(0,0,0,0.55)&#39;,<br>    paddingVertical: 6,<br>    paddingHorizontal: 14,<br>    borderRadius: 20,<br>    gap: 8,<br>    zIndex: 20,<br>  },<br>  recordingDot: {<br>    width: 10,<br>    height: 10,<br>    borderRadius: 5,<br>    backgroundColor: &#39;#ef4444&#39;,<br>  },<br>  durationText: {<br>    color: &#39;white&#39;,<br>    fontSize: 16,<br>    fontWeight: &#39;600&#39;,<br>    letterSpacing: 1,<br>  },<br>  flipButton: {<br>    position: &#39;absolute&#39;,<br>    top: 50,<br>    left: 20,<br>    backgroundColor: &#39;rgba(0,0,0,0.5)&#39;,<br>    paddingVertical: 8,<br>    paddingHorizontal: 14,<br>    borderRadius: 8,<br>    zIndex: 20,<br>  },<br>  flipButtonText: {<br>    color: &#39;white&#39;,<br>    fontWeight: &#39;600&#39;,<br>  },<br>  closeButton: {<br>    position: &#39;absolute&#39;,<br>    top: 50,<br>    right: 20,<br>    backgroundColor: &#39;rgba(0,0,0,0.5)&#39;,<br>    paddingVertical: 8,<br>    paddingHorizontal: 14,<br>    borderRadius: 8,<br>    zIndex: 20,<br>  },<br>  closeButtonText: {<br>    color: &#39;white&#39;,<br>    fontWeight: &#39;600&#39;,<br>  },<br>  buttonContainer: {<br>    position: &#39;absolute&#39;,<br>    bottom: 50,<br>    alignSelf: &#39;center&#39;,<br>    alignItems: &#39;center&#39;,<br>    gap: 8,<br>    zIndex: 20,<br>  },<br>  recordButton: {<br>    width: 80,<br>    height: 80,<br>    borderRadius: 40,<br>    backgroundColor: &#39;rgba(255,255,255,0.25)&#39;,<br>    borderWidth: 4,<br>    borderColor: &#39;white&#39;,<br>    justifyContent: &#39;center&#39;,<br>    alignItems: &#39;center&#39;,<br>  },<br>  recordButtonActive: {<br>    borderColor: &#39;#ef4444&#39;,<br>    backgroundColor: &#39;rgba(239,68,68,0.2)&#39;,<br>  },<br>  recordInnerCircle: {<br>    width: 56,<br>    height: 56,<br>    borderRadius: 28,<br>    backgroundColor: &#39;#ef4444&#39;,<br>  },<br>  stopSquare: {<br>    width: 30,<br>    height: 30,<br>    borderRadius: 6,<br>    backgroundColor: &#39;#ef4444&#39;,<br>  },<br>  recordLabel: {<br>    color: &#39;white&#39;,<br>    fontSize: 13,<br>    fontWeight: &#39;600&#39;,<br>  },<br>});</pre><h3>Key Concepts — Video</h3><p>ConceptExplanationuseVideoOutput({ enableAudio, fileType })Audio and format options go here — not in startRecording.createRecorder({})<strong>Must pass </strong><strong>{}</strong> — 0 arguments throws an error.startRecording(onFinished, onError)Two separate callback arguments, not an options object.stopRecording()Async. Signals stop. File is written asynchronously — wait for onRecordingFinished.Don&#39;t reuse RecorderCreate a fresh recorder instance for every new recording.useMicrophonePermission()Must request separately from camera permission.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f227711ad49e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>