Skip to content

Commit

Permalink
feat(video): add Vimeo support
Browse files Browse the repository at this point in the history
  • Loading branch information
CharlesMangwa committed Oct 15, 2016
1 parent f0603d3 commit d5d06b7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const MyAwesomeApp = () => {
return (
<Markdown styles={styles}>
#Markdown in react-native is so cool!

You can **emphasize** what you want, or just _suggest it_ 😏…

You can even [link your website](http://charlesmangwa.surge.sh) or if you prefer: [email sombedy](mailto:email@somebody.com)
Expand All @@ -35,7 +35,9 @@ const MyAwesomeApp = () => {

And even add a cool video 😎!

[![A cool video](https://img.youtube.com/vi/dQw4w9WgXcQ/0.jpg)](http://www.youtube.com/watch?v=dQw4w9WgXcQ)
[![A cool video from YT](https://img.youtube.com/vi/dQw4w9WgXcQ/0.jpg)](http://www.youtube.com/watch?v=dQw4w9WgXcQ)

[![Another one from Vimeo](https://i.vimeocdn.com/video/399486266_640.jpg)](https://vimeo.com/57580368)
</Markdown>
)
}
Expand Down Expand Up @@ -102,7 +104,7 @@ Example:
- `text` (`<Text>`) - Inherited by all text based elements
- `u` (`<View>`)
- `url` (`<Text>`)
- `video` (`<Image>`)
- `video` (`<Image>`) - Supports Youtube & Vimeo
- `view` (`<View>`) - This is the `View` container where the Markdown is render.
### WIP
Expand All @@ -112,7 +114,6 @@ _Most of these elements can be used, but I'm still working on some improvements.
- `autolink` (`<Text>`)
- `blockQuote` (`<Text>`)
- `codeBlock` (`<View>`)
- `video` (`<Image>`) - Only supports YouTube video. Vimeo is coming soon!
## Credits
Expand Down
2 changes: 1 addition & 1 deletion rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export default (styles) => ({
key: state.key,
resizeMode: styles.resizeMode ? styles.resizeMode : 'contain',
source: { uri: node.target },
style: node.target.match(/youtu/) ? styles.video : styles.image
style: node.target.match(/youtu|vimeo/) ? styles.video : styles.image
})
}
},
Expand Down

0 comments on commit d5d06b7

Please sign in to comment.