# react-tube-embed

> ReactJS library for embed Tube video's in your React application.

Latest version **1.1.3** (published 2017-08-09) · ISC license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install react-tube-embed
pnpm add react-tube-embed
yarn add react-tube-embed
bun add react-tube-embed
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.1.3 |
| Published | 2017-08-09 |
| First published | 2017-08-07 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Jeffrey Lanters |
| Maintainers | jefflanters |

## Links

- npm: https://www.npmjs.com/package/react-tube-embed
- Repository: https://github.com/jeffreylanters/react-tube-embed
- Homepage: https://github.com/jeffreylanters/react-tube-embed#readme
- Issues: https://github.com/jeffreylanters/react-tube-embed/issues
- npm.io page: https://npm.io/package/react-tube-embed

## Dependencies (2)

- [react](https://npm.io/package/react.md) 15.4.2
- [react-dom](https://npm.io/package/react-dom.md) 15.4.2

## Recent versions

- 1.1.3 (latest) — 2017-08-09
- 1.1.0 — 2017-08-09
- 1.0.5 — 2017-08-09
- 1.0.4 — 2017-08-09
- 1.0.3 — 2017-08-07
- 1.0.2 — 2017-08-07
- 1.0.1 — 2017-08-07
- 1.0.0 — 2017-08-07

## README

# React Tube Embed

ReactJS library for embed Tube video's in your React application.

## Usage

Load media directly into your ReactJS application by using the `TubeEmbed` tag. Pass an URL or text with an url in it (or not, I won't mind) in the `src` prop. The rest will be handled by the component. See the examples below for more details and other usefull functions.

An div will be return with the class `tube-embed`. You can still use the `className` and `style` prop for adding custom styling. Within the div will be the embedding media, in most cases this will be an iframe depending on the media source. Some sources such as Giphy this will be an img tag. Styling has to be done by yourself.

## Supported tubes

- Youtube
- Vimeo
- Dailymotion
- Spotify
- Giphy

Feel free to request more tubes.

### ES6 Examples 

Embedding ...

```jsx
import TubeEmbed from 'react-tube-embed';
...
<TubeEmbed src="https://www.youtube.com/watch?v=lmc21V-zBq0" />
<TubeEmbed src="https://youtu.be/lmc21V-zBq0" />
<TubeEmbed src="Check this, https://youtu.be/lmc21V-zBq0 :D!" />
<TubeEmbed src="https://vimeo.com/42615527" />
<TubeEmbed src="Hello World, I will be ignored!" />
<TubeEmbed src="http://www.dailymotion.com/video/x11jxof" />
<TubeEmbed src="https://giphy.com/gifs/happy-smile-P8MxmGnjmytws/" />
<TubeEmbed src="Some good jams https://open.spotify.com/user/spotify/playlist/37i9dQZF1DWWrJKwf0q9nn" />
```

Other functions ...

```jsx
import TubeEmbed, { 
    stripURL, 
    stripText, 
    hasURL, 
    parseMediaURL 
} from 'react-tube-embed';
...
let text = "Check this video! https://www.youtube.com/watch?v=lmc21V-zBq0 It's awesome!";
let textWithoutURL = stripURL (text);
let urlWithoutText = stripText (text);
let textHasValidURL = hasURL (text);
let mediaData = parseMediaURL (text);
```

---
_Source: https://npm.io/package/react-tube-embed · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
