react-media-player
react-media-player copied to clipboard
Publish as JavaScript module
Please include .mjs build so we can use it from unpkg with ?module suffix.
Example code with this module:
<script type="module">
// Import things
import htm from 'https://unpkg.com/htm?module'
import { React, ReactDOM } from 'https://unpkg.com/es-react-production'
import { Media, Player, controls } from 'https://unpkg.com/react-media-player?module'
const html = htm.bind(React.createElement)
const { Component } = React
const { render } = ReactDOM
class MediaPlayer extends Component {
render() {
return (
html`<${Media}>
<div className="media">
<div className="media-player">
<${Player} src="http://www.youtube.com/embed/h3YVKTxTOgU" />
</div>
<div className="media-controls">
<${PlayPause} />
<${MuteUnmute} />
</div>
</div>
</Media>`
)
}
}
render(html`<${MediaPlayer} />`, document.getElementById('root'))
</script>
If this is will may take a long time, I can send a PR.
Yes, if you can add a PR that would be greatly appreciated! 🙏
@souporserious ok, will do soon