Skip to content

Instantly share code, notes, and snippets.

Created December 21, 2016 16:13
What would you like to do?
React Native MJPEG
var styles = StyleSheet.create({
backgroundVideo: {
return (
contentInset={{top: 0, right: 0, left: 0, bottom: 0}}
source={{html: this.formatHtml(), baseUrl: '/'}} />
formatHtml () {
return ('<html><body><img src="' + this.props.mpjegUrl + '" width="100%" style="background-color: white; min-height: 100%; min-width: 100%; position: fixed; top: 0; left: 0;"></body></html>');
Copy link

It’s doesn’t work for me with react-native-video. Can you share me your code please ?

What format is your video in?

Copy link

KrifaYounes commented Jun 17, 2020

I use flask like this.
It’s mjpeg format, it doesn’t work woth react native video.
Have you a other solution ?

def video_feed():
# return the response generated along with the specific media
# type (mime type)
return Response(generate(),
mimetype = "multipart/x-mixed-replace; boundary=frame")

Copy link

Overdrive141 commented Jun 18, 2020 via email

Copy link

KrifaYounes commented Jun 18, 2020

ok i will search other streaming solutions but I use OpenCV with python for face detection.
Have you some recommandations to optimize Webview streaming for android ?

Copy link

Overdrive141 commented Jun 18, 2020 via email

Copy link

paxme commented Jun 17, 2022

Thanks man!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment