我有一个应用程序将播放用HTML / JS for Windows 8编写的互联网mp3流。
即使应用程序在后台,我希望它继续播放音频,但是,它仍然不起作用。
我试过以下
mediaControl = Windows.Media.MediaControl;
// Add event listeners for PBM notifications to illustrate app is
// getting a new SoundLevel and pass the audio tag along to the function
mediaControl.addEventListener("soundlevelchanged", $scope.soundLevelChanged, false);
// Add event listeners for the mandatory media commands.
// These are necessary to play streams of type 'backgroundCapableMedia'
mediaControl.addEventListener("playpausetogglepressed", $scope.playpause, false);
mediaControl.addEventListener("playpressed", $scope.play, false);
mediaControl.addEventListener("stoppressed", $scope.stop, false);
mediaControl.addEventListener("pausepressed", $scope.pause, false);
我似乎无法弄清楚我错过了什么。