Commit b167306
committed
feat(player): implement HLS session progress polling with visual feedback
- Add waitForSessionReady to poll session creation progress before playback
- Integrate useSessionProgress hook for reusable progress tracking logic
- Display deterministic progress bar with percentage and stage information during session initialization
- Add SessionService.getSessionProgress API with HTTP 425 handling for in-progress state
- Update backend submodule to v64aaf0b with HLS session progress support
- Remove excessive debug logging in SubtitleOverlay to reduce console noise
Changes:
PlayerPage:
- Add waitForSessionReady state and sessionProgress state for UI rendering
- Implement polling loop with 2s interval to fetch session progress until ready
- Display progress bar with stage text and percentage during session creation
- Handle HTTP 425 (session not ready) gracefully in progress polling
- Fallback to default playlist URL if progress response URL parsing fails
useSessionProgress Hook:
- Provide reusable session progress polling with configurable interval (default 2s)
- Auto-stop polling when session is ready or error occurs
- Expose startPolling, stopPolling, reset methods for lifecycle control
- Implement progress threshold (5%) to reduce log noise
SessionService:
- Add getSessionProgress(sessionId) API to fetch session creation progress
- Define SessionProgressResponse and AudioProgressInfo interfaces
- Treat HTTP 425 as normal in-progress state (not error)
This enhancement provides real-time visual feedback during HLS session
initialization, improving user experience by showing progress instead of
generic "loading..." spinner. The polling mechanism ensures playback starts
only after the session is fully ready, preventing premature playlist access.1 parent 35cf4ce commit b167306
6 files changed
Lines changed: 440 additions & 43 deletions
File tree
- src/renderer/src
- pages/player
- components
- hooks
- services
- assets/session-debug.html+161-1
- src/app/api/v1/audio.py+32
- src/app/api/v1/session.py+89-6
- src/app/models/audio_track.py+40
- src/app/models/session.py+43-1
- src/app/schemas/session_request.py+18-1
- src/app/services/audio_preprocessor.py+270-24
- src/app/services/session_factory.py+5-1
- src/app/services/session_manager.py+105-12
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
95 | 96 | | |
96 | 97 | | |
97 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
98 | 105 | | |
99 | 106 | | |
100 | 107 | | |
| |||
103 | 110 | | |
104 | 111 | | |
105 | 112 | | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
106 | 167 | | |
107 | 168 | | |
| 169 | + | |
| 170 | + | |
108 | 171 | | |
109 | 172 | | |
110 | 173 | | |
| |||
189 | 252 | | |
190 | 253 | | |
191 | 254 | | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
205 | 260 | | |
206 | 261 | | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
222 | 329 | | |
223 | 330 | | |
224 | 331 | | |
| |||
270 | 377 | | |
271 | 378 | | |
272 | 379 | | |
273 | | - | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
274 | 384 | | |
275 | 385 | | |
276 | 386 | | |
| |||
415 | 525 | | |
416 | 526 | | |
417 | 527 | | |
| 528 | + | |
| 529 | + | |
418 | 530 | | |
419 | 531 | | |
420 | 532 | | |
421 | | - | |
422 | | - | |
423 | | - | |
424 | | - | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
425 | 551 | | |
426 | 552 | | |
427 | 553 | | |
| |||
609 | 735 | | |
610 | 736 | | |
611 | 737 | | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
612 | 765 | | |
613 | 766 | | |
614 | 767 | | |
| |||
Lines changed: 0 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
423 | 423 | | |
424 | 424 | | |
425 | 425 | | |
426 | | - | |
427 | | - | |
428 | | - | |
429 | | - | |
430 | | - | |
431 | | - | |
432 | | - | |
433 | | - | |
434 | | - | |
435 | 426 | | |
436 | 427 | | |
437 | 428 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
0 commit comments