MCPcopy Create free account
hub / github.com/bajrangCoder/setu / new

Method new

src/components/audio_player.rs:49–65  ·  view source on GitHub ↗
(audio_bytes: Vec<u8>, content_type: String, cx: &mut Context<Self>)

Source from the content-addressed store, hash-verified

47}
48
49impl AudioPlayer {
50 pub fn new(audio_bytes: Bytes, content_type: String, cx: &mut Context<Self>) -> Self {
51 let duration = Self::probe_duration(&audio_bytes, &content_type);
52
53 Self {
54 audio_bytes,
55 content_type,
56 playback_state: PlaybackState::Stopped,
57 volume: 0.8,
58 muted: false,
59 current_position: Duration::ZERO,
60 total_duration: duration,
61 focus_handle: cx.focus_handle(),
62 backend: None,
63 progress_bounds: Bounds::default(),
64 error_message: None,
65 }
66 }
67
68 fn probe_duration(bytes: &Bytes, _content_type: &str) -> Option<Duration> {

Callers

nothing calls this directly

Calls 1

focus_handleMethod · 0.45

Tested by

no test coverage detected