Skip to content

Commit

Permalink
Add windows and mac back in
Browse files Browse the repository at this point in the history
  • Loading branch information
martijn00 committed Jan 12, 2023
1 parent e11514c commit 4baed78
Show file tree
Hide file tree
Showing 30 changed files with 86 additions and 305 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks>net7.0</TargetFrameworks>
</PropertyGroup>

<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0-android33.0</TargetFrameworks>
<TargetFrameworks>net7.0-android33.0</TargetFrameworks>
</PropertyGroup>

<PropertyGroup>
Expand Down
29 changes: 15 additions & 14 deletions MediaManager.Forms/MediaManager.Forms.csproj
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0;net6.0-ios;net6.0-android33.0</TargetFrameworks>
<!--
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net6.0-windows10.0.19041</TargetFrameworks>-->
<TargetFrameworks>net7.0;net7.0-android33.0;net7.0-ios;net7.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net7.0-windows10.0.19041.0</TargetFrameworks>

<!--
<TargetFrameworks>netstandard2.0;xamarin.ios10;xamarin.mac20;xamarin.tvos10;monoandroid12.0;tizen40</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">uap10.0.18362;net472;netcoreapp3.1;$(TargetFrameworks)</TargetFrameworks>-->
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">14.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.19041.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.19041.0</TargetPlatformMinVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>

<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
Expand All @@ -29,27 +31,26 @@

<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows' And $([MSBuild]::IsOSPlatform('windows'))">
<Compile Include="Platforms\Uap\**\*.cs" />
<Page Include="Platforms\Uap\**\*.xaml" SubType="Designer" Generator="MSBuild:Compile" />
<!--<Page Include="Platforms\Uap\**\*.xaml" SubType="Designer" Generator="MSBuild:Compile" />-->
<None Update="**\*.xaml.cs" DependentUpon="%(Filename)" />
<Compile Update="**\*.xaml.cs" DependentUpon="%(Filename)" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.755" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.2.221209.1" />
</ItemGroup>

<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">
<None Remove="Platforms\Apple\**\*.cs" />
<None Remove="Platforms\Ios\**\*.cs" />
<Compile Include="Platforms\Apple\**\*.cs" />
<Compile Include="Platforms\Ios\**\*.cs" />
</ItemGroup>

<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">
<None Remove="Platforms\Apple\**\*.cs" />
<None Remove="Platforms\Mac\**\*.cs" />
<None Remove="Platforms\Ios\**\*.cs" />
<Compile Include="Platforms\Apple\**\*.cs" />
<Compile Include="Platforms\Mac\**\*.cs" />
<Compile Include="Platforms\Ios\**\*.cs" />
</ItemGroup>

<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tvos'" >
<None Remove="Platforms\Apple\**\*.cs" />
<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tvos'">
<None Remove="Platforms\Ios\**\*.cs" />
<None Remove="Platforms\Tvos\**\*.cs" />
<Compile Include="Platforms\Apple\**\*.cs" />
Expand All @@ -58,7 +59,6 @@
</ItemGroup>

<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'watchos'">
<None Remove="Platforms\Apple\**\*.cs" />
<None Remove="Platforms\Watchos\**\*.cs" />
<Compile Include="Platforms\Apple\**\*.cs" />
<Compile Include="Platforms\Watchos\**\*.cs" />
Expand All @@ -67,6 +67,7 @@
<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">
<None Remove="Platforms\Android\**\*.cs" />
<Compile Include="Platforms\Android\**\*.cs" />
<AndroidResource Include="Resources\**\*.xml" SubType="Designer" Generator="MSBuild:UpdateAndroidResources" />
</ItemGroup>

<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">
Expand Down
40 changes: 0 additions & 40 deletions MediaManager.Forms/Platforms/Mac/ImageSourceExtensions.cs

This file was deleted.

45 changes: 0 additions & 45 deletions MediaManager.Forms/Platforms/Mac/VideoViewRenderer.cs

This file was deleted.

3 changes: 2 additions & 1 deletion MediaManager.Forms/VideoView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,8 @@ private static void OnAutoPlayPropertyChanged(BindableObject bindable, object ol

private static async void OnVideoPlaceholderPropertyChanged(BindableObject bindable, object oldValue, object newValue)
{
#if !NET6
//TODO: Add mac and Windows
#if ANDROID || IOS
if (newValue is ImageSource imageSource)
MediaManager.MediaPlayer.VideoPlaceholder = await imageSource.ToNative().ConfigureAwait(false);
#endif
Expand Down
2 changes: 1 addition & 1 deletion MediaManager.Reactive/MediaManager.Reactive.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks>net7.0</TargetFrameworks>
</PropertyGroup>

<PropertyGroup>
Expand Down
4 changes: 2 additions & 2 deletions MediaManager.UnitTest/MediaManager.UnitTest.csproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<PrivateAssets>all</PrivateAssets>
Expand Down
8 changes: 5 additions & 3 deletions MediaManager/CrossMediaManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@ public static IMediaManager Current

#if ANDROID
public static MediaManagerImplementation Android => (MediaManagerImplementation)Current;
#elif APPLE
public static MediaManagerImplementation Apple => (MediaManagerImplementation)Current;
#elif IOS
public static MediaManagerImplementation Ios => (MediaManagerImplementation)Current;
#elif MACCATALYST
public static MediaManagerImplementation Ios => (MediaManagerImplementation)Current;
#elif UWP
public static MediaManagerImplementation Windows => (MediaManagerImplementation)Current;
#elif TIZEN
Expand All @@ -45,7 +47,7 @@ public static IMediaManager Current

private static IMediaManager CreateMediaManager()
{
#if NET6
#if NET7
return null;
#else
#pragma warning disable IDE0022 // Use expression body for methods
Expand Down
19 changes: 8 additions & 11 deletions MediaManager/MediaManager.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0;net6.0-ios;net6.0-android33.0</TargetFrameworks>
<!--<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net6.0-windows10.0.19041</TargetFrameworks>-->
<TargetFrameworks>net7.0;net7.0-android33.0;net7.0-ios;net7.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net7.0-windows10.0.19041.0</TargetFrameworks>

<!--
<TargetFrameworks>netstandard2.0;xamarin.ios10;xamarin.mac20;xamarin.tvos10;monoandroid12.0;tizen40</TargetFrameworks>
Expand Down Expand Up @@ -41,28 +41,26 @@

<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows' And $([MSBuild]::IsOSPlatform('windows'))">
<Compile Include="Platforms\Uap\**\*.cs" />
<Page Include="Platforms\Uap\**\*.xaml" SubType="Designer" Generator="MSBuild:Compile" />
<!--<Page Include="Platforms\Uap\**\*.xaml" SubType="Designer" Generator="MSBuild:Compile" />-->
<None Update="**\*.xaml.cs" DependentUpon="%(Filename)" />
<Compile Update="**\*.xaml.cs" DependentUpon="%(Filename)" />
<PackageReference Include="Microsoft.WindowsAppSDK" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.755" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.2.221209.1" />
</ItemGroup>

<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">
<None Remove="Platforms\Apple\**\*.cs" />
<None Remove="Platforms\Ios\**\*.cs" />
<Compile Include="Platforms\Apple\**\*.cs" />
<Compile Include="Platforms\Ios\**\*.cs" />
</ItemGroup>

<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">
<None Remove="Platforms\Apple\**\*.cs" />
<None Remove="Platforms\Mac\**\*.cs" />
<None Remove="Platforms\Ios\**\*.cs" />
<Compile Include="Platforms\Apple\**\*.cs" />
<Compile Include="Platforms\Mac\**\*.cs" />
<Compile Include="Platforms\Ios\**\*.cs" />
</ItemGroup>

<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tvos'" >
<None Remove="Platforms\Apple\**\*.cs" />
<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tvos'">
<None Remove="Platforms\Ios\**\*.cs" />
<None Remove="Platforms\Tvos\**\*.cs" />
<Compile Include="Platforms\Apple\**\*.cs" />
Expand All @@ -71,7 +69,6 @@
</ItemGroup>

<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'watchos'">
<None Remove="Platforms\Apple\**\*.cs" />
<None Remove="Platforms\Watchos\**\*.cs" />
<Compile Include="Platforms\Apple\**\*.cs" />
<Compile Include="Platforms\Watchos\**\*.cs" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using AVFoundation;
using MediaManager.Media;
using MediaManager.Notifications;
using MediaManager.Platforms.Apple.Media;
using MediaManager.Platforms.Apple.Notifications;
using MediaManager.Platforms.Apple.Player;
using MediaManager.Platforms.Apple.Volume;
using MediaManager.Platforms.Ios.Media;
using MediaManager.Platforms.Ios.Notifications;
using MediaManager.Platforms.Ios.Player;
using MediaManager.Platforms.Ios.Volume;
using MediaManager.Player;
using MediaManager.Volume;

Expand Down
4 changes: 2 additions & 2 deletions MediaManager/Platforms/Ios/Media/AVAssetImageProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
using Foundation;
using MediaManager.Library;
using MediaManager.Media;
using MediaManager.Platforms.Apple.Media;
using MediaManager.Platforms.Ios.Media;
using UIKit;

namespace MediaManager.Platforms.Ios.Media
{
public class AVAssetImageProvider : MediaExtractorProviderBase, IMediaItemImageProvider
{
protected MediaManagerImplementation MediaManager = CrossMediaManager.Apple;
protected MediaManagerImplementation MediaManager = CrossMediaManager.Ios;

public async Task<object> ProvideImage(IMediaItem mediaItem)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using MediaManager.Library;
using MediaManager.Media;

namespace MediaManager.Platforms.Apple.Media
namespace MediaManager.Platforms.Ios.Media
{
public class AVAssetProvider : MediaExtractorProviderBase, IMediaItemMetadataProvider, IMediaItemVideoFrameProvider
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Foundation;
using MediaManager.Media;

namespace MediaManager.Platforms.Apple.Media
namespace MediaManager.Platforms.Ios.Media
{
public class AppleMediaExtractor : MediaExtractorBase, IMediaExtractor
{
Expand Down
4 changes: 2 additions & 2 deletions MediaManager/Platforms/Ios/Media/MPMediaItemExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public static IMediaItem ToMediaItem(this MPMediaItem item)
{
if (item == null)
return null;
#if IOS
#if IOS || MACCATALYST
var output = new MediaItem
{
MediaType = item.MediaType.ToMediaType(),
Expand Down Expand Up @@ -62,7 +62,7 @@ public static IMediaItem ToMediaItem(this MPMediaItem item)

public static IEnumerable<IMediaItem> ToMediaItems(this IEnumerable<MPMediaItem> items)
{
#if IOS
#if IOS || MACCATALYST
return items
.Where(i => i.AssetURL != null && i.IsCloudItem == false && i.HasProtectedAsset == false)
.Select(i => i.ToMediaItem());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
using Foundation;
using MediaManager.Library;
using MediaManager.Media;
using MediaManager.Platforms.Apple.Player;
using MediaManager.Platforms.Ios.Player;
using UniformTypeIdentifiers;

namespace MediaManager.Platforms.Apple.Media
namespace MediaManager.Platforms.Ios.Media
{
public static class MediaItemExtensions
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using MediaManager.Notifications;
using MediaPlayer;

namespace MediaManager.Platforms.Apple.Notifications
namespace MediaManager.Platforms.Ios.Notifications
{
public class NotificationManager : NotificationManagerBase
{
Expand All @@ -10,7 +10,7 @@ public NotificationManager()
Enabled = true;
}

protected MediaManagerImplementation MediaManager = CrossMediaManager.Apple;
protected MediaManagerImplementation MediaManager = CrossMediaManager.Ios;
protected MPRemoteCommandCenter CommandCenter = MPRemoteCommandCenter.Shared;

public override bool Enabled
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using AVFoundation;
using MediaManager.Player;

namespace MediaManager.Platforms.Apple.Playback
namespace MediaManager.Platforms.Ios.Playback
{
public static class MediaPlayerStateExtensions
{
Expand Down
Loading

0 comments on commit 4baed78

Please sign in to comment.