Open coingenexchange opened 6 years ago
Just loop through the json and add one by one object in it ! `
let resources = []
for (const video of videos) {
let resource = {
sources: [{
src: video.src,
type: 'video/mp4'
}],
poster: ''
}
resources.push(resource)
}
player.playlist(resources)
`
So I have the following code in my videojs project:
I also have a feed which will be populated with several video sources from an external API:
I want to discover how I can populate the player.playlist.sources.src with the arguments from the external json feed. Is there a good way to do this?
Thanks in advance