在 Tizen 应用程序中,我想在发布通知时播放音频文件,并且我编写了以下代码。
function postNotification()
{
try {
var iconPath=tizen.application.getCurrentApplication().appInfo.iconPath;
var myappInfo = tizen.application.getAppInfo();
var myAudio = document.getElementById('myAudio');
var notificationDict = {
content : "Alarm Playing",
iconPath : iconPath,
soundPath : "ab.mp3",
vibration : true,
thumbnails : "icon.png",
ledColor : "#FFFF00",
ledOnPeriod: 10000,
ledOffPeriod : 5000 ,
appId : myappInfo.id };
var myNotification = new tizen.StatusNotification("SIMPLE", "Simple notification", notificationDict);
tizen.notification.post(myNotification);
} catch (err) {
alert(err.name + ": " + err.message);
}
}
文件 ab.mp3 与 js 文件位于同一文件夹中。但它没有播放该音频。任何人都可以帮忙吗?