Android Media Player Exception Timed Out After 10 Seconds
Solution 1:
When repeatedly creating MediaPlayer
instances as you are, you need to call release()
on the previous player before creating the next one. Quoting the MediaPlayer
docs:
It is also recommended that once a MediaPlayer object is no longer being used, call
release()
immediately so that resources used by the internal player engine associated with the MediaPlayer object can be released immediately. Resource may include singleton resources such as hardware acceleration components and failure to callrelease()
may cause subsequent instances of MediaPlayer objects to fallback to software implementations or fail altogether.
Though you're using a single variable for reference to each new player, the old instances are still "hanging around" for a time, and eventually causing the stated Exception due to not being explicitly released.
Post a Comment for "Android Media Player Exception Timed Out After 10 Seconds"