我正在使用 React Native View Shot,我需要我们的产品能够从 React Native 视频包中的 m3u8 uri 捕获实时流。
目前在 android 上它可以很好地捕获屏幕,但在 IOS 上似乎存在 View Shot 仅捕获空白视频的问题。它在 IOS 上的外观
直播是下面播放的,截图是视频的截图。
它们只是不兼容,或者我将如何解决在 ios 上捕获实时流的屏幕截图的问题?
<TouchableOpacity onPress={()=>saveCapturedImage()} style={capturedShot ? styles.capturedShotStyle : styles.beforeShotStyle}>
{capturedShot ? <Text/> : <Text>Click to capture shot</Text> }
</TouchableOpacity>
<Image style={capturedShot ? styles.captureContainerPost : styles.captureContainerPre} source={capturedShot ? {uri: capturedShot } : null} />
{/* Viewshot component from React Native Viewshot */}
<ViewShot ref={viewShotRef} options={{ format: "jpg", quality: 0.9 }}>
{/* Video component from React Native Video, resizeMode cover to get full height on the component. Add pause controls for default, and controls can be toggled true/false */}
{videoUri && <Video
source={{
uri: videoUri,
}}
style={{
width: "100%",
height: "100%",
}}
resizeMode="cover"
controls={true}
paused = {false}
/>}
</ViewShot>