diff --git a/package.json b/package.json index d02fa4a8..f27b1372 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "magic-eye", "description": "A magic eye app", - "version": "0.9.1", + "version": "0.9.2", "type": "module", "scripts": { "check-format": "prettier . --check", @@ -26,6 +26,9 @@ "@tauri-apps/plugin-dialog": "^2.0.0-alpha.5", "@tauri-apps/plugin-window": "^2.0.0-alpha", "framer-motion": "^10.16.16", + "hls-video-element": "^1.1.1", + "hls.js": "^1.4.14", + "media-chrome": "^2.0.1", "react": "^18.2.0", "react-dom": "^18.2.0", "react-icons": "^4.12.0", diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 726fb347..2a4354f2 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -80,25 +80,6 @@ version = "1.0.77" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c9d19de80eff169429ac1e9f48fffb163916b448a44e8e046186232046d9e1f9" -[[package]] -name = "arboard" -version = "3.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aafb29b107435aa276664c1db8954ac27a6e105cdad3c88287a199eb0e313c08" -dependencies = [ - "clipboard-win", - "core-graphics 0.22.3", - "image", - "log", - "objc", - "objc-foundation", - "objc_id", - "parking_lot", - "thiserror", - "winapi", - "x11rb", -] - [[package]] name = "async-broadcast" version = "0.5.1" @@ -277,7 +258,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4af014b17dd80e8af9fa689b2d4a211ddba6eb583c1622f35d0cb543f6b17e4" dependencies = [ "atk-sys", - "glib 0.18.4", + "glib", "libc", ] @@ -287,8 +268,8 @@ version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "251e0b7d90e33e0ba930891a505a9a35ece37b2dd37a14f3ffc306c13b980009" dependencies = [ - "glib-sys 0.18.1", - "gobject-sys 0.18.0", + "glib-sys", + "gobject-sys", "libc", "system-deps", ] @@ -491,7 +472,7 @@ checksum = "f33613627f0dea6a731b0605101fad59ba4f193a52c96c4687728d822605a8a1" dependencies = [ "bitflags 2.4.1", "cairo-sys-rs", - "glib 0.18.4", + "glib", "libc", "once_cell", "thiserror", @@ -503,7 +484,7 @@ version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "685c9fa8e590b8b3d678873528d83411db17242a73fccaed827770ea0fedda51" dependencies = [ - "glib-sys 0.18.1", + "glib-sys", "libc", "system-deps", ] @@ -579,17 +560,6 @@ dependencies = [ "windows-targets 0.48.5", ] -[[package]] -name = "clipboard-win" -version = "4.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7191c27c2357d9b7ef96baac1773290d4ca63b24205b82a3fd8a0637afcf0362" -dependencies = [ - "error-code", - "str-buf", - "winapi", -] - [[package]] name = "cocoa" version = "0.24.1" @@ -1012,16 +982,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "error-code" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64f18991e7bf11e7ffee451b5318b5c1a73c52d0d0ada6e5a3017c8c1ced6a21" -dependencies = [ - "libc", - "str-buf", -] - [[package]] name = "event-listener" version = "2.5.3" @@ -1299,7 +1259,7 @@ dependencies = [ "gdk-pixbuf", "gdk-sys", "gio", - "glib 0.18.4", + "glib", "libc", "pango", ] @@ -1312,7 +1272,7 @@ checksum = "446f32b74d22c33b7b258d4af4ffde53c2bf96ca2e29abdf1a785fe59bd6c82c" dependencies = [ "gdk-pixbuf-sys", "gio", - "glib 0.18.4", + "glib", "libc", "once_cell", ] @@ -1323,9 +1283,9 @@ version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9839ea644ed9c97a34d129ad56d38a25e6756f99f3a88e15cd39c20629caf7" dependencies = [ - "gio-sys 0.18.1", - "glib-sys 0.18.1", - "gobject-sys 0.18.0", + "gio-sys", + "glib-sys", + "gobject-sys", "libc", "system-deps", ] @@ -1338,9 +1298,9 @@ checksum = "31ff856cb3386dae1703a920f803abafcc580e9b5f711ca62ed1620c25b51ff2" dependencies = [ "cairo-sys-rs", "gdk-pixbuf-sys", - "gio-sys 0.18.1", - "glib-sys 0.18.1", - "gobject-sys 0.18.0", + "gio-sys", + "glib-sys", + "gobject-sys", "libc", "pango-sys", "pkg-config", @@ -1354,8 +1314,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a90fbf5c033c65d93792192a49a8efb5bb1e640c419682a58bb96f5ae77f3d4a" dependencies = [ "gdk-sys", - "glib-sys 0.18.1", - "gobject-sys 0.18.0", + "glib-sys", + "gobject-sys", "libc", "pkg-config", "system-deps", @@ -1370,7 +1330,7 @@ dependencies = [ "gdk", "gdkx11-sys", "gio", - "glib 0.18.4", + "glib", "libc", "x11", ] @@ -1382,7 +1342,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fee8f00f4ee46cad2939b8990f5c70c94ff882c3028f3cc5abf950fa4ab53043" dependencies = [ "gdk-sys", - "glib-sys 0.18.1", + "glib-sys", "libc", "system-deps", "x11", @@ -1411,16 +1371,6 @@ dependencies = [ "version_check", ] -[[package]] -name = "gethostname" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb65d4ba3173c56a500b555b532f72c42e8d1fe64962b518897f8959fae2c177" -dependencies = [ - "libc", - "winapi", -] - [[package]] name = "gethostname" version = "0.4.3" @@ -1469,8 +1419,8 @@ dependencies = [ "futures-core", "futures-io", "futures-util", - "gio-sys 0.18.1", - "glib 0.18.4", + "gio-sys", + "glib", "libc", "once_cell", "pin-project-lite", @@ -1478,54 +1428,19 @@ dependencies = [ "thiserror", ] -[[package]] -name = "gio-sys" -version = "0.16.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9b693b8e39d042a95547fc258a7b07349b1f0b48f4b2fa3108ba3c51c0b5229" -dependencies = [ - "glib-sys 0.16.3", - "gobject-sys 0.16.3", - "libc", - "system-deps", - "winapi", -] - [[package]] name = "gio-sys" version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37566df850baf5e4cb0dfb78af2e4b9898d817ed9263d1090a2df958c64737d2" dependencies = [ - "glib-sys 0.18.1", - "gobject-sys 0.18.0", + "glib-sys", + "gobject-sys", "libc", "system-deps", "winapi", ] -[[package]] -name = "glib" -version = "0.16.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16aa2475c9debed5a32832cb5ff2af5a3f9e1ab9e69df58eaadc1ab2004d6eba" -dependencies = [ - "bitflags 1.3.2", - "futures-channel", - "futures-core", - "futures-executor", - "futures-task", - "futures-util", - "gio-sys 0.16.3", - "glib-macros 0.16.8", - "glib-sys 0.16.3", - "gobject-sys 0.16.3", - "libc", - "once_cell", - "smallvec", - "thiserror", -] - [[package]] name = "glib" version = "0.18.4" @@ -1538,10 +1453,10 @@ dependencies = [ "futures-executor", "futures-task", "futures-util", - "gio-sys 0.18.1", - "glib-macros 0.18.3", - "glib-sys 0.18.1", - "gobject-sys 0.18.0", + "gio-sys", + "glib-macros", + "glib-sys", + "gobject-sys", "libc", "memchr", "once_cell", @@ -1549,21 +1464,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "glib-macros" -version = "0.16.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb1a9325847aa46f1e96ffea37611b9d51fc4827e67f79e7de502a297560a67b" -dependencies = [ - "anyhow", - "heck", - "proc-macro-crate 1.3.1", - "proc-macro-error", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "glib-macros" version = "0.18.3" @@ -1578,16 +1478,6 @@ dependencies = [ "syn 2.0.43", ] -[[package]] -name = "glib-sys" -version = "0.16.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61a4f46316d06bfa33a7ac22df6f0524c8be58e3db2d9ca99ccb1f357b62a65" -dependencies = [ - "libc", - "system-deps", -] - [[package]] name = "glib-sys" version = "0.18.1" @@ -1604,24 +1494,13 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" -[[package]] -name = "gobject-sys" -version = "0.16.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3520bb9c07ae2a12c7f2fbb24d4efc11231c8146a86956413fb1a79bb760a0f1" -dependencies = [ - "glib-sys 0.16.3", - "libc", - "system-deps", -] - [[package]] name = "gobject-sys" version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0850127b514d1c4a4654ead6dedadb18198999985908e6ffe4436f53c785ce44" dependencies = [ - "glib-sys 0.18.1", + "glib-sys", "libc", "system-deps", ] @@ -1639,7 +1518,7 @@ dependencies = [ "gdk", "gdk-pixbuf", "gio", - "glib 0.18.4", + "glib", "gtk-sys", "gtk3-macros", "libc", @@ -1657,9 +1536,9 @@ dependencies = [ "cairo-sys-rs", "gdk-pixbuf-sys", "gdk-sys", - "gio-sys 0.18.1", - "glib-sys 0.18.1", - "gobject-sys 0.18.0", + "gio-sys", + "glib-sys", + "gobject-sys", "libc", "pango-sys", "system-deps", @@ -1968,8 +1847,6 @@ dependencies = [ "color_quant", "num-rational", "num-traits", - "png", - "tiff", ] [[package]] @@ -2067,7 +1944,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca5671e9ffce8ffba57afc24070e906da7fc4b1ba66f2cabebf61bf2ea257fcc" dependencies = [ "bitflags 1.3.2", - "glib 0.18.4", + "glib", "javascriptcore-rs-sys", ] @@ -2077,8 +1954,8 @@ version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af1be78d14ffa4b75b66df31840478fef72b51f8c2465d4ca7c194da9f7a5124" dependencies = [ - "glib-sys 0.18.1", - "gobject-sys 0.18.0", + "glib-sys", + "gobject-sys", "libc", "system-deps", ] @@ -2105,12 +1982,6 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" -[[package]] -name = "jpeg-decoder" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc0000e42512c92e31c2252315bda326620a4e034105e900c98ec492fa077b3e" - [[package]] name = "js-sys" version = "0.3.66" @@ -2168,7 +2039,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03589b9607c868cc7ae54c0b2a22c8dc03dd41692d48f2d7df73615c6a95dc0a" dependencies = [ - "glib 0.18.4", + "glib", "gtk", "gtk-sys", "libappindicator-sys", @@ -2289,7 +2160,7 @@ dependencies = [ [[package]] name = "magic_eye" -version = "0.9.1" +version = "0.9.2" dependencies = [ "axum", "dirs-next", @@ -2301,8 +2172,6 @@ dependencies = [ "tauri", "tauri-build", "tauri-plugin-app", - "tauri-plugin-clipboard-manager", - "tauri-plugin-dialog", "tauri-plugin-fs", "tauri-plugin-http", "tauri-plugin-log", @@ -2743,7 +2612,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ca27ec1eb0457ab26f3036ea52229edbdb74dee1edd29063f5b9b010e7ebee4" dependencies = [ "gio", - "glib 0.18.4", + "glib", "libc", "once_cell", "pango-sys", @@ -2755,8 +2624,8 @@ version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "436737e391a843e5933d6d9aa102cb126d501e815b83601365a948a518555dc5" dependencies = [ - "glib-sys 0.18.1", - "gobject-sys 0.18.0", + "glib-sys", + "gobject-sys", "libc", "system-deps", ] @@ -3338,29 +3207,6 @@ dependencies = [ "winreg 0.50.0", ] -[[package]] -name = "rfd" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "241a0deb168c88050d872294f7b3106c1dfa8740942bcc97bc91b98e97b5c501" -dependencies = [ - "block", - "dispatch", - "glib-sys 0.18.1", - "gobject-sys 0.18.0", - "gtk-sys", - "js-sys", - "log", - "objc", - "objc-foundation", - "objc_id", - "raw-window-handle", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "windows-sys 0.48.0", -] - [[package]] name = "rustc-demangle" version = "0.1.23" @@ -3729,7 +3575,7 @@ checksum = "471f924a40f31251afc77450e781cb26d55c0b650842efafc9c6cbd2f7cc4f9f" dependencies = [ "futures-channel", "gio", - "glib 0.18.4", + "glib", "libc", "soup3-sys", ] @@ -3740,9 +3586,9 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ebe8950a680a12f24f15ebe1bf70db7af98ad242d9db43596ad3108aab86c27" dependencies = [ - "gio-sys 0.18.1", - "glib-sys 0.18.1", - "gobject-sys 0.18.0", + "gio-sys", + "glib-sys", + "gobject-sys", "libc", "system-deps", ] @@ -3768,12 +3614,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" -[[package]] -name = "str-buf" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e08d8363704e6c71fc928674353e6b7c23dcea9d82d7012c8faf2a3a025f8d0" - [[package]] name = "string_cache" version = "0.8.7" @@ -3949,8 +3789,7 @@ checksum = "14c39fd04924ca3a864207c66fc2cd7d22d7c016007f9ce846cbb9326331930a" [[package]] name = "tauri" version = "2.0.0-alpha.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05fb63873c39d3fd5ddad995d395e7b7394ece0b69aeacb31e91d24af48f3de1" +source = "git+https://github.com/tauri-apps/tauri?branch=dev#29ced5ceec40b2934094ade2db9a8855f294e1d1" dependencies = [ "anyhow", "bytes", @@ -3996,8 +3835,7 @@ dependencies = [ [[package]] name = "tauri-build" version = "2.0.0-alpha.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a2582ffb43e5c28932c43ffc40c295a9196a9a33ffb1163269c6baed84834a" +source = "git+https://github.com/tauri-apps/tauri?branch=dev#29ced5ceec40b2934094ade2db9a8855f294e1d1" dependencies = [ "anyhow", "cargo_toml", @@ -4017,8 +3855,7 @@ dependencies = [ [[package]] name = "tauri-codegen" version = "2.0.0-alpha.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b06976ec7b704d6b842169ffd4ce596e9ce45917a0ab462cb96a119fa2829be9" +source = "git+https://github.com/tauri-apps/tauri?branch=dev#29ced5ceec40b2934094ade2db9a8855f294e1d1" dependencies = [ "base64", "brotli", @@ -4043,8 +3880,7 @@ dependencies = [ [[package]] name = "tauri-macros" version = "2.0.0-alpha.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff509be5a5ac34ec2e60d9029af1032c0a33e421f3e823bc92695192e2871c17" +source = "git+https://github.com/tauri-apps/tauri?branch=dev#29ced5ceec40b2934094ade2db9a8855f294e1d1" dependencies = [ "heck", "proc-macro2", @@ -4063,39 +3899,6 @@ dependencies = [ "tauri", ] -[[package]] -name = "tauri-plugin-clipboard-manager" -version = "2.0.0-alpha.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dd33e4675642fc51b5538d42169927e39058e02000baea4651dc47a98bf259b" -dependencies = [ - "arboard", - "log", - "serde", - "serde_json", - "tauri", - "tauri-build", - "thiserror", -] - -[[package]] -name = "tauri-plugin-dialog" -version = "2.0.0-alpha.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a0ff9a134afd29589d6154547a04dee18f5999aa63b91fdf7d58e597264633a" -dependencies = [ - "glib 0.16.9", - "log", - "raw-window-handle", - "rfd", - "serde", - "serde_json", - "tauri", - "tauri-build", - "tauri-plugin-fs", - "thiserror", -] - [[package]] name = "tauri-plugin-fs" version = "2.0.0-alpha.7" @@ -4178,7 +3981,7 @@ version = "2.0.0-alpha.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c7cfaf07f8dcbfd4b2ce6156c4158d9d1419850ffe4e8146b6e890b5381e6906" dependencies = [ - "gethostname 0.4.3", + "gethostname", "log", "os_info", "serde", @@ -4201,8 +4004,7 @@ dependencies = [ [[package]] name = "tauri-runtime" version = "1.0.0-alpha.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64a989e58af6e554dbac798a0a8d112faafc1509bcfab626466181e0724f09c5" +source = "git+https://github.com/tauri-apps/tauri?branch=dev#29ced5ceec40b2934094ade2db9a8855f294e1d1" dependencies = [ "gtk", "http 0.2.11", @@ -4219,8 +4021,7 @@ dependencies = [ [[package]] name = "tauri-runtime-wry" version = "1.0.0-alpha.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a9f181a6f5f982204ae293c19f37ba90116b8ec0bfd0a08c7a7ba67200cd9e3" +source = "git+https://github.com/tauri-apps/tauri?branch=dev#29ced5ceec40b2934094ade2db9a8855f294e1d1" dependencies = [ "cocoa 0.25.0", "gtk", @@ -4240,8 +4041,7 @@ dependencies = [ [[package]] name = "tauri-utils" version = "2.0.0-alpha.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4858f99fc9f28b72008ef51d04d18b7e3646845c2bc18ee340045fed6ed5095" +source = "git+https://github.com/tauri-apps/tauri?branch=dev#29ced5ceec40b2934094ade2db9a8855f294e1d1" dependencies = [ "brotli", "ctor", @@ -4346,17 +4146,6 @@ dependencies = [ "once_cell", ] -[[package]] -name = "tiff" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d172b0f4d3fba17ba89811858b9d3d97f928aece846475bbda076ca46736211" -dependencies = [ - "flate2", - "jpeg-decoder", - "weezl", -] - [[package]] name = "time" version = "0.3.31" @@ -4939,10 +4728,10 @@ dependencies = [ "gdk", "gdk-sys", "gio", - "gio-sys 0.18.1", - "glib 0.18.4", - "glib-sys 0.18.1", - "gobject-sys 0.18.0", + "gio-sys", + "glib", + "glib-sys", + "gobject-sys", "gtk", "gtk-sys", "javascriptcore-rs", @@ -4961,9 +4750,9 @@ dependencies = [ "bitflags 1.3.2", "cairo-sys-rs", "gdk-sys", - "gio-sys 0.18.1", - "glib-sys 0.18.1", - "gobject-sys 0.18.0", + "gio-sys", + "glib-sys", + "gobject-sys", "gtk-sys", "javascriptcore-rs-sys", "libc", @@ -5008,12 +4797,6 @@ dependencies = [ "windows-core 0.52.0", ] -[[package]] -name = "weezl" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9193164d4de03a926d909d3bc7c30543cecb35400c02114792c2cae20d5e2dbb" - [[package]] name = "win7-notifications" version = "0.3.1" @@ -5049,15 +4832,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "winapi-wsapoll" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44c17110f57155602a80dca10be03852116403c9ff3cd25b079d666f2aa3df6e" -dependencies = [ - "winapi", -] - [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" @@ -5493,28 +5267,6 @@ dependencies = [ "pkg-config", ] -[[package]] -name = "x11rb" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1641b26d4dec61337c35a1b1aaf9e3cba8f46f0b43636c609ab0291a648040a" -dependencies = [ - "gethostname 0.3.0", - "nix", - "winapi", - "winapi-wsapoll", - "x11rb-protocol", -] - -[[package]] -name = "x11rb-protocol" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82d6c3f9a0fb6701fab8f6cea9b0c0bd5d6876f1f89f7fada07e558077c344bc" -dependencies = [ - "nix", -] - [[package]] name = "xdg-home" version = "1.0.0" diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 30b9f842..00e66016 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "magic_eye" -version = "0.9.1" +version = "0.9.2" description = "A small gui application Made with Tauri, let you watch stream for a Mediamtx server." categories = ["utility", "network", "streaming"] authors = ["Thomas Toulouse"] @@ -14,6 +14,9 @@ edition = "2021" [toolchain] channel = "nightly" +[patch.crates-io] +tauri = { git = "https://github.com/tauri-apps/tauri", branch = "dev" } +tauri-build = { git = "https://github.com/tauri-apps/tauri", branch = "dev" } [build-dependencies] tauri-build = { version = "2.0.0-alpha", features = [] } @@ -23,8 +26,6 @@ tauri = { version = "2.0.0-alpha", features = [] } tauri-plugin-log = { version = "2.0.0-alpha" } tauri-plugin-fs = { version = "2.0.0-alpha" } -tauri-plugin-clipboard-manager = { version = "2.0.0-alpha" } -tauri-plugin-dialog = { version = "2.0.0-alpha" } tauri-plugin-http = {features = [ "multipart" ], version = "2.0.0-alpha" } tauri-plugin-notification = {version = "2.0.0-alpha", features = [ "windows7-compat" ] } tauri-plugin-os = { version = "2.0.0-alpha" } diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 555cfe3e..281c20e8 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -21,10 +21,8 @@ use magic_eye::utils::config::{ }; use magic_eye::utils::window_function::{__cmd__close_window, close_window, __cmd__minimize_window, minimize_window, __cmd__maximize_window, maximize_window, __cmd__unmaximize_window, unmaximize_window}; use tauri::path::BaseDirectory; -use std::{env, fs}; use tauri::{generate_handler, Manager}; use tauri_plugin_log::{Target, TargetKind}; -//use tauri::{path::BaseDirectory}; use tower_http::cors::CorsLayer; use tower_http::services::ServeDir; use utils::config::create_configuration_file_setting; @@ -39,8 +37,9 @@ async fn close_splashscreen(window: tauri::Window) { if let Some(splashscreen) = window.get_window("splashscreen") { splashscreen.close().expect("Failed to close splashscreen"); } - // Show main window - window.get_window("main").expect("Main window not found").show().expect("Failed to show main window"); + window.get_window("main").expect("no window labeled 'main' found").show().unwrap(); + + } @@ -86,12 +85,11 @@ fn main() -> Result<(), Box> { builder .setup(move |app| { - let main_window = app.get_window("main").expect("Main window not found"); - debug!("main_window url: : {:?}", main_window.url()); let asset_dir_path = app.path().app_data_dir().expect("Failed to get app data dir"); debug!("asset_dir_path: {:?}", asset_dir_path); let resource_path = app.path().resolve("assets/", BaseDirectory::Resource)?; + //let resource_path = app.path().parse(path).expect("Failed to parse asset dir path"); @@ -102,8 +100,7 @@ fn main() -> Result<(), Box> { tauri::async_runtime::spawn(async move { debug!("Initializing..."); let serve_dir = ServeDir::new(resource_path.to_str().expect("Failed to convert resource path to string")); - let _files = fs::read_dir(resource_path).map(|res| res.map(|e| e.expect("error").path())).expect("Failed to read dir"); - debug!("files: {:?}", _files); + let axum_app = Router::new().nest_service("/", serve_dir).layer( CorsLayer::new() diff --git a/src-tauri/src/utils/os_setup_and_info.rs b/src-tauri/src/utils/os_setup_and_info.rs index 341aac87..3b5b2ce4 100644 --- a/src-tauri/src/utils/os_setup_and_info.rs +++ b/src-tauri/src/utils/os_setup_and_info.rs @@ -5,7 +5,5 @@ pub fn setup_wayland() { let key = "GDK_BACKEND"; //set it to xwayland if user is using wayland env::set_var(key, "x11"); - - std::env::set_var("GTK_OVERLAY_SCROLLING", "1"); info!("GDK_BACKEND: {:?}", env::var(key).unwrap()); } diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index e1acb02e..b455c68b 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -9,34 +9,48 @@ }, "package": { "productName": "Magic Eye", - "version": "0.9.1" + "version": "0.9.2" }, "tauri": { - "windows": [ + "windows": [ { + "userAgent": "Chrome", "title": "Magic Eye", - "center": false, - "closable": true, - "maximizable": true, - - - + "resizable": true, + "shadow": true, "minimizable": true, - - - "alwaysOnTop": false, - - "resizable": true, + "maximizable": true, + "minWidth": 1000, + "minHeight": 600, "decorations": false, + "alwaysOnTop": false, + "fullscreen": false, + "titleBarStyle": "Visible", + "width": 1000, + "visible": false, + "height": 600, + "closable": true, + "url": "index.html", + "label": "main", + "theme":"Dark" + + }, + { + "title": "Magic Eye", + "titleBarStyle": "Visible", "minWidth": 1000, "minHeight": 600, - - "skipTaskbar": false, - "shadow": true - } - ] , + "resizable": true, + "fullscreen": false, + "decorations": false, + "alwaysOnTop": false, + "url": "splashscreen.html", + "label": "splashscreen" + } + + ], "bundle": { "copyright": "MIT", "active": true, @@ -51,7 +65,7 @@ "icons/icon.icns", "icons/icon.ico" ], - "identifier": "com.MagicEye.dev", + "identifier": "dev.MagicEye.magic", "targets": "all", "windows": { "allowDowngrades": true, @@ -80,7 +94,7 @@ "main", "settings" ], - "domain": "localhost" + "domain": "*" } ] @@ -88,52 +102,9 @@ }, "plugins": { - "windows": [ - { - "userAgent": "Chrome", - "close": true, - "title": "Magic Eye", - "titleBarStyle": "Overlay", - "minWidth": 1000, - "setResizable": true, - "minHeight": 600, - "resizable": true, - "fullscreen": false, - - "visible": false, - "decorations": false, - "alwaysOnTop": false, - "url": "index.html", - "label": "main", - "theme":"Dark" - - }, - { - "title": "Magic Eye", - "titleBarStyle": "Visible", - "minWidth": 1000, - "minHeight": 600, - "resizable": true, - "fullscreen": false, - "decorations": false, - "alwaysOnTop": false, - "url": "splashscreen.html", - "label": "splashscreen" - } - - ], - "dialog": { - "all": true, - "ask": false, - "confirm": false, - "message": true, - "open": false, - "save": false - }, "fs": { "all": true, "scope": [ - "$XDG_DATA_HOME/com.MagicEye.dev/assets/*", "$RESOURCE" ] }, @@ -144,11 +115,40 @@ "http://*", "https://*" ] + }, + "allowlist":{ + "all": true, + "window": { + "center": false, + "close": true, + "create": false, + "hide": false, + "maximize": true, + "minimize": true, + "print": false, + "requestUserAttention": false, + "setAlwaysOnTop": false, + "setCursorGrab": true, + "setCursorIcon": true, + "setCursorPosition": false, + "setCursorVisible": false, + "setDecorations": false, + "setFocus": true, + "setFullscreen": true, + "setIcon": true, + "setMaxSize": false, + "setMinSize": false, + "setPosition": false, + "setResizable": true, + "setSize": true, + "setSkipTaskbar": false, + "setTitle": true, + "show": true, + "startDragging": true, + "unmaximize": true, + "unminimize": true + } - } - - - - + } } diff --git a/src/components/titlebar/titlebar.tsx b/src/components/titlebar/titlebar.tsx index 05d4d261..e9f87f45 100644 --- a/src/components/titlebar/titlebar.tsx +++ b/src/components/titlebar/titlebar.tsx @@ -82,6 +82,7 @@ export default function Titlebar() { (
@@ -224,7 +225,7 @@ export default function Titlebar() { type="button" title="Close" className="flex items-center justify-center text-text-dark w-8 h-8 rounded-full hover:bg-window-dark-600" - onClick={async() => invoke("close_window")} + onClick={async() =>await invoke("close_window")} > (null); + const { height, width }: IVideoPlayer = useWindowDimensions(); const prevErrorRef = useRef(null); @@ -21,6 +23,7 @@ export default function VidPlayer() { const handleDismissErrorToast = () => { setError(null); }; + useEffect(() => { (async () => { invoke("get_config_file_content").then((res: string) => { @@ -38,13 +41,12 @@ export default function VidPlayer() { async function get_url() { try { - const response = await fetch(url); console.log("response:", response); + if (response.status === 200) { setIsConnected(true); setStreamUrl(url); - console.log("streamUrl:", url); setError(""); } else { throw new Error( @@ -53,7 +55,6 @@ export default function VidPlayer() { } } catch (err) { setIsConnected(false); - handleDisconnect(); handlePlayerError(err.message); } @@ -71,9 +72,12 @@ export default function VidPlayer() { function handleDisconnect(): void { setIsConnected(false); setStreamUrl(""); + + + + // Clear the error only if it's different from the previous one if (error && error !== prevErrorRef.current) { - setError(""); - setStreamUrl(""); + setError(null); } prevErrorRef.current = error; } @@ -84,13 +88,20 @@ export default function VidPlayer() { }> {streamUrl ? ( e.preventDefault()} + onBufferEnd={() => console.log("onBufferEnd")} + onProgress={() => console.log("onProgress")} className="flex mx-16 mt-16" - url={streamUrl.toString()} + url={streamUrl} width={width} height={height - 150} controls={false} + onStart={() => console.log("onStart")} onError={handlePlayerError} + onReady={() => console.log("onReady")} + onSeek={(e) => console.log("onSeek", e)} /> ) : (