Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
18 lines
714 B
JavaScript
18 lines
714 B
JavaScript
function pick(type, nocrop, width, height) {
|
|
var data = {type: type};
|
|
if (nocrop) data.nocrop = true;
|
|
if (width) data.width = width;
|
|
if (height) data.height = height;
|
|
var a = new MozActivity({ name: 'pick', data: data});
|
|
a.onsuccess = function(e) {
|
|
console.log('got blob of type', a.result.blob.type);
|
|
var url = URL.createObjectURL(a.result.blob);
|
|
var img = document.getElementById('result');
|
|
img.src = url;
|
|
img.onload = function() { URL.revokeObjectURL(url); };
|
|
};
|
|
a.onerror = function() { alert('Failure picking video'); };
|
|
}
|
|
|
|
document.getElementById('b1').onclick = function() { pick('video/3gpp'); };
|
|
document.getElementById('b2').onclick = function() { pick('video/*'); };
|