Commit 8df8182b authored by Jordan Petridis's avatar Jordan Petridis

AudioPlayer: Add an api to initialize a stream.

parent 733e2794
......@@ -40,6 +40,7 @@ trait PlayerExt {
fn play(&self);
fn pause(&self);
fn stop(&self);
fn set_uri(&self, &str);
}
#[derive(Debug, Clone)]
......@@ -182,8 +183,8 @@ impl AudioPlayerWidget {
Self::connect_gst_signals(s);
}
pub fn initialize_stream(&self) -> Result<(), Error> {
unimplemented!()
pub fn initialize_stream(&self, uri: &str) {
self.set_uri(uri)
}
#[cfg_attr(rustfmt, rustfmt_skip)]
......@@ -255,4 +256,8 @@ impl PlayerExt for AudioPlayerWidget {
// Reset the slider position to 0
self.timer.on_position_updated(Position(ClockTime::from_seconds(0)));
}
fn set_uri(&self, uri: &str) {
self.player.set_uri(uri)
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment