Mobile Application Development Media Player

Media Player

Media Types


Media Sources



MediaPlayer Creation


MediaPlayer mp = new MediaPlayer();
mp.setDataSource();
mp.setAudioStreamType(); //different streams have different audio controls
mp.prepare(); //or mp.prepareAsync();
mp.start();

prepare() vs prepareAsync()

Quick Creation


MediaPlayer mp = new MediaPlayer.create();
mp.start();


Video


SurfaceHolder