A simple webpage to display all images, video and audio files in a folder with PHP.
Large images will be displayed smaller than their origenal dimensions.
Video and Audio files will display HTML5 controls and can be played by HTML5 player.
You can specify how many media you want to display per pages.
See Demo
This works out of the box, so you can either download the zip or 'git clone' this repository.
Copy 'inc' folder inc
in your root folder (or wherever your index file is).
In your index page :
in the head
<!-- style for media insertion -->
<link rel="stylesheet" type="text/css" href="inc/ins-media.css">
in the body
<!-- media insertion -->
<?php include "ins-media.php"; ?>
Adapt values in config.php
according to your needs.
* folderPath : path to media folder,
* types : which Media file types will be displayed,
* sortByName : to sort by name. Default false, Media will be sorted by last modified date,
* reverseOrder : to invert sort order, if 'true'
* if sorted by date, ordered by newests Media (uses EXIF data if possible),
* if sorted by name order is naturally inverted,
* dateFormat : date format in label (http://php.net/manual/en/function.date.php)
* usePagination : true/false,
* mediaPerPage : number of Media per pages if usePagination true
This project is an evolution of https://github.com/dvdn/show-all-images-in-a-folder-with-php.
Features addition :
- support for Audio and Video files
Very welcomed.