Skip to content

[BUG] MediaElement on iOS and Mac Catalyst publishes a non-zero playback rate to Now Playing while paused #3383

Closed

Description

@TheCodeTraveler

Is there an existing issue for this?

  • I have searched the existing issues

Did you read the "Reporting a bug" section on Contributing file?

Current Behavior

On iOS and Mac Catalyst, MediaElement publishes a non-zero playback rate to the system's Now Playing info while playback is paused.

  • Metadata.SetMetadata sets NowPlayingInfo.PlaybackRate = mediaElement.Speed (Metadata.macios.cs, line 96).
  • MediaManager.macios.cs calls it whenever the player's TimeControlStatus changes, including to Paused (line 977), and the rate observer publishes PlaybackRate = MediaElement.Speed again (line 1071).
  • A pause doesn't change Speed (by design; MediaManagerSpeedAppleTests.NativePauseDoesNotChangeTheSpeed covers it), so the published rate stays 1.0 (or the chosen speed) while paused.

The system computes the lock screen's elapsed time from the last ElapsedPlaybackTime and the playback rate, and a rate of 0 is how the Now Playing info says "paused". So the lock screen and Control Center may show paused media as playing, with the elapsed time still advancing.

This was found by reading the code during #3344's review; it is not yet confirmed on a device. The code has been this way since #1782 (June 2024).

Expected Behavior

While MediaElement is paused or stopped, the Now Playing info has PlaybackRate = 0 and the current ElapsedPlaybackTime, so the lock screen and Control Center show it as paused at the right position. While playing, the rate is Speed.

Steps To Reproduce

  1. Run CommunityToolkit.Maui.Sample on an iPhone (a device shows the lock screen controls most reliably).
  2. Open Views > MediaElements Page > MediaElement, start a video, and set a speed if you like.
  3. Pause it in the app.
  4. Lock the iPhone, or open Control Center, and look at the Now Playing controls.
  5. Expected: paused, elapsed time not moving. Suspected: shown as playing, elapsed time advancing.

Link to public reproduction project repository

https://github.com/CommunityToolkit/Maui/tree/main/samples/CommunityToolkit.Maui.Sample

Environment

- .NET MAUI CommunityToolkit: main (991e2cba), CommunityToolkit.Maui.MediaElement
- OS: iOS and Mac Catalyst (Metadata.macios.cs)
- .NET MAUI: 10.0.90

Anything else?

A possible fix: publish PlaybackRate = 0 (with the current ElapsedPlaybackTime) when TimeControlStatus is Paused or the state is Stopped, and Speed only while playing; a device test can check MPNowPlayingInfoCenter.DefaultCenter.NowPlaying after a pause. The Windows and Android metadata may deserve the same check.

Activity

  1. added a commit that references this issue on Nov 13, 2026
    1e0c110
  2. locked and limited conversation to collaborators on Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions