Hello everyone.

I've had some problems with a VideoView.
This method is called from the main one in my code:

           private VideoView Vid;
    public void LaunchVideo() {
                   getWindow().setFormat(PixelFormat.TRANSLUCENT);
                   setContentView(R.layout.main);
                   Vid = (VideoView) findViewById(R.id.MyVideo);
VScreen.setVideoURI(Uri.parse("http://dl3.streamzilla.jet-stream.nl/
jet-stream/progressivedemos/goldfish_H264_Web.mp4"));
                   MediaController mc = new MediaController(this);
                   VScreen.setMediaController(mc);
                   VScreen.requestFocus();
                   VScreen.start();

               }

Now, that Code in the Main public class, all by itself, with nothing
else, works fine. But when called like this, I get:
the Progress Bar moving, but the video only plays for a second after
clicking Android's 'Back' button.


However, the video works fine in the independant project code below:


           private String url = "http://dl3.streamzilla.jet-stream.nl/jet-
stream/progressivedemos/goldfish_H264_Web.mp4";

           private VideoView Vid;
           public void onCreate(Bundle icicle)
               {
                   super.onCreate(icicle);
                   getWindow().setFormat(PixelFormat.TRANSLUCENT);
                  //Get video up and running
                   setContentView(R.layout.main);
                   Vid = (VideoView) findViewById(R.id.TheVideo);
                   Vid.setVideoURI(Uri.parse(url));
                   MediaController mediac = new MediaController(this);
                   Vid.setMediaController(mediac);
                   Vid.requestFocus();

                   Log.i("\n\nvideo",String.valueOf(VScreen.isPlaying()));
                   Vid.start();



               }//End of onCreate!!!!

}


What is wrong with my code? Again, the first sample has the problem,
and the second works fine.
Thanks,
SQLserver
--~--~---------~--~----~------------~-------~--~----~
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]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to