Take the 2-minute tour ×

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};
  // Test an action
  Unity.addAction('/Reproducir', unityPlayPause);
  // Test a notification

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
share|improve this question

1 Answer 1

up vote 0 down vote accepted

You are being bitten by lp:1031933. Remove the space from your name: parameter in the Unity.init call, and everything should fall right into place. This is on my TODO. Our bug fixing phase will be starting very soon, if I don't get to it before then.

share|improve this answer
Thank you Alex, that solved my problem. Everything seems to be working now. Keep up the good work! :) –  Jorge Suárez de Lis Aug 13 '12 at 15:34
subscribe to that bug so you can be notified when it's fixed –  Alex Launi Aug 13 '12 at 15:38
Thank you, I've just done it :) –  Jorge Suárez de Lis Aug 13 '12 at 16:01

Your Answer


