-
This commit is contained in:
68
README.md
68
README.md
@@ -7,7 +7,7 @@ mpv and mpv.net have a learning curve and are only suitable for experienced user
|
||||
mpv manual: <https://mpv.io/manual/master/>
|
||||
|
||||
Table of contents
|
||||
-------
|
||||
-----------------
|
||||
|
||||
- [Features](#features)
|
||||
- [Screenshots](#screenshots)
|
||||
@@ -21,7 +21,7 @@ Table of contents
|
||||
|
||||
- Customizable context menu defined in the same file as the keybindings
|
||||
- Addon API for .NET languages
|
||||
- 5 different scripting languages are supported, Python scripting implemented with IronPython, C# implemented with CS-Script, Lua and JavaScript implemented in libmpv and PowerShell
|
||||
- Scripting API for Python, C#, Lua, JavaScript and PowerShell
|
||||
- mpv's OSC, IPC, conf files and more
|
||||
|
||||
### Screenshots
|
||||
@@ -38,13 +38,13 @@ C:\Users\username\AppData\Roaming\mpv\input.conf
|
||||
```
|
||||
if it's missing mpv.net generates it with the following defaults:
|
||||
|
||||
https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/input.conf.txt
|
||||
<https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/input.conf.txt>
|
||||
|
||||
### Settings
|
||||
|
||||
mpv.net shares the settings with mpv, settings have to be edited in a config file called mpv.conf located at:
|
||||
mpv.net shares the settings with mpv, settings can be edited in a settings dialog or in a config file called mpv.conf located at:
|
||||
```
|
||||
C:\Users\username\AppData\Roaming\mpv\mpv.conf
|
||||
C:\Users\user\AppData\Roaming\mpv\mpv.conf
|
||||
```
|
||||
if it's missing mpv.net generates it with the following defaults:
|
||||
|
||||
@@ -52,7 +52,9 @@ if it's missing mpv.net generates it with the following defaults:
|
||||
|
||||
### Scripting
|
||||
|
||||
https://github.com/stax76/mpv.net/wiki/Scripting-using-C%23,-Python,-JavaScript,-Lua-or-PowerShell
|
||||
Scripting is supported for Python, C#, Lua, JavaScript and PowerShell
|
||||
|
||||
https://github.com/stax76/mpv.net/wiki/Scripting-(CSharp,-Python,-JavaScript,-Lua,-PowerShell)
|
||||
|
||||
### Support
|
||||
|
||||
@@ -64,7 +66,7 @@ https://github.com/stax76/mpv.net/wiki/Scripting-using-C%23,-Python,-JavaScript,
|
||||
|
||||
### Changelog
|
||||
|
||||
### 2.0
|
||||
### 2.0 (2019-03-28)
|
||||
|
||||
- setting track-auto-selection added to settings editor (<https://mpv.io/manual/master/#options-track-auto-selection>)
|
||||
- setting loop-playlist added to settings editor (<https://mpv.io/manual/master/#options-loop-playlist>)
|
||||
@@ -75,55 +77,3 @@ https://github.com/stax76/mpv.net/wiki/Scripting-using-C%23,-Python,-JavaScript,
|
||||
- added drag & drop support to drag & drop a youtube URL on mpv.net
|
||||
- added support to open a youtube URL from command line
|
||||
- added support for opening a URL from the menu: Open > Open URL
|
||||
|
||||
### 1.9
|
||||
|
||||
- improved settings editor
|
||||
- all info and error messages are shown now on the main window thread having the main window as parent
|
||||
|
||||
### 1.8
|
||||
|
||||
- new config editor added
|
||||
|
||||
### 1.7
|
||||
|
||||
- showing the conf files mpv.net uses now the app that is registered for txt files, before it just shell executed the conf file which only worked if conf files were associated with an application
|
||||
- leaving fullscreen mode the previous window size and position wasn't restored
|
||||
- when the source video aspect ratio changes the height is kept and the width is adjusted and a check is performed to assure the window is within screen bounds
|
||||
|
||||
### 1.6
|
||||
|
||||
- a crash caused by WM_APPCOMMAND (multimedia keyboards) commands was fixed
|
||||
- support for the 'screen' property was added, it should work both from mpv.conf (screen = 1) and from command line (--screen=1)
|
||||
- per monitor DPI awareness and better multi monitor support was added
|
||||
|
||||
### 1.5
|
||||
|
||||
- the info command supports now info for music files instead of showing an exception on music files
|
||||
- added support for WM_APPCOMMAND API to support media keyboards
|
||||
- fixed Alt key input not working
|
||||
- mpv.net API methods renamed to match the names used in the Lua/JS API
|
||||
|
||||
### 1.4
|
||||
|
||||
- the last thread sync fix wasn't working well, the delayed shutdown should be gone for good now
|
||||
- libmpv updated
|
||||
|
||||
### 1.3
|
||||
|
||||
- besides Lua/JavaScript/C#/Python there is now PowerShell supported as fifth scripting language
|
||||
|
||||
- in case there isn't yet a mpv.conf file mpv.net creates the file with certain default settings that were previously set on every mpv.net start. This was changed to provide transparency on which settings mpv.net uses. These default settings can be seen here: https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/mpv.conf.txt
|
||||
|
||||
### 1.2
|
||||
|
||||
- a thread synchonisation bug which caused the shutdown to be delayed or frozen was fixed, it also caused the Shutdown event not to fire which caused the rating plugin not to work
|
||||
|
||||
### 1.1
|
||||
|
||||
- added support for Python scripting via IronPython
|
||||
- show tracks and show playlist didn't work because the duration wasn't defined in the key bindings
|
||||
|
||||
### 1.0
|
||||
|
||||
- much more feature packed context menu
|
||||
@@ -0,0 +1,67 @@
|
||||
Here is a list of scripts that users of mpv(.net) have published, adding functionality that is not part of the core mpv(.net) player. Anyone can add their own script by editing this wiki. Scripts are usually placed in C:\Users\user\AppData\Roaming\mpv\scripts
|
||||
|
||||
### C#
|
||||
|
||||
```
|
||||
using mpvnet;
|
||||
|
||||
class Script
|
||||
{
|
||||
public Script()
|
||||
{
|
||||
var fs = mp.get_property_string("fullscreen");
|
||||
mp.commandv("show-text", "fullscreen: " + fs);
|
||||
mp.observe_property_bool("fullscreen", FullscreenChange);
|
||||
}
|
||||
|
||||
void FullscreenChange(bool val)
|
||||
{
|
||||
mp.commandv("show-text", "fullscreen: " + val.ToString());
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Python
|
||||
|
||||
```
|
||||
# when seeking displays position and
|
||||
# duration like so: 70:00 / 80:00
|
||||
# which is different from mpv which
|
||||
# uses 01:10:00 / 01:20:00
|
||||
|
||||
import math
|
||||
|
||||
|
||||
def seek():
|
||||
pos = mp.get_property_number("time-pos")
|
||||
dur = mp.get_property_number("duration")
|
||||
|
||||
if pos > dur:
|
||||
pos = dur
|
||||
|
||||
mp.commandv('show-text', format(pos) + " / " + format(dur))
|
||||
|
||||
def format(f):
|
||||
sec = round(f)
|
||||
|
||||
if sec < 0:
|
||||
sec = 0
|
||||
|
||||
pos_min_floor = math.floor(sec / 60)
|
||||
sec_rest = sec - pos_min_floor * 60
|
||||
return add_zero(pos_min_floor) + ":" + add_zero(sec_rest)
|
||||
|
||||
def add_zero(val):
|
||||
val = round(val)
|
||||
return "" + str(int(val)) if (val > 9) else "0" + str(int(val))
|
||||
|
||||
mp.register_event("seek", seek) # or use: mp.Seek += seek
|
||||
```
|
||||
|
||||
### PowerShell
|
||||
|
||||
```
|
||||
$position = [mp]::get_property_number("time-pos");
|
||||
[mp]::commandv("show-text", $position.ToString() + " seconds")
|
||||
```
|
||||
Please note that PowerShell don't allow assigning to events and mpv.net uses as workaround a matching script filename, a list of available events can be found in the mpv manual or in the file mp.cs in the mpv.net source code.
|
||||
Reference in New Issue
Block a user