diff --git a/src/CommunityToolkit.Maui.MediaElement/AppBuilderExtensions.shared.cs b/src/CommunityToolkit.Maui.MediaElement/AppBuilderExtensions.shared.cs
index 6d1cd023ac..5eacded955 100644
--- a/src/CommunityToolkit.Maui.MediaElement/AppBuilderExtensions.shared.cs
+++ b/src/CommunityToolkit.Maui.MediaElement/AppBuilderExtensions.shared.cs
@@ -12,13 +12,33 @@ public static class AppBuilderExtensions
/// Initializes the .NET MAUI Community Toolkit MediaElement Library
///
/// generated by .
+ ///
+ /// The mechanism to define the shared options for use with the implementations. Note this is optional.
+ /// An example of configuring the media options for iOS and macOS, is as follows:
+ ///
+ /// builder
+ /// .AddAudio(
+ /// configureMediaOptions: mediaOptions =>
+ /// {
+ ///#if IOS || MACCATALYST
+ /// mediaOptions.Category = AVFoundation.AVAudioSessionCategory.Playback;
+ /// mediaOptions.Mode = AVFoundation.AVAudioSessionMode.Default;
+ /// mediaOptions.CategoryOptions = AVFoundation.AVAudioSessionCategoryOptions.DefaultToSpeaker;
+ ///#endif
+ /// });
+ ///
+ ///
/// initialized for .
- public static MauiAppBuilder UseMauiCommunityToolkitMediaElement(this MauiAppBuilder builder)
+ public static MauiAppBuilder UseMauiCommunityToolkitMediaElement(this MauiAppBuilder builder, Action? configureMediaOptions = null)
{
builder.ConfigureMauiHandlers(h =>
{
h.AddHandler();
});
+
+ var mediaOptions = new MediaOptions();
+ configureMediaOptions?.Invoke(mediaOptions);
+ MediaManager.DefaultMediaOptions = mediaOptions;
#if ANDROID
builder.Services.AddSingleton();
diff --git a/src/CommunityToolkit.Maui.MediaElement/Options/MediaOptions.macios.cs b/src/CommunityToolkit.Maui.MediaElement/Options/MediaOptions.macios.cs
new file mode 100644
index 0000000000..5bdc9e8a72
--- /dev/null
+++ b/src/CommunityToolkit.Maui.MediaElement/Options/MediaOptions.macios.cs
@@ -0,0 +1,26 @@
+using AVFoundation;
+
+namespace CommunityToolkit.Maui;
+
+partial class MediaOptions
+{
+ ///
+ /// Gets or sets the category for the audio session.
+ ///
+ public AVAudioSessionCategory Category { get; set; } = AVAudioSessionCategory.Record;
+
+ ///
+ /// Gets or sets the mode for the audio session.
+ ///
+ public AVAudioSessionMode Mode { get; set; } = default;
+
+ ///
+ /// Gets or sets the options for the audio session category.
+ ///
+ public AVAudioSessionCategoryOptions CategoryOptions { get; set; } = default;
+
+ // ///
+ // /// Gets or sets the lifetime of the underlying audio session - basically whether the AVAudioSession will stay active or be deactivated.
+ // ///
+ // public SessionLifetime SessionLifetime { get; set; } = default;
+}
\ No newline at end of file
diff --git a/src/CommunityToolkit.Maui.MediaElement/Options/MediaOptions.shared.cs b/src/CommunityToolkit.Maui.MediaElement/Options/MediaOptions.shared.cs
new file mode 100644
index 0000000000..9a9e24f3e8
--- /dev/null
+++ b/src/CommunityToolkit.Maui.MediaElement/Options/MediaOptions.shared.cs
@@ -0,0 +1,9 @@
+namespace CommunityToolkit.Maui;
+
+///
+/// Options that can be configured for media playback sessions.
+///
+public partial class MediaOptions
+{
+
+}
\ No newline at end of file
diff --git a/src/CommunityToolkit.Maui.MediaElement/Views/MediaManager.shared.cs b/src/CommunityToolkit.Maui.MediaElement/Views/MediaManager.shared.cs
index 7aac7b2138..229f84f439 100644
--- a/src/CommunityToolkit.Maui.MediaElement/Views/MediaManager.shared.cs
+++ b/src/CommunityToolkit.Maui.MediaElement/Views/MediaManager.shared.cs
@@ -19,6 +19,8 @@ namespace CommunityToolkit.Maui.Core.Views;
///
public partial class MediaManager
{
+ internal static MediaOptions DefaultMediaOptions { get; set; } = new();
+
///
/// Initializes a new instance of the class.
///