Hello,

         I am writing a Video-player Application. I have created
SurfaceView, implemented necessary callbacks. I create my MediaPlayer
object by 'new' in the surfaceCreated callback just to be sure about
creation of surface. Then I passed the surface handler to media player
object by mp.setDisplay(holder) and then called mp.prepare(). I start
my media player i.e. mp.start() in OnPrepared to make sure mp should
be started after preparation. I expect now video should be available
on the surface but it only plays music without any video out put.

Here is the code snippet which I call in surfaceCreated.
            mp = new MediaPlayer();
            //set callbacks here

            Runnable r = new Runnable() {
                public void run() {
                    try {
                        mp.setDataSource(path);
                        mp.setDisplay(holder);

                        mp.prepare();

                    } catch (IOException e) {
                        Log.e(TAG, e.getMessage(), e);
                    }
                }
            };
           synchronized(this) {
              new Thread(r).start();
            }

I tried many alternatives and searched on internet for help.Could
Anyone suggest me why my video isn't displayed?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to