Commit 800fd0e
committed
fix(audio): support resource: and other URL schemes in GraalVM native images
Res.getUri returns a resource:/ URL inside a native image (there is no jar
on disk), which resolveFilePath passed through as a raw path — the native
decoder cannot open it and playback failed silently. Treat any non-file URL
scheme (jar:, resource:, ...) as an openable stream and extract it to a temp
file once, instead of special-casing jar: only.
Also bumps nucleus.rodio to 1.0.2: playback callbacks were stripped by
native-image because the JNI adapter was an anonymous class.1 parent 07545e7 commit 800fd0e
2 files changed
Lines changed: 21 additions & 10 deletions
File tree
- audioplayer/src/jvmMain/kotlin/io/github/kdroidfilter/composemediaplayer/audio
- gradle
Lines changed: 20 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
177 | 178 | | |
178 | | - | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
179 | 190 | | |
180 | 191 | | |
181 | 192 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
0 commit comments