MediaPlayerã®ããã¥ã¢ã«ã«ã¯ã以äžã®ããã«æžããŠãããŸãã
> public static MediaPlayer create(Context context, Uri uri)
> Convenience method to create a MediaPlayer for a given Uri. On success, prepare() will already have been called and must not be called again.
http://code.google.com/intl/ja-JP/android/reference/android/media/MediaPlayer.html
createãæåããæã«ã¯ïŒprepareã¯æ¢ã«åŒã³åºãããŠããããïŒåŒã¶å¿
èŠã¯æããŸããã
M5ã§ã® APIå€æŽã®ããã¥ã¡ã³ãã«ã¯
> MediaPlayer.prepare() is now called from MediaPlayer.create() and you will get an exception if you call MediaPlayer.prepare() after using create().
prepare㯠createããåŒã³åºãããããã«å€æŽãããŸããããã®çºïŒcreateãå©çšããåŸã« prepareãåŒã³åºããšäŸå€ãçºçã
ãŸãã
ã©ãããŠããprepareãåŒã³åºãããæã«ã¯ïŒ
> public void prepare()
> Call this after setDataSource() or stop(), and before any other method that might throw IllegalStateException in this class
ãšãããŸãã®ã§ãsetDataSourceããã㯠stopãåŒã³åºãå¿
èŠãããããã§ããã
ãœãŒã¹ã³ãŒããèŠãŠã¿ããšïŒMediaPlayerã®ç¶æ
ã MEDIA_PLAYER_INITIALIZEDãããã¯
MEDIA_PLAYER_STOPPEDã§ãªãå Žåã«ã¯ INVALID_OPERATIONã prepareãè¿ããŠããŸãã
--
ãªããŸã€
On 12æ23æ¥, ååŸ12:52, hkoba <
miruru...@gmail.com> wrote:
> å°æãšç³ããŸãã
> MediaPlayerã䜿çšããŠãmp3ãã¡ã€ã«ãåçããããšããŸããããäžæãåçãããŸããã§ããã
>
> ãããã°ã®çºã«ããadb logcat -dããå®è¡ããŠç¢ºèªããŸãããšãããprepare()ãå®è¡ããéã«ã
> ãprepareAsync called in state 1ããšããã¹ããŒã¿ã¹ãå
¥ã£ãŠãããŸããã
> ãã¡ããäœã圱é¿ããŠããã®ã§ãããã...ã
>
> ãœãŒã¹ã¯ã以äžã«ãªããŸããŠãmp3ãã¡ã€ã«ã¯ããµã³ãã«ã§åããŠãããã®ãå©çšããŠããåãçµæãšãªããŸããã
> ãprepareAsync called in state 1ãã§èª¿ã¹ãã®ã§ãããããŸãæ
å ±ããªãããã€ã倱æäŸãå°ãªãããã
> è¡ãè©°ã£ãŠããŸããŸãã...ã