我正在使用反应原生视图拍摄,我需要我们的产品能够捕获从反应原生视频包的m3u8 uri直播流。
目前在android上,它可以很好地捕捉屏幕,但在IOS上,View Shot似乎只捕捉空白视频的问题。How it looks on 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>发布于 2021-02-05 23:14:08
如果将来有人想知道这个问题的答案,我在react原生webview组件上打包了View shot capturing,在ios上播放视频。它拍摄了一段暂停播放的Youtube视频的照片。但是,即使View Shot捕捉到嵌入的视频的WebView,视频的内容也是空的。
不确定这是否是因为RN视图拍摄,已经给包的创始人发了电子邮件。还是Ios屏蔽了视频内容的播放?
<View collapsable={false} style=Template:Height: "80%">
<WebView
originWhitelist={["*"]}
source={{
html:
'<iframe playsinline controls autoplay src="https://bitdash-a.akamaihd.net/content/MI201109210084_1/m3u8s/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.m3u8" ></iframe>',
}}
useWebKit={true}
originWhitelist={["*"]}
allowsInlineMediaPlayback={true}
style={{
height: 600,
width: 400,
}}
/>
</View>
</ViewShot>但如果有人找到更好的替代解决方案,请让我知道。
https://stackoverflow.com/questions/66045012
复制相似问题