Languages

Menu
Sites
Language
I have found the problem that causes your app HIGH current

“I have found the problem that causes your app HIGH current.

 

Sound and music should be paused when your app is paused

because the api for sound/music will work even if your app is in background.

 

Actually I don’t know what api to pause sound/music but you would know that.”

 

 

 

 

 

Do you know how stop api sound/music on Gear S2 S3?

Edited by: Kilim A on 04 Apr, 2017
View Selected Answer

Responses

6 Replies
Marco Buettner

How do u play the sound/music in your app?

 

If u use "Audio()"... you can pause-Method

like

var audio = new Audio('mysound.ogg');
audio.play(); // play sound file
audio.pause(); // pause sound file
audio.stop(); // stop sound file

 

Armaan-Ul- Islam

Hello, If you are reffering to this post :

https://developer.tizen.org/forums/web-application-development/refusals-valid-team-sleep-mode-or-not-on-gears2

 

Then it could be related with 'Construct 2', the tool you used to develop the app. Reading this post on scirra forum, from the comment of Ashley we can say Construct 2 is a powerful, well build tool designed to develop games for web browsers. But web browser and Tizen web application may not be exactly same I guess.

https://www.scirra.com/forum/viewtopic.php?f=147&t=188405&p=1105721&hilit=pause+sound+music#p1105721

Kilim A

This is my topic on C2 Forum by shukra

 Here Ashley answer

"Construct 2's Audio plugin specifically suspends and resumes the audio context to save battery life, and it looks like the suspend and resume events are firing correctly.

I'm not sure what kind of browser comes on the Samsung Gear S3, but maybe it doesn't support suspending the audio context? If you check in the browser console on the device if AudioContext.prototype.suspend is available, that would identify the issue. If the browser doesn't support suspending or resuming the audio context, the problem is with the browser, not C2 - C2 will use these to optimise battery life if they are available, but if they're not available there's not much choice other than to leave the context running idle in the background."

Kilim A

This is my topic on C2 Forum by shukra

 Here Ashley answer

"Construct 2's Audio plugin specifically suspends and resumes the audio context to save battery life, and it looks like the suspend and resume events are firing correctly.

I'm not sure what kind of browser comes on the Samsung Gear S3, but maybe it doesn't support suspending the audio context? If you check in the browser console on the device if AudioContext.prototype.suspend is available, that would identify the issue. If the browser doesn't support suspending or resuming the audio context, the problem is with the browser, not C2 - C2 will use these to optimise battery life if they are available, but if they're not available there's not much choice other than to leave the context running idle in the background."

 

So there are the question:

1. what kind of browser comes on the Samsung Gear S3  S2?

2. Is it support the audio context?

3. How  can it be checken with emulator or how? I mean see it in Logs "if you check in the browser console on the device if AudioContext.prototype.suspend is available, that would identify the issue"?

Mark as answer
Armaan-Ul- Islam

You can see Tizen web application architecture here.

https://developer.tizen.org/tizen-architecture

 

How about you come up with no audio from c2, then add audio from tizen end using web audio api like Marco Buettner stated. In such way you would have a chance to pause audio.

 

Tizen Web Audio Guide

https://developer.tizen.org/ko/development/tutorials/web-application/w3chtml5supplementary-features/media/web-audio?langredirect=1

Tizen Web audio API ref

https://developer.tizen.org/ko/development/api-references/web-application?redirect=/dev-guide/2.4/org.tizen.web.apireference/html/w3c_api/w3c_api_m.html&langredirect=1#webaudio

 

Kilim A

Thank you