Talespin_Kit
Talespin_Kit

Reputation: 21877

android MediaPlayer without prepare() method

The following code to play the test_audio.mp3 using MediaPlayer Object works without calling the prepare() method. What problems may arise if the prepare() method is not called.

mp = MediaPlayer.create(this, R.raw.test_audio);
mp.start();

Upvotes: 0

Views: 397

Answers (2)

QArea
QArea

Reputation: 4981

You can have problems with playing big local files.

Upvotes: 0

CommonsWare
CommonsWare

Reputation: 1006799

The static create() method on MediaPlayer does a prepare() for you, as is noted in the documentation for that method.

Upvotes: 4

Related Questions