Skip to content

Commit

Permalink
replaced deprecated call to mediaplayer
Browse files Browse the repository at this point in the history
  • Loading branch information
amadeo-alex committed Jun 2, 2024
1 parent d858934 commit 96dbf64
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/HASS.Agent/HASS.Agent/Media/MediaManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
using Serilog;
using MediaPlayerState = HASS.Agent.Enums.MediaPlayerState;
using Octokit;
using Windows.Media.Core;

namespace HASS.Agent.Media
{
Expand Down Expand Up @@ -406,7 +407,7 @@ internal static async void ProcessMedia(string mediaUri)
if (Variables.MediaPlayer.CurrentState == Windows.Media.Playback.MediaPlayerState.Playing) Variables.MediaPlayer.Pause();

// set the uri source
Variables.MediaPlayer.SetUriSource(new Uri(localFile));
Variables.MediaPlayer.Source = MediaSource.CreateFromUri(new Uri(localFile));

if (Variables.ExtendedLogging) Log.Information("[MEDIA] Playing: {file}", Path.GetFileName(localFile));

Expand Down

0 comments on commit 96dbf64

Please sign in to comment.