Hi,
I am trying to make basic app with background music(mp3 file).
But it is not working. My team members are facing huge difficulties because there is no example for how to use the luna service in javascript in WebOS ose develop page.
Below is my source code.
<script src="webOSjs-0.1.0/webOS.js" charset="utf-8"></script>
<script type="text/javascript">
var lunaReq= webOS.service.request("luna://com.webos.media",
{
method:"load",
parameters:{
uri: 'music.mp3',
type : 'media'
},
onSuccess: function (returnValue, mediaId) {
playalarm(mediaId);
},
onFailure: function (args) {
}
});
var playalarm = function(mediaId) {
webOS.service.request("luna://com.webos.media", {
method:"play",
parameters:{
media : mediaId
},
onSuccess: function (returnValue, mediaId) {
console.log(mediaId);
},
onFailure: function (args) {
}
})};
</script>
Many thanks in advance