Published
Edited
Aug 12, 2020
1 fork
Importers
8 stars
Insert cell
Insert cell
twitch("687064601")
Insert cell
Insert cell
twitch("687064601", {
time: "0h0m20s",
width: 400,
autoplay: true,
muted: true,
visibility
})
Insert cell
twitch = async function(video, options = {}) {
let w = options.width || (options.height * 16) / 9 || document.body.clientWidth;
let height = options.height || (w * 9) / 16;
let time = options.time || "0h20m0s";
let autoplay = options.autoplay || false;
let muted = options.muted || false;

if (options.visibility)
await options.visibility();
return html`<iframe
src="https://player.twitch.tv/?video=${video}&parent=observablehq.com&parent=${window.location.host}&time=${time}&autoplay=${autoplay}&muted=${muted}"
height="${height}"
width="${w}"
frameborder="<frameborder>"
scrolling="<scrolling>"
allowfullscreen="<allowfullscreen>">
</iframe>`;
}
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more