Last active
December 9, 2019 10:08
-
-
Save bllmo/058d78c64033c911229be52a0d398eb8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Block } from "jsxstyle/preact"; | |
const Video = props => { | |
var isDevelopment = | |
location.hostname === "localhost" || location.hostname === "127.0.0.1"; | |
var params = window.adsbybeintoo.params; | |
var src = props.src; | |
if (!isDevelopment && params) { | |
var filename = /([\w-]+\.mp4)/.exec(src)[1]; | |
src = | |
"https://s3.eu-west-3.amazonaws.com/fast.beintoo.net/static/" + | |
params.ad_id + | |
"/" + | |
filename; | |
} | |
return ( | |
<Block | |
component="video" | |
top={props.top} | |
bottom={props.bottom} | |
props={{ | |
src: src, | |
autoplay: true, | |
muted: true, | |
playsinline: true, | |
loop: true | |
}} | |
width="100%" | |
position="absolute" | |
/> | |
); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment