1

I would like to do the following:

Some media content like video, audio, image, pdf e.t.c... should be stored on a Raspberry Pi 3. More than one smartphone is connected to the Pi through a Wi-Fi network. The phones should be able to access media content from a browser.

How can I build this type of application? Is there any existing package available to make this kind of service?

closed as too broad by Steve Robillard, Milliways, Jacobm001 Jun 19 '17 at 1:50

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • This question is way to broad and vague. What did you try so far? – Bex Jun 16 '17 at 7:48
  • I have tried to make my own server using apache tomcat and apache. It works fine but I am not so good in designing so, I want some ready platform where I can put my media content and it can be accessible from smartphone browser over wifi network. – Parth Shah Jun 16 '17 at 8:07
  • Have you looked into Plex, Kodi, or anything like them? – Jacobm001 Jun 19 '17 at 1:50
  • Using Plex or Kodi is it possible to play video on smartphone browser? – Parth Shah Jun 19 '17 at 8:45
1

I think ownCloud might be what you are after. Before following the steps below make sure your Pi has a fixed IP address.

Assuming you are running Raspbian open a Terminal window and run:

wget http://download.opensuse.org/repositories/isv:OwnCloud:community/Debian_7.0/Release.key

Then run:

sudo apt-key add - Release.key

Those two previous commands installs the necessary repositories and the command below ensures they are up to date:

sudo apt-get update

And finally:

sudo apt-get install owncloud

Which installs ownCloud, it will also ask you to set up a password. The above command also installs some Apache webserver stuff that is also required. To install the extra Apache modules run:

sudo a2enmod headers rewrite env

Followed by:

sudo apachectl restart

To enable the server to handle files greater than 2MB a couple of tweaks need to be made. Go to /etc/php5/apache2 and open the file php.ini. Change the value of upload_max_filesize and post_max_size variables to something like 2G. Which changes the maximum file size to 2GB.

As an extra you can install APC PHP accelerator which might make ownCloud more responsive for larger installations. To do this run:

sudo apt-get install php-apc

To configure APC PHP accelerator run sudo nano /etc/php5/conf.d/20-apc.ini. In this file add:

extension=apc.so apc.enabled=1 apc.shm_size=12M

running sudo apachectl restart enables the cache.

Now you can add external storage, start by plugging in the USB storage device and run sudo blkid. If only one USB device is plugged in it will probably be mounted as /dev/sda1, you will also want to make a note of the UUID. Run sudo mkdir /media/owncloud to create a new file directory. Mount the drive with sudo mount -t vfat -o umask=007,auto,uid=33,gid=33 /dev/sda1 /media/owncloud.

This does work on the assumption the drive is FAT 32. So the drive is automatically mounted run sudo nano /etc/fstab and add:

UUID=your-drives-uuid /media/owncloud/ vfat

rw,umask=007,auto,uid=33,gid=33 0 0

Now open a web browser on your computer and enter Pi's-IP-Address/owncloud. You will then be prompted to create an account. Click storage & database pull down menu and add media/ owncloud/data in the text box corresponding to Data Folder. Then select the MySQL/your-username option in the Database section.

You will then be asked enter the connection details of the database server, so just enter "localhost" as the host and "root" as the username, along with the password you configured when the database was pulled in along with ownCloud.

Everything is now setup. To access the files on the database from your phone you can install the ownCloud app or the free ocloud app and you are good to go.

  • I want just web application that can serve stored media. No user authentication required and user should not able to upload content they can only view or download stored content. – Parth Shah Jun 15 '17 at 11:58
  • Can Plex able to serve content on smartphone browser? – Parth Shah Jun 15 '17 at 12:01
  • There is a good tutorial here, but I have a feeling that it still requires some kind of authentication. There is also an app for it as well, so it is suitable for smartphones. – Darth Vader Jun 15 '17 at 12:03
  • Thanks. Can I play video on smartphone browser using owncloud? – Parth Shah Jun 15 '17 at 12:06
  • I'm not sure, that to a certain degree might depend on the smartphone. I think it is guaranteed if you use one of the apps though. Worst case scenario you can just download the file and then play it using a playback app on your phone. – Darth Vader Jun 15 '17 at 12:11

Not the answer you're looking for? Browse other questions tagged or ask your own question.