Video in Android Mode


… this takes over and continues from the thread at the old forum


The line … afd = context.getAssets().openFd(“machine_compr.mp4”); generates a file error for me too if the video is in the project folder. if you create a Data folder and put the video in there it works! When Processing turns your sketch into ‘proper’ Java/Android, the video is put into the apps Assets folder which is where getAssets() looks for it. I am guessing that this is why trying to load from and SD with this method doesn’t work… the file has to be in the Assets folder.

A start at least!!

@akenaton At last I can see a video … phew … hard work yes and more yet to be done but it’s a start!



i dont have time enough to go to the “old forum” but i un derstand reading your pos that you have tried the afd putting your video on the SD card: in this case afd cannot work (but you can use URI to make it running)
i am happy to have helped you and that finally it runs: now you can see that you can play video without any library…

good luck!

Is it possible to load 400 photos of total size 85MB on android mode?

Yes, that’s right … it runs. Just now trying look at the surface view stacking order as if use full screen, the video goes behind the main sketch … I am at least again motivated to try again!

Edit:… and I found it … mySurface.setZOrderOnTop(true)

:slight_smile: Happy days


Yes it works! :slight_smile:
So the problem is really the file location when trying to put it on the SD card… Should we get back to DataSource() for that?
I can’t just export the app with the videos because my “playlist” is supposed to change dynamically

But it feels good to see finally something happening, thank you so much! :slight_smile:



Yes, the problem is using getAssets. as this is searching in the assets folder of the app. I want the same as you … dynamically from the SD Card! @akenaton say it can be done using URI … so that’s where I will be looking next.

We’ll get there!


Great, I’m starting to read about URI as well. I have to admit it’s a brand new world to me!