Skip to content

Support for MediaPlayerElement/MediaPlayer #2642

Open
3 of 18 issues completed
Open

Description

@sonnemaf

What would you like to be added:

Windows.UI.Xaml.Controls.MediaPlayerElement and/or Windows.Media.Playback.MediaPlayer

Why is this needed:

I'm currently converting an UWP game (Minesweeper 10) to Uno. This game should play sounds. I would love to play them using an MediaPlayerElement or MediaPlayer.

I use the following SoundHelper to play my sounds. It works currently in UWP only.

Related issues

Support issues

Other issues

All targets

iOS/Android

Android

iOS

Mac Catalyst

Wasm/Skia

Wasm/iOS

Wasm

Skia

Example

using System;
using Windows.Media.Core;
using Windows.UI.Xaml.Controls;

namespace Minesweeper.Helpers {

    static class SoundHelper {

        public static MediaPlayerElement Player { get; set; } = new MediaPlayerElement();

        public static bool IsMuted { get; set; }

        public static void Play(Sound sound, double volume = 1D) {
            if (!IsMuted) {
                switch (sound) {
                    case Sound.Gameover:
                        Player.Source = MediaSource.CreateFromUri(new Uri("ms-appx:///Assets/Sounds/Yeah.wav"));
                        break;
                    case Sound.Explode:
                        Player.Source = MediaSource.CreateFromUri(new Uri("ms-appx:///Assets/Sounds/Explode.mp3"));
                        break;
                    default:
                        break;
                }
                Player.MediaPlayer.Volume = volume;
                Player.MediaPlayer.Play();
            }
        }

    }

    public enum Sound {
        Gameover,
        Explode,
    }
}

For which Platform:

  • iOS
  • Android
  • WebAssembly
  • WebAssembly renderers for Xamarin.Forms
  • macOS
  • Windows
  • Build tasks
  • Solution Templates

Anything else we need to know?

Sub-issues

Sub-issues

3 of 18 Issues completed
Loading 18 sub-issues

Activity

  1. added
    kind/enhancement
    triage/untriaged
    on Feb 12, 2020
  2. added
    platform/android 🤖
    platform/ios 🍎
    platform/wasm 🌐
    and removed
    triage/untriaged
    on Feb 12, 2020
  3. MartinZikmund commented on Feb 12, 2020

    @MartinZikmund
    Member

    If I understand correctly, neither wav nor mp3 work? Where do you store the sound files, in the Shared project? Thinking it could be related to #1839

  4. modified the milestones: 3.1, 3.2 on Aug 28, 2020
  5. added
    project/media 📺
    and removed on Sep 21, 2020
  6. added
    difficulty/tbd
    on Feb 15, 2021
  7. 24 remaining items

  8. changed the title [-][ROADMAP] Support for `MediaPlayerElement`/`MediaPlayer`[/-] [+]Support for `MediaPlayerElement`/`MediaPlayer`[/+] on Jul 25, 2025
  9. removed
    kind/enhancement
    difficulty/challenging 🤯
    on Nov 28, 2025
  10. MartinZikmund commented on Apr 7, 2026

    @MartinZikmund
    Member

    Repro generator

    This issue was classified as not reproducible with a code sample or test.

    Reason: This is a meta tracking epic for MediaPlayerElement/MediaPlayer support with many sub-issues (most already resolved). MediaPlayerElement has been implemented and is tracked by specific sub-issues. If there are remaining broken scenarios, please refer to the individual open sub-issues.

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

    no-reproplatform/android 🤖platform/ios 🍎platform/wasm 🌐project/media 📺

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions