Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-27057] Android: createVideoPlayer keepScreenOn not working properly

GitHub Issuen/a
TypeBug
PriorityCritical
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 8.0.0, Release 8.0.1
Fix Version/sn/a
ComponentsAndroid
LabelsengSchedule, regression
ReporterJoe Finnigan
AssigneeShak Hossain
Created2019-04-30T12:35:13.000+0000
Updated2019-05-21T16:54:09.000+0000

Description

When loading a second video player, after releasing a previous one, keepScreenOn is not working unless you set repeatMode to Ti.Media.VIDEO_REPEAT_MODE_ONE. If you set it to NONE or don't set it at all, the screen will lock. Reproduce with the code below, set the device auto lock to 15seconds and run the following code. Shortly after the 2nd video starts playing, the screen will auto lock. This used to work fine in previous SDK versions.
var activeVideo = Ti.Media.createVideoPlayer({
  url:
    "http://mirrors.standaloneinstaller.com/video-sample/Panasonic_HDC_TM_700_P_50i.mp4",
  backgroundColor: "black",
  mediaControlStyle: Ti.Media.VIDEO_CONTROL_HIDDEN,
  scalingMode: Ti.Media.VIDEO_SCALING_ASPECT_FILL,
  fullscreen: true,
  autoplay: true,
  keepScreenOn: true
});

setTimeout(function() {
  //Wait 30seconds, screen will still be on then release and load another video
  console.log("New video");
  activeVideo.hide();
  activeVideo.release();
  activeVideo = null;
  activeVideo = Ti.Media.createVideoPlayer({
    url:
      "https://sample-videos.com/video123/mp4/720/big_buck_bunny_720p_10mb.mp4",
    backgroundColor: "black",
    mediaControlStyle: Ti.Media.VIDEO_CONTROL_HIDDEN,
    scalingMode: Ti.Media.VIDEO_SCALING_ASPECT_FILL,
    fullscreen: true,
    autoplay: true,
    keepScreenOn: true
  });
}, 30000);

Comments

  1. Joe Finnigan 2019-04-30

    Also seeing this happen with the repeat mode set. Something very inconsistent going on with keepScreenOn!
  2. Joe Finnigan 2019-05-03

    Confirmed to be an issue on: 8.0.0.GA 8.0.1.v20190430172038 8.1.0.v20190426222341 Tip to reproduce, download those MP4 files and bring them locally into the app. It will happen with them remote, but seems harder to reproduce due to the buffering, think it's perhaps a timing issue on the 2nd player creation. Happens every time when the files are local.
  3. Joe Finnigan 2019-05-17

    Any updates on this issue?

JSON Source