OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.content.browser; | 5 package org.chromium.content.browser; |
6 | 6 |
7 import android.app.Activity; | 7 import android.app.Activity; |
8 import android.app.AlertDialog; | 8 import android.app.AlertDialog; |
9 import android.content.Context; | 9 import android.content.Context; |
10 import android.content.DialogInterface; | 10 import android.content.DialogInterface; |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
328 } | 328 } |
329 | 329 |
330 @Override | 330 @Override |
331 public void surfaceCreated(SurfaceHolder holder) { | 331 public void surfaceCreated(SurfaceHolder holder) { |
332 mSurfaceHolder = holder; | 332 mSurfaceHolder = holder; |
333 openVideo(); | 333 openVideo(); |
334 } | 334 } |
335 | 335 |
336 @Override | 336 @Override |
337 public void surfaceDestroyed(SurfaceHolder holder) { | 337 public void surfaceDestroyed(SurfaceHolder holder) { |
338 if (mNativeContentVideoView != 0) { | 338 // We expect the native side to call destroyContentVideoView |
qinmin
2013/12/18 02:09:46
This is not right. When user hit the home button,
kbalazs
2013/12/18 19:45:05
If the user calls ContentView.onHide in it's activ
| |
339 nativeSetSurface(mNativeContentVideoView, null); | 339 // before our surface could have been bone. |
340 } | 340 assert mVideoSurfaceView == null; |
341 mSurfaceHolder = null; | 341 mSurfaceHolder = null; |
342 post(mExitFullscreenRunnable); | |
343 } | 342 } |
344 | 343 |
345 private void setMediaController(MediaController controller) { | 344 private void setMediaController(MediaController controller) { |
346 if (mMediaController != null) { | 345 if (mMediaController != null) { |
347 mMediaController.hide(); | 346 mMediaController.hide(); |
348 } | 347 } |
349 mMediaController = controller; | 348 mMediaController = controller; |
350 attachMediaController(); | 349 attachMediaController(); |
351 } | 350 } |
352 | 351 |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
618 private native int nativeGetDurationInMilliSeconds(long nativeContentVideoVi ew); | 617 private native int nativeGetDurationInMilliSeconds(long nativeContentVideoVi ew); |
619 private native void nativeUpdateMediaMetadata(long nativeContentVideoView); | 618 private native void nativeUpdateMediaMetadata(long nativeContentVideoView); |
620 private native int nativeGetVideoWidth(long nativeContentVideoView); | 619 private native int nativeGetVideoWidth(long nativeContentVideoView); |
621 private native int nativeGetVideoHeight(long nativeContentVideoView); | 620 private native int nativeGetVideoHeight(long nativeContentVideoView); |
622 private native boolean nativeIsPlaying(long nativeContentVideoView); | 621 private native boolean nativeIsPlaying(long nativeContentVideoView); |
623 private native void nativePause(long nativeContentVideoView); | 622 private native void nativePause(long nativeContentVideoView); |
624 private native void nativePlay(long nativeContentVideoView); | 623 private native void nativePlay(long nativeContentVideoView); |
625 private native void nativeSeekTo(long nativeContentVideoView, int msec); | 624 private native void nativeSeekTo(long nativeContentVideoView, int msec); |
626 private native void nativeSetSurface(long nativeContentVideoView, Surface su rface); | 625 private native void nativeSetSurface(long nativeContentVideoView, Surface su rface); |
627 } | 626 } |
OLD | NEW |