Sample Blog Post
Let us take you on a tour of the codes and things you should do to show the wall of videos in your style and on your pages.
At the end of the tour you will:
- Know how easy it is to do,
- How quickly you can have it on your website
- And have a chance to see how it looks as well.
<link rel="stylesheet" href="https://assets.ziggeo.com/v2-stable/ziggeo.css" />
<script src="https://assets.ziggeo.com/v2-stable/ziggeo.js"></script>
<script>
var ziggeo_app = new ZiggeoApi.V2.Application({
token:"APPLICATION_TOKEN",
webrtc_streaming_if_necessary: true,
webrtc_on_mobile: true
});
</script>
All you would do here, is change the APPLICATION_TOKEN part with your actual application token.
- To configure it how you want, you can check out our JavaScript header page. Click few buttons and copy your code.
var response = ziggeo_app.videos.index({limit: 50, tags: 'homepage'});
response.success( function (data) {
for(i = 0; i < data.length; i++) {
//We create a placeholder (1 for each player)
var player_placeholder = document.createElement('div');
//Makes multiple placeholders go into single row
player_placeholder.style.display = 'inline-block';
//We add our code to the wall.
document.getElementById('ourwall').appendChild(player_placeholder);
var player = new ZiggeoApi.V2.Player({
element: player_placeholder,
attrs: {
width: "30%",
theme: "modern",
themecolor: "red",
video: data[i].token
}
});
player.activate();
}
});
That is it really. Once you get to this point you are done. Now just how simple was that.
Check it out how it looks bellow. First, here is the entire code, from top to bottom to make it easy to copy and paste to your website. All you need is to change your APPLICATION_TOKEN as per above.
You would also likely change the “homepage” to your own video tag.
<link rel="stylesheet" href="https://assets.ziggeo.com/v2-stable/ziggeo.css" />
<script src="https://assets.ziggeo.com/v2-stable/ziggeo.js"></script>
<script>
var ziggeo_app = new ZiggeoApi.V2.Application({
token:"APPLICATION_TOKEN",
webrtc_streaming_if_necessary: true,
webrtc_on_mobile: true
});
</script>
<div id="ourwall"></div>
<script>
function createWallOfVIdeos() {
var response = ziggeo_app.videos.index({limit: 50, tags: 'homepage'});
response.success( function (data) {
for(i = 0; i < data.length; i++) {
//We create a placeholder (1 for each player)
var player_placeholder = document.createElement('div');
//Makes multiple placeholders go into single row
player_placeholder.style.display = 'inline-block';
//We add our code to the wall.
document.getElementById('ourwall').appendChild(player_placeholder);
var player = new ZiggeoApi.V2.Player({
element: player_placeholder,
attrs: {
width: "30%",
theme: "modern",
themecolor: "red",
video: data[i].token
}
});
player.activate();
}
});
}
//To allow us to work in many different scenarios we move the code into this segment.
ziggeo_app.on("ready", function() {
createWallOfVIdeos();
});
</script>
Copy -> Paste -> Enjoy. It is that simple with Ziggeo. Remember to check it out bellow as well.
Bonus:
Can I do it without any code? Quite likely, just check out our integrations page to see if we already support it.
See all replies · Leave a reply