theothernt / AerialViews

A screensaver for Android TV devices including Nvidia Shield, Fire TV, and Chromecast with Google TV. Inspired by Apple TV's video screensaver.
GNU General Public License v3.0
469 stars 35 forks source link

Add network storage support #4

Closed theothernt closed 3 years ago

theothernt commented 3 years ago

Add the ability to play videos from the local network, via network shares (SMB/Samba)

spauldhaliwal commented 3 years ago

I was just researching whether it was possible to create symbolic links in android to network locations but this would be a better solution when added.

theothernt commented 3 years ago

I was able to get this working in a seperate test app, so the feature is coming soon @spauldhaliwal.

spauldhaliwal commented 3 years ago

That's great! But actually, I just realized the Shield allows me to mount network drives to the file system and after a quick test that seems to be working. But this will definitely be a good addition in general since most videos are ~half a gig each.

nirajsanghvi commented 3 years ago

Hey @theothernt , can you please give an update on the status of this? I'd love to use this on my Chromecast with Google TV and drive it from videos stored locally on my NAS. Thanks for your efforts!

theothernt commented 3 years ago

@nirajsanghvi it's actually nearly done. I just have to add the settings UI, test it for a few days then I'll upload a new build - so I'd say we're looking at later this week?

nirajsanghvi commented 3 years ago

@theothernt very cool, looking forward to it! 👍

theothernt commented 3 years ago

@nirajsanghvi @spauldhaliwal Ok, a day or two late but the latest build is up which includes SMB/Samba support. Give it a try and let me know if you run into any issues...

https://github.com/theothernt/AerialDream/releases/tag/0.97-preview

(Also, if any of the UI or text doesn't make sense - feedback welcome!)

nirajsanghvi commented 3 years ago

@theothernt just gave it a spin and it's working great! One thing that would really improve the setup is letting you navigate the folder structure of your share once you've entered the IP and username/password since it can be really cumbersome typing out a full path if it's not a simple one. However, I suspect that would take quite a bit of effort to implement, and given that this is more of a set-it-and-forget-it thing, it's probably not worth it when entering a full path just works and you have the "test connection" option to make sure it's setup right.

Note: I did initially have a user error in that I entered my share path and forgot to input the starting slash (I entered path/to/share instead of /path/to/share). Amusingly this still worked fine when I hit "Test connection" in the network share section, correctly connecting and identifying the number of videos in the folder. However when I then tested the screensaver from the main Settings screen, it was just a black screen. When I looked at the logcat I saw that Exoplayer was erroring out due to the malformed path (which ended up looking like smb://username:password@IP_ADDRESSpath/to/share) and quickly realized my mistake. Maybe it'd be beneficial to make it more clear on-screen when Exoplayer has encountered an error?

theothernt commented 3 years ago

I was thinking the same thing about hostname, share name entry, etc but I decided to go with the easier option because, as you point out, a file browser would be a lot of work to write but it is something I'll research. My only advice is to use the Android TV app on your phone for text entry - I'll probably add this to the README.

That other issue is a bug. The code for testing a connection and parsing for playback should be the same but it's obviously not. I'll go fix that and add some validation.

Thanks again for testing the build and giving feedback @nirajsanghvi

theothernt commented 3 years ago

I forgot to add - the 'just a black screen' issue is a long standing one, I just wanted to add local and network support before tackling it. I'll hopefully get to it next.

The plan is to run the screensaver as long as there is at least 1 video. If there are none, display a message like 'no videos found' but have a still image or two with a simple transition. Then within prefs, it will show any errors for each providers with more detail.

spauldhaliwal commented 3 years ago

Tested and it's working smoothly. Thanks again! Actually the shield sometimes un-mounts network shares so this is a better solution.

Only issues I noticed is the values inputted in the setup aren't previewed in the text fields afterward, so you don't really see what your settings are after putting them in. Also most, if not all, of these fields should be single line. I kept pressing enter after filling a field and it would add a new blank line.

But other than that the actual screen saver is working perfectly for me.

theothernt commented 3 years ago

Thanks for testing it @spauldhaliwal

Agreed about the issues with text entry and easily seeing what's saved. I did put that pref screen together quite quickly so it'll definitely be improved in future.

Hukuma1 commented 3 years ago

I host the offline videos on a network drive along with my other NAS media. For some reason this screensaver is doing a random file pull of all my video media, not just the specific file files I added for the screensaver. Anyway to debug this?

theothernt commented 3 years ago

@Hukuma1 currently, the network features works by listing all the files in the shared folder you specify - it doesn't search other sub-folders but it also doesn't filter any of the files, it gets a list of ALL files in that folder. If you're seeing lots of videos you don't want, the only solution currently is to put all the aerial videos in their own folder and point to that.

In a future release, you will be able to filter these files ie. play only Apple's aerial videos from a network share even if the folder contains lots of other videos too.

Hukuma1 commented 3 years ago

Hmmm. I did do that. I have only 4 files in my shared folder \\NAS\Emulation\ShieldTV and it's pulling media from \\Nas\nas\Media\TV\Seinfeld\Season 1 as an example. As much as I love Seinfeld, it's a little weird as a screen saver. :P

theothernt commented 3 years ago

Yeah, that would be odd! 🙃

As you have a Shield, it has the ability to mount a network share (No other Android TV device can do this, to my knowledge) - are you using that as well? If so, when a share is mounted by the system, all of the video files from that share are considered 'local' by Android TV. So if you have "Local Videos" enabled, it will actually put in all videos from that share (all sub folder too as the system scans everything I believe).

So if all your chosen aerial videos are on a network share, you've enabled "Network Videos" and filled in all the settings, then disable "Local Videos", it should work fine?

Hukuma1 commented 3 years ago

Ah that would be it! Thank you. :) Keep up the great work.