Skip to content

Commit 045e95f

Browse files
committed
Merge branch 'MediaElementOptionService' of https://github.com/ne0rrmatrix/MauiOld into MediaElementOptionService
2 parents 4106c25 + 747f95b commit 045e95f

File tree

44 files changed

+238
-331
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+238
-331
lines changed

.github/workflows/dotnet-build.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,12 @@ env:
3737
PathToCommunityToolkitCameraAnalyzersCsproj: 'src/CommunityToolkit.Maui.Camera.Analyzers/CommunityToolkit.Maui.Camera.Analyzers.csproj'
3838
PathToCommunityToolkitMediaElementAnalyzersCsproj: 'src/CommunityToolkit.Maui.MediaElement.Analyzers/CommunityToolkit.Maui.MediaElement.Analyzers.csproj'
3939
PathToCommunityToolkitSourceGeneratorsCsproj: 'src/CommunityToolkit.Maui.SourceGenerators/CommunityToolkit.Maui.SourceGenerators.csproj'
40-
PathToCommunityToolkitSourceGeneratorsInternalCsproj: 'src/CommunityToolkit.Maui.SourceGenerators.Internal/CommunityToolkit.Maui.SourceGenerators.Internal.csproj'
4140
PathToCommunityToolkitAnalyzersCodeFixCsproj: 'src/CommunityToolkit.Maui.Analyzers.CodeFixes/CommunityToolkit.Maui.Analyzers.CodeFixes.csproj'
4241
PathToCommunityToolkitCameraAnalyzersCodeFixCsproj: 'src/CommunityToolkit.Maui.Camera.Analyzers.CodeFixes/CommunityToolkit.Maui.Camera.Analyzers.CodeFixes.csproj'
4342
PathToCommunityToolkitMediaElementAnalyzersCodeFixCsproj: 'src/CommunityToolkit.Maui.MediaElement.Analyzers.CodeFixes/CommunityToolkit.Maui.MediaElement.Analyzers.CodeFixes.csproj'
4443
PathToCommunityToolkitAnalyzersUnitTestProjectDirectory: 'src/CommunityToolkit.Maui.Analyzers.UnitTests'
45-
PathToCommunityToolkitSourceGeneratorsInternalUnitTestDirectory: 'src/CommunityToolkit.Maui.SourceGenerators.Internal.UnitTests'
46-
PathToCommunityToolkitSourceGeneratorsInternalUnitTestCsproj: 'src/CommunityToolkit.Maui.SourceGenerators.Internal.UnitTests/CommunityToolkit.Maui.SourceGenerators.Internal.UnitTests.csproj'
44+
PathToCommunityToolkitSourceGeneratorsUnitTestDirectory: 'src/CommunityToolkit.Maui.SourceGenerators.UnitTests'
45+
PathToCommunityToolkitSourceGeneratorsUnitTestCsproj: 'src/CommunityToolkit.Maui.SourceGenerators.UnitTests/CommunityToolkit.Maui.SourceGenerators.UnitTests.csproj'
4746
PathToCommunityToolkitAnalyzersBenchmarkCsproj: 'src/CommunityToolkit.Maui.Analyzers.Benchmarks/CommunityToolkit.Maui.Analyzers.Benchmarks.csproj'
4847
CommunityToolkitLibrary_Xcode_Version: '26.1'
4948
CommunityToolkitSample_Xcode_Version: '26.2'
@@ -190,9 +189,6 @@ jobs:
190189
- name: 'Build CommunityToolkit.Maui.SourceGenerators'
191190
run: dotnet build ${{ env.PathToCommunityToolkitSourceGeneratorsCsproj }} -c Release
192191

193-
- name: 'Build CommunityToolkit.SourceGenerators.Internal'
194-
run: dotnet build ${{ env.PathToCommunityToolkitSourceGeneratorsInternalCsproj }} -c Release
195-
196192
- name: 'Build CommunityToolkit.Maui.Camera'
197193
run: dotnet build ${{ env.PathToCommunityToolkitCameraCsproj }} -c Release -p:PackageVersion=${{ env.NugetPackageVersionCamera }} -p:Version=${{ env.NugetPackageVersionCamera }}
198194

@@ -213,11 +209,11 @@ jobs:
213209
cd ${{ env.PathToCommunityToolkitAnalyzersUnitTestProjectDirectory }}
214210
dotnet run -c Release --results-directory "${{ runner.temp }}" --coverage --coverage-output "${{ runner.temp }}/ut-analyzers.cobertura.xml" --coverage-output-format cobertura --report-xunit
215211
216-
- name: Run CommunityToolkit Source Generators Internal UnitTests
212+
- name: Run CommunityToolkit Source Generators UnitTests
217213
if: runner.os == 'Windows'
218214
run: |
219-
cd ${{ env.PathToCommunityToolkitSourceGeneratorsInternalUnitTestDirectory }}
220-
dotnet run -c Release --results-directory "${{ runner.temp }}" --coverage --coverage-output "${{ runner.temp }}/ut-sourcegenerators-internal.cobertura.xml" --coverage-output-format cobertura --report-xunit
215+
cd ${{ env.PathToCommunityToolkitSourceGeneratorsUnitTestDirectory }}
216+
dotnet run -c Release --results-directory "${{ runner.temp }}" --coverage --coverage-output "${{ runner.temp }}/ut-sourcegenerators.cobertura.xml" --coverage-output-format cobertura --report-xunit
221217
222218
- name: Run CommunityToolkit UnitTests
223219
run: |

samples/CommunityToolkit.Maui.Sample.slnx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
<Project Path="../src/CommunityToolkit.Maui.Camera.Analyzers/CommunityToolkit.Maui.Camera.Analyzers.csproj" />
77
<Project Path="../src/CommunityToolkit.Maui.MediaElement.Analyzers.CodeFixes/CommunityToolkit.Maui.MediaElement.Analyzers.CodeFixes.csproj" />
88
<Project Path="../src/CommunityToolkit.Maui.MediaElement.Analyzers/CommunityToolkit.Maui.MediaElement.Analyzers.csproj" />
9-
<Project Path="../src/CommunityToolkit.Maui.SourceGenerators.Internal/CommunityToolkit.Maui.SourceGenerators.Internal.csproj" />
109
<Project Path="../src/CommunityToolkit.Maui.SourceGenerators/CommunityToolkit.Maui.SourceGenerators.csproj" />
1110
</Folder>
1211
<Folder Name="/Benchmarks/">
@@ -28,7 +27,7 @@
2827
</Folder>
2928
<Folder Name="/Tests/">
3029
<Project Path="../src/CommunityToolkit.Maui.Analyzers.UnitTests/CommunityToolkit.Maui.Analyzers.UnitTests.csproj" />
31-
<Project Path="../src/CommunityToolkit.Maui.SourceGenerators.Internal.UnitTests/CommunityToolkit.Maui.SourceGenerators.Internal.UnitTests.csproj" />
30+
<Project Path="../src/CommunityToolkit.Maui.SourceGenerators.UnitTests/CommunityToolkit.Maui.SourceGenerators.UnitTests.csproj" />
3231
<Project Path="../src/CommunityToolkit.Maui.UnitTests/CommunityToolkit.Maui.UnitTests.csproj">
3332
<Deploy />
3433
</Project>

src/CommunityToolkit.Maui.Camera/CommunityToolkit.Maui.Camera.csproj

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
1818
<RootNamespace>CommunityToolkit.Maui</RootNamespace>
1919
<AndroidGenerateResourceDesigner>false</AndroidGenerateResourceDesigner>
20+
21+
<DisableTextColorToGenerator>true</DisableTextColorToGenerator>
2022
</PropertyGroup>
2123

2224
<PropertyGroup>
@@ -50,10 +52,6 @@
5052
<None Include="..\..\build\nuget.png" PackagePath="icon.png" Pack="true" />
5153
<None Include="ReadMe.txt" pack="true" PackagePath="." />
5254
</ItemGroup>
53-
54-
<ItemGroup>
55-
<ProjectReference Include="..\CommunityToolkit.Maui.SourceGenerators.Internal\CommunityToolkit.Maui.SourceGenerators.Internal.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
56-
</ItemGroup>
5755

5856
<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">
5957
<!-- Required NuGet Packages -->
@@ -77,4 +75,9 @@
7775
<None Include="..\CommunityToolkit.Maui.Camera.Analyzers.CodeFixes\bin\$(Configuration)\netstandard2.0\CommunityToolkit.Maui.Camera.Analyzers.CodeFixes.dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
7876
</ItemGroup>
7977

78+
<ItemGroup>
79+
<CompilerVisibleProperty Include="DisableTextColorToGenerator" />
80+
<ProjectReference Include="..\CommunityToolkit.Maui.SourceGenerators\CommunityToolkit.Maui.SourceGenerators.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
81+
</ItemGroup>
82+
8083
</Project>

src/CommunityToolkit.Maui.Camera/Primitives/CameraViewDefaults.shared.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System.ComponentModel;
2-
using System.Runtime.Versioning;
32
using System.Windows.Input;
43
using CommunityToolkit.Maui.Views;
54

src/CommunityToolkit.Maui.MediaElement/CommunityToolkit.Maui.MediaElement.csproj

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
1919
<RootNamespace>CommunityToolkit.Maui</RootNamespace>
2020
<AndroidGenerateResourceDesigner>false</AndroidGenerateResourceDesigner>
21+
22+
<DisableTextColorToGenerator>true</DisableTextColorToGenerator>
2123
</PropertyGroup>
2224

2325
<PropertyGroup>
@@ -53,10 +55,6 @@
5355
<None Include="ReadMe.txt" pack="true" PackagePath="." />
5456
</ItemGroup>
5557

56-
<ItemGroup>
57-
<ProjectReference Include="..\CommunityToolkit.Maui.SourceGenerators.Internal\CommunityToolkit.Maui.SourceGenerators.Internal.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
58-
</ItemGroup>
59-
6058
<ItemGroup>
6159
<None Include="..\CommunityToolkit.Maui.MediaElement.Analyzers\bin\$(Configuration)\netstandard2.0\CommunityToolkit.Maui.MediaElement.Analyzers.dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
6260
<None Include="..\CommunityToolkit.Maui.MediaElement.Analyzers.CodeFixes\bin\$(Configuration)\netstandard2.0\CommunityToolkit.Maui.MediaElement.Analyzers.CodeFixes.dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
@@ -81,6 +79,11 @@
8179
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" Condition=" '$(Configuration)'=='Release' " PrivateAssets="All" />
8280
</ItemGroup>
8381

82+
<ItemGroup>
83+
<CompilerVisibleProperty Include="DisableTextColorToGenerator" />
84+
<ProjectReference Include="..\CommunityToolkit.Maui.SourceGenerators\CommunityToolkit.Maui.SourceGenerators.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
85+
</ItemGroup>
86+
8487
<ItemGroup>
8588
<EmbeddedResource Include="ResourceDictionary.windows.xaml">
8689
<LogicalName>ResourceDictionary.windows.xaml</LogicalName>

src/CommunityToolkit.Maui.MediaElement/Primitives/Metadata.macios.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,15 @@ public void SetMetadata(AVPlayerItem? playerItem, IMediaElement? mediaElement)
7777
return;
7878
}
7979

80+
var url = mediaElement.MetadataArtworkUrl;
81+
8082
NowPlayingInfo.Title = mediaElement.MetadataTitle;
8183
NowPlayingInfo.Artist = mediaElement.MetadataArtist;
8284
NowPlayingInfo.PlaybackDuration = playerItem?.Duration.Seconds ?? 0;
8385
NowPlayingInfo.IsLiveStream = false;
8486
NowPlayingInfo.PlaybackRate = mediaElement.Speed;
8587
NowPlayingInfo.ElapsedPlaybackTime = playerItem?.CurrentTime.Seconds ?? 0;
86-
NowPlayingInfo.Artwork = new(boundsSize: new(320, 240), requestHandler: _ => GetImage(mediaElement.MetadataArtworkUrl));
88+
NowPlayingInfo.Artwork = new(boundsSize: new(320, 240), requestHandler: _ => GetImage(url));
8789
MPNowPlayingInfoCenter.DefaultCenter.NowPlaying = NowPlayingInfo;
8890
}
8991

src/CommunityToolkit.Maui.MediaElement/Views/MediaManager.shared.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
using Microsoft.Extensions.Logging;
1414
using Microsoft.Maui;
15-
using System;
1615
using Microsoft.Maui.Dispatching;
1716
using Microsoft.Maui.Controls;
1817
using Microsoft.Extensions.DependencyInjection;

src/CommunityToolkit.Maui.SourceGenerators.Benchmarks/AttachedBindablePropertySourceGeneratorBenchmarks.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using BenchmarkDotNet.Attributes;
2-
using CommunityToolkit.Maui.SourceGenerators.Internal.UnitTests.AttachedBindablePropertyAttributeSourceGeneratorTests;
2+
using CommunityToolkit.Maui.SourceGenerators.UnitTests.AttachedBindablePropertyAttributeSourceGeneratorTests;
33

44
namespace CommunityToolkit.Maui.SourceGenerators.Benchmarks;
55

src/CommunityToolkit.Maui.SourceGenerators.Benchmarks/BindablePropertyAttributeSourceGeneratorBenchmarks.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using BenchmarkDotNet.Attributes;
2-
using CommunityToolkit.Maui.SourceGenerators.Internal.UnitTests.BindablePropertyAttributeSourceGeneratorTests;
2+
using CommunityToolkit.Maui.SourceGenerators.UnitTests.BindablePropertyAttributeSourceGeneratorTests;
33

44
namespace CommunityToolkit.Maui.SourceGenerators.Benchmarks;
55

src/CommunityToolkit.Maui.SourceGenerators.Benchmarks/CommunityToolkit.Maui.SourceGenerators.Benchmarks.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
</ItemGroup>
1313

1414
<ItemGroup>
15-
<ProjectReference Include="..\CommunityToolkit.Maui.SourceGenerators.Internal.UnitTests\CommunityToolkit.Maui.SourceGenerators.Internal.UnitTests.csproj" />
15+
<ProjectReference Include="..\CommunityToolkit.Maui.SourceGenerators.UnitTests\CommunityToolkit.Maui.SourceGenerators.UnitTests.csproj" />
1616
<ProjectReference Include="..\CommunityToolkit.Maui.SourceGenerators\CommunityToolkit.Maui.SourceGenerators.csproj" />
1717
</ItemGroup>
1818
</Project>

0 commit comments

Comments
 (0)