diff --git a/media/test.html b/media/test.html new file mode 100644 index 0000000..5dcd978 --- /dev/null +++ b/media/test.html @@ -0,0 +1,12 @@ + + + + + + + + +
+
+ + diff --git a/media/test.js b/media/test.js new file mode 100644 index 0000000..bee0597 --- /dev/null +++ b/media/test.js @@ -0,0 +1,105 @@ +//http://127.0.0.1:2620/media/test.html +$(function(){ + backend= { + base:'/', + profile: '96p.webm', + request: function(func, data, callback) { + $.getJSON(this.base+func, data, callback); + }, + extractStills: function(oshash, callback) { + this.request('extract', {'oshash': oshash, 'media': 'stills'}, callback); + }, + extractVideo: function(oshash, callback) { + this.request('extract', {'oshash': oshash, 'media': this.profile}, callback); + }, + info: function(oshash, callback) { + this.request('get', {'oshash': oshash}, callback); + }, + }; + + function addStill(parent, oshash) { + backend.request('get', {'oshash':oshash}, function(result) { + //console.log(result); + if(result.stills.length>0) { + $(parent).append(''); + } else { + backend.request('extract', {'oshash':oshash, 'media': 'stills'}, function(result) { + setTimeout(function () { + addStill(parent, oshash); + }, 25000); + }); + } + }); + } + function addVideo(parent, oshash) { + backend.request('get', {'oshash':oshash}, function(result) { + console.log(result); + if(result.video.length>0) { + $(parent).append('