Skip to content
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ namespace CommunityToolkit.Maui.Views;
[TypeConverter(typeof(MediaSourceConverter))]
public abstract class MediaSource : Element
{
static readonly bool isAndroid = OperatingSystem.IsAndroid();
readonly WeakEventManager weakEventManager = new();

internal event EventHandler SourceChanged
Expand Down Expand Up @@ -37,7 +38,7 @@ internal event EventHandler SourceChanged
/// </summary>
/// <param name="path">Full path to the resource file, relative to the application's resources folder.</param>
/// <returns>A <see cref="ResourceMediaSource"/> instance.</returns>
public static MediaSource FromResource(string? path) => new ResourceMediaSource { Path = path };
public static MediaSource FromResource(string? path) => new ResourceMediaSource { Path = isAndroid ? $"Assets/{path}" : path };

/// <summary>
/// Creates a <see cref="UriMediaSource"/> from an string that contains an absolute URI.
Expand Down