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

Adding media player #27

Open
Yumasko opened this issue Feb 3, 2023 · 5 comments
Open

Adding media player #27

Yumasko opened this issue Feb 3, 2023 · 5 comments
Labels
help wanted Extra attention is needed

Comments

@Yumasko
Copy link

Yumasko commented Feb 3, 2023

I use disbox to store my movies, and some photos. (Just as a backup).
It would be nice to be able to play media files in the browser instead of having to download it.

@Shieldowskyy
Copy link

I think this is not possible because it would require downloading the entire video to your computer before playing. This is even more apparent with MP4 files which store the header at the end of the file.

@Yumasko
Copy link
Author

Yumasko commented Feb 6, 2023

I think this is not possible because it would require downloading the entire video to your computer before playing. This is even more apparent with MP4 files which store the header at the end of the file.

Couldn't you just download the segments of the file as you are watching the file?

@regan-prendergast
Copy link

Couldn't you just download the segments of the file as you are watching the file?

I don't think Disbox is really designed for streaming files from the Discord storage, it's more designed for long term static storage. Things that you'd prefer to put away and not need to access on a regular basis.

However, if you really want to stream video from Disbox, you can achieve this with mkv files since they allow you to play individual segments of the video file. The upside is you can start playing the file immediately once the download begins, the downside (among others) is you probably won't be able to skip to different parts of the video since the segments are being downloaded sequentially, it has to start from the beginning. Also it can be a little glitchy/stuttery depending on how fast discord is giving you the parts.

Here is me playing a 4k mkv file as it's downloading, by playing the .crswap file in mpv.net

image

Again, I wouldn't recommend Disbox for this kind of thing.

@DisboxApp
Copy link
Owner

DisboxApp commented Feb 7, 2023

Hey guys! I agree that while you could download the file, it's more convenient to have that feature built in. It's also true that with some file formats this could be possible (as shown by regan).

I recently stumbled into the expermintal (Chrome 94+) MediaStreamTrackGenerator that should act as a MediaStreamTrack that can be written to using a WritableStream, which is what Disbox's downloadFile method accepts. This MediaStreamTrack can then be provided to react-player as the video source.

This sounds like theoretically it shuold be pretty straightforward to implemenet and a cool feature to add, but I'm getting some weird errors I can't find anywhere online:

Uncaught (in promise) TypeError: Failed to execute 'write' on 'UnderlyingSinkBase': Null video frame.

If anyone wants to locally clone the project and mess around with to see if they can get it to work that'd be great :)

@DisboxApp DisboxApp added the help wanted Extra attention is needed label Jul 1, 2023
@Scopen86
Copy link

Scopen86 commented Feb 8, 2024

Hey! @DisboxApp I have just come across a similar project that support playing videos albeit sometimes buggy but it's possible, you may want to check it out! https://github.com/Zeptosec/Thermastore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants