-
Notifications
You must be signed in to change notification settings - Fork 406
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add initial media options class and extension #1905
base: main
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using AVFoundation; | ||
|
||
namespace CommunityToolkit.Maui; | ||
|
||
partial class MediaOptions | ||
{ | ||
/// <summary> | ||
/// Gets or sets the category for the audio session. | ||
/// </summary> | ||
public AVAudioSessionCategory Category { get; set; } = AVAudioSessionCategory.Record; | ||
|
||
/// <summary> | ||
/// Gets or sets the mode for the audio session. | ||
/// </summary> | ||
public AVAudioSessionMode Mode { get; set; } = default; | ||
|
||
/// <summary> | ||
/// Gets or sets the options for the audio session category. | ||
/// </summary> | ||
public AVAudioSessionCategoryOptions CategoryOptions { get; set; } = default; | ||
|
||
// /// <summary> | ||
// /// Gets or sets the lifetime of the underlying audio session - basically whether the AVAudioSession will stay active or be deactivated. | ||
// /// </summary> | ||
// public SessionLifetime SessionLifetime { get; set; } = default; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace CommunityToolkit.Maui; | ||
|
||
/// <summary> | ||
/// Options that can be configured for media playback sessions. | ||
/// </summary> | ||
public partial class MediaOptions | ||
{ | ||
|
||
} |
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -19,6 +19,8 @@ namespace CommunityToolkit.Maui.Core.Views; | |||||||||
/// </summary> | ||||||||||
public partial class MediaManager | ||||||||||
{ | ||||||||||
internal static MediaOptions DefaultMediaOptions { get; set; } = new(); | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here's is fine to be mutable, since users may want to change how options based on the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed. Let's make these Maui/src/CommunityToolkit.Maui/Options.cs Lines 19 to 22 in d6d6e18
We can always make it a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we want to add bindable properties so we can use this at runtime for changes with |
||||||||||
|
||||||||||
/// <summary> | ||||||||||
/// Initializes a new instance of the <see cref="MediaManager"/> class. | ||||||||||
/// </summary> | ||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would say those
Options
should be immutable. So we can refactor it to be a record and remove thesetter
s