forked from Baseflow/XamarinMediaManager
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
79 changed files
with
2,327 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
using System; | ||
|
||
namespace MediaManager.Forms | ||
{ | ||
public class Class1 | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
<Project Sdk="MSBuild.Sdk.Extras"> | ||
<PropertyGroup> | ||
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">netstandard2.0;net461;Xamarin.iOS10;Xamarin.Mac20;Xamarin.TVOS10;MonoAndroid81;tizen40;uap10.0.16299</TargetFrameworks> | ||
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netstandard2.0;net461;Xamarin.iOS10;Xamarin.Mac20;Xamarin.TVOS10;MonoAndroid81;tizen40</TargetFrameworks> | ||
<AssemblyName>MediaManager.Forms</AssemblyName> | ||
<RootNamespace>MediaManager.Forms</RootNamespace> | ||
<PackageId>MediaManager.Forms</PackageId> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<Compile Remove="Platforms\**\*.cs" /> | ||
<None Include="Platforms\**\*.cs" /> | ||
<None Include="Resources\*.cs" /> | ||
<Compile Remove="Resources\*.cs" /> | ||
<None Include="readme.txt" pack="true" PackagePath="." /> | ||
</ItemGroup> | ||
|
||
<ItemGroup Condition=" $(TargetFramework.StartsWith('netstandard')) "> | ||
<Compile Include="Platforms\Netstandard\**\*.cs" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup Condition=" $(TargetFramework.StartsWith('net4')) "> | ||
<Compile Include="Platforms\Net\**\*.cs" /> | ||
<Compile Include="Platforms\Wpf\**\*.cs" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup Condition="'$(TargetFramework)'!='netstandard2.0'"> | ||
<Compile Include="Platforms\Shared\**\*.cs" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup Condition=" $(TargetFramework.StartsWith('uap')) "> | ||
<Compile Include="Platforms\Windows-common\**\*.cs" /> | ||
<Compile Condition=" '$(OS)' == 'Windows_NT' " Include="Platforms\Uap\**\*.cs" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup Condition=" $(TargetFramework.StartsWith('Xamarin.iOS')) "> | ||
<Compile Include="Platforms\Apple-common\**\*.cs" /> | ||
<Compile Include="Platforms\Ios\**\*.cs" /> | ||
<Compile Include="Platforms\Xamarin-common\**\*.cs" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup Condition=" $(TargetFramework.StartsWith('Xamarin.Mac')) "> | ||
<Compile Include="Platforms\Apple-common\**\*.cs" /> | ||
<Compile Include="Platforms\Mac\**\*.cs" /> | ||
<Compile Include="Platforms\Xamarin-common\**\*.cs" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup Condition=" $(TargetFramework.StartsWith('Xamarin.TVOS')) "> | ||
<Compile Include="Platforms\Apple-common\**\*.cs" /> | ||
<Compile Include="Platforms\Tvos\**\*.cs" /> | ||
<Compile Include="Platforms\Xamarin-common\**\*.cs" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup Condition=" $(TargetFramework.StartsWith('Xamarin.WatchOS')) "> | ||
<Compile Include="Platforms\Apple-common\**\*.cs" /> | ||
<Compile Include="Platforms\Watchos\**\*.cs" /> | ||
<Compile Include="Platforms\Xamarin-common\**\*.cs" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup Condition=" $(TargetFramework.StartsWith('MonoAndroid')) "> | ||
<Compile Include="Platforms\Android\**\*.cs" /> | ||
<Compile Include="Platforms\Xamarin-common\**\*.cs" /> | ||
<AndroidResource Include="Resources\**\*.xml" SubType="Designer" Generator="MSBuild:UpdateAndroidResources" /> | ||
<PackageReference Include="Xam.Plugins.Android.ExoPlayer.Core" Version="2.8.3" /> | ||
<PackageReference Include="Xam.Plugins.Android.ExoPlayer.Dash" Version="2.8.3" /> | ||
<PackageReference Include="Xam.Plugins.Android.ExoPlayer.Hls" Version="2.8.3" /> | ||
<PackageReference Include="Xam.Plugins.Android.ExoPlayer.SmoothStreaming" Version="2.8.3" /> | ||
<PackageReference Include="Xam.Plugins.Android.ExoPlayer.UI" Version="2.8.3" /> | ||
<PackageReference Include="Xam.Plugins.Android.ExoPlayer.Cast" Version="2.8.3" /> | ||
<PackageReference Include="Xam.Plugins.Android.ExoPlayer.Leanback" Version="2.8.3" /> | ||
<PackageReference Include="Xam.Plugins.Android.ExoPlayer.MediaSession" Version="2.8.3" /> | ||
<PackageReference Include="Xamarin.Build.Download" Version="0.4.11" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup Condition=" $(TargetFramework.StartsWith('tizen')) "> | ||
<Compile Include="Platforms\Tizen\**\*.cs" /> | ||
<Compile Include="Platforms\Xamarin-common\**\*.cs" /> | ||
<PackageReference Include="Tizen.NET" Version="4.0.0"> | ||
<ExcludeAssets>Runtime</ExcludeAssets> | ||
</PackageReference> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\MediaManager\MediaManager.csproj" /> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--------------------------------- | ||
Lottie | ||
--------------------------------- | ||
|
||
Lottie is a mobile library for Android and iOS that parses Adobe After Effects animations exported as json with Bodymovin and renders them natively on mobile! | ||
|
||
Using Lottie on Xamarin.Forms: | ||
|
||
<forms:AnimationView | ||
x:Name="animationView" | ||
Grid.Row="1" | ||
Animation="LottieLogo1.json" | ||
Loop="false" | ||
AutoPlay="false" | ||
OnFinish="Handle_OnFinish" | ||
PlaybackStartedCommand="{Binding PlayingCommand}" | ||
PlaybackFinishedCommand="{Binding FinishedCommand}" | ||
ClickedCommand="{Binding ClickedCommand}" | ||
VerticalOptions="FillAndExpand" | ||
HorizontalOptions="FillAndExpand" /> | ||
|
||
Star on Github if this project helps you: https://github.com/martijn00/LottieXamarin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio 15 | ||
VisualStudioVersion = 15.0.27703.2018 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MediaManager", "MediaManager\MediaManager.csproj", "{ABA3225C-7219-4472-BA3E-CFC3D9C06675}" | ||
EndProject | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SolutionItems", "SolutionItems", "{3B5D9760-7F39-40DF-A213-ED0410A989BE}" | ||
ProjectSection(SolutionItems) = preProject | ||
appveyor.yml = appveyor.yml | ||
build.cake = build.cake | ||
Directory.build.props = Directory.build.props | ||
Directory.build.targets = Directory.build.targets | ||
global.json = global.json | ||
EndProjectSection | ||
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 | ||
EndProjectSection | ||
EndProject | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ElementPlayer.Android", "Samples\ElementPlayer.Android\ElementPlayer.Android.csproj", "{52381C0D-EAAA-42D6-BAE9-66657B9E0A21}" | ||
EndProject | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ElementPlayer.Core", "Samples\ElementPlayer.Core\ElementPlayer.Core.csproj", "{D4FBA2B6-2057-412D-A391-0D1BF0E04E12}" | ||
EndProject | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MediaManager.Forms", "MediaManager.Forms\MediaManager.Forms.csproj", "{A1F6D7D2-D6D3-4FF2-87E7-D0CEF41D0653}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{ABA3225C-7219-4472-BA3E-CFC3D9C06675}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{ABA3225C-7219-4472-BA3E-CFC3D9C06675}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{ABA3225C-7219-4472-BA3E-CFC3D9C06675}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{ABA3225C-7219-4472-BA3E-CFC3D9C06675}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{52381C0D-EAAA-42D6-BAE9-66657B9E0A21}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{52381C0D-EAAA-42D6-BAE9-66657B9E0A21}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{52381C0D-EAAA-42D6-BAE9-66657B9E0A21}.Debug|Any CPU.Deploy.0 = Debug|Any CPU | ||
{52381C0D-EAAA-42D6-BAE9-66657B9E0A21}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{52381C0D-EAAA-42D6-BAE9-66657B9E0A21}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{52381C0D-EAAA-42D6-BAE9-66657B9E0A21}.Release|Any CPU.Deploy.0 = Release|Any CPU | ||
{D4FBA2B6-2057-412D-A391-0D1BF0E04E12}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{D4FBA2B6-2057-412D-A391-0D1BF0E04E12}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{D4FBA2B6-2057-412D-A391-0D1BF0E04E12}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{D4FBA2B6-2057-412D-A391-0D1BF0E04E12}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{A1F6D7D2-D6D3-4FF2-87E7-D0CEF41D0653}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{A1F6D7D2-D6D3-4FF2-87E7-D0CEF41D0653}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{A1F6D7D2-D6D3-4FF2-87E7-D0CEF41D0653}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{A1F6D7D2-D6D3-4FF2-87E7-D0CEF41D0653}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(NestedProjects) = preSolution | ||
{52381C0D-EAAA-42D6-BAE9-66657B9E0A21} = {6F888D07-C7FE-4257-9F3C-61EC1C1C39FA} | ||
{D4FBA2B6-2057-412D-A391-0D1BF0E04E12} = {6F888D07-C7FE-4257-9F3C-61EC1C1C39FA} | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {71F856D1-F12F-4E77-9ECB-5DCAC2CAC99F} | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
namespace MediaManager.Audio | ||
{ | ||
public interface IAudioPlayer : IMediaPlayer | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
using System; | ||
|
||
namespace MediaManager | ||
{ | ||
/// <summary> | ||
/// Cross MediaManager | ||
/// </summary> | ||
public static class CrossMediaManager | ||
{ | ||
static Lazy<IMediaManager> implementation = new Lazy<IMediaManager>(() => CreateMediaManager(), System.Threading.LazyThreadSafetyMode.PublicationOnly); | ||
|
||
/// <summary> | ||
/// Gets if the plugin is supported on the current platform. | ||
/// </summary> | ||
public static bool IsSupported => implementation.Value == null ? false : true; | ||
|
||
/// <summary> | ||
/// Current plugin implementation to use | ||
/// </summary> | ||
public static IMediaManager Current | ||
{ | ||
get | ||
{ | ||
IMediaManager ret = implementation.Value; | ||
if (ret == null) | ||
{ | ||
throw NotImplementedInReferenceAssembly(); | ||
} | ||
return ret; | ||
} | ||
} | ||
|
||
static IMediaManager CreateMediaManager() | ||
{ | ||
#if NETSTANDARD | ||
return null; | ||
#else | ||
#pragma warning disable IDE0022 // Use expression body for methods | ||
return new MediaManagerImplementation(); | ||
#pragma warning restore IDE0022 // Use expression body for methods | ||
#endif | ||
} | ||
|
||
internal static Exception NotImplementedInReferenceAssembly() => | ||
new NotImplementedException("This functionality is not implemented in the portable version of this assembly. You should reference the NuGet package from your main application project in order to reference the platform-specific implementation."); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using MediaManager.Media; | ||
using MediaManager.Playback; | ||
using MediaManager.Volume; | ||
|
||
namespace MediaManager | ||
{ | ||
public interface IMediaManager | ||
{ | ||
//IAudioPlayer AudioPlayer { get; set; } | ||
|
||
//IVideoPlayer VideoPlayer { get; set; } | ||
|
||
//INotificationManager NotificationManager { get; set; } | ||
|
||
IMediaExtractor MediaExtractor { get; set; } | ||
|
||
IVolumeManager VolumeManager { get; set; } | ||
|
||
IMediaQueue MediaQueue { get; set; } | ||
|
||
IPlaybackManager PlaybackManager { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using MediaManager.Media; | ||
|
||
namespace MediaManager | ||
{ | ||
public interface IMediaPlayer | ||
{ | ||
/// <summary> | ||
/// Gets or sets the request headers. | ||
/// </summary> | ||
Dictionary<string, string> RequestHeaders { get; set; } | ||
|
||
/// <summary> | ||
/// Reading the current status of the player | ||
/// </summary> | ||
MediaPlayerStatus Status { get; } | ||
|
||
/// <summary> | ||
/// Gets the players position | ||
/// </summary> | ||
TimeSpan Position { get; } | ||
|
||
/// <summary> | ||
/// Gets the source duration | ||
/// If the response is TimeSpan.Zero, the duration is unknown or the player is still buffering. | ||
/// </summary> | ||
TimeSpan Duration { get; } | ||
|
||
/// <summary> | ||
/// Gets the buffered time | ||
/// </summary> | ||
TimeSpan Buffered { get; } | ||
|
||
// <summary> | ||
/// Adds MediaFile to the Queue and starts playing | ||
/// </summary> | ||
Task Play(IMediaItem mediaItem); | ||
|
||
// <summary> | ||
/// Starts playing | ||
/// </summary> | ||
Task Play(); | ||
|
||
/// <summary> | ||
/// Stops playing but retains position | ||
/// </summary> | ||
Task Pause(); | ||
|
||
/// <summary> | ||
/// Stops playing | ||
/// </summary> | ||
Task Stop(); | ||
|
||
/// <summary> | ||
/// Changes position to the specified number of milliseconds from zero | ||
/// </summary> | ||
Task Seek(TimeSpan position); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
namespace MediaManager | ||
{ | ||
public interface INotificationManager | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using System.IO; | ||
using System.Threading.Tasks; | ||
|
||
namespace MediaManager.Media | ||
{ | ||
public interface IMediaExtractor | ||
{ | ||
Task<IMediaItem> CreateMediaItem(string url); | ||
|
||
Task<IMediaItem> CreateMediaItem(FileInfo file); | ||
} | ||
} |
Oops, something went wrong.