Completed VlcAudioService

This commit is contained in:
Yoshi Askharoun
2022-08-06 13:05:01 -05:00
parent 1d919c8511
commit 3b843ae2db
2 changed files with 7 additions and 3 deletions
+6 -2
View File
@@ -48,7 +48,7 @@ namespace Microsoft.Zune.Playback
}
}
public TimeSpan Position { get; private set; }
public TimeSpan Position => TimeSpan.FromMilliseconds(m_player.Time);
public StrixPlaybackState PlaybackState => m_player.State switch
{
@@ -115,7 +115,7 @@ namespace Microsoft.Zune.Playback
if (CurrentSource != sourceConfig)
await Preload(sourceConfig, cancellationToken);
m_player.Play(m_media);
m_player.Play();
}
public async Task Preload(PlaybackItem sourceConfig, CancellationToken cancellationToken = default)
@@ -134,6 +134,7 @@ namespace Microsoft.Zune.Playback
}
await m_media.Parse(MediaParseOptions.ParseNetwork | MediaParseOptions.ParseLocal, cancellationToken: cancellationToken);
m_player.Media = m_media;
}
public Task ResumeAsync(CancellationToken cancellationToken = default)
@@ -144,6 +145,9 @@ namespace Microsoft.Zune.Playback
public Task SeekAsync(TimeSpan position, CancellationToken cancellationToken = default)
{
if (m_player.IsSeekable)
m_player.SeekTo(position);
return Task.CompletedTask;
}
}
+1 -1
View File
@@ -64,7 +64,7 @@
</ItemGroup>
<ItemGroup Condition=" $(TargetFramework.StartsWith('net6.0-windows')) ">
<PackageReference Include="VideoLAN.LibVLC.Windows" Version="3.0.17.4" />
<PackageReference Include="VideoLAN.LibVLC.Windows" Version="3.0.17.4" PrivateAssets="analyzers;build" />
</ItemGroup>
</Project>