android, nextcloud

Stream media files from nextcloud to your Android (and iOS) device with Kodi

Introduction

First off all, this write up was inspired by this very good article.  If you haven’t read it so far, go ahead and do it. My post was initially published on r/nextcloud and nachoparker asked me if I want to update it with some pictures and publish it here again. I was very happy to do so.

I looked for a solution to a common problem: I wanted to stream music and video files that are stored on my nextcloud to my phone where ever I am. I have an Android device, but as far as I can see, this will also work on iOS.

I’ve tried a lot of different things like music players and also file managers on Android to somehow get access to my music when I’m not at home. Nothing worked.

And then I remembered Kodi.

Here comes the magic: Kodi can stream any media using WebDAV. I’ve never used it in this way before, because at home I just mount my SMB to Kodi and can stream the things I like. But on the road this does not work (of course).

The beauty about using Kodi on your phone is that you don’t need to do anything to your nextcloud. WebDAV is active by default you don’t need any addons or special settings. So go ahead and get Kodi from the playstore or their website. There are also instructions for iOS.

Getting your music into Kodi

I will primarily guide you through the process using my music library as example, but the same steps can be applied for videos. There are some more remarks about it at the end of the article.

After installation start Kodi on your phone and tap on “Music”. It’s probably empty, except for the “Add Music” button.

Tap on it, which opens a new window where you select “Browse”.

This lists a lot of different options, for example you can also add music from your internal or external storage here. Scroll down to “Add network location” and tap on it.

The first line is “Protocol” and you need to tap the up and down buttons until you find “WebDAV server (HTTPS)” (or HTTP, depending how your nextcloud is set up). Make sure that you really select “WebDAV” and not “Webserver directory”. I only want to add my music collection at the moment, which is stored in a folder called “Music” on my nextcloud. For this reason, I simply add the folder name at the end of the “Remote path” line. The rest should look like you can see below, depending on how you access your nextcloud and where your music is of course.

If everything worked the network location will show up in the list. Again, make sure it starts with “davs://” and that Kodi inserted a slash after the main URL. If something does not look correct you can edit it by tapping on it for a couple seconds.

Tap on the path and it will open a connection to your nextcloud. You should see already sub-folders (if there are any) and files inside your “Music” folder. Don’t select anything further, just tap on “ok” and give the resource a name.

If everything worked you will be back to the first screen, where before there was only the “Add Music” option available. Now there should also be your nextcloud visible, identified by the name you just gave it (“Nextcloud Music” in my case).

Kodi will probably also ask you already if you want to add the files to your media library. Tap “Yes” and it will start scanning your nextcloud Music folder for files. You can also start this process later by tapping longer on “Nextcloud Music” and select “Scan files to media library”.

Depending on your internet connection and the size of your collection this will take a while, but you can see the progress on the top right corner of the screen. On Android you can also minimize Kodi to the background and it will continue scanning. The next time you tap on Music in the Kodi main menu, your music collection will be there.

Conclusion

When you add new music to your nextcloud folder, you need to rescan it with Kodi. Kodi will not do this by itself, however it knows which files it did scan already and only add the new files. This means it won’t take as long as the first scan.

The steps described here also work for videos/movies. Just select the corresponding option from the Kodi main menu. The WebDAV setting for your nextcloud will already be available and you don’t need to set it up again. However, if you defined a specific music folder for Kodi to scan in “Remote path” (as I did in this article), you need to change this or set it up in the same way, but with “Movies” at the end or something. You get what I mean.

Stream ON!

Images by nextcloud.com and XBMC Foundation via Wikimedia

Author: tct

tct is a biologist currently working in the UK. His hobbies have connected him with the world of computers, data protection and security. If you want to do him some good, he likes coffee a lot. Tip in BTC: 1Gv3sQMQ8tsiKgJN8vDJyqvGqTd3d7wDw4 ETH: 0x5b03657a0aB4AB9Db877bD8D967ec40CbAF143c8 or XMR: 87byLZDMkqVJ1xtbgNT3oLUe94uyXdKo1BBqT MmHnZKgUCZ7R9jGbRxA8fNQ8M7BzhDTbX1me3fR1MBnKRwRP9X4BQxarM7

4 Comments on “Stream media files from nextcloud to your Android (and iOS) device with Kodi

  1. Thanks for sharing your great solution for streaming music with Nextcloud. I am using the NextcloudPi image and my final path looked like this in the end:

    davs://ncp:@langbein.spdns.eu/remote.php/dav/files//Music

    As you can see, I had to remove the /nextcloud/ bevore /remote.php/. Otherwise the server was not found.

    1. Hi there,
      Yes, if you use NextcloudPi, nextcloud is installed in the root-directory of the webserver and not in a subfolder called “nextcloud” or something similar. In the note to the “Remote Path” I wrote “My nextcloud is on my server in the folder nextcloud, if yours is different you need to change this”. Of course this applies to NextcloudPi as well.

      I’m happy that you figured it out and that it’s working well for you!

  2. Hey,
    Thanks for the article. I was also on the search for a reliable solution to stream the music to an android device and your solution worked pretty good. Inspired by the webdav solution, I further tried Total Commander (file manager) with the webdav plugin. Worked pretty good as well. But it seems the app is freeware, but not open source.

    1. You are very welcome and I’m happy to hear that it’s working well for you!
      I’ve not looked into Total Commander so far, but I assume that every file manager or application that supports WebDAV should be able to connect to your nextcloud. Very nice idea to expand the WebDAV solution.

Leave a Reply

Your email address will not be published. Required fields are marked *