Skip to content

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NowPlaying.NET logo

NowPlaying.NET

An App*eMusic-inspired, web-based Now Playing display for Windows.

Read the active Windows media session through GSMTC and display it on any browser on your local network.

Latest release .NET 8 Windows MIT License

English · 한국어

NowPlaying.NET player interface

Tip

Using an iOS 9 device? Use the separate NowPlaying.iOS native client. It connects directly to NowPlaying.NET and provides a native player experience on legacy hardware such as the iPad 3, without depending on the iOS 9 Safari engine.

Overview

NowPlaying.NET is a lightweight Windows tray application built with .NET 8 and ASP.NET Core. It reads the current system media session through Windows Global System Media Transport Controls (GSMTC), then exposes an embedded web player and a small REST/WebSocket API through Kestrel.

Run it on the Windows PC that is playing media, then open the player from the same PC or another device on the same LAN. Modern devices can use the embedded web player directly, while iOS 9 devices can connect through the separate native NowPlaying.iOS client.

Features

  • Displays title, artist, album, source application, playback state, timeline, and album artwork
  • Play/pause, previous, and next controls
  • WebSocket state updates with REST polling as a fallback
  • Stable progress tracking based on a local monotonic clock
  • Album-art-derived blurred background and full-screen player layout
  • Bouncing marquee for long titles and artist/album text
  • Full-screen control that hides after three seconds of inactivity
  • Normalizes player name to the user-friendly name
  • Windows notification-area application with open, startup, information, log, and exit commands
  • Debug-only live log window
  • Web UI, icons, and other static assets embedded in NowPlaying.NET.dll
  • Native iOS 9 client support through the separate NowPlaying.iOS repository

Requirements

Host PC

  • Windows 10 version 1809 or later, or Windows 11
  • x64 Windows installation
  • One of the following release packages:
Package Runtime requirement Notes
win-x64 .NET 8 ASP.NET Core Runtime required Default package with the smaller download size
win-x64-self-contained None Runtime-integrated package; runs without a separate .NET installation

Development

  • .NET 8 SDK or later within the .NET 8 servicing line
  • PowerShell
  • Visual Studio 2022 17.8 or later with the ASP.NET and web development workload, when using Visual Studio

Install and run

  1. Download the appropriate package from Releases.
  2. Extract the archive.
  3. Run NowPlaying.NET.exe.
  4. Double-click the tray icon, or right-click it and select Open Player.

The default local address is:

http://localhost:9864/

To open the player from another device on the same LAN, use the host PC's private IP address:

http://192.168.x.x:9864/

Windows Defender Firewall may require an inbound TCP rule for port 9864. Limit the rule to Private networks and, where practical, to the required local subnet.

Warning

NowPlaying.NET does not require authentication for its local control API. Do not expose port 9864 directly to the Internet or forward it from a public router.

Native client for iOS 9

NowPlaying.iOS is a separate Objective-C/UIKit client for legacy iOS 9 hardware, with the iPad 3 as its primary target. It consumes the /api/v1 endpoints provided by NowPlaying.NET and renders the player as a native application instead of relying on the aging iOS 9 Safari engine.

Typical setup:

  1. Run NowPlaying.NET on the Windows host PC.
  2. Confirm that http://PC-IP:9864/api/v1/health is reachable from the iOS device.
  3. Build and install NowPlaying.iOS from its own repository.
  4. Set the NowPlaying.NET server address in the app, for example http://192.168.x.x:9864.

NowPlaying.iOS is maintained and distributed independently. It is not included in the NowPlaying.NET release archives. Build instructions, supported toolchains, and device-specific details are documented in the NowPlaying.iOS repository.

Development

Clone the repository:

git clone https://github.com/HiSkyZen/NowPlaying.NET.git
cd NowPlaying.NET

Run with simulated media data:

.\scripts\run-demo.ps1

Run against the active Windows media session:

.\scripts\run-live.ps1

Debug builds run with a console and expose the live log window. Release builds use the Windows GUI subsystem and operate as a tray application without a console window.

Publishing

Default framework-dependent package

.\scripts\publish-win-x64.ps1

Output:

publish\win-x64

Self-contained package

.\scripts\publish-win-x64-self-contained.ps1

The self-contained package includes the .NET and ASP.NET Core runtimes and is therefore substantially larger.

Microsoft.Windows.SDK.NET.dll and WinRT.Runtime.dll are required for the Windows Runtime GSMTC integration and must remain in the published output, including framework-dependent builds.

Release publishing uses the following configuration:

  • wwwroot HTML, CSS, JavaScript, icons, and manifest are embedded as assembly resources
  • A physical wwwroot directory in the publish output is treated as a build failure
  • WinExe output with no console window
  • PDB and debug symbols disabled
  • ReadyToRun disabled
  • Trimming disabled to preserve ASP.NET Core and WinRT metadata compatibility
  • Self-contained publishing disabled by default

Tray menu

Command Function
Open Player Opens the local player in the default browser
Log Opens the live log window in Debug builds
About Displays the version and server addresses
Run at startup Registers or removes the application for the current Windows user
Exit Stops the web server and exits the tray application cleanly

API

The existing API paths and response models are retained for browser and native-client compatibility.

Method Path Description
GET /api/state Current player state
GET /api/artwork Current album artwork
POST /api/control/play Start playback
POST /api/control/pause Pause playback
POST /api/control/toggle Toggle play/pause
POST /api/control/previous Previous item
POST /api/control/next Next item
GET /api/v1 API v1 information
GET /api/v1/health Health check
GET /api/v1/state API v1 player state
GET /api/v1/artwork API v1 album artwork
POST /api/v1/control/{command} API v1 playback command
WS /ws Real-time state stream

Architecture

flowchart LR
    A[Windows media application] --> B[GSMTC]
    B --> C[NowPlaying.NET]
    C --> D[REST API]
    C --> E[WebSocket]
    C --> F[Embedded web UI]
    D --> G[Web browser]
    E --> G
    F --> G
    D --> H[NowPlaying.iOS native client]
Loading

Media metadata and artwork are re-read only when the media properties or active session change. The one-second refresh loop updates playback status and timeline data without repeatedly allocating the same large artwork buffer.

Project structure

src/
  Program.cs                          Web server and tray-host entry point
  Assets/NowPlaying.ico               Executable and tray icon
  Models/                              API models
  Services/                            GSMTC, state storage, and WebSocket broadcast
  Tray/                                Tray UI, startup registration, and debug log
  Web/EmbeddedWebRootFileProvider.cs  Embedded web-resource provider
  wwwroot/                             Editable web source embedded at build time
scripts/                               Development and publishing scripts
docs/                                  README images

Security model

NowPlaying.NET is intended for a trusted local network. Its defensive measures include:

  • Read-only web assets served from assembly manifest resources
  • No replaceable physical wwwroot directory in release output
  • Explicit MIME mapping for supported embedded assets
  • CSP, nosniff, frame, referrer, and permissions-policy headers
  • Rejection of mismatched browser Origin requests for /api and /ws
  • Compatibility with native clients that do not send an Origin header
  • Separate per-IP rate limits for reads, control requests, and WebSocket connections
  • A cap on concurrent WebSocket connections and rejection of client-sent WebSocket messages
  • Signature validation for JPEG, PNG, GIF, BMP, and WebP artwork responses
  • 404 responses for unknown /api/* and /ws/* paths instead of SPA fallback

These controls do not replace authentication or network isolation. Keep the service on a trusted LAN.

License

NowPlaying.NET is distributed under the MIT License.

About

App*eMusic-style web-based Now Playing display for Windows GSMTC

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages