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
30
gaia/apps/music/test/marionette/fakeringtones/index.html
Executable file
30
gaia/apps/music/test/marionette/fakeringtones/index.html
Executable file
|
|
@ -0,0 +1,30 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Fake Ringtones</title>
|
||||
|
||||
<style>
|
||||
html, body {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
#player {
|
||||
position: absolute;
|
||||
top: 10%;
|
||||
left: 10%;
|
||||
width: 80%;
|
||||
height: 80%;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script defer src="/js/fakeringtones.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<audio id="player" controls autoplay></audio>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
41
gaia/apps/music/test/marionette/fakeringtones/js/fakeringtones.js
Executable file
41
gaia/apps/music/test/marionette/fakeringtones/js/fakeringtones.js
Executable file
|
|
@ -0,0 +1,41 @@
|
|||
'use strict';
|
||||
|
||||
var FakeRingtones = {
|
||||
get player() {
|
||||
return document.getElementById('player');
|
||||
},
|
||||
|
||||
init: function() {
|
||||
this.loadMediaSample(function(file) {
|
||||
this.setSource(file);
|
||||
this.play();
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
loadMediaSample: function(callback) {
|
||||
var songs = navigator.getDeviceStorage('music');
|
||||
|
||||
var cursor = songs.enumerate();
|
||||
|
||||
cursor.onsuccess = function(event) {
|
||||
var file = event.target.result;
|
||||
callback(file);
|
||||
};
|
||||
|
||||
cursor.onerror = function(event) {
|
||||
console.warn('No file found: ' + event.target.error);
|
||||
};
|
||||
},
|
||||
|
||||
setSource: function(file) {
|
||||
var url = window.URL.createObjectURL(file);
|
||||
this.player.mozAudioChannelType = 'ringer';
|
||||
this.player.src = url;
|
||||
},
|
||||
|
||||
play: function() {
|
||||
this.player.play();
|
||||
}
|
||||
};
|
||||
|
||||
FakeRingtones.init();
|
||||
14
gaia/apps/music/test/marionette/fakeringtones/manifest.webapp
Executable file
14
gaia/apps/music/test/marionette/fakeringtones/manifest.webapp
Executable file
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"name": "Fake Ringtones",
|
||||
"description": "A fake ringtones app",
|
||||
"type": "certified",
|
||||
"launch_path": "/index.html",
|
||||
"developer": {
|
||||
"name": "The Gaia Team",
|
||||
"url": "https://github.com/mozilla-b2g/gaia"
|
||||
},
|
||||
"permissions": {
|
||||
"device-storage:music":{ "access": "readwrite" },
|
||||
"audio-channel-ringer":{}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue