The solution is deceptively simple. You just need to format a URI that
refers to the video in the APK using the R.raw.yourvideo object
pointer:

Example for use with a VideoView (assuming you have one already named
mVideoView) is:

        Uri uri = Uri.parse("android.resource://
com.your.package.name/" + R.raw.videoname);
        mVideoView.setVideoURI(uri);

Documentation is buried obscurely here:
http://developer.android.com/reference/android/content/ContentResolver.html

See the detail on the openAssetFileDescriptor method, and you'll find
the info on formatting the URI.

Regards,

John K

On Jun 16, 10:22 am, JP <[email protected]> wrote:
> I'm writing a program which requires that avideobe packaged with
> it.  The only way I know of doing this is by adding thevideoto res/raw/, 
> which coincidentally renders thevideouseless.  I've looked all
> over the web and the consensus seems to be you can only play streamingvideo, 
> orvideofrom a file.  In the emulator if I attempt to play thevideothrough the 
> method used here (http://developer.android.com/guide/topics/media/index.html
> ), all I get is audio and a black screen.
>
> I've attempted to use VideoView as well, and the same thing occurs,
> audio but with a black screen.  There must be a way to packagevideo
> with your application without needing an SD card, or having to stream
> the file and have thevideoactually play.  In the words of Google, I
> would like to create a "seamless" experience.  :)
>
> Any help is greatly appreciated!

--~--~---------~--~----~------------~-------~--~----~
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