replace v6 with experimental v7 code
This commit is contained in:
24
src/MpvNet.Extension/ExampleExtension/ExampleExtension.cs
Normal file
24
src/MpvNet.Extension/ExampleExtension/ExampleExtension.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
|
||||
namespace MpvNet.Extension.ExampleExtension;
|
||||
|
||||
public class Extension : IExtension
|
||||
{
|
||||
public MpvClient Player { get; set; }
|
||||
|
||||
public Extension()
|
||||
{
|
||||
Player = Global.Player.CreateNewPlayer("example");
|
||||
Player.ObservePropertyBool("fullscreen", FullscreenChange);
|
||||
Player.FileLoaded += Player_FileLoaded;
|
||||
}
|
||||
|
||||
void Player_FileLoaded()
|
||||
{
|
||||
Terminal.Write("File loaded: " + Player.GetPropertyString("path"));
|
||||
}
|
||||
|
||||
void FullscreenChange(bool value)
|
||||
{
|
||||
Player.CommandV("show-text", "fullscreen: " + value);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
|
||||
<OutputPath>C:\Users\frank\AppData\Roaming\mpv.net-experimental\extensions\ExampleExtension</OutputPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\MpvNet\MpvNet.csproj">
|
||||
<Private>False</Private>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
25
src/MpvNet.Extension/ExampleExtension/ExampleExtension.sln
Normal file
25
src/MpvNet.Extension/ExampleExtension/ExampleExtension.sln
Normal file
@@ -0,0 +1,25 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.7.34018.315
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ExampleExtension", "ExampleExtension.csproj", "{4D6623A0-E890-44E5-956F-D5A5A24A6619}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{4D6623A0-E890-44E5-956F-D5A5A24A6619}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{4D6623A0-E890-44E5-956F-D5A5A24A6619}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{4D6623A0-E890-44E5-956F-D5A5A24A6619}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{4D6623A0-E890-44E5-956F-D5A5A24A6619}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {47E1F7E3-3833-4E05-841B-4683C1DEA133}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
Reference in New Issue
Block a user