Skip to content

Commit 6520b49

Browse files
Merge pull request livecode#3029 from livecodepanos/bugfix-16027
[Bug 16027] Set permanent visibility of Android audio/video controller
2 parents b7c6eb8 + d917d24 commit 6520b49

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

docs/notes/bugfix-16027.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Android audio/video controller disappears after some seconds of inactivity

engine/src/java/com/runrev/android/nativecontrol/ExtVideoView.java

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ public void setMediaController(MediaController controller) {
316316
mMediaController = controller;
317317
attachMediaController();
318318
}
319-
319+
320320
public MediaController getMediaController() {
321321
return mMediaController;
322322
}
@@ -391,7 +391,8 @@ public void onPrepared(MediaPlayer mp) {
391391
if (mTargetState == STATE_PLAYING) {
392392
start();
393393
if (mMediaController != null) {
394-
mMediaController.show();
394+
// PM-2015-10-08: [[ Bug 16027 ]] Make sure the controller does not disappear after some ms of inactivity
395+
mMediaController.show(0);
395396
}
396397
} else if (!isPlaying() &&
397398
(seekToPosition != 0 || getCurrentPosition() > 0)) {
@@ -406,6 +407,10 @@ public void onPrepared(MediaPlayer mp) {
406407
// The video size might be reported to us later.
407408
if (mTargetState == STATE_PLAYING) {
408409
start();
410+
// show the controller when starting playing a remote video
411+
if (mMediaController != null) {
412+
mMediaController.show(0);
413+
}
409414
}
410415
}
411416
}
@@ -538,7 +543,7 @@ public void surfaceChanged(SurfaceHolder holder, int format,
538543
}
539544
start();
540545
if (mMediaController != null) {
541-
mMediaController.show();
546+
mMediaController.show(0);
542547
}
543548
}
544549
}
@@ -621,7 +626,7 @@ public boolean onKeyDown(int keyCode, KeyEvent event)
621626
keyCode == KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE) {
622627
if (mMediaPlayer.isPlaying()) {
623628
pause();
624-
mMediaController.show();
629+
mMediaController.show(0);
625630
} else {
626631
start();
627632
mMediaController.hide();
@@ -630,7 +635,7 @@ public boolean onKeyDown(int keyCode, KeyEvent event)
630635
} else if (keyCode == KeyEvent.KEYCODE_MEDIA_STOP
631636
&& mMediaPlayer.isPlaying()) {
632637
pause();
633-
mMediaController.show();
638+
mMediaController.show(0);
634639
} else {
635640
toggleMediaControlsVisiblity();
636641
}
@@ -644,7 +649,7 @@ private void toggleMediaControlsVisiblity() {
644649
if (mMediaController.isShowing()) {
645650
mMediaController.hide();
646651
} else {
647-
mMediaController.show();
652+
mMediaController.show(0);
648653
}
649654
}
650655

0 commit comments

Comments
 (0)