Skip to content

Instantly share code, notes, and snippets.

@bllmo
Last active December 9, 2019 10:08
Show Gist options
  • Save bllmo/058d78c64033c911229be52a0d398eb8 to your computer and use it in GitHub Desktop.
Save bllmo/058d78c64033c911229be52a0d398eb8 to your computer and use it in GitHub Desktop.
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