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
16
gaia/dev_apps/music-oga/test/marionette/fakecontrols/index.html
Executable file
16
gaia/dev_apps/music-oga/test/marionette/fakecontrols/index.html
Executable file
|
|
@ -0,0 +1,16 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Fake Remote Controls</title>
|
||||
<script defer src="/js/fakecontrols.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="controls">
|
||||
<button id="playpause">Play/Pause</button>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
38
gaia/dev_apps/music-oga/test/marionette/fakecontrols/js/fakecontrols.js
Executable file
38
gaia/dev_apps/music-oga/test/marionette/fakecontrols/js/fakecontrols.js
Executable file
|
|
@ -0,0 +1,38 @@
|
|||
/* exported controls */
|
||||
'use strict';
|
||||
|
||||
function RemoteControls() {
|
||||
this.controls = document.getElementById('controls');
|
||||
this.controls.addEventListener('click', this);
|
||||
|
||||
this.playPauseButton = document.getElementById('playpause');
|
||||
|
||||
window.navigator.mozSetMessageHandler('connection', function(request) {
|
||||
if (request.keyword !== 'mediacomms') {
|
||||
return;
|
||||
}
|
||||
|
||||
this.port = request.port;
|
||||
}.bind(this));
|
||||
}
|
||||
|
||||
RemoteControls.prototype = {
|
||||
handleEvent: function(event) {
|
||||
if (!this.port) {
|
||||
return;
|
||||
}
|
||||
|
||||
var command = null;
|
||||
switch (event.target) {
|
||||
case this.playPauseButton:
|
||||
command = 'playpause';
|
||||
break;
|
||||
}
|
||||
|
||||
if (command) {
|
||||
this.port.postMessage({command: command});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var controls = new RemoteControls();
|
||||
16
gaia/dev_apps/music-oga/test/marionette/fakecontrols/manifest.webapp
Executable file
16
gaia/dev_apps/music-oga/test/marionette/fakecontrols/manifest.webapp
Executable file
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"name": "Fake Remote Controls",
|
||||
"description": "A fake remote controls app",
|
||||
"type": "certified",
|
||||
"launch_path": "/index.html",
|
||||
"developer": {
|
||||
"name": "The Gaia Team",
|
||||
"url": "https://github.com/mozilla-b2g/gaia"
|
||||
},
|
||||
"connections": {
|
||||
"mediacomms": {
|
||||
"description": "Communication with media apps for now playing info",
|
||||
"rules": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue