react-media-player icon indicating copy to clipboard operation
react-media-player copied to clipboard

Publish as JavaScript module

Open v1rtl opened this issue 6 years ago • 2 comments

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.

v1rtl avatar Jun 15 '19 10:06 v1rtl

Yes, if you can add a PR that would be greatly appreciated! 🙏

souporserious avatar Jun 15 '19 14:06 souporserious

@souporserious ok, will do soon

v1rtl avatar Jun 15 '19 14:06 v1rtl