rejetto / hfs

HFS is a web file server to run on your computer. Share folders or even a single file thanks to the virtual file system.
GNU General Public License v3.0
2.29k stars 228 forks source link

Video player #109

Closed albamef closed 1 year ago

albamef commented 1 year ago

Is it planned to add a video player to this version? Or maybe the plugin already exists?

rejetto commented 1 year ago

there's no video plugin that i know of. hopefully someone will make it. i will consider as improvement for the simple-player plugin

IlyaBOT commented 1 year ago

I have practically written a video player, I started testing it, but at the moment the electricity has been turned off. As soon as it appears, I will upload the video player plugin to github.

IlyaBOT commented 1 year ago

The player is ready, I'm not very good at writing CSS and JS, but it works and seems to look good. IlyaBOT/video-player

albamef commented 1 year ago

I try it, but not all .mkv videos come with sound, and most of the .avi's don't play at all

IlyaBOT commented 1 year ago

Hmm, it seems HTML5 does not support mkv playback, and I'll check avi now. image image

redtrillix commented 1 year ago

I try it, but not all .mkv videos come with sound, and most of the .avi's don't play at all

Ive had that issue before (https://github.com/rejetto/hfs/discussions/73), I've had good luck running the MIME type as a wildcard (*.*) in the HFS configuration.

Unfortunately, some video and audio formats (like avi) are propriety and don't have integration with browsers.

image image

redtrillix commented 1 year ago

@IlyaBOT

The player is ready, I'm not very good at writing CSS and JS, but it works and seems to look good. IlyaBOT/video-player

also, ive been using ur audio player for a bit, it works great!

IlyaBOT commented 1 year ago

Thank you very much! :)

IlyaBOT commented 1 year ago

Yes, now the mkv is playing, I will return its support back to the plugin and write to README file about setting MIME types, thank you. image But AVI still won't play :( image

redtrillix commented 1 year ago

Yeah unfortunately AVI is a Microsoft propriety format and not built in, it probably wont work unless you do something with the browser (which the plugin might be able to)

MIME types just tell the browser what to do with the file and dont add any capabilities, so if it doesnt have avi implemented it still doesnt know what to do.

Im not sure but this might help: https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Video_codecs. It sounds like Firefox use to use QuickTime which allowed for AVI playback, but i dont know anything about QuickTime and im pretty sure its discontinued https://support.mozilla.org/en-US/kb/quicktime-plugin-play-audio-and-video.

rejetto commented 1 year ago

if the problem is being "property" you should expect Edge to support it

xrivo1 commented 1 year ago

Hello. Did you then solve with the various bugs? On many MKV files there is still no audio and AVI does not work. I don't think it's a browser problem. On HFS the player icon does not appear at all.

SanokKule commented 1 year ago

@xrivo1 this is strictly a browser problem, if it doesn't support h265, or other codecs, it won't play. Saying 'mkv files don't have audio' is not giving any useful info.

IlyaBOT commented 1 year ago

@xrivo1 I disabled the display of the play button on AVI files in the plugin, because they did not play, this is a browser problem. Why some MKVs don't have an audio, I have no idea, so far no one has had this problem. There was audio without video, but not vice versa.

albamef commented 1 year ago

@xrivo1 I disabled the display of the play button on AVI files in the plugin, because they did not play, this is a browser problem. Why some MKVs don't have an audio, I have no idea, so far no one has had this problem. There was audio without video, but not vice versa.

Check https://server.takoe.tk/Films/ any *.mkv file from the main list. More than half will have no sound, just a picture. And it's not a browser issue.

SanokKule commented 1 year ago

Check https://server.takoe.tk/Films/ any *.mkv file from the main list. More than half will have no sound, just a picture. And it's not a browser issue.

Most of those have ac3 audio which is not supported by browsers. If the audio/video codec is not supported, there's nothing you can do about that. Most you can do is open the link in your installed player like mpv, vlc and others.

SanokKule commented 1 year ago

@albamef i would suggest if you need to play them from browser to convert them to h264, vp9 or av1 video and aac, ogg or opus audio

SanokKule commented 1 year ago

Here you can see what codecs most browsers support: https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Video_codecs#common_codecs https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Audio_codecs#common_codecs As for the container, .mp4 and .webm( .mkv is mostly equivalent to .webm) are the most supported. .avi is extremely old and convoluted so browsers don't support it.

xrivo1 commented 1 year ago

Ok. I understand that the plugin does not send the data stream to the PC media player, but uses that of the browser. would it be possible to send the data stream ( so without downloading the file ) directly to a VLC type reader ?

SanokKule commented 1 year ago

If you mean vlc, yes. Just copy the link of the file from hfs. In vlc under File menu there's a Open Network Stream... button, paste it in there. Should play without problems.

rejetto commented 1 year ago

someone may investigate on this possibility https://wiki.videolan.org/Documentation:WebPlugin#Input_object

SanokKule commented 1 year ago

someone may investigate on this possibility https://wiki.videolan.org/Documentation:WebPlugin#Input_object

Isn't that plugin deprecated?

Note: In the most of browsers, the support for NPAPI plugins was dropped. Only in some forks of Firefox like Waterfox or Pale Moon, NPAPI plugins are still supported. For this reason, the NPAPI plugin will be dropped in vlc version 4.

xrivo1 commented 1 year ago

I knew this practice. for me it is not feasible because my HFS is not open but needs login. Videolan, has open codecs. I was thinking about the possibility of being able to embed them in the plugin. I attach the files[]() windows.zip .`

rejetto commented 1 year ago

doesn't VLC offer you to input credentials accessing a protected URL ? like download managers do...

anyway, about opening VLC, another idea is to make "xspf" virtual files, that are associated to VLC https://wiki.videolan.org/XSPF/

virtual in the sense that it's the URL of the video file but with "?get=xspf" at the end. The plugin should intercept these requests and, instead of giving the video file, produces the content of the xspf on the fly. Similarly to what HFS does when you ?get=zip, it produces the content of the zip, but the zip never exists on server disk. While zip is very complex, xspf is quite simple.

xrivo1 commented 1 year ago

very interesting

rejetto commented 1 year ago

i'll leave this link to something that can be interesting to try https://github.com/qgustavor/mkv-extract but otherwise I'm considering this request as closed, since we have a video player now, both in the "file show" feature and as specialized plugins.