Created
December 21, 2016 16:13
-
-
Save stefangordon/268b979afebf6e6f337f8c3555b4eb36 to your computer and use it in GitHub Desktop.
React Native MJPEG
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var styles = StyleSheet.create({ | |
backgroundVideo: { | |
width:400, | |
height:322 | |
} | |
}) | |
return ( | |
<View> | |
<WebView | |
style={styles.backgroundVideo} | |
automaticallyAdjustContentInsets={true} | |
scalesPageToFit={true} | |
startInLoadingState={false} | |
contentInset={{top: 0, right: 0, left: 0, bottom: 0}} | |
scrollEnabled={false} | |
source={{html: this.formatHtml(), baseUrl: '/'}} /> | |
</View> | |
); | |
} | |
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>'); | |
} |
Overdrive141
commented
Jun 18, 2020
via email
For Mjpeg webviewer is the only solution. Have you tried streaming directly
from Pi?
…On Wed, Jun 17, 2020, 3:06 PM KrifaYounes ***@***.***> wrote:
***@***.**** commented on this gist.
------------------------------
I use flask like this.
It’s mjpeg format, it doesn’t work woth react native video.
Have you a other solution ?
@app.route("/video_feed")
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")
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<https://gist.github.com/268b979afebf6e6f337f8c3555b4eb36#gistcomment-3344693>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AF3J32O7WLMA3MHSZF4EYULRXCIS7ANCNFSM4M5OQJOA>
.
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 ?
Nah man, I'm new to WebView myself. Have your tried streaming video from
Raspberry directly without flask server through Raspivid
…On Thu, Jun 18, 2020, 2:57 PM KrifaYounes ***@***.***> wrote:
***@***.**** commented on this gist.
------------------------------
ok
Have you some recommandations to optimize Webview streaming for android ?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<https://gist.github.com/268b979afebf6e6f337f8c3555b4eb36#gistcomment-3346022>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AF3J32JTDXVZYY4AF36W3VDRXHQGZANCNFSM4M5OQJOA>
.
Thanks man!
Any other solutions u all find?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment