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

[bug] Tauri cant load WebVTT file with asset protocol. #6446

Closed
promer94 opened this issue Mar 14, 2023 · 2 comments
Closed

[bug] Tauri cant load WebVTT file with asset protocol. #6446

promer94 opened this issue Mar 14, 2023 · 2 comments
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug

Comments

@promer94
Copy link

Describe the bug

Tarui can't load WebVTT subtitles through asset protocol.

When i try to load video and it subtitles using asset protocol. I found that the video could be successfully loaded but not the subtitles.

CleanShot 2023-03-14 at 12 28 32@2x

CleanShot 2023-03-14 at 12 29 07@2x

{
  "tauri": {
    "allowlist": {
      "path": {
        "all": true
      },
      "dialog": {
        "open": true
      },
      "fs": {
        "all": true,
        "scope": [
          "$DOWNLOAD/**/*"
        ]
      },
      "protocol": {
        "all": true,
        "asset": true,
        "assetScope": [
          "$DOWNLOAD/**/*"
        ]
      }
    },
    "security": {
      "csp": "default-src 'self'; img-src 'self' asset: https://asset.localhost; media-src 'self' asset: https://asset.localhost; connect-src 'self' asset: https://asset.localhost"
    },
  }
}

Reproduction

No response

Expected behavior

Tarui should be able to load WebVTT subtitles through asset protocol.

Platform and versions

Environment
  › OS: Mac OS 13.2.0 X64
  › Node.js: 18.12.0
  › npm: 8.19.2
  › pnpm: 7.16.1
  › yarn: 1.23.0-20220130.1630
  › rustup: 1.25.2
  › rustc: 1.67.0
  › cargo: 1.67.0
  › Rust toolchain: stable-aarch64-apple-darwin

Packages
  › @tauri-apps/cli [NPM]: 1.2.3
  › @tauri-apps/api [NPM]: 1.2.0
  › tauri [RUST]: 1.2.4,
  › tauri-build [RUST]: 1.2.1,
  › tao [RUST]: 0.15.8,
  › wry [RUST]: 0.23.4,

App
  › build-type: bundle
  › CSP: default-src 'self'; img-src 'self' asset: https://asset.localhost; media-src 'self' asset: https://asset.localhost; connect-src 'self' asset: https://asset.localhost
  › distDir: ../dist
  › devPath: http://localhost:1420/
  › framework: React
  › bundler: Vite

App directory structure
  ├─ dist
  ├─ node_modules
  ├─ public
  ├─ src-tauri
  ├─ .vscode
  └─ src

Stack trace

No response

Additional context

No response

@promer94 promer94 added status: needs triage This issue needs to triage, applied to new issues type: bug labels Mar 14, 2023
@promer94 promer94 changed the title [bug] Tauri cant load WebVTT files with asset protocol. [bug] Tauri cant load WebVTT file with asset protocol. Mar 14, 2023
@FabianLars
Copy link
Member

This should be fixed by #6390. According to #6375 (comment).

@mauritzn
Copy link

This issue is unrelated to the asset protocol, rather this is caused by the overly strict CORS applied to captions compared to video files (this is not a Tauri issues, rather a general browser issue), to fix this add crossorigin="anonymous" to the video element.

Example:

<video src="..." controls width="500" height="300" crossorigin="anonymous">
  ...
</video>

For more information: https://bugs.chromium.org/p/chromium/issues/detail?id=226019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug
Projects
None yet
Development

No branches or pull requests

3 participants