3

I am doing a podcast manager application for Firefox OS. So far I managed to download files and save them on the sdcard. For playback I am using MozActivity because I want the file to be played in an installed music player.

Here is the code for playback:

var activity = new MozActivity({

    name: "open",

    data: {
      type: [
        "audio/mpeg",
        "audio/ogg",
        "audio/mp4"
      ],
      // here I pass the file blob
      blob: data
    }
  });

The problem is that when I put the app in background to open another one, the playback stops and the music player is closed.

Another thing I would like to do, is when I play again a file that I did not finished listening, to resume the playback from the minute I left it.

Adrian
  • 1,006
  • 2
  • 9
  • 20

1 Answers1

0

The solution was to add this in the manifest file

"permissions": {
    "audio-channel-content": {
      "description": "Required to play audio in the background."
    }
}
Adrian
  • 1,006
  • 2
  • 9
  • 20