How can I get a list of all videos from the browser?
For security reasons, the index operation is not enabled by default in the browser. You should rather use the server-side SDK to perform the index operation.
That being said, it is possible to enable the index operation in the browser for testing purposes. First, go to your application settings in the dashboard and check the box to allow the index operation on the client-side.
You can now perform the index operation by a simple asynchronous JavaScript call as follows:
[code language="javascript"]
ZiggeoApi.Videos.index({}, {
success: function (args, videos) {
// videos is an array of all the videos
// the following code dynamically adds all the videos to the page
for (var i = 0; i < videos.length; ++i) {
$("body").append("<ziggeo ziggeo-video='" + videos[i].token + "'></ziggeo>");
}
}
});
[/code]