@quintype/native-components 2.20.1 → 2.20.2

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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [2.20.2](https://github.com/quintype/native-components/compare/v2.20.1...v2.20.2) (2023-01-23)
6
+
5
7
  ### [2.20.1](https://github.com/quintype/native-components/compare/v2.20.0...v2.20.1) (2023-01-12)
6
8
 
7
9
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quintype/native-components",
3
- "version": "2.20.1",
3
+ "version": "2.20.2",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -2,17 +2,12 @@ import PropTypes from "prop-types";
2
2
  import React from "react";
3
3
  import { View, Dimensions } from "react-native";
4
4
  import { WebView } from "react-native-webview";
5
- import { getYoutubeVideoID } from "../../utils";
6
5
 
7
6
  export const YouTubePlayer = ({ card = {} }) => {
8
- const ytURL = card.url;
9
- if (!ytURL) return null;
7
+ const ytEmbedURL = card['embed-url'];
8
+ if (!ytEmbedURL) return null;
10
9
 
11
10
  const windowWidth = Dimensions.get("window").width;
12
-
13
- const ytVideoID = getYoutubeVideoID(ytURL);
14
- const ytEmbedURL = `https://www.youtube.com/embed/${ytVideoID}`;
15
-
16
11
  const styles = webviewStyles(windowWidth);
17
12
 
18
13
  return (
@@ -1,12 +1,3 @@
1
1
  export function stripHTML(text) {
2
2
  return text?.replace(/<[^>]*>?/gm, '');
3
3
  }
4
-
5
- export function getYoutubeVideoID(url) {
6
- const regExp = /^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/;
7
- const match = url.match(regExp);
8
-
9
- return (match && match[2].length === 11)
10
- ? match[2]
11
- : null;
12
- }