This commit is contained in:
jahruz67
2026-03-26 09:56:19 -07:00
commit 2d36041f6a
50 changed files with 6563 additions and 0 deletions
+35
View File
@@ -0,0 +1,35 @@
using System;
using Windows.Media.Control;
using System.Threading.Tasks;
class MediaCheck
{
static async Task<int> Main()
{
try
{
var sessionManager = await GlobalSystemMediaTransportControlsSessionManager.RequestAsync();
var session = sessionManager.GetCurrentSession();
if (session == null)
{
return 0; // No media session
}
var playbackInfo = session.GetPlaybackInfo();
var status = playbackInfo.PlaybackStatus;
// PlaybackStatus.Playing = 4
if (status == GlobalSystemMediaTransportControlsSessionPlaybackStatus.Playing)
{
return 1; // Playing
}
return 0; // Not playing (paused, stopped, etc.)
}
catch
{
return 0; // Error = assume not playing
}
}
}