Skip to content

Instantly share code, notes, and snippets.

@seemcat
Last active September 14, 2018 18:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seemcat/60819bca28ac3ad6c1af9eee44c37f88 to your computer and use it in GitHub Desktop.
Save seemcat/60819bca28ac3ad6c1af9eee44c37f88 to your computer and use it in GitHub Desktop.
// 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