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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user