Commit a76e8c2
committed
feat(player): HLS session progress polling with media server integration (#209)
* 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.
* refactor(PlayerPage): replace progress bar hardcoded values with theme tokens
- Import theme constants (SPACING, FONT_SIZES, ANIMATION_DURATION, etc.)
- Replace hardcoded width (240px) with SPACING.XXL * 5
- Replace hardcoded heights (4px) with COMPONENT_TOKENS.PROGRESS_BAR.TRACK_HEIGHT_HOVER
- Replace hardcoded border-radius (2px) with COMPONENT_TOKENS.PROGRESS_BAR.TRACK_BORDER_RADIUS
- Replace hardcoded font-sizes (16px, 14px) with FONT_SIZES.BASE and FONT_SIZES.SM
- Replace hardcoded transition timing with ANIMATION_DURATION.SLOW and EASING.STANDARD
- Fix: Add setTranscodeStatus('completed') call after HLS session completes
Changes ensure theme consistency, maintainability, and proper status tracking
across components. Progress bar now respects design system tokens for
cross-theme compatibility.1 parent fa9aa09 commit a76e8c2
4 files changed
Lines changed: 262 additions & 43 deletions
File tree
- src/renderer/src
- pages/player
- components
- 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 | | |
| |||
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
19 | 27 | | |
20 | 28 | | |
21 | 29 | | |
| |||
95 | 103 | | |
96 | 104 | | |
97 | 105 | | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
98 | 112 | | |
99 | 113 | | |
100 | 114 | | |
| |||
103 | 117 | | |
104 | 118 | | |
105 | 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 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
106 | 174 | | |
107 | 175 | | |
| 176 | + | |
| 177 | + | |
108 | 178 | | |
109 | 179 | | |
110 | 180 | | |
| |||
189 | 259 | | |
190 | 260 | | |
191 | 261 | | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
205 | 267 | | |
206 | 268 | | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
| 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 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
222 | 339 | | |
223 | 340 | | |
224 | 341 | | |
| |||
270 | 387 | | |
271 | 388 | | |
272 | 389 | | |
273 | | - | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
274 | 394 | | |
275 | 395 | | |
276 | 396 | | |
| |||
415 | 535 | | |
416 | 536 | | |
417 | 537 | | |
| 538 | + | |
| 539 | + | |
418 | 540 | | |
419 | 541 | | |
420 | 542 | | |
421 | | - | |
422 | | - | |
423 | | - | |
424 | | - | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
425 | 561 | | |
426 | 562 | | |
427 | 563 | | |
| |||
609 | 745 | | |
610 | 746 | | |
611 | 747 | | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
612 | 777 | | |
613 | 778 | | |
614 | 779 | | |
| |||
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 | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
108 | 135 | | |
109 | 136 | | |
110 | 137 | | |
| |||
518 | 545 | | |
519 | 546 | | |
520 | 547 | | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
521 | 584 | | |
522 | 585 | | |
523 | 586 | | |
| |||
0 commit comments