I'm following the API documentation at http://developer.ubuntu.com/api/ubuntu-12.04/javascript/
My code, very simplistic:
var Unity = external.getUnityObject(1,0);
Unity.init({name: "Radio Battletoads",
iconUrl: "http://new.radiobattletoads.com/images/icon.png",
onInit: setupMediaPlayer
});
function unityPlayPause(){
// TODO
}
function setupMediaPlayer() {
// Test the Media Player
Unity.MediaPlayer.init("Radio Battletoads");
var trackInfo = {title: "Todo",
album: null,
artist: null,
artLocation: null};
Unity.MediaPlayer.setTrack(trackInfo);
// Test an action
Unity.addAction('/Reproducir', unityPlayPause);
// Test a notification
Unity.Notification.showNotification("Test","Test",null);
}
The notification is shown, but neither the media player nor the action are working. I've taken a look at the bundled userscripts and I can't see any remarkable difference from my code.
Has somebody experienced this?
Installed version:
$ dpkg -l | grep unity-webapps
ii libunity-webapps-chromium 1.9-0precise2 Unity WebApp extension for chromium/chrome browser
ii libunity-webapps0 1.9.1-0precise2 Web Apps integration with the Unity desktop
ii unity-webapps 1.9-0precise2 Unity WebApp integration scripts
ii unity-webapps-preview 2.1 Unity Webapps Preview metapackage
ii unity-webapps-service 1.9.1-0precise2 Service for Web Apps integration with the Unity desktop