-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Closed
Labels
Description
Describe the bug
currupt when loading local hls files with asset protocol
Reproduction
- copied player code from vimejs
- used convertFileSrc
<script lang="ts">
import { convertFileSrc } from "@tauri-apps/api/tauri";
import { onMount } from "svelte";
let showPlayer = false;
let player;
onMount(async () => {
const { defineCustomElements } = await import("@vime/core");
defineCustomElements();
showPlayer = true;
});
const posterlocal = convertFileSrc("/Users/CC/posterlocal.png");
const datasrclocal = convertFileSrc(
"/Users/CC/resources/master.m3u8"
);
console.log("posterlocal=", posterlocal, " datasrclocal=", datasrclocal);
</script>
<div class="w-full h-full">
<div><img alt="poster.png" src={posterlocal} /></div>
<br /><br />
{#if showPlayer}
<vm-player bind:this={player}>
<vm-hls version="latest" poster={posterlocal}>
<source data-src={datasrclocal} type="application/x-mpegURL" />
</vm-hls>
<!-- We turn off the controls that come with the default UI. -->
<vm-default-ui no-controls>
<!-- We setup the default controls and pass in any options. -->
<vm-default-controls hide-on-mouse-leave active-duration="2000" />
</vm-default-ui>
</vm-player>
{/if}
</div>
<svelte:head>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/@vime/core@^5/themes/default.css"
/>
</svelte:head>
Expected behavior
load hls file m3u8 sucessfully
Platform and versions
❯ cargo tauri info
Operating System - Mac OS, version 12.1.0 X64
Node.js environment
Node.js - 16.13.1
@tauri-apps/cli - 1.0.0-beta.10
@tauri-apps/api - 1.0.0-beta.8
Global packages
npm - 8.1.2
pnpm - 6.24.2
yarn - 1.22.10
Rust environment
rustc - 1.59.0-nightly
cargo - 1.58.0-nightly
Rust environment
rustup - 1.24.3
rustc - 1.59.0-nightly
cargo - 1.58.0-nightly
toolchain - nightly-x86_64-apple-darwin (environment override by RUSTUP_TOOLCHAIN)
App directory structure
/@types
/node_modules
/datas
/static
/.github
/src-tauri
/.svelte-kit
/build
/.git
/.vscode
/.idea
/src
App
tauri.rs - 1.0.0-beta.8
build-type - bundle
CSP - default-src blob: data: filesystem: ws: wss: http: https: tauri: asset: customprotocol: 'unsafe-eval' 'unsafe-inline' 'self' img-src: 'self'
distDir - ../build
devPath - http://localhost:3030/
framework - SvelteStack trace
2021-12-31 12:03:55.887007 UTC INFO may::io::sys::select - wakeup id=0, ret=0
2021-12-31 12:03:55.887852 UTC INFO may::io::sys::select - got wakeup event in select, id=0
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: InvalidRange', /Users/CC/github/tauri-apps/tauri/core/tauri/src/manager.rs:346:78
stack backtrace:
0: 0x10cf09941 - std::backtrace_rs::backtrace::libunwind::trace::hd1f3f27a0ce98cd1
at /rustc/efec545293b9263be9edfb283a7aa66350b3acbf/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
1: 0x10cf09941 - std::backtrace_rs::backtrace::trace_unsynchronized::hd569a01ac3d00854
at /rustc/efec545293b9263be9edfb283a7aa66350b3acbf/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
2: 0x10cf09941 - std::sys_common::backtrace::_print_fmt::h996dd958d6ad6e0c
at /rustc/efec545293b9263be9edfb283a7aa66350b3acbf/library/std/src/sys_common/backtrace.rs:67:5
3: 0x10cf09941 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hd97b45925762f035
at /rustc/efec545293b9263be9edfb283a7aa66350b3acbf/library/std/src/sys_common/backtrace.rs:46:22
4: 0x10cf2ca4b - core::fmt::write::h2d5ecb4b9764759c
at /rustc/efec545293b9263be9edfb283a7aa66350b3acbf/library/core/src/fmt/mod.rs:1149:17
5: 0x10cf00f2a - std::io::Write::write_fmt::h80cfd69766515533
at /rustc/efec545293b9263be9edfb283a7aa66350b3acbf/library/std/src/io/mod.rs:1697:15
6: 0x10cf0b775 - std::sys_common::backtrace::_print::h811beb019f458a3f
at /rustc/efec545293b9263be9edfb283a7aa66350b3acbf/library/std/src/sys_common/backtrace.rs:49:5
7: 0x10cf0b775 - std::sys_common::backtrace::print::h2568609b53248111
at /rustc/efec545293b9263be9edfb283a7aa66350b3acbf/library/std/src/sys_common/backtrace.rs:36:9
8: 0x10cf0b775 - std::panicking::default_hook::{{closure}}::h726902fd3b2e524f
at /rustc/efec545293b9263be9edfb283a7aa66350b3acbf/library/std/src/panicking.rs:211:50
9: 0x10cf0b35f - std::panicking::default_hook::h8c88a86349ae0d96
at /rustc/efec545293b9263be9edfb283a7aa66350b3acbf/library/std/src/panicking.rs:228:9
10: 0x10bb2b7a4 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h7e7d0fa5d9b607e1
at /rustc/efec545293b9263be9edfb283a7aa66350b3acbf/library/alloc/src/boxed.rs:1825:9
11: 0x10bb49c99 - may::scheduler::filter_cancel_panic::{{closure}}::haac0632072a8a8ba
at /Users/CC/.cargo/registry/src/github.com-1ecc6299db9ec823/may-0.3.19/src/scheduler.rs:49:9
12: 0x10cf0be86 - std::panicking::rust_panic_with_hook::h5cbc51010430491b
at /rustc/efec545293b9263be9edfb283a7aa66350b3acbf/library/std/src/panicking.rs:610:17
13: 0x10cf0b8fe - std::panicking::begin_panic_handler::{{closure}}::hf90c83b4ac2013ae
at /rustc/efec545293b9263be9edfb283a7aa66350b3acbf/library/std/src/panicking.rs:502:13
14: 0x10cf09dc7 - std::sys_common::backtrace::__rust_end_short_backtrace::hca90c3f3f4640bf8
at /rustc/efec545293b9263be9edfb283a7aa66350b3acbf/library/std/src/sys_common/backtrace.rs:139:18
15: 0x10cf0b86a - rust_begin_unwind
at /rustc/efec545293b9263be9edfb283a7aa66350b3acbf/library/std/src/panicking.rs:498:5
16: 0x10cf52b1f - core::panicking::panic_fmt::h88a1b6fbb9084d2c
at /rustc/efec545293b9263be9edfb283a7aa66350b3acbf/library/core/src/panicking.rs:107:14
17: 0x10cf52c05 - core::result::unwrap_failed::h8abe20a396a5e82a
at /rustc/efec545293b9263be9edfb283a7aa66350b3acbf/library/core/src/result.rs:1660:5
18: 0x10b415f78 - core::result::Result<T,E>::unwrap::h86599c529547f483
at /rustc/efec545293b9263be9edfb283a7aa66350b3acbf/library/core/src/result.rs:1342:23
19: 0x10b646a41 - tauri::manager::WindowManager<R>::prepare_pending_window::{{closure}}::{{closure}}::h860235919876ac84
at /Users/CC/github/tauri-apps/tauri/core/tauri/src/manager.rs:346:25
20: 0x10b370a07 - <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::hdbb1f02938fa2a82
at /rustc/efec545293b9263be9edfb283a7aa66350b3acbf/library/core/src/future/mod.rs:80:19
21: 0x10b570e01 - tokio::park::thread::CachedParkThread::block_on::{{closure}}::h005cba928abb745e
at /Users/CC/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.15.0/src/park/thread.rs:263:54
22: 0x10b64a621 - tokio::coop::with_budget::{{closure}}::h058ec82ff0e8435a
at /Users/CC/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.15.0/src/coop.rs:102:9
23: 0x10b4ba700 - std::thread::local::LocalKey<T>::try_with::h5496337966fce81c
at /rustc/efec545293b9263be9edfb283a7aa66350b3acbf/library/std/src/thread/local.rs:413:16
24: 0x10b4b980e - std::thread::local::LocalKey<T>::with::h37a4577b8f1a74ee
at /rustc/efec545293b9263be9edfb283a7aa66350b3acbf/library/std/src/thread/local.rs:389:9
25: 0x10b57041c - tokio::coop::with_budget::h44b4baf2fa0493ab
at /Users/CC/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.15.0/src/coop.rs:95:5
26: 0x10b57041c - tokio::coop::budget::hdf257886ca87d845
at /Users/CC/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.15.0/src/coop.rs:72:5
27: 0x10b57041c - tokio::park::thread::CachedParkThread::block_on::h8d007173ad97c9fd
at /Users/CC/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.15.0/src/park/thread.rs:263:31
28: 0x10b55fb40 - tokio::runtime::enter::Enter::block_on::h0d15765e904823fb
at /Users/CC/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.15.0/src/runtime/enter.rs:151:13
29: 0x10b30cb95 - tokio::runtime::thread_pool::ThreadPool::block_on::ha848b1f82c47c834
at /Users/CC/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.15.0/src/runtime/thread_pool/mod.rs:77:9
30: 0x10b1f24e8 - tokio::runtime::Runtime::block_on::he11151ed87562583
at /Users/CC/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.15.0/src/runtime/mod.rs:463:43
31: 0x10b43a10b - tauri::async_runtime::Runtime::block_on::h0743c2bd78929f34
at /Users/CC/github/tauri-apps/tauri/core/tauri/src/async_runtime.rs:124:25
32: 0x10b436bb5 - tauri::async_runtime::GlobalRuntime::block_on::h1a4c1518de111ac5
at /Users/CC/github/tauri-apps/tauri/core/tauri/src/async_runtime.rs:72:7
33: 0x10b43a2e5 - tauri::async_runtime::block_on::h864fc13f5aca2c4f
at /Users/CC/github/tauri-apps/tauri/core/tauri/src/async_runtime.rs:259:3
34: 0x10b4379b7 - tauri::async_runtime::safe_block_on::hb15a52a6ec1cebfb
at /Users/CC/github/tauri-apps/tauri/core/tauri/src/async_runtime.rs:294:5
35: 0x10b645853 - tauri::manager::WindowManager<R>::prepare_pending_window::{{closure}}::hd8620bfbf08a8ea1
at /Users/CC/github/tauri-apps/tauri/core/tauri/src/manager.rs:339:46
36: 0x10b306a14 - tauri_runtime::window::PendingWindow<R>::register_uri_scheme_protocol::{{closure}}::h373639f3e7c7ca2b
at /Users/CC/github/tauri-apps/tauri/core/tauri-runtime/src/window.rs:179:48
37: 0x10c7e135b - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h08045e6cc89def8c
at /rustc/efec545293b9263be9edfb283a7aa66350b3acbf/library/alloc/src/boxed.rs:1825:9
38: 0x10c76c4bd - tauri_runtime_wry::create_webview::{{closure}}::h91f599a551649051
at /Users/CC/github/tauri-apps/tauri/core/tauri-runtime-wry/src/lib.rs:2628:7
39: 0x10c89155b - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::hef627901c13d9e48
at /rustc/efec545293b9263be9edfb283a7aa66350b3acbf/library/alloc/src/boxed.rs:1825:9
40: 0x10c86c26b - wry::webview::wkwebview::InnerWebView::new::start_task::ha2dcfe551dd04304
at /Users/CC/.cargo/git/checkouts/wry-0ba07c7b81cd1a87/3284f8d/src/webview/wkwebview/mod.rs:164:38
41: 0x7ff91baeec61 - <unknown>
42: 0x7ff91bbdebbc - <unknown>
43: 0x7ff91bba3c0f - <unknown>
44: 0x7ff91bba3b79 - <unknown>
45: 0x7ff91beced7b - <unknown>
46: 0x7ff91b7df959 - <unknown>
47: 0x7ff91bbd970b - <unknown>
48: 0x7ff91b7bd3ce - <unknown>
49: 0x7ff91b7bcba0 - <unknown>
50: 0x7ff83107af3f - <unknown>
51: 0x7ff83107be9a - <unknown>
52: 0x7ff817aaf8fd - <unknown>
53: 0x7ff817aaf865 - <unknown>
54: 0x7ff817aaf5e4 - <unknown>
55: 0x7ff817aae01b - <unknown>
56: 0x7ff817aad5dd - <unknown>
57: 0x7ff8206e04f1 - <unknown>
58: 0x7ff8206e0247 - <unknown>
59: 0x7ff8206dffe5 - <unknown>
60: 0x7ff81a4dcb4c - <unknown>
61: 0x7ff81a4db1b8 - <unknown>
62: 0x7ff81a4cd5a9 - <unknown>
63: 0x10c756086 - <() as objc::message::MessageArguments>::invoke::h4996b229a6f0ffb8
at /Users/CC/.cargo/registry/src/github.com-1ecc6299db9ec823/objc-0.2.7/src/message/mod.rs:128:17
64: 0x10c759f9c - objc::message::platform::send_unverified::h86c989ac1f33cd2a
at /Users/CC/.cargo/registry/src/github.com-1ecc6299db9ec823/objc-0.2.7/src/message/apple/mod.rs:27:9
65: 0x10b561bcf - objc::message::send_message::h172ab26c98d9cc77
at /Users/CC/.cargo/registry/src/github.com-1ecc6299db9ec823/objc-0.2.7/src/message/mod.rs:178:5
66: 0x10b561bcf - tao::platform_impl::platform::event_loop::EventLoop<T>::run_return::hf74d0f95e38adf7f
at /Users/CC/.cargo/git/checkouts/tao-b2c91e21b396bd53/d380100/src/platform_impl/macos/event_loop.rs:180:16
67: 0x10b561e7d - tao::platform_impl::platform::event_loop::EventLoop<T>::run::h0e9fd94ea6de5aca
at /Users/CC/.cargo/git/checkouts/tao-b2c91e21b396bd53/d380100/src/platform_impl/macos/event_loop.rs:147:5
68: 0x10b2323bc - tao::event_loop::EventLoop<T>::run::hdf59594d175bf82e
at /Users/CC/.cargo/git/checkouts/tao-b2c91e21b396bd53/d380100/src/event_loop.rs:152:5
69: 0x10b5bd614 - <tauri_runtime_wry::Wry as tauri_runtime::Runtime>::run::h2114e098c156cddf
at /Users/CC/github/tauri-apps/tauri/core/tauri-runtime-wry/src/lib.rs:1881:5
70: 0x10b45481c - tauri::app::App<R>::run::hc86b6175d9b11cc7
at /Users/CC/github/tauri-apps/tauri/core/tauri/src/app.rs:480:5
71: 0x10b30c323 - ebmaster::main::ha0b218c1f73fe4bb
at /Users/CC/xxxx/src-tauri/src/main.rs:260:3
72: 0x10b1b5b2e - core::ops::function::FnOnce::call_once::h0399af985b26312e
at /rustc/efec545293b9263be9edfb283a7aa66350b3acbf/library/core/src/ops/function.rs:227:5
73: 0x10b5d04c1 - std::sys_common::backtrace::__rust_begin_short_backtrace::ha15d4f9d5077d1dd
at /rustc/efec545293b9263be9edfb283a7aa66350b3acbf/library/std/src/sys_common/backtrace.rs:123:18
74: 0x10b5dbce4 - std::rt::lang_start::{{closure}}::hc03cf426bc4b8680
at /rustc/efec545293b9263be9edfb283a7aa66350b3acbf/library/std/src/rt.rs:145:18
75: 0x10cf091a4 - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::he64439ea80c91c04
at /rustc/efec545293b9263be9edfb283a7aa66350b3acbf/library/core/src/ops/function.rs:259:13
76: 0x10cf091a4 - std::panicking::try::do_call::h66ad3d2da0471c01
at /rustc/efec545293b9263be9edfb283a7aa66350b3acbf/library/std/src/panicking.rs:406:40
77: 0x10cf091a4 - std::panicking::try::h355714f8158880bc
at /rustc/efec545293b9263be9edfb283a7aa66350b3acbf/library/std/src/panicking.rs:370:19
78: 0x10cf091a4 - std::panic::catch_unwind::hf52738c273a0e724
at /rustc/efec545293b9263be9edfb283a7aa66350b3acbf/library/std/src/panic.rs:133:14
79: 0x10cf091a4 - std::rt::lang_start_internal::{{closure}}::hc160f80a2e430575
at /rustc/efec545293b9263be9edfb283a7aa66350b3acbf/library/std/src/rt.rs:128:48
80: 0x10cf091a4 - std::panicking::try::do_call::hf89d9db6874b51b7
at /rustc/efec545293b9263be9edfb283a7aa66350b3acbf/library/std/src/panicking.rs:406:40
81: 0x10cf091a4 - std::panicking::try::hbf22e3fb725f11ab
at /rustc/efec545293b9263be9edfb283a7aa66350b3acbf/library/std/src/panicking.rs:370:19
82: 0x10cf091a4 - std::panic::catch_unwind::h70212148c0e249ee
at /rustc/efec545293b9263be9edfb283a7aa66350b3acbf/library/std/src/panic.rs:133:14
83: 0x10cf091a4 - std::rt::lang_start_internal::he76135267df4563a
at /rustc/efec545293b9263be9edfb283a7aa66350b3acbf/library/std/src/rt.rs:128:20
84: 0x10b5dbcbe - std::rt::lang_start::hbf8d4b087bbfbd1f
at /rustc/efec545293b9263be9edfb283a7aa66350b3acbf/library/std/src/rt.rs:144:17
85: 0x10b30c4d6 - <unknown>
at /Users/CC/xxxx/src-tauri/src/main.rs:33:39Additional context
No response
Reactions are currently unavailable