title: Disable sleep mode in mobile phone when camera is in 'on' in a mobile app
body: <p>I have done a mobile app(live video streaming from mobile phone). Normally in mobile phones when the camera is in on the mobile backlight does not go to sleep mode but in my app i have written code to attach a camera and when i start to stream from the app then after some time the mobile goes to sleepmode. <strong>I need to make an application that should be able to make the phone light off when video is streaming.</strong> How can i achieve this ?
  Here is my code,</p>
  
  <pre><code>            camera = null;
              netStreamPublisher.attachCamera(null);
  
              if (cameraPosition == "auto") {
                  camera = Camera.getCamera();
                  trace("Entered auto");
              } else {
                  if (Camera.names.length == 1) {
                      camera = Camera.getCamera();
                      trace("Entered camera");
                  } else {
                      var tmpCamera:Camera = null;
                      trace("Entered");
                      for (var i:uint = 0; i &lt; Camera.names.length; i++) {
                          tmpCamera = Camera.getCamera(Camera.names[i]);
                          if (tmpCamera.position == cameraPosition) {
                              camera = tmpCamera;
                              trace("Entered");
                              break;
                          }
                      }
                  }
              }
  
              if (camera) {
                  camera.setMode (640, 480, 15, true);
                  camera.setQuality (15000, 0); // 30000, 0 (adobe settings)
                  netStreamPublisher.attachCamera (camera);
                  return camera;
              } else {
                  return null;
              }
  </code></pre>