How to use Kodi for streaming media files from your Nextcloud
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 so.
I looked for a solution to the same problem: I wanted to stream my music that is 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 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.
And then I remembered Kodi.
Here comes the magic: Kodi can stream any media using WebDAV. I 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. So go ahead and get Kodi from the playstore or their website. There are also instructions for iOS.
Getting your Music into Kodi
After installation start Kodi on your phone and go to Music. It's probably empty, except for the "Add Music" button.
ap 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). The rest should look like this, assuming that your access your nextcloud via https://your-URL.no-ip.net/nextcloud/:
Server address your-URL.no-ip.net (don't put https or anything here, just the main URL)
Remote path nextcloud/remote.php/dav/files/your_username/ (don't use a leading /)
Port 443 (for me this doesn't seem to matter and it actually sets itself to 0)
Password your_password (the same as you use in your browser for the user you defined above)
Tap 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.
Kodi will probably also ask you already if you want to add the files to your media library. Tap yes and Kodi will start scanning your nextcloud. 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.
A small remark: If you don't want Kodi to scan everything on your nextcloud, but only the folder that contains the music, add in "Remote path" the name of the folder where your music is stored. Something like "/music/" to the end.
This also works for videos/movies. Just select the corresponding option from the Kodi main menue. The WebDAV setting for your nextcloud will be available already and you don't need to set it up again for this. However, if you defined a specific music folder for Kodi to scan in "Remote path", you need to chance this again or set it up in the same way but with "/movies/" at the ende or something. You get what I mean.