Spotlightr Default Code

Simple React Hooks example. A timer that pauses when you hold the mouse button. Creates and uses a custom Hook.

by petarsubotic

HTML

<div id="app"></div>

CSS

.timer {
  padding: 20px;
  font-size: 40px;
}

React

function EmbedVideo () {
const playerId='MTM0NDUzMA==';
const videoHost= 'https://videos.cdn.spotlightr.com/';
const iframeSrc = videoHost+"watch/"+ playerId;
const iframeSrcFallback = videoHost+"watch/"+ playerId + "?fallback=true";

return (
  <div style={{position:'relative', width:'1px', minWidth:'100%', paddingBottom:'56.25%'}}><iframe allow="autoplay" class='spotlightr' allowtransparency="true" style={{width:'1px', minWidth:'100%', height: '100%', position:'absolute'}} allowfullscreen="true" src={iframeSrcFallback} frameborder="0" scrolling="no" name="videoPlayer"> </iframe></div>
    )
}

ReactDOM.render(<EmbedVideo />, document.querySelector("#app"))