Don't double-speak previous item when not flushing queue.

This commit is contained in:
Nolan Darilek 2020-11-03 11:20:02 -06:00
parent 9c98026978
commit 289a35dc83
1 changed files with 6 additions and 0 deletions

View File

@ -156,6 +156,12 @@ impl Backend for WinRT {
let content_type = stream.content_type()?;
let source = MediaSource::create_from_stream(stream, content_type)?;
let item = MediaPlaybackItem::create(source)?;
let item_index = self.playback_list.current_item_index()?;
let item_count = self.playback_list.items()?.size()?;
let state = self.player.playback_session()?.playback_state()?;
if state == MediaPlaybackState::Paused && item_index != 0 {
self.playback_list.items()?.clear()?;
}
self.playback_list.items()?.append(&item)?;
if !self.is_speaking()? {
self.player.play()?;