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 { ...@@ -40,6 +40,7 @@ trait PlayerExt {
fn play(&self); fn play(&self);
fn pause(&self); fn pause(&self);
fn stop(&self); fn stop(&self);
fn set_uri(&self, &str);
} }
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
...@@ -182,8 +183,8 @@ impl AudioPlayerWidget { ...@@ -182,8 +183,8 @@ impl AudioPlayerWidget {
Self::connect_gst_signals(s); Self::connect_gst_signals(s);
} }
pub fn initialize_stream(&self) -> Result<(), Error> { pub fn initialize_stream(&self, uri: &str) {
unimplemented!() self.set_uri(uri)
} }
#[cfg_attr(rustfmt, rustfmt_skip)] #[cfg_attr(rustfmt, rustfmt_skip)]
...@@ -255,4 +256,8 @@ impl PlayerExt for AudioPlayerWidget { ...@@ -255,4 +256,8 @@ impl PlayerExt for AudioPlayerWidget {
// Reset the slider position to 0 // Reset the slider position to 0
self.timer.on_position_updated(Position(ClockTime::from_seconds(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