Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8053293
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T07:47:47+00:00 2026-06-05T07:47:47+00:00

My question is does having too many MediaPlayers cause an IOException preparefailed: status= 0x1

  • 0

My question is does having too many MediaPlayers cause an IOException preparefailed: status= 0x1 to log?

The way my program is running is i use a separate instance of Media Player for each video I want to play. At the end of the run i stop the videoPlayer, release it, and turn it null; this is ok sometimes but other times when i move between video’s too fast i get a IO exception and the video will not play. I also have a mediaPlayer playing some background music in a service.

Basically my Video activity gets a new call each time a file ends playback. Could this be the error and i should try to just reuse the same media player with a different file?

Thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T07:47:50+00:00Added an answer on June 5, 2026 at 7:47 am

    I found my own answer. I don’t know if this is a good way to do it but:

    if(videoFile != null)
            {
                Log.i("INITPLAYER", videoFile);
                afd = getAssets().openFd(videoFile);
    
                instructionVideoPlayer = new MediaPlayer();
    
                instructionVideoPlayer.setDataSource(afd.getFileDescriptor(), afd.getStartOffset(), afd.getDeclaredLength());
    
                instructionVideoPlayer.setDisplay(holder);
    
                instructionVideoPlayer.prepare();
    
                instructionVideoPlayer.setOnCompletionListener(instructionVideoComplete);
                instructionVideoPlayer.setOnPreparedListener(this);
            }
            else
                Log.i("VideoPlayer", "noVideoFile");
    
        } catch (IllegalArgumentException e) {
            e.printStackTrace();
        } catch (IllegalStateException e) {
            e.printStackTrace();
        } catch (IOException e) {
            Log.i(this.toString(), "IOEXception");
            e.printStackTrace();
    
    //Here is the fix:
            instructionVideoPlayer.release();
            instructionVideoPlayer = null;
            initPlayer();
    // reinit after prepare failed. although this can bring in an infinte loop if video file does not exits
        } catch (Exception e)
        {
            Log.i("InitPlayer", e.getClass().toString());
            e.printStackTrace();
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having a problem with Hadoop producing too many log files in $HADOOP_LOG_DIR/userlogs (the
I've spotted this question: Does Microsoft SkyDrive have an API? But not having an
Question: Does anyone have a quick way for removing all the extra resources in
I think that perhaps the original question was too long-winded with too many unnecessary
[Question] Does anyone product release notes via an automated process? If so how. Especially
Question: Does anyone have an example of a filter as you type dropdown control
The question does not refer to some Vim-mode in Emacs, but to Vim inside
(This question does not rely on a specific IoC framework, so the interfaces and
Drupal Question: Does anyone have a method of using Views and highlighting a selected/current
This question does pretty much what I want to accomplish, but my table is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.