Skip to content

Videos with small file size won't load from local file system #2854

@rafma0

Description

@rafma0

Describe the bug

Videos with small file size won't load from local file system

To Reproduce

I encoded the same video with different sizes from 18mb to 75kb and the two smallest ones won't load with the html5 video player
https://drive.google.com/u/0/uc?id=1DooRCgDgyFh45kbfl0XohAcErNVfwQ6r&export=download

It seems to be related to the headers from the local assets server

When I try to load for example the file '5.mp4' (74kb) from the local disk, using something like

<video>
  <source src="https://asset.localhost/e:/my/video/5.mp4" type="video/mp4" />
</video>

the server replies with

content-length: 409600
content-range: bytes 0-409599/75990
Content-Type: video/mp4

and the video gets stuck

but when I load the same file from a nginx server to the same tauri app the reply is

Content-Length: 75990
Content-Range: bytes 0-75989/75990
Content-Type: video/mp4

and everything works fine

Platform and Versions (required):

Operating System - Windows, version 10.0.22000 X64
Webview2 - 95.0.1020.44

Node.js environment
  Node.js - 16.4.2
  @tauri-apps/cli - 1.0.0-beta.10
  @tauri-apps/api - 1.0.0-beta.8

Global packages
  npm - 7.18.1
  yarn - 1.22.10

Rust environment
  rustc - 1.56.1
  cargo - 1.56.0

App directory structure
/build
/node_modules
/public
/src
/src-tauri

App
  tauri.rs - 1.0.0-beta.8
  build-type - bundle
  CSP - default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self' img-src: 'self' asset:
  distDir - ../build
  devPath - http://localhost:3000
  framework - React

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions