# Running videos on android

**URL:** <https://discourse.processing.org/t/running-videos-on-android/26916>\
**Category:** Processing for Android\
**Created:** [January 9, 2021, 12:46pm UTC](https://discourse.processing.org/t/running-videos-on-android/26916 "2021-01-09T12:46:31Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![paturn](https://avatars.discourse-cdn.com/v4/letter/p/34f0e0/32.png) [@paturn](https://discourse.processing.org/u/paturn)\
**Post date:** [January 9, 2021, 12:46pm UTC](https://discourse.processing.org/t/running-videos-on-android/26916/1 "2021-01-09T12:46:31Z")

</div>

I have used Movie in Processing for Windows from processing.video.\* but cannot use it in android.

I have tried using FileDescriptor and getAssets etc with the video in data or other folder (located via Environment.getExternalStorageDirectory()) but I just get a null pointer, although it is looking in the correct folder.

Any ideas where the problem lies? I have searched on the web but none of the solutions work. The manifest has the correct permissions.

---

<div class="post-metadata">

**Author:** ![akenaton](https://avatars.discourse-cdn.com/v4/letter/a/a88e4f/32.png) [@akenaton](https://discourse.processing.org/u/akenaton)\
**Post date:** [January 9, 2021, 3:30pm UTC](https://discourse.processing.org/t/running-videos-on-android/26916/2 "2021-01-09T15:30:57Z")

</div>

@paturn === it works fine with AFD and mediaPlayer  
can you put the code you are using?

---

<div class="post-metadata">

**Author:** ![paturn](https://avatars.discourse-cdn.com/v4/letter/p/34f0e0/32.png) [@paturn](https://discourse.processing.org/u/paturn)\
**Post date:** [January 9, 2021, 6:26pm UTC](https://discourse.processing.org/t/running-videos-on-android/26916/3 "2021-01-09T18:26:14Z")

</div>

@akenaton  
Code as follows :-  
import android.media.MediaMetadataRetriever;  
import android.os.Looper;  
import android.app.Activity;  
import android.view.ViewGroup;  
import android.view.View;  
import android.view.SurfaceHolder;  
import android.view.SurfaceView;  
import android.media.MediaMetadataRetriever;  
import android.media.MediaPlayer;  
import android.content.res.Resources;  
import android.content.res.AssetFileDescriptor;  
import android.content.res.AssetManager;  
import android.content.Context;  
import android.widget.FrameLayout;  
import android.R;  
import android.content.\*;  
import android.view.Gravity;  
import android.view.ViewGroup.LayoutParams;  
import android.os.Environment;

AssetFileDescriptor afd;  
Context context;  
Activity act;  
SurfaceView mySurface;  
SurfaceHolder mSurfaceHolder;  
MediaMetadataRetriever metaRetriever;  
MediaPlayer mp;  
FrameLayout fl;  
String pathstr = Environment.getExternalStorageDirectory();.

void setup() {  
size(10, 10);  
Looper.prepare();  
try {  
afd = context.getAssets().openFd(pathstr+“ConDrift.mp4”);  
MediaMetadataRetriever metaRetriever = new MediaMetadataRetriever();  
metaRetriever.setDataSource(afd.getFileDescriptor(), afd.getStartOffset(), afd.getLength());  
String height = metaRetriever.extractMetadata(MediaMetadataRetriever.METADATA\_KEY\_VIDEO\_HEIGHT);  
}  
catch (IOException e) {  
e.printStackTrace();  
}  
mp = new MediaPlayer();  
try {  
mp.setDataSource(afd.getFileDescriptor(), afd.getStartOffset(), afd.getLength());  
mp.prepare();  
}  
catch (IOException e) {  
e.printStackTrace();  
}  
startVideo();  
}

void startVideo() {  
act.runOnUiThread(new Runnable() {  
public void run() {

```
  if (mp.isPlaying() == false) {
    mp.start();
  }
}

```

}  
);  
}

void draw() {  
}

void onStop() {  
if (mp!=null) {  
mp.release();  
mp = null;  
}  
super.onStop() ;  
}

@Override  
public void onStart() {  
act = this.getActivity();  
context = act.getApplicationContext();  
mySurface = new SurfaceView(act);  
mSurfaceHolder = mySurface.getHolder();  
mSurfaceHolder.setType(SurfaceHolder.SURFACE\_TYPE\_PUSH\_BUFFERS);  
mSurfaceHolder.addCallback(new SurfaceHolder.Callback() {  
@Override  
public void surfaceCreated(SurfaceHolder surfaceHolder) {  
mp.setDisplay(surfaceHolder);  
}  
@Override  
public void surfaceChanged(SurfaceHolder surfaceHolder, int i, int i2, int i3) {  
mp.setDisplay(surfaceHolder);  
}  
@Override  
public void surfaceDestroyed(SurfaceHolder surfaceHolder) {  
}  
}  
);  
mySurface.bringToFront();  
[//mySurface.setX](https://mySurface.setX)(100);  
[//mySurface.setY](https://mySurface.setY)(100);  
fl = (FrameLayout)act.findViewById(R.id.content);  
FrameLayout.LayoutParams params1 = new FrameLayout.LayoutParams(LayoutParams.WRAP\_CONTENT, LayoutParams.WRAP\_CONTENT, Gravity.CENTER);  
fl.addView(mySurface);  
}  
pathstr shows correct folder in console, and mp4 file us in that folder, but error says file not found.

---

<div class="post-metadata">

**Author:** ![akenaton](https://avatars.discourse-cdn.com/v4/letter/a/a88e4f/32.png) [@akenaton](https://discourse.processing.org/u/akenaton)\
**Post date:** [January 9, 2021, 6:30pm UTC](https://discourse.processing.org/t/running-videos-on-android/26916/4 "2021-01-09T18:30:00Z")

</div>

@paturn === ill’give a look at that to morrow; it has to run

---

<div class="post-metadata">

**Author:** ![akenaton](https://avatars.discourse-cdn.com/v4/letter/a/a88e4f/32.png) [@akenaton](https://discourse.processing.org/u/akenaton)\
**Post date:** [January 10, 2021, 6:23pm UTC](https://discourse.processing.org/t/running-videos-on-android/26916/5 "2021-01-10T18:23:43Z")

</div>

@paturn === i gave a look to this old code and made some modifs; it runs; you have ony to put your video in the data folder (and change the name, of course; now i have another solution with a videoView; if you want i can put the code.Tested with MM and Nougat.

```auto
import android.media.MediaMetadataRetriever;
import android.os.Looper;
import android.app.Activity;
import android.view.ViewGroup;
import android.view.View;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.media.MediaPlayer;
import android.content.res.Resources;
import android.content.res.AssetFileDescriptor;
import android.content.res.AssetManager;
import android.content.Context;
import android.widget.FrameLayout;
import android.content.*;
import android.view.Gravity;
import android.view.ViewGroup.LayoutParams;
import android.os.Environment;
import android.content.pm.PackageManager;
import android.os.Build;
import android.Manifest;
import android.os.Build;
////////////////////////////////////////////////
int MyVersion = Build.VERSION.SDK_INT;
AssetFileDescriptor afd;
Context context;
Activity act;
SurfaceView mySurface;
SurfaceHolder mSurfaceHolder;
MediaMetadataRetriever metaRetriever;
MediaPlayer mp;
FrameLayout fl;
boolean surfacecreated = false;///new, in order to avoid taht the mp is created but not the surface
//String pathstr = Environment.getExternalStorageDirectory();////i put the video in the data folder

void setup() {
size(10, 10);// to show that the surface is created
permissions();///new, normally it is notneeded, yet i am prudent with that (after lollypop they are asked on runtime and not only through the Manifest)
Looper.prepare();//as you modify the main ui thread
}

void permissions(){
if (MyVersion > Build.VERSION_CODES.LOLLIPOP_MR1) {
                if (!permissionsDejaAccordees()) {
                    demandePermissionParticuliere();
                }
};  
};

private boolean permissionsDejaAccordees() {
/// in some cases i have seen that an error is fired if the permissision is allready granted
    int result = act.checkSelfPermission( Manifest.permission.WRITE_EXTERNAL_STORAGE);
    if (result == PackageManager.PERMISSION_GRANTED) {
      println("permission déjà accordée");
        return true;
    } else {
      println("je demande particulière");
        return false;
    }
};

private void demandePermissionParticuliere() {
        
        act.requestPermissions(new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE},101);////you can also ask only for read but...
};

public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
    switch (requestCode) {
        case 101:
            if (grantResults[0] == PackageManager.PERMISSION_GRANTED) {
               println("permissions accordées");
            } else {
                println("permissions not granted");
            }
            break;
        default:
            act.onRequestPermissionsResult(requestCode, permissions, grantResults);
    }
}
void prepareMP(){
 try {
afd = context.getAssets().openFd("who.mp4");
MediaMetadataRetriever metaRetriever = new MediaMetadataRetriever();
metaRetriever.setDataSource(afd.getFileDescriptor(), afd.getStartOffset(), afd.getLength());
String height = metaRetriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_HEIGHT);
println("la hauteur2 de la video est=="+ height);///in order to be sure that the video was found and also, if needed to work with the height or the width of the video and the surface (scaling)
}
catch (IOException e) {
e.printStackTrace();
}
mp = new MediaPlayer();
try {
mp.setDataSource(afd.getFileDescriptor(), afd.getStartOffset(), afd.getLength()); 
mp.prepare();
}catch (IOException e) {
e.printStackTrace();
}

if(surfacecreated){
startVideo();
}
};

void startVideo() {
act.runOnUiThread(new Runnable() {
public void run() {

  if (mp.isPlaying() == false) {
    mp.start();
  }
}

}
);
}

void draw() {
}

void onStop() {
if (mp!=null) {
mp.release();
mp = null;
}
super.onStop() ;
}

@Override
public void onStart() {
act = this.getActivity();
context = act.getApplicationContext();
prepareMP();//new, because it happens that onStart is performed before settings() and mp is not //instantiated
mySurface = new SurfaceView(act);
mSurfaceHolder = mySurface.getHolder();
mSurfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);

mSurfaceHolder.addCallback(new SurfaceHolder.Callback() {
@Override
public void surfaceCreated(SurfaceHolder surfaceHolder) {
  surfacecreated = true;//new, i am very prudent....
  println("la surface a été créé");
  if(mp !=null){
mp.setDisplay(surfaceHolder);
startVideo();
  }else{
    println("le mediaplayer n'est pas ok");
    prepareMP();
    mp.setDisplay(surfaceHolder);
    startVideo();
  
}
}
@Override
public void surfaceChanged(SurfaceHolder surfaceHolder, int i, int i2, int i3) {
mp.setDisplay(surfaceHolder);
}
@Override
public void surfaceDestroyed(SurfaceHolder surfaceHolder) {
}
}
);
mySurface.bringToFront();
//mySurface.setX(100);
//mySurface.setY(100);
fl = (FrameLayout)act.findViewById(R.id.content);
FrameLayout.LayoutParams params1 = new FrameLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, Gravity.CENTER);
fl.addView(mySurface);
}

```

---

<div class="post-metadata">

**Author:** ![paturn](https://avatars.discourse-cdn.com/v4/letter/p/34f0e0/32.png) [@paturn](https://discourse.processing.org/u/paturn)\
**Post date:** [January 10, 2021, 6:46pm UTC](https://discourse.processing.org/t/running-videos-on-android/26916/6 "2021-01-10T18:46:41Z")

</div>

Thank you akenaton.

I’ll try it tomorrow.

When I’ve written programs for video in Eclipse I’ve always used just READ EXTERNAL STORAGE permission. Does Processing require extra pemissions?

---

<div class="post-metadata">

**Author:** ![akenaton](https://avatars.discourse-cdn.com/v4/letter/a/a88e4f/32.png) [@akenaton](https://discourse.processing.org/u/akenaton)\
**Post date:** [January 10, 2021, 6:49pm UTC](https://discourse.processing.org/t/running-videos-on-android/26916/7 "2021-01-10T18:49:29Z")

</div>

@paturn ==== write is more potent: if you can write you can read!!!

---

<div class="post-metadata">

**Author:** ![paturn](https://avatars.discourse-cdn.com/v4/letter/p/34f0e0/32.png) [@paturn](https://discourse.processing.org/u/paturn)\
**Post date:** [January 11, 2021, 10:15am UTC](https://discourse.processing.org/t/running-videos-on-android/26916/8 "2021-01-11T10:15:28Z")

</div>

@akenaton  
Result is the following error

Found a { that’s missing a matching }

That is all. One line. Not even a list or an explanation of what “a” is.  
I must be missing something which your code requires and my previous code did not require.

Any ideas?

---

<div class="post-metadata">

**Author:** ![clay21](https://avatars.discourse-cdn.com/v4/letter/c/e8c25b/32.png) [@clay21](https://discourse.processing.org/u/clay21)\
**Post date:** [January 11, 2021, 12:49pm UTC](https://discourse.processing.org/t/running-videos-on-android/26916/9 "2021-01-11T12:49:55Z")

</div>

Have you been able to run it? If you are, would you share it? I also have problems with the video 🙂

---

<div class="post-metadata">

**Author:** ![paturn](https://avatars.discourse-cdn.com/v4/letter/p/34f0e0/32.png) [@paturn](https://discourse.processing.org/u/paturn)\
**Post date:** [January 11, 2021, 1:06pm UTC](https://discourse.processing.org/t/running-videos-on-android/26916/10 "2021-01-11T13:06:45Z")

</div>

@clay21

No, please see above result.

Previous videos on android using Eclipse work OK but I can’t get a video to run on Processing for Android.

---

<div class="post-metadata">

**Author:** ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)\
**Post date:** [January 11, 2021, 2:15pm UTC](https://discourse.processing.org/t/running-videos-on-android/26916/11 "2021-01-11T14:15:06Z")

</div>

> [@paturn](#):
>
> I can’t get a video to run on Processing for Android.

See [here](https://discourse.processing.org/t/android-video-problem/26948/7) the answer to @clay21 I gave.

---

<div class="post-metadata">

**Author:** ![paturn](https://avatars.discourse-cdn.com/v4/letter/p/34f0e0/32.png) [@paturn](https://discourse.processing.org/u/paturn)\
**Post date:** [January 11, 2021, 3:33pm UTC](https://discourse.processing.org/t/running-videos-on-android/26916/12 "2021-01-11T15:33:13Z")

</div>

I get the surface view from this, but I still get the error message file not found. This applies to the data folder or any folder located from the Environment source.

Whenever I use any other of my android apps (via Eclipse) the correct video file is found.

I assume my settings in Processing are not correct. Any suggestions?

---

<div class="post-metadata">

**Author:** ![paturn](https://avatars.discourse-cdn.com/v4/letter/p/34f0e0/32.png) [@paturn](https://discourse.processing.org/u/paturn)\
**Post date:** [January 11, 2021, 3:54pm UTC](https://discourse.processing.org/t/running-videos-on-android/26916/13 "2021-01-11T15:54:35Z")

</div>

I’ve removed the reference to the GStreamer library but it still gives the same error of file not found.

Is there a different video library that I should be using?

---

<div class="post-metadata">

**Author:** ![akenaton](https://avatars.discourse-cdn.com/v4/letter/a/a88e4f/32.png) [@akenaton](https://discourse.processing.org/u/akenaton)\
**Post date:** [January 11, 2021, 4:13pm UTC](https://discourse.processing.org/t/running-videos-on-android/26916/14 "2021-01-11T16:13:46Z")

</div>

@paturn === i heve verified, the code is ok; there wa probably a typo with cut && copy; i put the code again: dont forget the permission and put the orientation according to your video.

```auto

import android.R;
import android.media.MediaMetadataRetriever;
import android.os.Looper;
import android.app.Activity;
import android.view.ViewGroup;
import android.view.View;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.media.MediaPlayer;
import android.content.res.Resources;
import android.content.res.AssetFileDescriptor;
import android.content.res.AssetManager;
import android.content.Context;
import android.widget.FrameLayout;
import android.content.*;
import android.view.Gravity;
import android.view.ViewGroup.LayoutParams;
import android.os.Environment;
import android.content.pm.PackageManager;
import android.os.Build;
import android.Manifest;
import android.os.Build;
////////////////////////////////////////////////
int MyVersion = Build.VERSION.SDK_INT;
AssetFileDescriptor afd;
Context context;
Activity act;
SurfaceView mySurface;
SurfaceHolder mSurfaceHolder;
MediaMetadataRetriever metaRetriever;
MediaPlayer mp;
FrameLayout fl;
boolean surfacecreated = false;///new, in order to avoid taht the mp is created but not the surface
//String pathstr = Environment.getExternalStorageDirectory();////i put the video in the data folder

void setup() {
size(10, 10);// to show that the surface is created
permissions();///new, normally it is notneeded, yet i am prudent with that (after lollypop they are asked on runtime and not only through the Manifest)
Looper.prepare();//as you modify the main ui thread
}

void permissions(){
if (MyVersion > Build.VERSION_CODES.LOLLIPOP_MR1) {
                if (!permissionsDejaAccordees()) {
                    demandePermissionParticuliere();
                }
};  
};

private boolean permissionsDejaAccordees() {
/// in some cases i have seen that an error is fired if the permissision is allready granted
    int result = act.checkSelfPermission( Manifest.permission.WRITE_EXTERNAL_STORAGE);
    if (result == PackageManager.PERMISSION_GRANTED) {
      println("permission déjà accordée");
        return true;
    } else {
      println("je demande particulière");
        return false;
    }
};

private void demandePermissionParticuliere() {
        
        act.requestPermissions(new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE},101);////you can also ask only for read but...
};

public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
    switch (requestCode) {
        case 101:
            if (grantResults[0] == PackageManager.PERMISSION_GRANTED) {
               println("permissions accordées");
            } else {
                println("permissions not granted");
            }
            break;
        default:
            act.onRequestPermissionsResult(requestCode, permissions, grantResults);
    }
}
void prepareMP(){
 try {
afd = context.getAssets().openFd("who.mp4");
MediaMetadataRetriever metaRetriever = new MediaMetadataRetriever();
metaRetriever.setDataSource(afd.getFileDescriptor(), afd.getStartOffset(), afd.getLength());
String height = metaRetriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_HEIGHT);
println("la hauteur2 de la video est=="+ height);///in order to be sure that the video was found and also, if needed to work with the height or the width of the video and the surface (scaling)
}
catch (IOException e) {
e.printStackTrace();
}
mp = new MediaPlayer();
try {
mp.setDataSource(afd.getFileDescriptor(), afd.getStartOffset(), afd.getLength()); 
mp.prepare();
}catch (IOException e) {
e.printStackTrace();
}

if(surfacecreated){
startVideo();
}
};

void startVideo() {
act.runOnUiThread(new Runnable() {
public void run() {

  if (mp.isPlaying() == false) {
    mp.start();
  }
}

}
);
}

void draw() {
}

void onStop() {
if (mp!=null) {
mp.release();
mp = null;
}
super.onStop() ;
}

@Override
public void onStart() {
act = this.getActivity();
context = act.getApplicationContext();
prepareMP();//new, because it happens that onStart is performed before settings() and mp is not //instantiated
mySurface = new SurfaceView(act);
mSurfaceHolder = mySurface.getHolder();
mSurfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);

mSurfaceHolder.addCallback(new SurfaceHolder.Callback() {
@Override
public void surfaceCreated(SurfaceHolder surfaceHolder) {
  surfacecreated = true;//new, i am very prudent....
  println("la surface a été créé");
  if(mp !=null){
mp.setDisplay(surfaceHolder);
startVideo();
  }else{
    println("le mediaplayer n'est pas ok");
    prepareMP();
    mp.setDisplay(surfaceHolder);
    startVideo();
  
}
}
@Override
public void surfaceChanged(SurfaceHolder surfaceHolder, int i, int i2, int i3) {
mp.setDisplay(surfaceHolder);
}
@Override
public void surfaceDestroyed(SurfaceHolder surfaceHolder) {
}
}
);
mySurface.bringToFront();
//mySurface.setX(100);
//mySurface.setY(100);
fl = (FrameLayout)act.findViewById(R.id.content);
FrameLayout.LayoutParams params1 = new FrameLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, Gravity.CENTER);
fl.addView(mySurface);
}

```

---

<div class="post-metadata">

**Author:** ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)\
**Post date:** [January 11, 2021, 4:29pm UTC](https://discourse.processing.org/t/running-videos-on-android/26916/15 "2021-01-11T16:29:30Z")

</div>

> [@paturn](#):
>
> via Eclipse

When you have some time could you please install APDE and test the code of the link above? It will only take a minute or two. Because when I use a file in the data folder, I don’t need any permission at all. I’m curious if it can be device-dependent,

---

<div class="post-metadata">

**Author:** ![paturn](https://avatars.discourse-cdn.com/v4/letter/p/34f0e0/32.png) [@paturn](https://discourse.processing.org/u/paturn)\
**Post date:** [January 12, 2021, 10:34am UTC](https://discourse.processing.org/t/running-videos-on-android/26916/16 "2021-01-12T10:34:20Z")

</div>

@akenaton  
I still get no file found using your latest code, both for default data folder and one located with Environment.

I am using Processing 3.5.4

---

<div class="post-metadata">

**Author:** ![paturn](https://avatars.discourse-cdn.com/v4/letter/p/34f0e0/32.png) [@paturn](https://discourse.processing.org/u/paturn)\
**Post date:** [January 12, 2021, 10:46am UTC](https://discourse.processing.org/t/running-videos-on-android/26916/17 "2021-01-12T10:46:33Z")

</div>

@noel  
I have tried the sketch with APDE and it doesn’t work. I have retried previous examples in APDE and they work correctly. I am using Samsung Galaxy A40 with android 10.

---

<div class="post-metadata">

**Author:** ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)\
**Post date:** [January 12, 2021, 11:20am UTC](https://discourse.processing.org/t/running-videos-on-android/26916/18 "2021-01-12T11:20:58Z")

</div>

> [@paturn](#):
>
> I have tried the sketch with APDE and it doesn’t work.

Did you use APDE’s App mode? Could you try it with [this](https://drive.google.com/file/d/1PO6x1kKs85_cPs1TzOOXjgsNp1dFjiRt/view?usp=sharing) video, placing it in the data folder? (maybe it’s the file) I’ve tested it on Samsung Android 10.

Edit: Wich sketch are you referring to; mine or yours?

---

<div class="post-metadata">

**Author:** ![paturn](https://avatars.discourse-cdn.com/v4/letter/p/34f0e0/32.png) [@paturn](https://discourse.processing.org/u/paturn)\
**Post date:** [January 12, 2021, 11:46am UTC](https://discourse.processing.org/t/running-videos-on-android/26916/19 "2021-01-12T11:46:51Z")

</div>

@noel  
I have tried your video on your code  
and it doesn’t work on my phone.  
Where is App mode in APDE?

---

<div class="post-metadata">

**Author:** ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)\
**Post date:** [January 12, 2021, 12:48pm UTC](https://discourse.processing.org/t/running-videos-on-android/26916/20 "2021-01-12T12:48:57Z")

</div>

> [@paturn](#):
>
> Where is App mode in APDE?

To the right of the play button you have a phone and \<\> icon. First = App mode, last = Preview mode.  
Did it give any error?

[Next page](https://discourse.processing.org/t/running-videos-on-android/26916.md?page=2)
