Skip to content
Merged
Changes from 7 commits
Commits
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
@@ -1,6 +1,8 @@
using Android.App;
using System.Diagnostics.CodeAnalysis;
using Android.App;
using Android.Content;
using Android.Runtime;
using Android.Util;
using Android.Views;
using Android.Widget;
using AndroidX.CoordinatorLayout.Widget;
Expand All @@ -24,18 +26,40 @@ public class MauiMediaElement : CoordinatorLayout

#pragma warning disable CS8618 // Non-nullable field is uninitialized. Consider declaring as nullable.
Comment thread
ne0rrmatrix marked this conversation as resolved.
#pragma warning disable IDE0060 // Remove unused parameter
public MauiMediaElement(nint ptr, JniHandleOwnership jni) : base(Platform.AppContext)
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring as nullable.
[DynamicDependency(DynamicallyAccessedMemberTypes.PublicConstructors, typeof(MediaElement))]
protected MauiMediaElement(nint javaReference, JniHandleOwnership transfer) : base(javaReference, transfer)
{
//Fixes no constructor found exception: https://github.com/CommunityToolkit/Maui/issues/3114
}

[DynamicDependency(DynamicallyAccessedMemberTypes.PublicConstructors, typeof(MediaElement))]
public MauiMediaElement(Context? context) : base(context)
{
//Fixes no constructor found exception: https://github.com/CommunityToolkit/Maui/issues/3114
}
Comment thread
ne0rrmatrix marked this conversation as resolved.

[DynamicDependency(DynamicallyAccessedMemberTypes.PublicConstructors, typeof(MediaElement))]
public MauiMediaElement(Context? context, IAttributeSet? attrs) : base(context, attrs)
{
//Fixes no constructor found exception: https://github.com/CommunityToolkit/Maui/issues/3114
}

[DynamicDependency(DynamicallyAccessedMemberTypes.PublicConstructors, typeof(MediaElement))]
public MauiMediaElement(Context? context, IAttributeSet? attrs, int defStyleAttr) : base(context, attrs, defStyleAttr)
{
//Fixes no constructor found exception: https://github.com/CommunityToolkit/Maui/pull/1692#issuecomment-1955099758
Comment thread
ne0rrmatrix marked this conversation as resolved.
Outdated
}
#pragma warning restore CS8618 // Non-nullable field is uninitialized. Consider declaring as nullable.
#pragma warning restore IDE0060 // Remove unused parameter
#pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring as nullable.

/// <summary>
/// Initializes a new instance of the <see cref="MauiMediaElement"/> class.
/// </summary>
/// <param name="context">The application's <see cref="Context"/>.</param>
/// <param name="playerView">The <see cref="PlayerView"/> that acts as the platform media player.</param>
[DynamicDependency(DynamicallyAccessedMemberTypes.PublicConstructors, typeof(MediaElement))]
public MauiMediaElement(Context context, PlayerView playerView) : base(context)
{
this.playerView = playerView;
Expand All @@ -54,6 +78,7 @@ public MauiMediaElement(Context context, PlayerView playerView) : base(context)
AddView(relativeLayout);
}

[DynamicDependency(DynamicallyAccessedMemberTypes.PublicConstructors, typeof(MediaElement))]
Comment thread
ne0rrmatrix marked this conversation as resolved.
public override void OnDetachedFromWindow()
{
if (isFullScreen)
Expand Down
Loading