(&self)
| 326 | if total.as_millis() == 0 { |
| 327 | return 0.0; |
| 328 | } |
| 329 | |
| 330 | (self.current_position.as_secs_f32() / total.as_secs_f32()).clamp(0.0, 1.0) |
| 331 | } else { |
| 332 | 0.0 |
| 333 | } |
| 334 | } |
| 335 | |
| 336 | fn audio_format_label(&self) -> &str { |
| 337 | let ct = self.content_type.to_lowercase(); |
| 338 | if ct.contains("mp3") || ct.contains("mpeg") { |
| 339 | "MP3" |
| 340 | } else if ct.contains("wav") { |
| 341 | "WAV" |