Allow screen to sleep when video finishes

This commit is contained in:
Hampton Maxwell 2018-08-05 17:34:16 -07:00 committed by GitHub
parent bd48a001c0
commit 3a1d81930e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -624,9 +624,11 @@ public class ReactVideoView extends ScalableVideoView implements MediaPlayer.OnP
@Override
public void onCompletion(MediaPlayer mp) {
isCompleted = true;
mEventEmitter.receiveEvent(getId(), Events.EVENT_END.toString(), null);
if (!mRepeat) {
setKeepScreenOn(false);
}
}
@Override