Skip to content

Commit

Permalink
Update files
Browse files Browse the repository at this point in the history
  • Loading branch information
martijn00 committed Sep 4, 2020
1 parent 8e6c49b commit 7e71a68
Show file tree
Hide file tree
Showing 20 changed files with 137 additions and 73 deletions.
4 changes: 2 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<RepositoryUrl>https://github.com/Baseflow/XamarinMediaManager</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<Product>$(AssemblyName) ($(TargetFramework))</Product>
<Version>1.0.2</Version>
<Version>1.0.3</Version>

<!--<Nullable>enable</Nullable>-->
<LangVersion>8.0</LangVersion>
Expand Down Expand Up @@ -86,7 +86,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>-->
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.0.0">
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.3.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
2 changes: 1 addition & 1 deletion MediaManager.UnitTest/MediaManager.UnitTest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<PrivateAssets>all</PrivateAssets>
Expand Down
4 changes: 2 additions & 2 deletions MediaManager.sln
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SolutionItems", "SolutionIt
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{6F888D07-C7FE-4257-9F3C-61EC1C1C39FA}"
ProjectSection(SolutionItems) = preProject
Samples\Directory.build.props = Samples\Directory.build.props
Samples\Directory.build.targets = Samples\Directory.build.targets
Samples\Directory.Build.props = Samples\Directory.Build.props
Samples\Directory.Build.targets = Samples\Directory.Build.targets
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ElementPlayer.Android", "Samples\ElementPlayer.Android\ElementPlayer.Android.csproj", "{52381C0D-EAAA-42D6-BAE9-66657B9E0A21}"
Expand Down
31 changes: 29 additions & 2 deletions MediaManager/Platforms/Ios/Media/MPMediaItemExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@ public static class MPMediaItemExtensions
{
public static IMediaItem ToMediaItem(this MPMediaItem item)
{
if (item == null)
return null;
#if IOS
var output = new MediaItem
{
MediaType = MediaType.Audio,
MediaType = item.MediaType.ToMediaType(),
Album = item.AlbumTitle,
Artist = item.Artist,
Compilation = null,
Expand All @@ -37,15 +40,39 @@ public static IMediaItem ToMediaItem(this MPMediaItem item)

if (output.Date != null)
output.Year = output.Date.Year;

#elif TVOS
var output = new MediaItem();
//TODO: something like this?
/*
output.MediaType = item.ValueForKey(MPMediaItem.MediaTypeProperty);
output.Album = item.ValueForProperty(MPMediaItem.AlbumTitleProperty).ToString();
output.Artist = item.Artist,
output.Compilation = null,
output.Composer = item.Composer,
output.Duration = TimeSpan.FromSeconds(item.PlaybackDuration),
output.Genre = item.Genre,
output.Title = item.Title,
output.AlbumArtist = item.AlbumArtist,
output.DiscNumber = item.DiscNumber,
output.MediaUri = item.AssetURL.ToString(),
output.NumTracks = item.AlbumTrackCount,
output.UserRating = item.Rating,
output.Id = item.PersistentID.ToString()*/

#endif
return output;
}

public static IEnumerable<IMediaItem> ToMediaItems(this IEnumerable<MPMediaItem> items)
{
#if IOS
return items
.Where(i => i.AssetURL != null && i.IsCloudItem == false && i.HasProtectedAsset == false)
.Select(i => i.ToMediaItem());
#elif TVOS
return items
.Select(i => i.ToMediaItem());
#endif
}
}
}
37 changes: 37 additions & 0 deletions MediaManager/Platforms/Ios/Media/MPMediaTypeExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MediaManager.Library;
using MediaPlayer;

namespace MediaManager.Platforms.Ios.Media
{
public static class MPMediaTypeExtensions
{
public static MediaType ToMediaType(this MPMediaType mediaType)
{
switch (mediaType)
{
case MPMediaType.Music:
case MPMediaType.Podcast:
case MPMediaType.AudioBook:
case MPMediaType.AudioITunesU:
case MPMediaType.AnyAudio:
return MediaType.Audio;
case MPMediaType.Movie:
case MPMediaType.TVShow:
case MPMediaType.VideoPodcast:
case MPMediaType.MusicVideo:
case MPMediaType.VideoITunesU:
case MPMediaType.HomeVideo:
case MPMediaType.TypeAnyVideo:
return MediaType.Video;
case MPMediaType.Any:
default:
return MediaType.Default;
}
}
}
}
36 changes: 18 additions & 18 deletions Samples/Directory.build.props → Samples/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<Project>
<PropertyGroup>
<Copyright>Copyright (c) Martijn van Dijk</Copyright>
<Owners>Martijn van Dijk</Owners>
<Authors>Martijn van Dijk</Authors>
<Product>$(AssemblyName) ($(TargetFramework))</Product>
<NeutralLanguage>en</NeutralLanguage>
<Version>1.0.0</Version>

<LangVersion>latest</LangVersion>
<NoWarn>$(NoWarn);1591;1701;1702;1705;VSX1000;NU1603</NoWarn>

<Platform>AnyCPU</Platform>
<DebugType>full</DebugType>

<IsLibraryProject>$(MSBuildProjectName.Contains('MediaManager'))</IsLibraryProject>
<IsXamarinForms>$(MSBuildProjectName.Contains('.Forms'))</IsXamarinForms>
</PropertyGroup>
<Project>
<PropertyGroup>
<Copyright>Copyright (c) Baseflow</Copyright>
<Owners>Martijn van Dijk</Owners>
<Authors>Martijn van Dijk</Authors>
<Product>$(AssemblyName) ($(TargetFramework))</Product>
<NeutralLanguage>en</NeutralLanguage>
<Version>1.0.0</Version>

<LangVersion>latest</LangVersion>
<NoWarn>$(NoWarn);1591;1701;1702;1705;VSX1000;NU1603</NoWarn>

<Platform>AnyCPU</Platform>
<DebugType>full</DebugType>

<IsLibraryProject>$(MSBuildProjectName.Contains('MediaManager'))</IsLibraryProject>
<IsXamarinForms>$(MSBuildProjectName.Contains('.Forms'))</IsXamarinForms>
</PropertyGroup>
</Project>
File renamed without changes.
36 changes: 18 additions & 18 deletions Samples/ElementPlayer.Android/ElementPlayer.Android.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -90,57 +90,57 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="MvvmCross">
<Version>6.5.0-alpha.201</Version>
<Version>7.0.0</Version>
</PackageReference>
<PackageReference Include="MvvmCross.DroidX.RecyclerView">
<Version>6.5.0-alpha.201</Version>
<Version>7.0.0</Version>
</PackageReference>
<PackageReference Include="MvvmCross.Plugin.Json">
<Version>6.5.0-alpha.201</Version>
<Version>7.0.0</Version>
</PackageReference>
<PackageReference Include="MvvmCross.Plugin.Visibility">
<Version>6.5.0-alpha.201</Version>
<Version>7.0.0</Version>
</PackageReference>
<PackageReference Include="Xamarin.AndroidX.Core">
<Version>1.2.0.1</Version>
<Version>1.3.0.1</Version>
</PackageReference>
<PackageReference Include="Xamarin.AndroidX.Legacy.Support.Core.UI">
<Version>1.0.0.1</Version>
<Version>1.0.0.3</Version>
</PackageReference>
<PackageReference Include="Xamarin.AndroidX.Legacy.Support.Core.Utils">
<Version>1.0.0.1</Version>
<Version>1.0.0.3</Version>
</PackageReference>
<PackageReference Include="Xamarin.Google.Android.Material" Version="1.0.0.1" />
<PackageReference Include="Xamarin.AndroidX.Fragment">
<Version>1.2.4.1</Version>
<Version>1.2.5.1</Version>
</PackageReference>
<PackageReference Include="Xamarin.AndroidX.Media">
<Version>1.1.0.1</Version>
<Version>1.1.0.3</Version>
</PackageReference>
<PackageReference Include="Xamarin.AndroidX.Leanback">
<Version>1.0.0.1</Version>
<Version>1.0.0.3</Version>
</PackageReference>
<PackageReference Include="Xamarin.AndroidX.Legacy.Support.V4">
<Version>1.0.0.1</Version>
<Version>1.0.0.3</Version>
</PackageReference>
<PackageReference Include="Xamarin.AndroidX.AppCompat">
<Version>1.1.0.1</Version>
<Version>1.2.0.2</Version>
</PackageReference>
<PackageReference Include="Xamarin.AndroidX.MediaRouter">
<Version>1.1.0.1</Version>
<Version>1.1.0.3</Version>
</PackageReference>
<PackageReference Include="Xamarin.AndroidX.Palette">
<Version>1.0.0.1</Version>
<Version>1.0.0.3</Version>
</PackageReference>
<PackageReference Include="Xamarin.AndroidX.RecyclerView">
<Version>1.1.0.1</Version>
<Version>1.1.0.3</Version>
</PackageReference>
<PackageReference Include="Xamarin.AndroidX.Migration" Version="1.0.6.1" />
<PackageReference Include="Xamarin.AndroidX.Migration" Version="1.0.7" />
<PackageReference Include="Xamarin.AndroidX.Browser">
<Version>1.2.0.1</Version>
<Version>1.2.0.2</Version>
</PackageReference>
<PackageReference Include="Xamarin.AndroidX.Lifecycle.LiveData">
<Version>2.2.0.1</Version>
<Version>2.2.0.2</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions Samples/ElementPlayer.Core/ElementPlayer.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="MvvmCross" Version="6.5.0-alpha.201" />
<PackageReference Include="MvvmCross.Plugin.Json" Version="6.5.0-alpha.201" />
<PackageReference Include="MvvmCross.Plugin.Visibility" Version="6.5.0-alpha.201" />
<PackageReference Include="MvvmCross" Version="7.0.0" />
<PackageReference Include="MvvmCross.Plugin.Json" Version="7.0.0" />
<PackageReference Include="MvvmCross.Plugin.Visibility" Version="7.0.0" />
<PackageReference Include="Xamarin.Forms" Version="4.7.0.968" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,26 +59,26 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="MvvmCross.Forms">
<Version>6.5.0-alpha.201</Version>
<Version>7.0.0</Version>
</PackageReference>
<PackageReference Include="Xamarin.Forms" Version="4.7.0.968" />
<PackageReference Include="Xamarin.Google.Android.Material" Version="1.0.0.1" />
<PackageReference Include="Xamarin.AndroidX.AppCompat" Version="1.1.0.1" />
<PackageReference Include="Xamarin.AndroidX.Legacy.Support.V4" Version="1.0.0.1" />
<PackageReference Include="Xamarin.AndroidX.CardView" Version="1.0.0.1" />
<PackageReference Include="Xamarin.AndroidX.MediaRouter" Version="1.1.0.1" />
<PackageReference Include="Xamarin.AndroidX.Legacy.Support.Core.Utils" Version="1.0.0.1" />
<PackageReference Include="Xamarin.AndroidX.Browser" Version="1.2.0.1" />
<PackageReference Include="Xamarin.AndroidX.AppCompat" Version="1.2.0.2" />
<PackageReference Include="Xamarin.AndroidX.Legacy.Support.V4" Version="1.0.0.3" />
<PackageReference Include="Xamarin.AndroidX.CardView" Version="1.0.0.3" />
<PackageReference Include="Xamarin.AndroidX.MediaRouter" Version="1.1.0.3" />
<PackageReference Include="Xamarin.AndroidX.Legacy.Support.Core.Utils" Version="1.0.0.3" />
<PackageReference Include="Xamarin.AndroidX.Browser" Version="1.2.0.2" />
<PackageReference Include="Xamarin.Essentials" Version="1.5.3.2" />
<PackageReference Include="Xamarin.AndroidX.Migration" Version="1.0.6.1" />
<PackageReference Include="Xamarin.AndroidX.Migration" Version="1.0.7" />
<PackageReference Include="Xamarin.AndroidX.Lifecycle.LiveData">
<Version>2.2.0.1</Version>
<Version>2.2.0.2</Version>
</PackageReference>
<PackageReference Include="Xamarin.AndroidX.Fragment">
<Version>1.2.4.1</Version>
<Version>1.2.5.1</Version>
</PackageReference>
<PackageReference Include="Xamarin.AndroidX.Media">
<Version>1.1.0.1</Version>
<Version>1.1.0.3</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="MvvmCross.Forms">
<Version>6.5.0-alpha.201</Version>
<Version>7.0.0</Version>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Mac\Xamarin.Mac.CSharp.targets" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MvvmCross.Forms" Version="6.5.0-alpha.201" />
<PackageReference Include="MvvmCross.Forms" Version="7.0.0" />
<PackageReference Include="Xamarin.Forms" Version="4.7.0.968" />
<PackageReference Include="Xamarin.Essentials" Version="1.5.3.2" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="MvvmCross.Forms">
<Version>6.5.0-alpha.201</Version>
<Version>7.0.0</Version>
</PackageReference>
<PackageReference Include="Xamarin.Forms" Version="4.7.0.968" />
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.2.9" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="MvvmCross.Forms.Platforms.Wpf">
<Version>6.5.0-alpha.201</Version>
<Version>7.0.0</Version>
</PackageReference>
<PackageReference Include="Xamarin.Forms.Platform.WPF">
<Version>4.7.0.968</Version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="MvvmCross.Forms">
<Version>6.5.0-alpha.201</Version>
<Version>7.0.0</Version>
</PackageReference>
<PackageReference Include="Xamarin.Forms" Version="4.7.0.968" />
<PackageReference Include="Xamarin.Essentials" Version="1.5.3.2" />
Expand Down
6 changes: 3 additions & 3 deletions Samples/ElementPlayer.Mac/ElementPlayer.Mac.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,13 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="MvvmCross">
<Version>6.5.0-alpha.201</Version>
<Version>7.0.0</Version>
</PackageReference>
<PackageReference Include="MvvmCross.Plugin.Json">
<Version>6.5.0-alpha.201</Version>
<Version>7.0.0</Version>
</PackageReference>
<PackageReference Include="MvvmCross.Plugin.Visibility">
<Version>6.5.0-alpha.201</Version>
<Version>7.0.0</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions Samples/ElementPlayer.TvOS/ElementPlayer.TvOS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -204,13 +204,13 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="MvvmCross">
<Version>6.5.0-alpha.201</Version>
<Version>7.0.0</Version>
</PackageReference>
<PackageReference Include="MvvmCross.Plugin.Json">
<Version>6.5.0-alpha.201</Version>
<Version>7.0.0</Version>
</PackageReference>
<PackageReference Include="MvvmCross.Plugin.Visibility">
<Version>6.5.0-alpha.201</Version>
<Version>7.0.0</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Samples/ElementPlayer.Uwp/ElementPlayer.Uwp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
<Version>6.2.9</Version>
</PackageReference>
<PackageReference Include="MvvmCross">
<Version>6.5.0-alpha.201</Version>
<Version>7.0.0</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Samples/ElementPlayer.Wpf/ElementPlayer.Wpf.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="MvvmCross.Platforms.Wpf">
<Version>6.5.0-alpha.201</Version>
<Version>7.0.0</Version>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
Expand Down
Loading

0 comments on commit 7e71a68

Please sign in to comment.