Note that there are some explanatory texts on larger screens.

plurals
  1. POplayback video full screen
    text
    copied!<p>I am trying to play a video in my app. It has to be embedded. </p> <p>I went through the <a href="http://groups.google.com/group/android-developers/browse_thread/thread/63692208da946ead" rel="noreferrer">"Play Video Files in Android"</a> thread.</p> <p>I am able to play my video using VideoView as mentioned in this discussion. But there are a few problems. </p> <ol> <li><p>I need full screen video, how do I stretch VideoView to full screen? Will that stretch the video too? </p></li> <li><p>I don't need the default play/forward/stop buttons at all. Basically I need continuous loop playing of the video. </p></li> </ol> <p>I tried the MediaPlayer class as in <a href="http://davanum.wordpress.com/2007/12/29/android-videomusic-player-sample-from-local-disk-as-well-as-remote-urls/" rel="noreferrer">here</a>, but it never worked. What should the string format look like if I have my video file in res/raw directory? I really don't want the video file played from sdcard. How can it be bundled along with the app? </p> <p>If any of these two approaches work, I will be better off.</p> <p>This is my code:</p> <pre><code>videoHolder = new VideoView(this); // videoHolder = (VideoView)findViewById(R.id.videoview); LayoutParams params = new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT); videoHolder.setLayoutParams(params); videoHolder.setMediaController(new MediaController(this)); setContentView(videoHolder); // // //// I tested and found that it works fine for .wmv, .3gp and .mp4 //// videoHolder.setVideoURI(Uri.parse("file:///sdcard/video.3gp")); videoHolder.setVideoURI(Uri.parse("res/raw/demo.3gp")); videoHolder.requestFocus(); videoHolder.start(); </code></pre> <p>Strangely the commented url works (the one with sdcard). The other one does not work. I have tried many combinations from "file:// res/raw/demo.3gp" to only "demo".</p> <p>What would be the correct string to access the file?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload