Feed showing posts
This commit is contained in:
37
components/VimeoPlayer.js
Normal file
37
components/VimeoPlayer.js
Normal file
@@ -0,0 +1,37 @@
|
||||
import React from 'react';
|
||||
import { string, func } from 'prop-types';
|
||||
import WebView from 'react-native-autoheight-webview';
|
||||
|
||||
const VimeoPlayer = ({ videoId, onError }) => {
|
||||
return (
|
||||
<WebView
|
||||
style={style}
|
||||
onError={onError}
|
||||
allowsFullscreenVideo
|
||||
scrollEnabled={false}
|
||||
automaticallyAdjustContentInsets
|
||||
source={{
|
||||
html: `
|
||||
<html>
|
||||
<body>
|
||||
<iframe src="https://player.vimeo.com/video/${videoId}" width="100%" height="200px" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
|
||||
<script src="https://player.vimeo.com/api/player.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
`,
|
||||
}}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
export default VimeoPlayer;
|
||||
|
||||
const style = {
|
||||
height: 200,
|
||||
maxWidth: '100%',
|
||||
};
|
||||
|
||||
VimeoPlayer.propTypes = {
|
||||
videoId: string,
|
||||
onError: func,
|
||||
};
|
||||
Reference in New Issue
Block a user