VulpesOS/gaia/dev_apps/uitest/js/API/pickvideo.js
OverSu b38dea0597 Publish Vulpes Preview 15 sources for desktop, Android and Tundra
Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
2026-09-30 23:13:03 +02:00

18 lines
714 B
JavaScript
Executable file

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/*'); };