Last active
September 14, 2018 18:16
-
-
Save seemcat/60819bca28ac3ad6c1af9eee44c37f88 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
// 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