summaryrefslogtreecommitdiffstats
path: root/src/org/codeaurora/gallery3d/video/CodeauroraVideoView.java
diff options
context:
space:
mode:
authorzhuw <zhuw@codeaurora.org>2018-04-04 10:46:00 +0800
committerGerrit - the friendly Code Review server <code-review@localhost>2018-08-30 19:14:42 -0700
commitd1700fc02166b43aadce4de0047116524b7a73a8 (patch)
treed4cf6dc6304ba5440aeb05ae8976e42ca19a6236 /src/org/codeaurora/gallery3d/video/CodeauroraVideoView.java
parent40136b39d748d8e9b5c2ce1249b18870b6fcbabf (diff)
downloadandroid_packages_apps_Gallery2-d1700fc02166b43aadce4de0047116524b7a73a8.tar.gz
android_packages_apps_Gallery2-d1700fc02166b43aadce4de0047116524b7a73a8.tar.bz2
android_packages_apps_Gallery2-d1700fc02166b43aadce4de0047116524b7a73a8.zip
Fix Time bar don't update replay after trim
add start Timer callback, run during start() Change-Id: I648d8a28c7ab9b49c8703ceab482214b992cf8de
Diffstat (limited to 'src/org/codeaurora/gallery3d/video/CodeauroraVideoView.java')
-rw-r--r--src/org/codeaurora/gallery3d/video/CodeauroraVideoView.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/org/codeaurora/gallery3d/video/CodeauroraVideoView.java b/src/org/codeaurora/gallery3d/video/CodeauroraVideoView.java
index 7fefbb881..6b5a9bef0 100644
--- a/src/org/codeaurora/gallery3d/video/CodeauroraVideoView.java
+++ b/src/org/codeaurora/gallery3d/video/CodeauroraVideoView.java
@@ -28,6 +28,7 @@ import android.view.accessibility.AccessibilityNodeInfo;
import android.widget.MediaController;
import android.widget.MediaController.MediaPlayerControl;
+import com.android.gallery3d.app.MoviePlayer;
import com.android.gallery3d.common.ApiHelper;
import com.android.gallery3d.common.ApiHelper.Metadata;
@@ -85,6 +86,7 @@ public class CodeauroraVideoView extends SurfaceView implements MediaPlayerContr
private MediaPlayer.OnVideoSizeChangedListener mVideoSizeListener;
private MediaPlayer.OnPreparedListener mPreparedListener;
private ScreenModeManager mScreenManager;
+ private MoviePlayer.TimerProgress mTimerController;
private int mCurrentBufferPercentage;
private OnErrorListener mOnErrorListener;
private OnInfoListener mOnInfoListener;
@@ -621,6 +623,16 @@ public class CodeauroraVideoView extends SurfaceView implements MediaPlayerContr
mOnInfoListener = l;
}
+ /**
+ * Register a callback to start Timer for time progress bar
+ * occurs during this.start()
+ *
+ * @param c The callback that will be run
+ */
+ public void setTimerProgress(MoviePlayer.TimerProgress c) {
+ mTimerController = c;
+ }
+
SurfaceHolder.Callback mSHCallback = new SurfaceHolder.Callback() {
public void surfaceChanged(SurfaceHolder holder, int format,
int w, int h) {
@@ -772,6 +784,7 @@ public class CodeauroraVideoView extends SurfaceView implements MediaPlayerContr
if (mIsShowDialog) return;
if (isInPlaybackState()) {
mMediaPlayer.start();
+ mTimerController.startTimer();
mCurrentState = STATE_PLAYING;
}
mTargetState = STATE_PLAYING;