web client: add HTML5 player

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino
2022-07-23 16:30:27 +02:00
parent 2da19ef233
commit d34446e6e9
10 changed files with 172 additions and 72 deletions

View File

@@ -295,9 +295,6 @@ func (fs *SFTPFs) Open(name string, offset int64) (File, *pipeat.PipeReaderAt, f
if err != nil {
return nil, nil, nil, err
}
if fs.config.BufferSize == 0 {
return f, nil, nil, err
}
if offset > 0 {
_, err = f.Seek(offset, io.SeekStart)
if err != nil {
@@ -305,6 +302,9 @@ func (fs *SFTPFs) Open(name string, offset int64) (File, *pipeat.PipeReaderAt, f
return nil, nil, nil, err
}
}
if fs.config.BufferSize == 0 {
return f, nil, nil, nil
}
r, w, err := pipeat.PipeInDir(fs.localTempDir)
if err != nil {
f.Close()
@@ -507,11 +507,9 @@ func (*SFTPFs) IsNotSupported(err error) bool {
// CheckRootPath creates the specified local root directory if it does not exists
func (fs *SFTPFs) CheckRootPath(username string, uid int, gid int) bool {
if fs.config.BufferSize > 0 {
// we need a local directory for temporary files
osFs := NewOsFs(fs.ConnectionID(), fs.localTempDir, "")
osFs.CheckRootPath(username, uid, gid)
}
// we need a local directory for temporary files
osFs := NewOsFs(fs.ConnectionID(), fs.localTempDir, "")
osFs.CheckRootPath(username, uid, gid)
if fs.config.Prefix == "/" {
return true
}