Skip to content

Instantly share code, notes, and snippets.

@seemcat seemcat/index.html
Last active Sep 14, 2018

Embed
What would you like to do?
// index.js
const getVideos = () => {
fetch("/videoTokens")
.then(res => res.json())
.then(myJson => {
const vidsToDisplay = myJson.reduce((acc, token) => {
acc += `<div class="vid-singles"><ziggeoplayer ziggeo-video="${token}" ziggeo-width=320 ziggeo-height=240 ziggeo-theme="modern" ziggeo-themecolor="red"></ziggeo></div>`;
return acc;
}, '');
const videosElement = document.getElementById('videos');
videosElement.innerHTML = vidsToDisplay;
});
}
getVideos();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.