use of android.widget.MediaController in project android-aosp-mms by slvn.
the class SlideshowActivity method initMediaController.
private void initMediaController() {
mMediaController = new MediaController(SlideshowActivity.this, false);
mMediaController.setMediaPlayer(new SmilPlayerController(mSmilPlayer));
mMediaController.setAnchorView(findViewById(R.id.slide_view));
mMediaController.setPrevNextListeners(new OnClickListener() {
public void onClick(View v) {
mSmilPlayer.next();
}
}, new OnClickListener() {
public void onClick(View v) {
mSmilPlayer.prev();
}
});
}
use of android.widget.MediaController in project JustAndroid by chinaltz.
the class PictureVideoPlayActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
super.onCreate(savedInstanceState);
setContentView(R.layout.picture_activity_video_play);
video_path = getIntent().getStringExtra("video_path");
picture_left_back = (ImageView) findViewById(R.id.picture_left_back);
mVideoView = (VideoView) findViewById(R.id.video_view);
mVideoView.setBackgroundColor(Color.BLACK);
iv_play = (ImageView) findViewById(R.id.iv_play);
mMediaController = new MediaController(this);
mVideoView.setOnCompletionListener(this);
mVideoView.setOnPreparedListener(this);
mVideoView.setMediaController(mMediaController);
picture_left_back.setOnClickListener(this);
iv_play.setOnClickListener(this);
}
use of android.widget.MediaController in project coursera-android by aporter.
the class AudioVideoVideoPlayActivity method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
// Get a reference to the VideoView
mVideoView = findViewById(R.id.videoViewer);
// Add a Media controller to allow forward/reverse/pause/resume
final MediaController mMediaController = new MediaController(AudioVideoVideoPlayActivity.this, true);
mMediaController.setEnabled(false);
mVideoView.setMediaController(mMediaController);
mVideoView.setVideoURI(Uri.parse("android.resource://" + getPackageName() + "/raw/moon"));
// Add an OnPreparedListener to enable the MediaController once the video is ready
mVideoView.setOnPreparedListener(new OnPreparedListener() {
@Override
public void onPrepared(MediaPlayer mp) {
mMediaController.setEnabled(true);
}
});
}
use of android.widget.MediaController in project AndroidSDK-RecipeBook by gabu.
the class Recipe068 method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// フルスクリーン表示にします
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
// タイトルバーを非表示にします
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.main);
mVideoView = (VideoView) findViewById(R.id.video_view);
mMediaController = new MediaController(this);
mVideoView.setMediaController(mMediaController);
mVideoView.setOnPreparedListener(new OnPreparedListener() {
public void onPrepared(MediaPlayer mp) {
mVideoView.start();
showTelop();
}
});
mFrameLayout = (FrameLayout) findViewById(R.id.frame_layout);
}
use of android.widget.MediaController in project cw-advandroid by commonsguy.
the class VideoDemo method onCreate.
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
getWindow().setFormat(PixelFormat.TRANSLUCENT);
setContentView(R.layout.main);
File clip = new File(Environment.getExternalStorageDirectory(), "test.mp4");
if (clip.exists()) {
video = (VideoView) findViewById(R.id.video);
video.setVideoPath(clip.getAbsolutePath());
ctlr = new MediaController(this);
ctlr.setMediaPlayer(video);
video.setMediaController(ctlr);
video.requestFocus();
video.start();
}
}
Aggregations