Create a list of Videos and Play any one

I want to create a list of videos, selected from Gallery. may be in separate folder. order them n a list, say 0 to k.
and play one of the video when idex number n is available (n = 0 to k).
Kindly help.

what have you tried? show your blocks.

1 Like

HI, I tried this.

I have gone through many examples, apps on Video player etc. but all are either playing online (youtube) videos through player or recorded camera videos. I have not found any source where a list of videos to be played is formed, and videos played from that list only, when selected by some means.
The objective is

  1. Select videos to from a playlist or list. (lets Say, I have selected 10 videos from my phone through activity)
  2. play a video from a list (of 10 videos), (when 1 to 10 any number is selected)


Uploading: 123.png...

No blocks photo attached.

which part is your problem?

  1. How to select 10 videos and save to a list?
    or 2. play a random video from a list?

The problem s both 1& 2

You might get an idea how to do it from the jukebox example found here

Just adjust it to your needs...

To pick a random item from a list without repeating see here


AI2 list indexes start at 1

Great souce of sample blocks, Thank you.

I have tried this... To play one of the video when V1 or V2 is pressed.
Nothing is happening. I dont know what is wrong.
Pls help.
VideoPlay3.aia (349.6 KB)

If you are asking for help, I recommend you to make it as easy for others to be able to help you ...
You probably will get more feedback then...

which means in your case post a screenshot of your relevant blocks...

To download the aia file, upload it to App Inventor, open it, do some bug hunting for you, etc... this takes time, and most people will not do that...
Thank you.


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

[quote="Amit_Jagtap, post:12, topic:77646"]
I have tried this... To play one of the video when V1 or V2 is pressed.
Nothing is happening. I dont know what is wrong.
Pls help.
blocks divided in two snaps.

THis is the complete block.

Does it make sense to have all movie files twice in the list?

Debug your blocks to find out, if the videoplayer source is a valid path to a movie... you might want to display it in a label...

Also why do you want to play only the 1st or 2nd movie and after completing the movie play the same movie again?


  1. Its a mistake, I am adding same files twice in the list.
  2. For testing purpose I added only two videos there. Once code is working, there will be number of videos and souce of video selection will be different.
    There is no other mistake in code?

if you have 10 files , 100 files , how long will this code be?

For that I just want to create a list off all available videos in a folder. And then play one whos index is matching with my input number. How it can be done with short & smart code.
Pls help.

You have already been directed to the jukebox example on Taifun's website. Use this as a base to get a list of files to play.

Use a textbox and set it to numbers only