Hi,
Code snippets reference :
http://chandan-tech.blogspot.in/2010/10/handling-screen-lock-unlock-in-android.html
Step1:
Currently you have to extend the auto generated activity (created under src/<packagename>/Applicationname.java )and add the
private BroadcastReceiver mReceiver;//Add this deceleration in onCreate of extended activity.
//add the below lines of code in to your onCreate() method,
//soon after calling super method.[i.e super.onCreate()]
IntentFilter filter = new IntentFilter(Intent.ACTION_SCREEN_ON);
filter.addAction(Intent.ACTION_SCREEN_OFF);
filter.addAction(Intent.ACTION_USER_PRESENT);
// Customized BroadcastReceiver class
//Will be defined soon..
mReceiver = new ScreenReceiver();
registerReceiver(mReceiver, filter);
Step 2:Rest of the broadcast receiver code can go in as FFI.
Step 3: Register a invoke JS callback with FFI and invoke it once you receive the power event.
In JS callback you can pause the video.
Step 4:
You have to change the Main launcher Activity usign "Tags tab: "->"Child Tag Entries under Main Launcher <activity> tag:" as indicated under link below to the overridden Activity which registers and unregister broadcast receivers.
http://docs.kony.com/konylibrary/visualizer/visualizer_user_guide/Content/Native_App_Properties.htm
Attached contents of blog as Doc for future reference in case blog link goes down
Additionally please raise it as feature request to incorporate the power events support in platform itself.
Thanks and Regards