surfaceholder

SurfaceHolder.setType is deprecated… But required?

谁说我不能喝 提交于 2019-11-30 05:41:26
void android.view.SurfaceHolder.setType(int type) public abstract void setType (int type) Since: API Level 1 This method is deprecated. this is ignored, this value is set automatically when needed. Sets the surface's type. http://developer.android.com/reference/android/view/SurfaceHolder.html It says it's set automatically but, without it my video doesn't play. What's going on here? Is there something that replaces it? I'm having a time getting video to play correctly on Android. lyricsboy The trick is in knowing when it was deprecated, which is kind of hard to determine from my experience.

SurfaceHolder.setType is deprecated… But required?

时光怂恿深爱的人放手 提交于 2019-11-29 04:44:57
问题 void android.view.SurfaceHolder.setType(int type) public abstract void setType (int type) Since: API Level 1 This method is deprecated. this is ignored, this value is set automatically when needed. Sets the surface's type. http://developer.android.com/reference/android/view/SurfaceHolder.html It says it's set automatically but, without it my video doesn't play. What's going on here? Is there something that replaces it? I'm having a time getting video to play correctly on Android. 回答1: The

How to attach MediaPlayer with SurfaceView in android?

时光总嘲笑我的痴心妄想 提交于 2019-11-28 19:43:36
I'm building video player with android media player object. i'm able to hear the audio but the video does not appear on surfaceView. here is my code public class PlayerActivity extends Activity implements SurfaceHolder.Callback { String path; private MediaPlayer mp; private SurfaceView mPreview; private SurfaceHolder holder; boolean pausing = false; public static String filepath; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_player); getWindow().setFormat(PixelFormat.UNKNOWN); mPreview = (SurfaceView

Android Camera will not work. startPreview fails

老子叫甜甜 提交于 2019-11-26 03:25:15
问题 I\'m getting these errors from LogCat: 10-30 00:31:51.494: D/CameraHal(1205): CameraHal setOverlay/1/00000000/00000000 10-30 00:31:51.494: E/CameraHal(1205): Trying to set overlay, but overlay is null!, line:3472 10-30 00:31:51.494: W/CameraService(1205): Overlay create failed - retrying ... 10-30 00:31:52.526: E/CameraService(1205): Overlay Creation Failed! ... 10-30 00:31:52.588: E/AndroidRuntime(5040): FATAL EXCEPTION: main 10-30 00:31:52.588: E/AndroidRuntime(5040): java.lang