Thursday, 10 July 2014

Android API - Video Playback

Video Playback

Intent

Uses the user's preferred media player. Use it if the media playback experience is not an essential part of your application.

Always provide the media type so that the system will choose the most suitable media player.

playIntent = new Intent(Intent.ACTION_VIEW);
playIntent.setDataAndType(Uri.parse(videoUrl), "video/*");
startActivity(playIntent)


How to display the video in a player?

SurfaceView ==> SurfaceHolder

Surfaces may change or be removed dynamically so it is recommended to implement a SurfaceHolder Listener.


aaa




No comments:

Post a Comment