@shoutem/ui 6.4.0-rc.0 → 6.4.1-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import { Vimeo } from 'react-native-vimeo-iframe';
2
3
  import YoutubePlayer from 'react-native-youtube-iframe';
3
4
  import iframe from '@native-html/iframe-plugin';
4
5
  import PropTypes from 'prop-types';
@@ -41,6 +42,19 @@ const IframeRenderer = props => {
41
42
  );
42
43
  }
43
44
 
45
+ if (url && url.includes('vimeo')) {
46
+ const vimeoIdRegEx = /(?:www\.|player\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/(?:[^\/]*)\/videos\/|album\/(?:\d+)\/video\/|video\/|)(\d+)(?:[a-zA-Z0-9_\-]+)?/i;
47
+ const regExMatches = url.match(vimeoIdRegEx);
48
+ const vimeoId = regExMatches[1];
49
+
50
+ return (
51
+ <Vimeo
52
+ videoId={vimeoId}
53
+ style={{ height: shoutemStyle.vimeoVideo.height }}
54
+ />
55
+ );
56
+ }
57
+
44
58
  return iframe(props);
45
59
  };
46
60
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shoutem/ui",
3
- "version": "6.4.0-rc.0",
3
+ "version": "6.4.1-rc.0",
4
4
  "description": "Styleable set of components for React Native applications",
5
5
  "scripts": {
6
6
  "lint": "eslint .",
@@ -41,6 +41,7 @@
41
41
  "react-native-toast-message": "2.1.5",
42
42
  "react-native-webview": "11.23.0",
43
43
  "react-native-youtube-iframe": "2.2.2",
44
+ "react-native-vimeo-iframe": "1.2.1",
44
45
  "stream": "0.0.2",
45
46
  "tinycolor2": "1.4.1"
46
47
  },
package/theme.js CHANGED
@@ -2284,6 +2284,10 @@ export default () => {
2284
2284
  height: responsiveWidth(194),
2285
2285
  paddingBottom: resolveVariable('smallGutter'),
2286
2286
  },
2287
+ // Just enough to display portrait mode Vimeo videos and all Vimeo player controls
2288
+ vimeoVideo: {
2289
+ height: responsiveWidth(220),
2290
+ },
2287
2291
  fallback: {
2288
2292
  width: window.width,
2289
2293
  height: 40,