Languages

Menu
Sites
Language
gear s2 screen timeout duration in play video

hey,

normally when i play a video, screen auto timeout is off and screen is always on, now how i can set default device setting duration play a video like as screentimeout or wakeup gesture?

anyone can help me ?

 

Edited by: aMir Sirati on 03 Apr, 2016
View Selected Answer

Responses

4 Replies
daniel kim

Hi,

It seems that application has no able to access such kind of platform value.

but I think that you can try these kind of power Apis to achieve your requirement. 

     tizen.power.request("SCREEN", "SCREEN_OFF");

     tizen.power.turnScreenOff();

Regards

AVSukhov

Hello,

As i know, SCREEN_OFF state cannot be requested and turnScreenOff() is deprecated from 2.4

I recommend to use setScreenStateChangeListener to verify how to change the screen state when playing video. I think that screen state is released automatically after video stops.

or I do not fully understand your requirements.

aMir Sirati

finally i write a timeout function to stop video and turn auto screen off and write accelerationIncludingGravity function for turn screen of with gesture :

if (e.accelerationIncludingGravity.y < -5 ) {
            videocontainer.pause();
            tizen.power.turnScreenOff();
     } else {
        
         if (e.accelerationIncludingGravity.x > 7 ) {
                videocontainer.pause();
                tizen.power.turnScreenOff();
         } else {
             
             if (e.accelerationIncludingGravity.x < -7 ) {
                    videocontainer.pause();
                    tizen.power.turnScreenOff();
             } else {
                    videocontainer.play();
            }
        }
    }

 

 

 

Mark as answer
Nafisul Islam Kiron

Hello aMir Sirati, you can use

system_settings_get_value_string(SYSTEM_SETTINGS_KEY_SCREEN_BACKLIGHT_TIME, char **value); 

OR

system_settings_get_value_int(SYSTEM_SETTINGS_KEY_SCREEN_BACKLIGHT_TIME, int **value); 

 

to get the display time out time. Then you can adjust your timer according to it.

 

You can find more details about settings api here:

https://developer.tizen.org/dev-guide/2.3.1/org.tizen.native.mobile.apireference/group__CAPI__SYSTEM__SYSTEM__SETTINGS__MODULE.html