Skip to content

Commit

Permalink
Add Gerald's awesome screen recording plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
aritchie committed Jan 20, 2024
1 parent 84f9fe3 commit 925985f
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 9 deletions.
6 changes: 6 additions & 0 deletions ProjectTemplates/ShinyApp/.template.config/ide.host.json
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,12 @@
},
"isVisible": true
},{
"id": "screenrecord",
"name":{
"text": "Add Screen Recording (Plugin.Maui.ScreenRecording)"
},
"isVisible": true
},{
"id": "ffimageloading",
"name":{
"text": "Add FFImageLoading MAUI (FFImageLoading.Maui)"
Expand Down
7 changes: 7 additions & 0 deletions ProjectTemplates/ShinyApp/.template.config/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,13 @@
"description": "Audio Plugin by Gerald Versluis - Documentation https://github.com/jfversluis/Plugin.Maui.Audio",
"displayName": "Add Audio (Plugin.Maui.Audio)"
},
"screenrecord":{
"type": "parameter",
"datatype": "bool",
"defaultValue": "false",
"description": "Screen Recording Plugin by Gerald Versluis - Documentation https://github.com/jfversluis/Plugin.Maui.ScreenRecording",
"displayName": "Add Screen Recording (Plugin.Maui.ScreenRecording)"
},
"fingerprint":{
"type": "parameter",
"datatype": "bool",
Expand Down
8 changes: 8 additions & 0 deletions ProjectTemplates/ShinyApp/Documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,14 @@ _Provides the ability to play audio inside a .NET MAUI application. - Written by

* [GitHub](https://github.com/jfversluis/Plugin.Maui.Audio)

<!--#endif-->
<!--#if (screenrecord)-->
## MAUI Screen Recording Plugin

_Provides the ability to record the screen from within your .NET MAUI app - Written by Gerald Versluis_

* [GitHub](https://github.com/jfversluis/Plugin.Maui.ScreenRecording)

<!--#endif-->
<!--#if (fingerprint)-->
## Fingerprint Plugin
Expand Down
9 changes: 9 additions & 0 deletions ProjectTemplates/ShinyApp/MauiProgram.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
#if audio
using Plugin.Maui.Audio;
#endif
#if screenrecord
using Plugin.Maui.ScreenRecording;
#endif
#if fingerprint
using Plugin.Fingerprint;
#endif
Expand Down Expand Up @@ -57,6 +60,9 @@ public static MauiApp CreateMauiApp() => MauiApp
.UseUraniumUIMaterial()
.UseUraniumUIBlurs()
#endif
#if screenrecord
.UseScreenRecording()
#endif
#if shinyframework || communitytoolkit
.UseMauiCommunityToolkit()
#endif
Expand Down Expand Up @@ -189,6 +195,9 @@ static MauiAppBuilder RegisterInfrastructure(this MauiAppBuilder builder)
#if (calendar)
s.AddSingleton(CalendarStore.Default);
#endif
#if (screenrecord)
s.AddSingleton(ScreenRecording.Default);
#endif
#if appaction
s.AddSingleton<ShinyApp.Delegates.AppActionDelegate>();
#endif
Expand Down
12 changes: 9 additions & 3 deletions ProjectTemplates/ShinyApp/Platforms/Android/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,15 @@
</intent-filter>
</activity>
<!--#endif-->
<!--#if (screenrecord)-->
<service android:name="Plugin.Maui.ScreenRecording.ScreenRecordingImplementation.ScreenRecordingService" android:exported="false" android:foregroundServiceType="mediaProjection" />
<!--#endif-->
</application>
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="android.permission.BATTERY_STATS" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<!--#if (audio || usemaps || essentialsmedia || essentialsfilepicker)-->
<!--#if (audio || usemaps || essentialsmedia || essentialsfilepicker || )-->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="32" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<!--#endif-->
Expand Down Expand Up @@ -65,7 +68,7 @@
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<!--#endif-->
<!--#if (audio || speechrecognition)-->
<!--#if (audio || speechrecognition || screenrecord)-->
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<!--#endif-->
<!--#if (audio)-->
Expand All @@ -74,7 +77,7 @@
<!--#if (notifications || usepush || gps || beacons || httptransfers)-->
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<!--#endif-->
<!--#if (gps || beacons || httptransfers)-->
<!--#if (gps || beacons || httptransfers || screenrecord)-->
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<!--#endif-->
<!--#if (gps)-->
Expand All @@ -83,6 +86,9 @@
<!--#if (httptransfers)-->
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />
<!--#endif-->
<!--#if (screenrecord)-->
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PROJECTION" />
<!--#endif-->
<!--#if (essentialsmedia || barcodes)-->
<uses-feature android:name="android.hardware.camera" android:required="false" />
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />
Expand Down
4 changes: 3 additions & 1 deletion ProjectTemplates/ShinyApp/Platforms/iOS/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,11 @@
<key>NSMicrophoneUsageDescription</key>
<string>Say something useful here that your users will understand</string>
<!--#endif-->
<!--#if (essentialsmedia)-->
<!--#if (essentialsmedia || screenrecord)-->
<key>NSPhotoLibraryAddUsageDescription</key>
<string>Say something useful here that your users will understand</string>
<!--#endif-->
<!--#if (essentialsmedia)-->
<key>NSPhotoLibraryUsageDescription</key>
<string>Say something useful here that your users will understand</string>
<!--#endif-->
Expand Down
14 changes: 9 additions & 5 deletions ProjectTemplates/ShinyApp/ShinyApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<!--#if (usemaccatalyst)-->
<TargetFrameworks>$(TargetFrameworks);{DOTNET_TFM}-maccatalyst</TargetFrameworks>
<!--#endif-->
<MauiVersion>8.0.3</MauiVersion>
<MauiVersion>8.0.6</MauiVersion>
<OutputType>Exe</OutputType>
<RootNamespace>ShinyApp</RootNamespace>
<SingleProject>true</SingleProject>
Expand All @@ -27,12 +27,13 @@
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
<ApplicationVersion>1</ApplicationVersion>

<ShinyVersion>3.2.1</ShinyVersion>
<ShinyVersion>3.2.3</ShinyVersion>
</PropertyGroup>

<PropertyGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">
<DefineConstants>$(DefineConstants);PLATFORM</DefineConstants>
<SupportedOSPlatformVersion>26.0</SupportedOSPlatformVersion>
<TargetPlatformVersion>34</TargetPlatformVersion>
<!--
<AndroidLinkTool>r8</AndroidLinkTool>
<AndroidLinkTool>proguard</AndroidLinkTool>
Expand Down Expand Up @@ -224,9 +225,12 @@
<PackageReference Include="Sharpnado.CollectionView.Maui" Version="3.0.0" />
<!--#endif-->
<!--#if (uraniumui)-->
<PackageReference Include="UraniumUI.Material" Version="2.7.3" />
<PackageReference Include="UraniumUI.Icons.MaterialIcons" Version="2.7.3" />
<PackageReference Include="UraniumUI.Blurs" Version="2.7.3" />
<PackageReference Include="UraniumUI.Material" Version="2.7.4" />
<PackageReference Include="UraniumUI.Icons.MaterialIcons" Version="2.7.4" />
<PackageReference Include="UraniumUI.Blurs" Version="2.7.4" />
<!--#endif-->
<!--#if (screenrecord)-->
<PackageReference Include="Plugin.Maui.ScreenRecording" Version="1.0.0-preview1" />
<!--#endif-->
<!--#if (skia)-->
<PackageReference Include="SkiaSharp.Views.Maui.Controls" Version="2.88.6" />
Expand Down

0 comments on commit 925985f

Please sign in to comment.