Skip to content

Instantly share code, notes, and snippets.

Stefan Anca bilbo7833

  • Berlin
Block or report user

Report or block bilbo7833

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@bilbo7833
bilbo7833 / MediaPlayerListenerExample.java
Created Jul 22, 2016
Android & Video Blog series - MediaPlayer Listener Example
View MediaPlayerListenerExample.java
mPlayer.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
public void onPrepared(MediaPlayer mp) {
// Start video
mPlayer.start();
}
});
@bilbo7833
bilbo7833 / MediaPlayerExample.java
Created Jul 22, 2016
Android & Video Blog series - MediaPlayer Configuration Example
View MediaPlayerExample.java
MediaPlayer mPlayer = new MediaPlayer();
mPlayer.setDisplay(mSurfaceHolder);
mPlayer.setDataSource(MyActivity.this, videoUri);
mPlayer.setVolume(left, right);
mPlayer.setLooping(true);
mPlayer.prepare();
mPlayer.start();
@bilbo7833
bilbo7833 / SurfaceViewExample.java
Created Jul 22, 2016
Android & Video Blog Series - SurfaceView Example
View SurfaceViewExample.java
SurfaceView preview = (SurfaceView) findViewById(R.id.surf_video_playback);
SurfaceHolder previewHolder = preview.getHolder();
previewHolder.addCallback(surfaceCallback);
previewHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
SurfaceHolder.Callback surfaceCallback = new SurfaceHolder.Callback() {
public void surfaceCreated(SurfaceHolder holder);
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height);
public void surfaceDestroyed(SurfaceHolder holder);
}
@bilbo7833
bilbo7833 / VideoViewExample.java
Last active Jul 22, 2016
Android & Video Blog series - VideoView Example
View VideoViewExample.java
VideoView myVideoView = (VideoView) findViewById(R.id.videoPreview);
myVideoView.setVideoURI(data);
myVideoView.setMediaController(new MediaController(this));
myVideoView.requestFocus();
myVideoView.start();
You can’t perform that action at this time.