1var dir = "/videos";
2var fileextension = ".mp4";
3$.ajax({
4 //This will retrieve the contents of the folder if the folder is configured as 'browsable'
5 url: dir,
6 success: function (data) {
7 // List all mp4 file names in the page
8 $(data).find("a:contains(" + fileextension + ")").each(function () {
9 var filename = this.href.replace(window.location.host, "").replace("http:///", "");
10 $("body").append($("<img src=" + dir + filename + "></img>"));
11 });
12 }
13});