1
$(document).ready(function() {
2
var apiUrl = "/list/videos?listId=" + listId;
3
callPadma(apiUrl, initList);
6
var padmaVideo = function(json, index) {
9
this.title = json.title;
10
this.poster = "http://pad.ma/" + this.id + "/poster.jpg";
11
this.wrapperHtml = this.getWrapperHtml()
15
padmaVideo.prototype.getWrapperHtml = function() {
17
var videoElem = $('<div />');
18
videoElem.attr('id', that.id);
19
videoElem.addClass("videoWrapper");
21
html += "<div class='videoTitle'>";
24
html += "<div class='videoPoster'>";
25
html += "<img src='" + this.poster + "' />";
27
html += "<div class='videoMeta'>";
34
padmaVideo.prototype.init = function() {
36
$('#videos').append(that.wrapperHtml);
40
padmaVideo.prototype.metaLoaded = function() {
42
$('#' + that.id + ' .videoMeta').html(that.meta.description_html);
45
padmaVideo.prototype.layersLoaded = function() {
49
padmaVideo.prototype.loadData = function() {
51
var metaUrl = "http://pad.ma/" + that.id + "/video.js";
52
$.getScript(metaUrl, function() {
55
var layersUrl = "http://pad.ma/" + that.id + "/layers.js";
56
$.getScript(layersUrl, function() {
64
function initList(json) {
65
var videos = json.videos;
67
var thisVideo = new padmaVideo(videos[v], v);
68
padmaVideos.push(thisVideo);