Languages

Menu
Sites
Language
Tizen Web App Custom Sound

In the tizen web app for wearable (Tizen 3.0) i want to play a custom sound for a notification, the html source code is :

 <div class="ui-content content-padding-timer" >
    <audio id="myaudio" src="sound/ding.mp3"></audio>
    <div id="wk-timer">0</div>
    <div id="cc-timer">cycles: 0</div>
</div> 

and the js part to trigger it :

 var ding = document.querySelector('#myaudio');
 ding.pause();
 ding.load();
 ding.play();

This works perfectly in the emulator but when i try it on a actual device (Gear S3) the app crashes and exists with no real error.

I really appreciate any tips since i've been struggling with this for some time.

Responses

6 Replies
Maciej

Try this way, dynamically creating the Audio element:

 

        sound = new Audio("sound/ding.mp3");
    	sound.loop = false;
    	sound.volume = 1.0;
        // play the sound
        sound.play();

 

Stefan Stere

Ty for the suggestion, i've tried it (the big difference is that now the sound is loaded via js instead of html) and it has the same behaviour : on the emulator it works but on the device it doesn't the app just exists with no error whatsoever (in debug mode)

André Reus

The problem is may be on Tizen 3.0
If you have device, you can have a try on Tizen 2.3.2 devices... hope it will work. 

Stefan Stere

The only device i have is my watch : Gear S3 with Tizen 3.0 and even if it works in 2.3.2 devices it defeats the porpose :D

André Reus

I think it is bug in Tizen 3.0 

And as it is already reported in bug system...hope it will be solved soon https://bugs.tizen.org/browse/TW-66

Stefan Stere

It's funny because that bug report it's made by me :)) at least i think it is a bug... it may not... will see. Ty for the reply thou