Skip to content

Instantly share code, notes, and snippets.

@stefangordon
Created December 21, 2016 16:13
Show Gist options
  • Save stefangordon/268b979afebf6e6f337f8c3555b4eb36 to your computer and use it in GitHub Desktop.
Save stefangordon/268b979afebf6e6f337f8c3555b4eb36 to your computer and use it in GitHub Desktop.
React Native MJPEG
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>');
}
@paxme
Copy link

paxme commented Jun 17, 2022

Thanks man!

@h4nkyn
Copy link

h4nkyn commented Aug 13, 2024

Any other solutions u all find?

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