VideoView Help

Put your problem here if it does not fit any of the other categories.

VideoView Help

Postby Questioneer » Tue Mar 11, 2008 2:27 am

Hello-
I've been trying to play an online mp4 video with this code:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2.  package video.test.android;
  3.  
  4.  
  5.  
  6. import android.app.Activity;
  7.  
  8. import android.graphics.PixelFormat;
  9.  
  10. import android.net.Uri;
  11.  
  12. import android.os.Bundle;
  13.  
  14. import android.util.Log;
  15.  
  16. import android.widget.VideoView;
  17.  
  18.  
  19.  
  20. public class VideoTest extends Activity {
  21.  
  22.  
  23.  
  24.        private String url = "http://www.archive.org/stream/GaryKild/GaryKild_64kb.mp4";
  25.  
  26.  
  27.  
  28.        private VideoView vv;
  29.  
  30.        protected void onCreate(Bundle icicle)
  31.  
  32.            {
  33.  
  34.                super.onCreate(icicle);
  35.  
  36.                getWindow().setFormat(PixelFormat.TRANSLUCENT);
  37.  
  38.  
  39.  
  40.                vv = new VideoView(this);
  41.  
  42.                setContentView(vv);
  43.  
  44.  
  45.  
  46.                vv.setVideoURI(Uri.parse(url));
  47.  
  48.                vv.requestFocus();
  49.  
  50.  
  51.  
  52.                Log.i("\n\nvideo",String.valueOf(vv.isPlaying()));
  53.  
  54.                vv.start();
  55.  
  56.  
  57.  
  58.            }
  59.  
  60.  
  61.  
  62.     }
  63.  
  64.  
Parsed in 0.033 seconds, using GeSHi 1.0.8.4


But the video view always stays black.
It could be a problem with the video.
Can anyone supply me with one they know works, or correct my errors?
thanks,
Questioneer
Questioneer
Junior Developer
Junior Developer
 
Posts: 12
Joined: Thu Feb 14, 2008 11:23 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 13 guests