Can't view Video in Android

In my code (for Android), I'm using the following.

var intent = Titanium.Android.createIntent({ action: '' });
    Titanium.Android.currentActivity.startActivityForResult(intent, function(e) {

            if (e.resultCode === Titanium.Android.RESULT_OK) {
                videoFile =;
               var scramble=new Date();
               var scramble=scramble.getTime();
               var source = Ti.Filesystem.getFile(videoFile);
                movieFile = Titanium.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory, scramble);

                            videoFile = movieFile.nativePath;


and other code not relevant.

The problem is that I cant play this video, even if its taken from an Android device. I've changed the exetension to 3gp to see if that would work, but it doesnt. I can view the videos fine on Android.

Seems silly that I can't even view the video I recorded on the device. Does anyone else have working code to record and view video?

My video player is

        var holder=Titanium.Media.createVideoPlayer({
        bottom:'50dp',, //my video, yes it is there
        movieControlMode : Titanium.Media.VIDEO_CONTROL_DEFAULT,
        scalingMode : Titanium.Media.VIDEO_SCALING_ASPECT_FILL,


1 Answer

  • Hi Josh,

    Try to find Titanium.Filesystem.applicationDataDirectory and movieFile.nativePath path in your application and compare it.

    I am also facing this problem, I think normally Titanium application stored in to phone memory and data directory reference to the phone memory by default. I got different path all time when I am trying to store video to data directory. and also found a directory in memory card.

    I still have no luck. so I try to store at specific location on the memory, try to create a folder in phone memory and store all video in it. It works for me.

    If you find any solution then please share it.

    Make sure the file type you selected for storage it supported by android player.

    — answered 3 years ago by Gaurang Chhatbar
    1 Comment
    • Well, I'm not trying to store it, I'm trying to stream it. That code I posted was just the capturing part, I send it later to my server (and I can verify its there).

      In another section of my app, I just pull in the http path to the video, and thats where it just sits.

      — commented 3 years ago by Josh Lewis