Index: content/public/android/java/src/org/chromium/content/browser/ContentVideoView.java |
diff --git a/content/public/android/java/src/org/chromium/content/browser/ContentVideoView.java b/content/public/android/java/src/org/chromium/content/browser/ContentVideoView.java |
index 40439888c787ba13f76cd1b42140cde337c1b904..95ecedc80bba7536588bef4d30ba7c2457a981a3 100644 |
--- a/content/public/android/java/src/org/chromium/content/browser/ContentVideoView.java |
+++ b/content/public/android/java/src/org/chromium/content/browser/ContentVideoView.java |
@@ -68,7 +68,6 @@ public class ContentVideoView extends FrameLayout |
private SurfaceHolder mSurfaceHolder; |
private int mVideoWidth; |
private int mVideoHeight; |
- private int mDuration; |
// Native pointer to C++ ContentVideoView object. |
private long mNativeContentVideoView; |
@@ -165,7 +164,7 @@ public class ContentVideoView extends FrameLayout |
} |
}; |
- protected ContentVideoView(Context context, long nativeContentVideoView, |
+ private ContentVideoView(Context context, long nativeContentVideoView, |
ContentVideoViewClient client) { |
super(context); |
mNativeContentVideoView = nativeContentVideoView; |
@@ -178,7 +177,7 @@ public class ContentVideoView extends FrameLayout |
setVisibility(View.VISIBLE); |
} |
- protected ContentVideoViewClient getContentVideoViewClient() { |
+ private ContentVideoViewClient getContentVideoViewClient() { |
return mClient; |
} |
@@ -196,7 +195,7 @@ public class ContentVideoView extends FrameLayout |
org.chromium.content.R.string.media_player_loading_video); |
} |
- protected void showContentVideoView() { |
+ private void showContentVideoView() { |
mVideoSurfaceView.getHolder().addCallback(this); |
this.addView(mVideoSurfaceView, new FrameLayout.LayoutParams( |
ViewGroup.LayoutParams.WRAP_CONTENT, |
@@ -213,7 +212,7 @@ public class ContentVideoView extends FrameLayout |
Gravity.CENTER)); |
} |
- protected SurfaceView getSurfaceView() { |
+ private SurfaceView getSurfaceView() { |
return mVideoSurfaceView; |
} |
@@ -282,7 +281,7 @@ public class ContentVideoView extends FrameLayout |
} |
@CalledByNative |
- protected void onBufferingUpdate(int percent) { |
+ private void onBufferingUpdate(int percent) { |
} |
@CalledByNative |
@@ -291,14 +290,13 @@ public class ContentVideoView extends FrameLayout |
} |
@CalledByNative |
- protected void onUpdateMediaMetadata( |
+ private void onUpdateMediaMetadata( |
int videoWidth, |
int videoHeight, |
int duration, |
boolean canPause, |
boolean canSeekBack, |
boolean canSeekForward) { |
- mDuration = duration; |
mProgressView.setVisibility(View.GONE); |
mCurrentState = isPlaying() ? STATE_PLAYING : STATE_PAUSED; |
onVideoSizeChanged(videoWidth, videoHeight); |
@@ -339,7 +337,7 @@ public class ContentVideoView extends FrameLayout |
} |
@CalledByNative |
- protected void openVideo() { |
+ private void openVideo() { |
if (mSurfaceHolder != null) { |
mCurrentState = STATE_IDLE; |
if (mNativeContentVideoView != 0) { |
@@ -350,65 +348,10 @@ public class ContentVideoView extends FrameLayout |
} |
} |
- protected void onCompletion() { |
+ private void onCompletion() { |
mCurrentState = STATE_PLAYBACK_COMPLETED; |
} |
- |
- protected boolean isInPlaybackState() { |
- return (mCurrentState != STATE_ERROR && mCurrentState != STATE_IDLE); |
- } |
- |
- protected void start() { |
- if (isInPlaybackState()) { |
- if (mNativeContentVideoView != 0) { |
- nativePlay(mNativeContentVideoView); |
- } |
- mCurrentState = STATE_PLAYING; |
- } |
- } |
- |
- protected void pause() { |
- if (isInPlaybackState()) { |
- if (isPlaying()) { |
- if (mNativeContentVideoView != 0) { |
- nativePause(mNativeContentVideoView); |
- } |
- mCurrentState = STATE_PAUSED; |
- } |
- } |
- } |
- |
- // cache duration as mDuration for faster access |
- protected int getDuration() { |
- if (isInPlaybackState()) { |
- if (mDuration > 0) { |
- return mDuration; |
- } |
- if (mNativeContentVideoView != 0) { |
- mDuration = nativeGetDurationInMilliSeconds(mNativeContentVideoView); |
- } else { |
- mDuration = 0; |
- } |
- return mDuration; |
- } |
- mDuration = -1; |
- return mDuration; |
- } |
- |
- protected int getCurrentPosition() { |
- if (isInPlaybackState() && mNativeContentVideoView != 0) { |
- return nativeGetCurrentPosition(mNativeContentVideoView); |
- } |
- return 0; |
- } |
- |
- protected void seekTo(int msec) { |
- if (mNativeContentVideoView != 0) { |
- nativeSeekTo(mNativeContentVideoView, msec); |
- } |
- } |
- |
public boolean isPlaying() { |
return mNativeContentVideoView != 0 && nativeIsPlaying(mNativeContentVideoView); |
} |
@@ -470,7 +413,7 @@ public class ContentVideoView extends FrameLayout |
* To exit fullscreen, use exitFullscreen in Java. |
*/ |
@CalledByNative |
- protected void destroyContentVideoView(boolean nativeViewDestroyed) { |
+ private void destroyContentVideoView(boolean nativeViewDestroyed) { |
if (mVideoSurfaceView != null) { |
removeSurfaceView(); |
setVisibility(View.GONE); |
@@ -508,15 +451,8 @@ public class ContentVideoView extends FrameLayout |
private static native ContentVideoView nativeGetSingletonJavaContentVideoView(); |
private native void nativeExitFullscreen(long nativeContentVideoView, |
boolean relaseMediaPlayer); |
- private native int nativeGetCurrentPosition(long nativeContentVideoView); |
- private native int nativeGetDurationInMilliSeconds(long nativeContentVideoView); |
private native void nativeRequestMediaMetadata(long nativeContentVideoView); |
- private native int nativeGetVideoWidth(long nativeContentVideoView); |
- private native int nativeGetVideoHeight(long nativeContentVideoView); |
private native boolean nativeIsPlaying(long nativeContentVideoView); |
- private native void nativePause(long nativeContentVideoView); |
- private native void nativePlay(long nativeContentVideoView); |
- private native void nativeSeekTo(long nativeContentVideoView, int msec); |
private native void nativeSetSurface(long nativeContentVideoView, Surface surface); |
private native void nativeRecordFullscreenPlayback( |
long nativeContentVideoView, boolean isVideoPortrait, boolean isOrientationPortrait); |