언어 설정

Menu
Sites
Language
Playing Audio File with notificaition

I want to play an audio file when notification is posted and have written below code.

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 are in the same folder with js file. But its not playing that audio. Can anyone help please ?

Responses

1 댓글
AVSukhov

Hello,

Sound path must be in the /opt/usr/media/

Or you may use following directory /opt/apps/{appId}/shared folder, so just use that folder as the path. Hope this info helps.