Hi Dear,

i am looking for the same solution, i need to play a local video for
the introduction of my App.
for the simplest solution i created a new activity and playing video
from sdcard as follows:

 private String path = "/sdcard/intro.mp4";
    private VideoView mVideoView;

    @Override
    public void onCreate(Bundle icicle) {
        super.onCreate(icicle);
        setContentView(R.layout.videoview);
        mVideoView = (VideoView) findViewById(R.id.surface_view);

            mVideoView.setVideoPath(path);
            mVideoView.setMediaController(new MediaController(this));
            mVideoView.requestFocus();
            mVideoView.start();
            mVideoView.setOnCompletionListener(new OnCompletionListener
(){

                // @Override
                public void onCompletion(MediaPlayer arg0) {
               finish();
                }
           });

///////////////////////////

now i have put the intro.mp4 in res/raw but dont know how can i set
its path to videoView
anybody know how to play a local video?


On Jul 21, 11:45 pm, MannyNS <[email protected]> wrote:
> Hey Mark,
>
> thanks for the reply. I thought that having the video in "/files/" is
> how it is meant to be done. I do not have to have it in somewhere
> specific, but wherever I put it, I must be able to provide a reference
> to it to native media player.
>
> What do you suggest?
>
> Manny
>
> On Jul 21, 11:48 pm, Mark Murphy <[email protected]> wrote:
>
> > MannyNS wrote:
> > > Do you, by any chance, know how I can embed the 3gp file in the apk? I
> > > would like to have it in the subdirectory "/files/".
>
> > In general, those are mutually exclusive.
>
> > You can have it as a raw resource (res/raw/) or an asset (assets/) in
> > your APK. Or, you can download it from somewhere and put it in files/.
>
> > You could put the 3GP file in res/raw/ or assets/, then copy it to a
> > local file, but you will wind up taking twice the on-board storage,
> > which for a video file is not a great idea, since storage is limited on
> > some devices.
>
> > --
> > Mark Murphy (a Commons 
> > Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> > Need help for your Android OSS project?http://wiki.andmob.org/hado
--~--~---------~--~----~------------~-------~--~----~
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