Skip to content

Commit 1d3248c

Browse files
authored
Merge pull request #6315 from MicrosoftDocs/drewbat/media-playback-migration
[DO NOT MERGE] Migrating media playback content from UWP->WinUI
2 parents a0cbe37 + bf154f7 commit 1d3248c

19 files changed

Lines changed: 779 additions & 721 deletions

.openpublishing.redirection.json

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11149,6 +11149,61 @@
1114911149
"source_path": "uwp/composition/xaml-lighting.md",
1115011150
"redirect_url": "/windows/apps/develop/composition/xaml-lighting",
1115111151
"redirect_document_id": false
11152+
},
11153+
{
11154+
"source_path": "uwp/audio-video-camera/play-audio-and-video-with-mediaplayer.md",
11155+
"redirect_url": "/windows/apps/develop/media-playback/play-audio-and-video-with-mediaplayer",
11156+
"redirect_document_id": false
11157+
},
11158+
{
11159+
"source_path": "uwp/audio-video-camera/media-playback-with-mediasource.md",
11160+
"redirect_url": "/windows/apps/develop/media-playback/media-playback-with-mediasource",
11161+
"redirect_document_id": false
11162+
},
11163+
{
11164+
"source_path": "uwp/audio-video-camera/integrate-with-systemmediatransportcontrols.md",
11165+
"redirect_url": "/windows/apps/develop/media-playback/integrate-with-systemmediatransportcontrols",
11166+
"redirect_document_id": false
11167+
},
11168+
{
11169+
"source_path": "uwp/audio-video-camera/system-media-transport-controls.md",
11170+
"redirect_url": "/windows/apps/develop/media-playback/system-media-transport-controls",
11171+
"redirect_document_id": false
11172+
},
11173+
{
11174+
"source_path": "uwp/audio-video-camera/system-supported-metadata-cues.md",
11175+
"redirect_url": "/windows/apps/develop/media-playback/system-supported-metadata-cues",
11176+
"redirect_document_id": false
11177+
},
11178+
{
11179+
"source_path": "uwp/audio-video-camera/create-schedule-and-manage-media-breaks.md",
11180+
"redirect_url": "/windows/apps/develop/media-playback/create-schedule-and-manage-media-breaks",
11181+
"redirect_document_id": false
11182+
},
11183+
{
11184+
"source_path": "uwp/audio-video-camera/adaptive-streaming.md",
11185+
"redirect_url": "/windows/apps/develop/media-playback/adaptive-streaming",
11186+
"redirect_document_id": false
11187+
},
11188+
{
11189+
"source_path": "uwp/audio-video-camera/hls-tag-support.md",
11190+
"redirect_url": "/windows/apps/develop/media-playback/hls-tag-support",
11191+
"redirect_document_id": false
11192+
},
11193+
{
11194+
"source_path": "uwp/audio-video-camera/dash-profile-support.md",
11195+
"redirect_url": "/windows/apps/develop/media-playback/dash-profile-support",
11196+
"redirect_document_id": false
11197+
},
11198+
{
11199+
"source_path": "uwp/audio-video-camera/media-casting.md",
11200+
"redirect_url": "/windows/apps/develop/media-playback/media-casting",
11201+
"redirect_document_id": false
11202+
},
11203+
{
11204+
"source_path": "uwp/audio-video-camera/enable-remote-audio-playback.md",
11205+
"redirect_url": "/windows/apps/develop/media-playback/enable-remote-audio-playback",
11206+
"redirect_document_id": false
1115211207
}
1115311208
]
1115411209
}

uwp/audio-video-camera/adaptive-streaming.md renamed to hub/apps/develop/media-playback/adaptive-streaming.md

Lines changed: 28 additions & 32 deletions
Large diffs are not rendered by default.

uwp/audio-video-camera/create-schedule-and-manage-media-breaks.md renamed to hub/apps/develop/media-playback/create-schedule-and-manage-media-breaks.md

Lines changed: 24 additions & 21 deletions
Large diffs are not rendered by default.

uwp/audio-video-camera/dash-profile-support.md renamed to hub/apps/develop/media-playback/dash-profile-support.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
---
2-
ms.assetid: 3E0FBB43-F6A4-4558-AA89-20E7760BA73F
3-
description: This article lists the Dynamic Adaptive Streaming over HTTP (DASH) profiles supported for UWP apps.
2+
description: This article lists the Dynamic Adaptive Streaming over HTTP (DASH) profiles supported for WinUI apps.
43
title: Dynamic Adaptive Streaming over HTTP (DASH) profile support
5-
ms.date: 02/15/2017
4+
ms.date: 02/24/2026
65
ms.topic: article
7-
keywords: windows 10, uwp
6+
keywords: windows 10, winui, dash
87
ms.localizationpriority: medium
98
---
109
# Dynamic Adaptive Streaming over HTTP (DASH) profile support
1110

1211

1312
## Supported DASH profiles
14-
The following table lists the DASH profiles that are supported for UWP apps.
13+
The following table lists the DASH profiles that are supported for WinUI apps.
1514

1615
|Tag | Manifest type | Notes|July release of Windows 10|Windows 10, Version 1511|Windows 10, Version 1607 |Windows 10, Version 1607 |Windows 10, Version 1703| Windows 10, Version 1809
1716
|----------------|------|-------|-----------|--------------|---------|-------|--------|--------|

uwp/audio-video-camera/enable-remote-audio-playback.md renamed to hub/apps/develop/media-playback/enable-remote-audio-playback.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
11
---
22
description: This article shows you how to use AudioPlaybackConnection to enable Bluetooth-connected remote devices to play back audio on the local machine.
33
title: Enable audio playback from remote Bluetooth-connected devices
4-
ms.date: 05/03/2020
4+
ms.date: 02/24/2026
55
ms.topic: article
6-
keywords: windows 10, uwp
6+
keywords: windows, winui
77
ms.localizationpriority: medium
88
---
99

1010
# Enable audio playback from remote Bluetooth-connected devices
1111

1212
This article shows you how to use [AudioPlaybackConnection](/uwp/api/windows.media.audio.audioplaybackconnection) to enable Bluetooth-connected remote devices to play back audio on the local machine.
1313

14-
Starting with Windows 10, version 2004 remote audio sources can stream audio to Windows devices, enabling scenarios such as configuring a PC to behave like a Bluetooth speaker and allowing users to hear audio from their phone. The implementation uses the Bluetooth components in the OS to process incoming audio data and play it on the system's audio endpoints on the system such as built-in PC speakers or wired headphones. The enabling of the underlying Bluetooth A2DP sink is managed by apps, which are responsible for the end-user scenario, rather than by the system.
14+
Audio sources can stream audio to Windows devices, enabling scenarios such as configuring a PC to behave like a Bluetooth speaker and allowing users to hear audio from their phone. The implementation uses the Bluetooth components in the OS to process incoming audio data and play it on the system's audio endpoints on the system such as built-in PC speakers or wired headphones. The enabling of the underlying Bluetooth A2DP sink is managed by apps, which are responsible for the end-user scenario, rather than by the system.
1515

1616
The [AudioPlaybackConnection](/uwp/api/windows.media.audio.audioplaybackconnection) class is used to enable and disable connections from a remote device as well as to create the connection, allowing remote audio playback to begin.
1717

1818
## Add a user interface
1919

2020
For the examples in this article, we will use the following simple XAML UI which defines **ListView** control to display available remote devices, a **TextBlock** to display connection status, and three buttons for enabling, disabling, and opening connections.
2121

22-
:::code language="xml" source="~/../snippets-windows/windows-uwp/audio-video-camera/AudioPlaybackConnectionExample/cs/MainPage.xaml" id="snippet_AudioPlaybackConnectionXAML":::
22+
:::code language="xml" source="~/../snippets-windows/winappsdk/audio-video-camera/audio-playback-connection/cs/AudioPlaybackConnectionExample/MainWindow.xaml" id="snippet_AudioPlaybackConnectionXAML":::
2323

2424
## Use DeviceWatcher to monitor for remote devices
2525

2626
The [DeviceWatcher](/uwp/api/windows.devices.enumeration.devicewatcher) class allows you to detect connected devices. The [AudioPlaybackConnection.GetDeviceSelector](/uwp/api/windows.media.audio.audioplaybackconnection.getdeviceselector) method returns a string that tells the device watcher what kinds of devices to watch for. Pass this string into the **DeviceWatcher** constructor.
2727

2828
The [DeviceWatcher.Added](/uwp/api/windows.devices.enumeration.devicewatcher.added) event is raised for each device that is connected when the device watcher is started as well as for any device that is connected while the device watcher is running. The [DeviceWatcher.Removed](/uwp/api/windows.devices.enumeration.devicewatcher.removed) event is raised if a previously connected device disconnects.
2929

30-
Call [DeviceWatcher.Start](/uwp/api/windows.devices.enumeration.devicewatcher.start) to begin watching for connected devices that support audio playback connections. In this example we will start the device manager when the main **Grid** control in the UI is loaded. For more information on using **DeviceWatcher**, see [Enumerate Devices](../devices-sensors/enumerate-devices.md).
30+
Call [DeviceWatcher.Start](/uwp/api/windows.devices.enumeration.devicewatcher.start) to begin watching for connected devices that support audio playback connections. In this example we will start the device manager when the main **Grid** control in the UI is loaded. For more information on using **DeviceWatcher**, see [Enumerate Devices](/windows/uwp/devices-sensors/enumerate-devices).
3131

32-
:::code language="csharp" source="~/../snippets-windows/windows-uwp/audio-video-camera/AudioPlaybackConnectionExample/cs/MainPage.xaml.cs" id="snippet_MainGridLoaded":::
32+
:::code language="csharp" source="~/../snippets-windows/winappsdk/audio-video-camera/audio-playback-connection/cs/AudioPlaybackConnectionExample/MainWindow.xaml.cs" id="snippet_MainGridLoaded":::
3333

3434

3535
In the device watcher's **Added** event, each discovered device is represented by a [DeviceInformation](/uwp/api/Windows.Devices.Enumeration.DeviceInformation) object. Add each discovered device to an observable collection that is bound to the **ListView** control in the UI.
3636

37-
:::code language="csharp" source="~/../snippets-windows/windows-uwp/audio-video-camera/AudioPlaybackConnectionExample/cs/MainPage.xaml.cs" id="snippet_DeclareDevices":::
37+
:::code language="csharp" source="~/../snippets-windows/winappsdk/audio-video-camera/audio-playback-connection/cs/AudioPlaybackConnectionExample/MainWindow.xaml.cs" id="snippet_DeclareDevices":::
3838

3939

40-
:::code language="csharp" source="~/../snippets-windows/windows-uwp/audio-video-camera/AudioPlaybackConnectionExample/cs/MainPage.xaml.cs" id="snippet_DeviceWatcher_Added":::
40+
:::code language="csharp" source="~/../snippets-windows/winappsdk/audio-video-camera/audio-playback-connection/cs/AudioPlaybackConnectionExample/MainWindow.xaml.cs" id="snippet_DeviceWatcher_Added":::
4141

4242

4343
## Enable and release audio playback connections
@@ -46,35 +46,35 @@ Before opening a connection with a device, the connection must be enabled. This
4646

4747
In the click handler for the **Enable Audio Playback Connection** button, get the device ID associated with the currently selected device in the **ListView** control. This example maintains a dictionary of **AudioPlaybackConnection** objects that have been enabled. This method first checks to see if there is already an entry in the dictionary for the selected device. Next, the method attempts to create an **AudioPlaybackConnection** for the selected device by calling [TryCreateFromId](/uwp/api/windows.media.audio.audioplaybackconnection.trycreatefromid) and passing in the selected device ID.
4848

49-
If the connection is successfully created, add the new **AudioPlaybackConnection** object to the app's dictionary, register a handler for the object's [StateChanged](/uwp/api/windows.media.audio.audioplaybackconnection.statechanged) event, and call[StartAsync](/uwp/api/windows.media.audio.audioplaybackconnection.startasync) to notify the system that the new connection is enabled.
49+
If the connection is successfully created, add the new **AudioPlaybackConnection** object to the app's dictionary, register a handler for the object's [StateChanged](/uwp/api/windows.media.audio.audioplaybackconnection.statechanged) event, and call [StartAsync](/uwp/api/windows.media.audio.audioplaybackconnection.startasync) to notify the system that the new connection is enabled.
5050

51-
:::code language="csharp" source="~/../snippets-windows/windows-uwp/audio-video-camera/AudioPlaybackConnectionExample/cs/MainPage.xaml.cs" id="snippet_DeclareConnections":::
51+
:::code language="csharp" source="~/../snippets-windows/winappsdk/audio-video-camera/audio-playback-connection/cs/AudioPlaybackConnectionExample/MainWindow.xaml.cs" id="snippet_DeclareConnections":::
5252

53-
:::code language="csharp" source="~/../snippets-windows/windows-uwp/audio-video-camera/AudioPlaybackConnectionExample/cs/MainPage.xaml.cs" id="snippet_EnableAudioPlaybackConnection":::
53+
:::code language="csharp" source="~/../snippets-windows/winappsdk/audio-video-camera/audio-playback-connection/cs/AudioPlaybackConnectionExample/MainWindow.xaml.cs" id="snippet_EnableAudioPlaybackConnection":::
5454

5555

5656
## Open the audio playback connection
5757

5858
In the previous step, an audio playback connection was created, but sound does not begin playing until the connection is opened by calling [Open](/uwp/api/windows.media.audio.audioplaybackconnection.open) or [OpenAsync](/uwp/api/windows.media.audio.audioplaybackconnection.openasync). In the **Open Audio Playback Connection** button click handler, get the currently selected device and use the ID to retrieve the **AudioPlaybackConnection** from the app's dictionary of connections. Await a call to **OpenAsync** and check the **Status** value of the returned [AudioPlaybackConnectionOpenResultStatus](/uwp/api/windows.media.audio.audioplaybackconnectionopenresult) object to see if the connection was opened successfully and, if so, update the connection state text box.
5959

6060

61-
:::code language="csharp" source="~/../snippets-windows/windows-uwp/audio-video-camera/AudioPlaybackConnectionExample/cs/MainPage.xaml.cs" id="snippet_OpenAudioPlaybackConnectionButton":::
61+
:::code language="csharp" source="~/../snippets-windows/winappsdk/audio-video-camera/audio-playback-connection/cs/AudioPlaybackConnectionExample/MainWindow.xaml.cs" id="snippet_OpenAudioPlaybackConnectionButton":::
6262

6363
## Monitor audio playback connection state
6464

65-
The [AudioPlaybackConnection.ConnectionStateChanged](/uwp/api/windows.media.audio.audioplaybackconnection.statechanged) event is raised whenever the state of the connection changes. In this example, the handler for this event updates the status text box. Remember to update the UI inside a call to [Dispatcher.RunAsync](/uwp/api/windows.ui.core.coredispatcher.runasync) to make sure the update is made on the UI thread.
65+
The [AudioPlaybackConnection.ConnectionStateChanged](/uwp/api/windows.media.audio.audioplaybackconnection.statechanged) event is raised whenever the state of the connection changes. In this example, the handler for this event updates the status text box. Remember to update the UI inside a call to [DispatcherQueue.TryEnqueue](/windows/windows-app-sdk/api/winrt/microsoft.ui.dispatching.dispatcherqueue.tryenqueue) to make sure the update is made on the UI thread.
6666

67-
:::code language="csharp" source="~/../snippets-windows/windows-uwp/audio-video-camera/AudioPlaybackConnectionExample/cs/MainPage.xaml.cs" id="snippet_ConnectionStateChanged":::
67+
:::code language="csharp" source="~/../snippets-windows/winappsdk/audio-video-camera/audio-playback-connection/cs/AudioPlaybackConnectionExample/MainWindow.xaml.cs" id="snippet_ConnectionStateChanged":::
6868

6969
## Release connections and handle removed devices
7070

7171
This example provides a **Release Audio Playback Connection** button to allow the user to release an audio playback connection. In the handler for this event, we get the currently selected device and use the device's ID to look up the **AudioPlaybackConnection** in the dictionary. Call **Dispose** to release the reference and free any associated resources and remove the connection from the dictionary.
7272

73-
:::code language="csharp" source="~/../snippets-windows/windows-uwp/audio-video-camera/AudioPlaybackConnectionExample/cs/MainPage.xaml.cs" id="snippet_ReleaseAudioPlaybackConnectionButton":::
73+
:::code language="csharp" source="~/../snippets-windows/winappsdk/audio-video-camera/audio-playback-connection/cs/AudioPlaybackConnectionExample/MainWindow.xaml.cs" id="snippet_ReleaseAudioPlaybackConnectionButton":::
7474

75-
You should handle the case where a device is removed while a connection is enabled or open. To do this, implement a handler for the device watcher's [DeviceWatcher.Removed](/uwp/api/windows.devices.enumeration.devicewatcher.removed) event. First, the ID of the removed device is used to remove the device from the observable collection bound to the app's **ListView** control. Next, if a connection associated with this device is in the app's dictionary, **Dispose** is called to free the associated resources and then the connection is removed from the dictionary. All of this is done within a call to **Dispatcher.RunAsync** to make sure the UI updates are performed on the UI thread.
75+
You should handle the case where a device is removed while a connection is enabled or open. To do this, implement a handler for the device watcher's [DeviceWatcher.Removed](/uwp/api/windows.devices.enumeration.devicewatcher.removed) event. First, the ID of the removed device is used to remove the device from the observable collection bound to the app's **ListView** control. Next, if a connection associated with this device is in the app's dictionary, **Dispose** is called to free the associated resources and then the connection is removed from the dictionary. All of this is done within a call to **DispatcherQueue.TryEnqueue** to make sure the UI updates are performed on the UI thread.
7676

77-
:::code language="csharp" source="~/../snippets-windows/windows-uwp/audio-video-camera/AudioPlaybackConnectionExample/cs/MainPage.xaml.cs" id="snippet_DeviceWatcher_Removed":::
77+
:::code language="csharp" source="~/../snippets-windows/winappsdk/audio-video-camera/audio-playback-connection/cs/AudioPlaybackConnectionExample/MainWindow.xaml.cs" id="snippet_DeviceWatcher_Removed":::
7878

7979
## Related topics
8080

uwp/audio-video-camera/hls-tag-support.md renamed to hub/apps/develop/media-playback/hls-tag-support.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
2-
ms.assetid: 66a9cfe2-b212-4c73-8a36-963c33270099
3-
description: This article lists the HTTP Live Streaming (HLS) protocol tags supported for UWP apps.
2+
description: This article lists the HTTP Live Streaming (HLS) protocol tags supported for WinUI apps.
43
title: HTTP Live Streaming (HLS) tag support
5-
ms.date: 02/08/2017
4+
ms.date: 02/24/2026
65
ms.topic: article
7-
keywords: windows 10, uwp
6+
keywords: windows 10, winui
87
ms.localizationpriority: medium
98
---
109
# HTTP Live Streaming (HLS) tag support
11-
The following table lists the HLS tags that are supported for UWP apps.
10+
11+
The following table lists the HLS tags that are supported for WinUI apps.
1212

1313
> [!NOTE]
1414
> Custom tags that start with "X-" can be accessed as timed metadata as described in the article [Media items, playlists, and tracks](media-playback-with-mediasource.md).
14.5 KB
Loading
697 KB
Loading

0 commit comments

Comments
 (0)