Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Offline capability (videos, audio, news, etc.) when connection lacks #155

Closed
serrq opened this issue May 2, 2024 · 20 comments · Fixed by #163
Closed

Offline capability (videos, audio, news, etc.) when connection lacks #155

serrq opened this issue May 2, 2024 · 20 comments · Fixed by #163

Comments

@serrq
Copy link

serrq commented May 2, 2024

Use case: the internet connection lacks for any reason (airplane mode included).

Box, box automatically downloads only the heavy data (for example videos) that I effectively seen: news data are always got because they are light.

Optionally you could adding an on/off switch in settings for this feature.

1000109728

@BrightDV
Copy link
Owner

BrightDV commented May 8, 2024

So you mean: downloading a video for a future watching or caching the whole video while watching it in case of an internet connection error?
The first case could be a really nice feature to add (dedicated section with video/article saves), the second one could be easily added with a setting to choose the cache size (in seconds) of the video player.

@serrq
Copy link
Author

serrq commented May 8, 2024

"Caching the whole video while watching" always, even if connection is excellent.

This idea is taken from another app, called ViMusic (fdroid). It put aside (for future offline use) all that I listen, even mistakenly.

Do you want delete an already downloaded music track?

Go to "download" tab and delete what you want.

To do this please add a download "folder" limit, for example max 5 gb or max 3 months, or a combination of both, in order to not consume excessive resources.

News download all. They are few megabytes (pictures and audio included).

@serrq
Copy link
Author

serrq commented May 8, 2024

What you mean is even another feature, that we can calling "favorites" section or "archive" section.

An user can going on a video and then push "send to archive" or "add to favorites".

@BrightDV
Copy link
Owner

BrightDV commented May 8, 2024

"Caching the whole video while watching" always, even if connection is excellent.

That should be doable. I limited the cache to ~30 seconds because the player can lag (crash?) on devices without a lot of RAM.

This idea is taken from another app, called ViMusic (fdroid). It put aside (for future offline use) all that I listen, even mistakenly.

Do you want delete an already downloaded music track?

Go to "download" tab and delete what you want.

To do this please add a download "folder" limit, for example max 5 gb or max 3 months, or a combination of both, in order to not consume excessive resources.

I agree for the music player, but is it really useful for a video player? For example, you can listen to a music several times, but I don't guess that you would watch the same video more than 3 to 4 different times (and offline).

News download all. They are few megabytes (pictures and audio included).

That's seems a good idea, I will see how I can implement it (images and text first).

What you mean is even another feature, that we can calling "favorites" section or "archive" section.

An user can going on a video and then push "send to archive" or "add to favorites".

Yes, that was the idea; I will open different issues to track the progress of the features' implementation.

@serrq
Copy link
Author

serrq commented May 8, 2024

I have a Senna docufilm put aside. Eh eh eh.

Okay dev, you are the best. I put my wishes in your hands.

@serrq
Copy link
Author

serrq commented May 8, 2024

I agree for the music player, but is it really useful for a video player? For example, you can listen to a music several times, but I don't guess that you would watch the same video more than 3 to 4 different times (and offline).

My approach is different: in my idea I haven't to think about anything. Download just happen automatically.

In your approach you have to push physically the "download" button, and what if the connection lack when you return to see that video again? Maybe you travel in a train that day... but you forgot to push "download"...

@serrq
Copy link
Author

serrq commented May 8, 2024

Or maybe both the ideas "automatically" (caching) and "watch later".

@serrq
Copy link
Author

serrq commented May 8, 2024

I limited the cache to ~30 seconds because the player can lag (crash?) on devices without a lot of RAM.

We can adding an on/off caching switch (for less gifted devices).

@BrightDV
Copy link
Owner

BrightDV commented May 8, 2024

I agree for the music player, but is it really useful for a video player? For example, you can listen to a music several times, but I don't guess that you would watch the same video more than 3 to 4 different times (and offline).

My approach is different: in my idea I haven't to think about anything. Download just happen automatically.

In your approach you have to push physically the "download" button, and what if the connection lack when you return to see that video again?

Yes: you download a video for a future use, but you need to tap on the download button. Then you can watch it later.

Or maybe both the ideas "automatically" (caching) and "watch later".

I limited the cache to ~30 seconds because the player can lag (crash?) on devices without a lot of RAM.

We can adding an on/off full caching switch (for less gifted devices).

I think I will add a setting to manually set the cache time, so you would be able to set it to 1 hour.

The point that I want to understand is whether the video should still be available, even after closing the player or the app.
The cache is only used when you are watching the video, like ViMusic does. However, ViMusic keeps the file in the storage after the playing, so you can listen later to the song, but Box, Box! deletes the cache when you exit the player.
The download should save the video in the storage.

My point is that with your approach, all the videos you have seen will be saved on your device, but you may only watch a few of them again.
With a download, you only save offline what you want to see.

For example, when you see a post-race interview of a particular driver, you will not watch it a lot of time. However, race highlights may be saved. That's why a non-automatic approach seems the best to me.

@serrq
Copy link
Author

serrq commented May 8, 2024

My solution to get the best of two worlds (automatic and based on push) is setting a double trap:

• all those videos automatically downloaded are subject to two rules simultaneously:

  1. Max 5gb (caching of all videos)
  2. Max 3 weeks

Then Box box automatically delete when they expire or they reach the volume limit.

Do you want store "forever" a particular video? Send to archive (manually).

• Based on manual push: manual download is subject on same above rules or send (it directly) to archive to store the video permanently.

@BrightDV
Copy link
Owner

BrightDV commented May 8, 2024

Ok, that's seems to be the best solution. I will add different settings to that.
Now it is the harder part, because I have to implement a download system ;)

@serrq
Copy link
Author

serrq commented May 8, 2024

Okay dev, my philosophy (thinking) is ended. Now it begins the code time. And afterwards we can celebrate the result. 🤓

@serrq
Copy link
Author

serrq commented May 9, 2024

Changed logic in "manual push". Tell me if you approve. Read my edited message above.

#155 (comment)

In this way the download (manual or automatic) always has the same behavior.

Same for the "send to archive" function (basically it says to the app "avoid the download rules" and store the media content permanently).

Basically "send to archive" becomes something like "sanctify this video". Make it immortal. 🤣

@BrightDV
Copy link
Owner

So I have been working on this for some days now in #163.
What I have added yet is the "send to archive" as you said. You can download videos and articles. There is a proper Downloads screen with running and finished downloads, you can pause/resume/delete downloads from there or from the per-download notification.
However, after some thinking, I decided not to add the autodownloader soon. It would need a huge amount of work to create the logic, and there are still missing features/bugs in the app that I want to address first.

I think that the current implementation is the best for a newsreader/video player.
(I will attach screenshots soon!)

@serrq
Copy link
Author

serrq commented Jun 12, 2024

Excellent!

@BrightDV BrightDV linked a pull request Jun 14, 2024 that will close this issue
7 tasks
@BrightDV
Copy link
Owner

So here are some screenshots of the download component:

  • Download screen (running downloads can be paused, resumed; downloads can be opened, deleted...)
  • Notification with a progress indicator for the running downloads, and another notification on download finish.
  • There is a new icon on the top right to download/delete an article/video. You can refresh/delete an article; select video quality on download.
  • Finally, I have added an option in the player to download a video from there (with quality selector also).

@serrq
Copy link
Author

serrq commented Jun 14, 2024

You are a kind man. This is a great work!

@BrightDV
Copy link
Owner

BrightDV commented Jun 16, 2024

So I just merged the PR!
If you want, you can try the debug build from here (app-release.apk at the bottom), but if so, you will have to delete your already installed app.

@serrq
Copy link
Author

serrq commented Jun 16, 2024

I don't see any apk. Don't worry dev, I wait the fdroid update.

PS: what does it mean "debug" version?

1000113826

@BrightDV
Copy link
Owner

You have to be logged in to be able to download the file.

PS: what does it mean "debug" version?

Here I am wrong because it is more a prereleae than a debug version. Anyway, the debug version is a version of the app which logs everything while active, so it is very useful to find bugs, add new features... but not made for production/public releases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants