Эх сурвалжийг харах

fix(examples): fix streaming example on Windows, closes #3646

Lucas Nogueira 3 жил өмнө
parent
commit
ea94a28a34

+ 3 - 0
examples/streaming/src-tauri/src/main.rs

@@ -43,6 +43,9 @@ fn main() {
       // prepare our response
       let mut response = ResponseBuilder::new();
       // get the wanted path
+      #[cfg(target_os = "windows")]
+      let path = request.uri().replace("stream://localhost/", "");
+      #[cfg(not(target_os = "windows"))]
       let path = request.uri().replace("stream://", "");
 
       if path != "example/test_video.mp4" {

+ 1 - 1
examples/streaming/src-tauri/tauri.conf.json

@@ -48,7 +48,7 @@
       }
     ],
     "security": {
-      "csp": "default-src 'self'; media-src stream: https://stream.example"
+      "csp": "default-src 'self'; media-src stream: https://stream.localhost"
     },
     "updater": {
       "active": false