From 61e024a51fa274f0e9dbee89310cbe3a23a59d6a Mon Sep 17 00:00:00 2001 From: Martijn van Dijk Date: Wed, 21 Oct 2020 15:33:31 +0200 Subject: [PATCH] Cleanup --- Directory.Build.props | 2 +- MediaManager.Forms/Platforms/Uap/VideoViewRenderer.cs | 4 ++-- MediaManager.sln | 6 ++---- MediaManager/MediaManagerBase.cs | 6 ------ MediaManager/Platforms/Android/Media/ID3Provider.cs | 2 +- .../Platforms/Android/Player/AndroidMediaPlayer.cs | 2 +- MediaManager/Platforms/Apple/AppleMediaManagerBase.cs | 3 --- .../Platforms/Ios/Media/MPMediaItemExtensions.cs | 8 ++++---- .../Platforms/Ios/Media/MPMediaTypeExtensions.cs | 7 +------ .../Platforms/Uap/Media/StorageFileProvider.cs | 1 - MediaManager/Playback/IPlaybackManager.cs | 7 ++----- Samples/ElementPlayer.Android/SplashScreen.cs | 1 - Samples/ElementPlayer.Core/ViewModels/HomeViewModel.cs | 3 +-- Samples/ElementPlayer.WPFCore/App.xaml.cs | 10 +--------- Samples/ElementPlayer.WPFCore/AssemblyInfo.cs | 1 - Samples/ElementPlayer.WPFCore/MainWindow.xaml.cs | 4 +--- 16 files changed, 17 insertions(+), 50 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index a47d9f5a..8af98078 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -18,7 +18,7 @@ https://github.com/Baseflow/XamarinMediaManager git $(AssemblyName) ($(TargetFramework)) - 1.0.3 + 1.0.4 8.0 diff --git a/MediaManager.Forms/Platforms/Uap/VideoViewRenderer.cs b/MediaManager.Forms/Platforms/Uap/VideoViewRenderer.cs index 6e1ac324..a16587cb 100644 --- a/MediaManager.Forms/Platforms/Uap/VideoViewRenderer.cs +++ b/MediaManager.Forms/Platforms/Uap/VideoViewRenderer.cs @@ -34,7 +34,7 @@ protected override Size MeasureOverride(Size availableSize) { if (_videoView != null) { - if(!double.IsInfinity(availableSize.Height)) + if (!double.IsInfinity(availableSize.Height)) { _videoView.Height = availableSize.Height; _videoView.PlayerView.Height = availableSize.Height; @@ -44,7 +44,7 @@ protected override Size MeasureOverride(Size availableSize) _videoView.Height = MediaManager.MediaPlayer.VideoHeight > 0 ? MediaManager.MediaPlayer.VideoHeight : 300; _videoView.PlayerView.Height = MediaManager.MediaPlayer.VideoHeight > 0 ? MediaManager.MediaPlayer.VideoHeight : 300; } - + _videoView.Width = availableSize.Width; _videoView.PlayerView.Width = availableSize.Width; } diff --git a/MediaManager.sln b/MediaManager.sln index e617e159..a0fdd230 100644 --- a/MediaManager.sln +++ b/MediaManager.sln @@ -59,9 +59,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MediaManager.Reactive", "Me EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MediaManager.FFmpegMediaMetadataRetriever", "MediaManager.FFmpegMediaMetadataRetriever\MediaManager.FFmpegMediaMetadataRetriever.csproj", "{00D077AA-5CED-422E-91C7-3D515086DC22}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ElementPlayer.Forms.WPFCore", "Samples\ElementPlayer.Forms.WPFCore\ElementPlayer.Forms.WPFCore.csproj", "{311FC5DB-E938-405C-ACA7-D74AC11B505E}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ElementPlayer.Forms.WPFCore", "Samples\ElementPlayer.Forms.WPFCore\ElementPlayer.Forms.WPFCore.csproj", "{311FC5DB-E938-405C-ACA7-D74AC11B505E}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ElementPlayer.WPFCore", "Samples\ElementPlayer.WPFCore\ElementPlayer.WPFCore.csproj", "{62642DB1-7FCF-455E-AAC0-7B9FE4764A5B}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ElementPlayer.WPFCore", "Samples\ElementPlayer.WPFCore\ElementPlayer.WPFCore.csproj", "{62642DB1-7FCF-455E-AAC0-7B9FE4764A5B}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -607,7 +607,6 @@ Global {311FC5DB-E938-405C-ACA7-D74AC11B505E}.Debug|x86.ActiveCfg = Debug|Any CPU {311FC5DB-E938-405C-ACA7-D74AC11B505E}.Debug|x86.Build.0 = Debug|Any CPU {311FC5DB-E938-405C-ACA7-D74AC11B505E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {311FC5DB-E938-405C-ACA7-D74AC11B505E}.Release|Any CPU.Build.0 = Release|Any CPU {311FC5DB-E938-405C-ACA7-D74AC11B505E}.Release|ARM.ActiveCfg = Release|Any CPU {311FC5DB-E938-405C-ACA7-D74AC11B505E}.Release|ARM.Build.0 = Release|Any CPU {311FC5DB-E938-405C-ACA7-D74AC11B505E}.Release|ARM64.ActiveCfg = Release|Any CPU @@ -635,7 +634,6 @@ Global {62642DB1-7FCF-455E-AAC0-7B9FE4764A5B}.Debug|x86.ActiveCfg = Debug|Any CPU {62642DB1-7FCF-455E-AAC0-7B9FE4764A5B}.Debug|x86.Build.0 = Debug|Any CPU {62642DB1-7FCF-455E-AAC0-7B9FE4764A5B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {62642DB1-7FCF-455E-AAC0-7B9FE4764A5B}.Release|Any CPU.Build.0 = Release|Any CPU {62642DB1-7FCF-455E-AAC0-7B9FE4764A5B}.Release|ARM.ActiveCfg = Release|Any CPU {62642DB1-7FCF-455E-AAC0-7B9FE4764A5B}.Release|ARM.Build.0 = Release|Any CPU {62642DB1-7FCF-455E-AAC0-7B9FE4764A5B}.Release|ARM64.ActiveCfg = Release|Any CPU diff --git a/MediaManager/MediaManagerBase.cs b/MediaManager/MediaManagerBase.cs index 6baf1733..6463abbf 100644 --- a/MediaManager/MediaManagerBase.cs +++ b/MediaManager/MediaManagerBase.cs @@ -34,12 +34,6 @@ public bool IsInitialized public Timer Timer { get; protected set; } = new Timer(TimerInterval); public static double TimerInterval { get; set; } = 1000; - [Obsolete("Use StepSizeForward and StepSizeBackward properties instead.", true)] - public virtual TimeSpan StepSize - { - get => throw new NotImplementedException("This property is obsolete. Use StepSizeForwards and StepSizeBackwards properties instead."); - set => throw new NotImplementedException("This property is obsolete. Use StepSizeForwards and StepSizeBackwards properties instead."); - } protected TimeSpan _stepSizeForward = TimeSpan.FromSeconds(10); public virtual TimeSpan StepSizeForward diff --git a/MediaManager/Platforms/Android/Media/ID3Provider.cs b/MediaManager/Platforms/Android/Media/ID3Provider.cs index 569eb97a..ec724fbf 100644 --- a/MediaManager/Platforms/Android/Media/ID3Provider.cs +++ b/MediaManager/Platforms/Android/Media/ID3Provider.cs @@ -133,7 +133,7 @@ public async Task ProvideVideoFrame(IMediaItem mediaItem, TimeSpan timeF { var metadataRetriever = await CreateMediaRetriever(mediaItem).ConfigureAwait(false); - image = metadataRetriever.GetFrameAtTime((long)(timeFromStart.TotalMilliseconds*1000)); + image = metadataRetriever.GetFrameAtTime((long)(timeFromStart.TotalMilliseconds * 1000)); metadataRetriever.Release(); } diff --git a/MediaManager/Platforms/Android/Player/AndroidMediaPlayer.cs b/MediaManager/Platforms/Android/Player/AndroidMediaPlayer.cs index 44ba8577..368f60a8 100644 --- a/MediaManager/Platforms/Android/Player/AndroidMediaPlayer.cs +++ b/MediaManager/Platforms/Android/Player/AndroidMediaPlayer.cs @@ -304,7 +304,7 @@ public override async Task Play(IMediaItem mediaItem, TimeSpan startAt, TimeSpan { BeforePlaying?.Invoke(this, new MediaPlayerEventArgs(mediaItem, this)); - + var mediaSource = stopAt.HasValue ? mediaItem.ToClippingMediaSource(stopAt.Value) : mediaItem.ToMediaSource(); MediaSource.Clear(); MediaSource.AddMediaSource(mediaSource); diff --git a/MediaManager/Platforms/Apple/AppleMediaManagerBase.cs b/MediaManager/Platforms/Apple/AppleMediaManagerBase.cs index 058195e6..cdd8edee 100644 --- a/MediaManager/Platforms/Apple/AppleMediaManagerBase.cs +++ b/MediaManager/Platforms/Apple/AppleMediaManagerBase.cs @@ -1,8 +1,5 @@ using System; -using System.Collections.Generic; -using System.Threading.Tasks; using AVFoundation; -using MediaManager.Library; using MediaManager.Media; using MediaManager.Notifications; using MediaManager.Platforms.Apple.Media; diff --git a/MediaManager/Platforms/Ios/Media/MPMediaItemExtensions.cs b/MediaManager/Platforms/Ios/Media/MPMediaItemExtensions.cs index aafde9dc..2ecc6799 100644 --- a/MediaManager/Platforms/Ios/Media/MPMediaItemExtensions.cs +++ b/MediaManager/Platforms/Ios/Media/MPMediaItemExtensions.cs @@ -31,13 +31,13 @@ public static IMediaItem ToMediaItem(this MPMediaItem item) UserRating = item.Rating, Id = item.PersistentID.ToString() }; - + if (item.ReleaseDate != null) output.Date = (DateTime)item.ReleaseDate; - + if (item.Artwork != null) output.Image = item.Artwork.ImageWithSize(new CGSize(300, 300)); - + if (output.Date != null) output.Year = output.Date.Year; #elif TVOS @@ -62,7 +62,7 @@ public static IMediaItem ToMediaItem(this MPMediaItem item) #endif return output; } - + public static IEnumerable ToMediaItems(this IEnumerable items) { #if IOS diff --git a/MediaManager/Platforms/Ios/Media/MPMediaTypeExtensions.cs b/MediaManager/Platforms/Ios/Media/MPMediaTypeExtensions.cs index ed0897fb..bb5b291c 100644 --- a/MediaManager/Platforms/Ios/Media/MPMediaTypeExtensions.cs +++ b/MediaManager/Platforms/Ios/Media/MPMediaTypeExtensions.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using MediaManager.Library; +using MediaManager.Library; using MediaPlayer; namespace MediaManager.Platforms.Ios.Media diff --git a/MediaManager/Platforms/Uap/Media/StorageFileProvider.cs b/MediaManager/Platforms/Uap/Media/StorageFileProvider.cs index b72ee406..b908f60b 100644 --- a/MediaManager/Platforms/Uap/Media/StorageFileProvider.cs +++ b/MediaManager/Platforms/Uap/Media/StorageFileProvider.cs @@ -7,7 +7,6 @@ using Windows.Storage.FileProperties; using Windows.Storage.Streams; using Windows.UI.Core; -using Windows.UI.Xaml; using Windows.UI.Xaml.Media.Imaging; namespace MediaManager.Platforms.Uap.Media diff --git a/MediaManager/Playback/IPlaybackManager.cs b/MediaManager/Playback/IPlaybackManager.cs index d09d09c7..938c91cd 100644 --- a/MediaManager/Playback/IPlaybackManager.cs +++ b/MediaManager/Playback/IPlaybackManager.cs @@ -18,19 +18,16 @@ namespace MediaManager.Playback public interface IPlaybackManager : INotifyPropertyChanged { - /// - /// Managing the step size for the step forward and step backward functions - /// - [Obsolete("Use StepSizeForward and StepSizeBackward properties instead.", true)] - TimeSpan StepSize { get; set; } /// /// Managing the step size for the step forward function /// TimeSpan StepSizeForward { get; set; } + /// /// Managing the step size for the step backward function /// TimeSpan StepSizeBackward { get; set; } + /// /// Reading the current status of the player /// diff --git a/Samples/ElementPlayer.Android/SplashScreen.cs b/Samples/ElementPlayer.Android/SplashScreen.cs index 4b544e7b..2b06fc82 100644 --- a/Samples/ElementPlayer.Android/SplashScreen.cs +++ b/Samples/ElementPlayer.Android/SplashScreen.cs @@ -1,6 +1,5 @@ using Android.App; using Android.Content.PM; -using MvvmCross.Core; using MvvmCross.Platforms.Android.Core; using MvvmCross.Platforms.Android.Views; diff --git a/Samples/ElementPlayer.Core/ViewModels/HomeViewModel.cs b/Samples/ElementPlayer.Core/ViewModels/HomeViewModel.cs index 271ee503..0d9594ee 100644 --- a/Samples/ElementPlayer.Core/ViewModels/HomeViewModel.cs +++ b/Samples/ElementPlayer.Core/ViewModels/HomeViewModel.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Threading.Tasks; using MediaManager; using MediaManager.Library; diff --git a/Samples/ElementPlayer.WPFCore/App.xaml.cs b/Samples/ElementPlayer.WPFCore/App.xaml.cs index 4b22e03b..218cea40 100644 --- a/Samples/ElementPlayer.WPFCore/App.xaml.cs +++ b/Samples/ElementPlayer.WPFCore/App.xaml.cs @@ -1,12 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Configuration; -using System.Data; -using System.Linq; -using System.Threading.Tasks; -using System.Windows; - -namespace ElementPlayer.WPFCore +namespace ElementPlayer.WPFCore { /// /// Interaction logic for App.xaml diff --git a/Samples/ElementPlayer.WPFCore/AssemblyInfo.cs b/Samples/ElementPlayer.WPFCore/AssemblyInfo.cs index 8b5504ec..85833564 100644 --- a/Samples/ElementPlayer.WPFCore/AssemblyInfo.cs +++ b/Samples/ElementPlayer.WPFCore/AssemblyInfo.cs @@ -1,4 +1,3 @@ -using System.Windows; [assembly: ThemeInfo( ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located diff --git a/Samples/ElementPlayer.WPFCore/MainWindow.xaml.cs b/Samples/ElementPlayer.WPFCore/MainWindow.xaml.cs index fb9b1156..a993f770 100644 --- a/Samples/ElementPlayer.WPFCore/MainWindow.xaml.cs +++ b/Samples/ElementPlayer.WPFCore/MainWindow.xaml.cs @@ -1,6 +1,4 @@ -using System.Windows; - -namespace ElementPlayer.WPFCore +namespace ElementPlayer.WPFCore { /// /// Interaction logic for MainWindow.xaml