UNPKG

react-video

Version:

React component to load video from Vimeo or Youtube across any device

105 lines (104 loc) 1.83 kB
/* * React Video - React component to load video from Vimeo or Youtube across any device * @version v1.5.3 * @link https://github.com/pedronauck/react-video * @license MIT * @author Pedro Nauck (https://github.com/pedronauck) */ .video-image, .video-image:after, .video-embed { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } .video { position: relative; padding-bottom: 56.25%; background: #e2e2e2; } .video iframe { border: 0; } .video-image { background-position: center center; background-size: 100% auto; } .video-image:after { z-index: 1; display: block; content: ''; background: rgba(0,0,0,0.3); } .video-play-button, .video-loading { top: 50%; left: 50%; transform: translateX(-50%) translateY(-50%); } .video-play-button { z-index: 2; position: absolute; padding: 0; width: 70px; border: 0; background: none; } .video-play-button:focus { outline: none; } .video-play-button svg { fill: #fff; -webkit-filter: drop-shadow(0 1px 1px rgba(0,0,0,0.8)); filter: drop-shadow(0 1px 1px rgba(0,0,0,0.8)); } .video-loading { z-index: 4; position: absolute; width: 32px; height: 32px; } .video-loading svg { fill: #000; transform-origin: 50% 50%; -webkit-animation: spinner 0.8s infinite linear; animation: spinner 0.8s infinite linear; } .video-embed iframe { width: 100%; height: 100%; } @-moz-keyframes spinner { from { transform: rotate(0deg); } to { transform: rotate(360deg); } } @-webkit-keyframes spinner { from { transform: rotate(0deg); } to { transform: rotate(360deg); } } @-o-keyframes spinner { from { transform: rotate(0deg); } to { transform: rotate(360deg); } } @keyframes spinner { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }