MediaPi - Media player web interface for the Rasberry Pi
Author: https://github.com/electronicsleep
Play movies continuously on boot or respond to commands via web interface
Turn your TV into a personal movie player to play your favorite videos or songs
RasberryPi2, Raspbian GNU/Linux 9
HDMI cable, TV with HDMI
Wifi USB device - for access to ssh/web interface
Ensure omxplayer is installed.
sudo apt-get install omxplayer -y
Enable ssh at boot https://www.raspberrypi-spy.co.uk/2012/05/enable-secure-shell-ssh-on-your-raspberry-pi/
- Install apache2, php7, setup wifi, add media to folders in www/
sudo apt-get install apache2 php -y
- Setup hosts file for mediapi.local and deploy files
# create hosts entry (mediapi.local) update permissions then deploy
mkdir /home/pi/scripts
sudo chown -R pi /var/www/html
sudo chmod -R 775 /var/www/html
sudo chgrp -R www-data /var/www/html
bash deploy.sh
- Remove default html file
rm /var/www/html/index.html
- Control via web interface, start music/movies, stop media
Launch http://mediapi.local in your browser to access web interface
using pi user crontab -e
#MediaPi: script for media control
@reboot bash -x /home/pi/scripts/mediapi.sh >> /home/pi/scripts/mediapi.log 2>&1
sudo apt-get install tmux htop -y
# Start
bash /home/pi/scripts/mediapi-start.sh
# Stop
bash /home/pi/scripts/mediapi-stop.sh
Movie Playlists: Continuously play movies
Web Interface: See what video is playing and start and stop media
Play a relaxing playlist for your family
Review recorded GoPro Videos
Show footage on TV with friends
Small Portable Movie player
Recycle (repurpose an old not smart TV)
Install scripts to autoplay movies at boot
Q) How do I stop playing
A) Easiest way is to simply hit the home button on TV remote to get out of HDMI
Q) How do I boot up normally and not play videos/songs?
A) Comment out the mediapi cron
Q) How to stop the videos while playing?
A) Use the web interface link or ssh to the mediapi: echo "stop" > /tmp/mediapi-stop.txt
Q) Does this require X running?
A) No does not require X (although it will work either way)
https://www.raspberrypi.org/products/raspberry-pi-2-model-b/