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.
This commit is contained in:
parent
93e3a48004
commit
b38dea0597
25901 changed files with 9982925 additions and 369 deletions
49
assets/webapps/uitest.gaiamobile.org/js/API/openvideo.js
Normal file
49
assets/webapps/uitest.gaiamobile.org/js/API/openvideo.js
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
var open = document.getElementById('open');
|
||||
var opensave = document.getElementById('opensave');
|
||||
open.hidden = true;
|
||||
opensave.hidden = true;
|
||||
|
||||
open.onclick = function() {
|
||||
var a = new MozActivity({
|
||||
name: 'open',
|
||||
data: {
|
||||
type: 'video/3gpp',
|
||||
blob: videoblob,
|
||||
title: 'Stapler'
|
||||
}
|
||||
});
|
||||
a.onsuccess = function() {
|
||||
console.log('activity returns', JSON.stringify(a.result));
|
||||
};
|
||||
};
|
||||
|
||||
opensave.onclick = function() {
|
||||
var a = new MozActivity({
|
||||
name: 'open',
|
||||
data: {
|
||||
type: 'video/3gpp',
|
||||
blob: videoblob,
|
||||
allowSave: true,
|
||||
filename: 'downloads/uitest/stapler.3gp'
|
||||
}
|
||||
});
|
||||
a.onsuccess = function() {
|
||||
console.log('activity returns', JSON.stringify(a.result));
|
||||
};
|
||||
};
|
||||
|
||||
// The image we want to view
|
||||
var videoblob;
|
||||
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open('GET', '../../data/video/stapler.3gp');
|
||||
xhr.responseType = 'blob';
|
||||
xhr.send();
|
||||
xhr.onload = function() {
|
||||
videoblob = new Blob([xhr.response], { type: 'video/3gpp' });
|
||||
open.hidden = false;
|
||||
opensave.hidden = false;
|
||||
};
|
||||
xhr.onerror = function() {
|
||||
console.log('Error loading test video', xhr.error.name);
|
||||
};
|
||||
Loading…
Reference in a new issue