Log in

View Full Version : mpv.net media player


Pages : 1 2 [3] 4 5 6 7 8 9 10 11 12 13 14 15

BetA13
10th April 2019, 20:44
im just using an windows 7 theme that i edited a bit..
its this here:

https://www.deviantart.com/barbiturikk/art/Viewlix-420986331

And yes, its mostly Systemwide.. i did some customization here and there..
Heres a screen with the STANDART windows 7 Style, for reference Purpose :)

https://i.imgur.com/sSCjs0J.png

Cheers

stax76
12th April 2019, 15:03
2.7 (2019-04-12)

the autofit mpv property was added to the conf editor
the routine that writes the mpv.conf file in the conf editor was completely rewritten
the conf editor has a dedicated page for mpv.net specific settings,
these settings are saved in the same folder as mpv.conf using mpvnet.conf as filename,
the first setting there is dark-mode
new optional dark theme

go to download page (https://github.com/stax76/mpv.net/releases)

https://i.postimg.cc/R0QWWzTQ/Screenshot-18.png

stax76
16th April 2019, 18:09
Changelog

2.9 (2019-04-16)

clicking the right top corner in full screen mode
closes the player but it did not work on all displays
the info display was changed to display the filename on top
so it's not displayed in the middle of the screen
on start up of the conf editor all text is now selected in the
search text box so it's ready for a new search to be typed
the conf editor was changed to write the settings to disk
only if the settings were actually modified, also the message
that says that the settings will be available on next start
is now only shown if the settings were actually modified.
there was an instance in the context menu where the sub menu
arrow was overlapping with the text
in the input editor when only one character is entered in the
search text box the search is performed only in the input and
not in the command or menu
in the input editor the routine that generates the input string
was completely rewritten because it was adding Shift where it
wasn't necessary (it took a huge amount of time to implement)
the context menu has a new track menu where the active track
can be seen and selected, it shows video, audio and subtitle
tracks with various metadata. Menu default definition (https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/input.conf.txt#L104).
The screenshots were updated showing the new track menu (https://github.com/stax76/mpv.net#screenshots).

go to download page (https://github.com/stax76/mpv.net/releases)

https://i.postimg.cc/nrKdxcMR/mpvnet-Context-Menu.png

stax76
16th April 2019, 20:13
I think my mission with this player is mostly completed, it already does more than I need and there is not much feedback (thanks to BetA13 and everybody else giving feedback). I'm still here trying to help, be it general mpv topics, help about extension development or incorporating pull requests.

Next mission is likely a Electron (https://electronjs.org/) based player similar to MusicBee (https://www.getmusicbee.com/), MediaMonkey or Dopamine (http://www.digimezzo.com/software/dopamine/). I've not any real wishes or complaints about MusicBee, I just don't know what else to code and I want to learn to program using the web platform.

Grimsdyke
16th April 2019, 21:00
As I said a few weeks ago I would love to have a player that gives me the opportunately to play certain parts of a 'file' via a playlist !!
But not the existing chapters but parts that I want to play. And directly within the player and not by creating a mkv or whatever.

stax76
16th April 2019, 21:24
The idea isn't that bad, I can't promise it but there is a chance if you create an issue on the tracker with a description of your requirements.

https://github.com/stax76/mpv.net/issues

hubblec4
17th April 2019, 11:20
Hey, stax76, you could learn C++ or Lazarus to write a GUÍ for mpv without depending on the ".net"-components. I don't like such tools, and for mpv.net I had to install it (cruel).

I'm always interested in a player with Matroska support (more as basic support).

stax76
17th April 2019, 13:28
I've written a series of C++ apps ten years ago, take a look here:

https://github.com/stax76/OpenWithPlusPlus

I prefer C#/VB.NET, Visual Studio and Visual Studio Code but am generally open-minded towards any kind of language and I don't mind installing a run time. For JDownloader I've installed Java and it's officially the slowest starting app on my system, over 5 seconds. There are numerous Visual C++ run times installed on my sys and Python mostly because I want to learn it due to its popularity and interesting concepts it uses.

.NET is part of the Win OS and it's update process and many .NET app makers use a new .NET version even if they could use an older version, they just don't see many disadvantages using the latest and greatest. Complaints are rare, I'm relatively sure you are the only one mention it for mpv.net.

Yesterday I wanted to add mkv edition support but gave up quickly when I noticed that there is no way getting the edition name with MediaInfo. I don't know if it's really missing and if there are other simple methods getting it.

If you miss things in players and player devs can't help you, you can always get involved in player development like I did two years ago. You can start from scratch, use a lib like libmpv or contribute to an existing player or fork one, or maybe you can find one that can be extended. mpv.net supports numerous extension languages but don't has a C interface, instead off adding a C interface I recommend people to learn one of the languages it supports but there is also a language agnostic interface built into the mpv core, json-ipc, you can read about it here:

https://mpv.io/manual/master/#json-ipc

I've used it in my Wox launcher mpv add-in:

https://github.com/stax76/wox-mpv-plugin

The mpv wiki has a list of front ends, there is an MPC clone for instance but I don't think any of them has great MKV and Windows support.

https://github.com/mpv-player/mpv/wiki/Applications-using-mpv

I decided against MPC and for mpv and I've never regretted it, in fact it was a great experience using libmpv, great documentation, everything just works wonderfully and in the rare occasion of encountering a problem there were helpful developers.

mpv.net has about 10 000 lines of code, probably only a third is essential and the rest is GUI related and nice to have features for better usability or better look and feel or features that hardly anybody uses.

stax76
17th April 2019, 13:51
I forgot to mention that .NET Core 3 supports desktop GUI development and I could easily port mpv.net to .NET Core which eliminates the need for installing the newest or any .NET framework, it's even possible to compile everything into one executable and would probably not be much bigger than a QT app.

hubblec4
17th April 2019, 16:06
I've written a series of C++ apps ten years ago, take a look here:

https://github.com/stax76/OpenWithPlusPlus

I prefer C#/VB.NET, Visual Studio and Visual Studio Code but am generally open-minded towards any kind of language and I don't mind installing a run time. For JDownloader I've installed Java and it's officially the slowest starting app on my system, over 5 seconds. There are numerous Visual C++ run times installed on my sys and Python mostly because I want to learn it due to its popularity and interesting concepts it uses.

.NET is part of the Win OS and it's update process and many .NET app makers use a new .NET version even if they could use an older version, they just don't see many disadvantages using the latest and greatest. Complaints are rare, I'm relatively sure you are the only one mention it for mpv.net.

Yes maybe I'm the only one, but sometime I found a cool app and want test it. But the app says there is some .net-component missing.


Yesterday I wanted to add mkv edition support but gave up quickly when I noticed that there is no way getting the edition name with MediaInfo. I don't know if it's really missing and if there are other simple methods getting it.

I know MediaInfo is not the best tool to get info about an mkv. It is very easy to parse an mkv.


If you miss things in players and player devs can't help you, you can always get involved in player development like I did two years ago. You can start from scratch, use a lib like libmpv or contribute to an existing player or fork one, or maybe you can find one that can be extended. mpv.net supports numerous extension languages but don't has a C interface, instead off adding a C interface I recommend people to learn one of the languages it supports but there is also a language agnostic interface built into the mpv core, json-ipc, you can read about it here:

https://mpv.io/manual/master/#json-ipc

I've used it in my Wox launcher mpv add-in:

https://github.com/stax76/wox-mpv-plugin

The mpv wiki has a list of front ends, there is an MPC clone for instance but I don't think any of them has great MKV and Windows support.

https://github.com/mpv-player/mpv/wiki/Applications-using-mpv

I decided against MPC and for mpv and I've never regretted it, in fact it was a great experience using libmpv, great documentation, everything just works wonderfully and in the rare occasion of encountering a problem there were helpful developers.

mpv.net has about 10 000 lines of code, probably only a third is essential and the rest is GUI related and nice to have features for better usability or better look and feel or features that hardly anybody uses.

mpv looks indeed interesting and I hope in future there is more native Matroska support.
Unfortunately my mkv's play not smooth in mpv.net. Stuttering or frame drops I don't know.

My knowledge about C coding is very rare and so I can't really help/join to projects. I can ask only and offer my helping hand.

stax76
20th April 2019, 19:35
Unfortunately my mkv's play not smooth in mpv.net. Stuttering or frame drops I don't know.

What's the content of your mpv.conf file and what GPU are you using?

hubblec4
20th April 2019, 20:45
mpv.conf

# https://mpv.io/manual/master/

input-ar-delay = 500
input-ar-rate = 20
volume = 50
hwdec = yes
vo = direct3d
keep-open = yes
keep-open-pause = no
osd-playing-msg = ${filename}
screenshot-directory = ~~desktop/
scale = lanczos
cscale = lanczos
dscale = lanczos


I have changed some settings because with default values not working. GPU is NVIDIA.

Mkv content is from Blu-ray and from UHD-BD. Both mkv's plays fine in mpv, but not in mpv.net.

stax76
20th April 2019, 23:07
Changelog

3.0 (2019-04-20)

the history feature logs now only files that were opened longer than 90 seconds
the default input command for cycling the audio tracks was replaced with an
mpv.net command that shows detailed track info and has no 'no audio' track. Default binding (https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/input.conf.txt#L89).
new website at https://mpv-net.github.io/mpv.net-web-site/
the Tracks menu supports now MKV edition selection. Default binding (https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/input.conf.txt#L106).
the Navigate menu supports now chapter selection. Default binding (https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/input.conf.txt#L57).
opening the context menu was crashing if the default binding for Tracks was missing

stax76
20th April 2019, 23:14
@hubblec4

Maybe try the default 'vo = gpu', it's usually better than 'vo = direct3d'.

my settings and card:

NVIDIA GT 1030

#log-file = C:\Users\frank\AppData\Roaming\mpv\log.txt
input-ar-delay = 500
input-ar-rate = 20
volume = 50
keep-open = always
keep-open-pause = no
screenshot-directory = ~~desktop/
input-default-bindings = no
screen = 1
input-ipc-server = \\.\pipe\mpvsocket
hwdec = yes
osd-playing-msg = ${filename}
alang = de,en
fullscreen = yes

hubblec4
21st April 2019, 12:30
Hi stax76,

it would be so nice if you could offer a portable version of mpv.net. And for me more important: the mpv config folder should be include in the portable exe-folder.

hubblec4
21st April 2019, 12:46
Hi stax76

a short test with an mkv which have 3 editions.

here is a pic of the sub entry "Track"
https://forum.videohelp.com/attachments/48762-1555846833/editions_mpv.net.jpg

The editions are 3 times shown. I think you have to adjust the list so that the editions located at the top(one times only), then video tracks, audio tracks, sub tracks.


EDIT:
I would prefer an extra entry in the popup menu for the Editions and also for the Chapters "EDIT: after the Subtitle entry".

hubblec4
21st April 2019, 12:59
@hubblec4

Maybe try the default 'vo = gpu', it's usually better than 'vo = direct3d'.


Now it seems to work. Video stuttering is gone.

But I have installed mpv.net in a VM(Win7-64) and try to open the mkv(from host OS, via network) and mpv.net crashes without a warning.

I copied the mpv.net install folder to my host OS and it works.

Thanks for upgrading Matroska support.

stax76
21st April 2019, 13:47
it would be so nice if you could offer a portable version of mpv.net. And for me more important: the mpv config folder should be include in the portable exe-folder.

I consider it, can you describe a few benefits this would have? My installer is extreme lightweight and there are many very easy ways to uninstall apps:


appwiz.cpl

ms-settings:appsfeatures (Win 10)

right click menu item in start menu and select uninstall (maybe only available in Win 10)

open start menu and type 'dein' (also maybe only available in Win 10)


https://github.com/stax76/mpv.net/blob/master/mpvnet.iss

I was able to get both edition names and chapter names from the mpv API, it was straightforward to implement.

stax76
21st April 2019, 14:00
The editions are 3 times shown. I think you have to adjust the list so that the editions located at the top(one times only), then video tracks, audio tracks, sub tracks.

It looks like all menu items are shown 3 times, did this happen only once or does it happen all the time?

I would prefer an extra entry in the popup menu for the Editions and also for the Chapters "EDIT: after the Subtitle entry".

Normally you can edit your menu by modifying your input.conf file but I think I've hard coded something that the chapter will always be under 'Navigate > Chapters'. I should be able to change this to allow people to move chapters to the top level menu.

edit:

I believe I know what was happening, you don't have defaults for Track and Chapters in your input.conf simply because input.conf was created by an earlier version. There are two ways to fix it, either add the defaults for track and chapters manually, links are in the change log, or delete input.conf so it gets created with those default.

Next version will show tracks and chapters only if input conf contains defaults and you will be able to move tracks and chapters wherever you want by editing input.conf.

Why would you prefer a sub menu for editions? I'm trying to keep the code base simple and lightweight.

hubblec4
21st April 2019, 14:31
I consider it, can you describe a few benefits this would have? My installer is extreme lightweight and there are many very easy ways to uninstall apps:....

I always prefer portable versions and with portable I mean 100% portable!
Most "portable" tools writes settings and other stuff in the registry. When I copy the app folder to an USB stick and want use it on other PCs it will not work right.




I was able to get both edition names and chapter names from the mpv API, it was straightforward to implement.

OK, but I guess the internal mkv parser is not really 100% working. I found nothing about nested chapters.


It looks like all menu items are shown 3 times, did this happen only once or does it happen all the time?
No. An mkv with 2 editions is shown correctly, but an other mkv with 3 editions don't work.



Normally you can edit your menu by modifying your input.conf file but I think I've hard coded something that the chapter will always be under 'Navigate > Chapters'. I should be able to change this to allow people to move chapters to the top level menu.

Don't forget the Editions entry, this is more important as Chapters. The Editions and Chapters entry should be shown in the main menu by default.

stax76
21st April 2019, 14:33
I just edited my previous post.

stax76
21st April 2019, 14:43
The Editions and Chapters entry should be shown in the main menu by default.

The top level menu is already too long, next version will allow to move chapters to the top level by editing input conf.

I would like to keep editions in the tracks menu (second level) in order to keep the code simple, in MPC-HC it's 3rd level.

hubblec4
21st April 2019, 15:50
The issue with the editions is gone after I deleted the old input.conf.

The list of top level entries is not too long (my opinion). I use LAV Filters tray icon and with only one right click I have access to the editions.
I want such short way within a player. Selecting editions (and chapters) within MPC is not good.
There are other top level entries which make no sense for me and could be moved to lower level.
Editions is the most important feature, selecting and changing.

What I want is a "button" to change quickly Editions in mpv, like the Audio/Sub buttons where you can change the track.

stax76
21st April 2019, 19:39
I wrote a script to get your editions to the top level menu, it works however only in the next release, find the script here:

https://github.com/stax76/mpv.net/wiki/Scripting

I don't know much about the mpv on screen controller. It might be possible to implement a control bar as mpv.net add-on but I'm not sure if it's easy to do.

hubblec4
21st April 2019, 20:11
I will test it. Thanks.

If it possible to implement such a control bar that would be soooo great. I dream of a Matroska control bar to navigate in Matroska menu structure :-)

ashlar42
21st April 2019, 22:37
I just don't know what else to code and I want to learn to program using the web platform.What about Kodi DSPlayer, if you don't know what else to code?
Sorry but it was too... tempting not to ask.

stax76
22nd April 2019, 18:23
If it possible to implement such a control bar that would be soooo great. I dream of a Matroska control bar to navigate in Matroska menu structure :-)

I might try it sometime but currently try to focus on my new project which is web platform based and because it is web platform based it is a challenge for me, that's why I created a website for mpv.net, in order to start learning the web platform.

What about Kodi DSPlayer, if you don't know what else to code?
Sorry but it was too... tempting not to ask.

The reason why I stopped working on staxrip (some maintenance work is still an option) is I'm not using it any longer and I'm also not using Kodi (but rather mpv.net) at this time but I agree that Kodi is great software, much better than most desktop player because it has a modular architecture.

ashlar42
23rd April 2019, 13:49
The reason why I stopped working on staxrip (some maintenance work is still an option) is I'm not using it any longer and I'm also not using Kodi (but rather mpv.net) at this time but I agree that Kodi is great software, much better than most desktop player because it has a modular architecture.
Yeah, Kodi is great software. When used together with madVR is quite likely to be the highest quality option available currently. Unfortunately the past developer of Kodi DSPlayer has abandonded the project and nobody is willing/capable of picking it up. A sad story. :(

Staxrip has been hugely helpful for me. Thanks a bunch for that.

stax76
23rd April 2019, 15:17
Yeah, Kodi is great software. When used together with madVR is quite likely to be the highest quality option available currently. Unfortunately the past developer of Kodi DSPlayer has abandonded the project and nobody is willing/capable of picking it up. A sad story.

I hope somebody will maintain it. HQ processing was never a special interest of me, it probably has something to do with not having the best eyesight I guess.

--------------------

Changelog

3.1 (2019-04-23)

the Tracks and Chapters menu are now only added if default bindings exist and
it's now possible to move the chapters menu to the top level by editing input.conf
mpvnet supports now like mpv a portable settings directory. If a directory named portable_config
next to the mpvnet.exe exists, all config will be loaded and written in this directory.
there is now a portable download in 7zip format.


https://mpv.io/manual/master/#files-on-windows

hubblec4
23rd April 2019, 15:34
Thanks. I have downloaded it and test the portable version.

When I start the mpvInputEdit there are nothing, no entries. Is this correct?

EDIT: You should include a folder "portable_config" to the portable version as default.


EDIT2:
I can change the Editions, many thanks. And playback looks very fine now.
But the Editions and also the Chapters should be in the top level menu by default.

stax76
23rd April 2019, 15:40
When I start the ConfEditor there are nothing, no entries. Is this correct?

Does the file mpvConf.toml exist next to mpvConfEdit.exe?

Did you set a filter key word that yields to zero results maybe?

stax76
23rd April 2019, 18:27
Article that writes about Lua which is the number one scripting language in mpv and VLC:

https://www.codementor.io/blog/worst-languages-2019-6mvbfg3w9x

hubblec4
23rd April 2019, 18:29
The mpvConf.toml exists and the editor works. You had answered to fast. I had changed my post.

In the change log you speak about editing the inputConf. I mean mpvInputEditor shows nothing. What is to do that Chapters/Editions move to the top level menu?

stax76
23rd April 2019, 20:13
In the change log you speak about editing the inputConf. I mean mpvInputEditor shows nothing.

I think when the input editor has no content then either input.conf don't exist or is empty and the input editor is not generating defaults because technically it might not be easy to do, the defaults are only included as resource in mpvnet and only mpvnet creates defaults when input.conf don't exist.

You can't however use the input editor for changing the menu structure, you have to edit input.conf manually. First try to move chapters to top level.

https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/input.conf.txt#L57

Once you figured out chapters you can try moving edition to top level with the script you can find here:

https://github.com/stax76/mpv.net/wiki/Scripting

hubblec4
23rd April 2019, 20:29
The input.conf exits but has no content, expect some comment lines.

EDIT: I deleted the input.conf and start mpv.net. A new filled input.conf was created.
My first step was to open the config editor and it saves an empty file after closing. And than I started mpv.net which create not a new input.conf file.

https://github.com/stax76/mpv.net/wiki/Scripting
Which of the script sample is for moving chapters?

EDIT:
I could find out how to move Chapters by manually editing the input.conf.

hubblec4
23rd April 2019, 20:37
Maybe it is better to ask the user for saving settings when he close an editor. With an option for auto-save on exit.

stax76
27th April 2019, 01:47
Changelog

3.2 (2019-04-27)

mpvInputEdit and mpvConfEdit were discontinued and merged into
mpvnet because separate apps were to difficult to work with
portable mode: in case no config folder exists and the
startup folder has write access mpvnet will ask where
the config folder should be created (portable or appdata)
there was an issue causing keys not working after a modal window was shown
there was a crash when no script folder existed in the conf folder
MediaInfo and youtube-dl were updated
a new JavaScript example script was added to the wiki and the
script descriptions were improved. Scripting Page (https://github.com/stax76/mpv.net/wiki/Scripting).
greatly improved README.md file and github startpage (https://github.com/stax76/mpv.net)
About dialog added
the input editor shows only a closing message if actually a change was made
the input editor don't show confusing menu separators any longer. Screenshot (https://github.com/stax76/mpv.net#input-editor)
new Command Palette feature added. Screenshot (https://github.com/stax76/mpv.net#command-palette), Default input binding (https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/inputConf.txt#L141)
the history feature had a bug causing files to be logged more than once

hubblec4
28th April 2019, 02:50
Thanks again. All seems to work, but I can't figure out how I can move the Editions to an Edition entry in the top level.

I have searched a bit in mpv Github and found an incredible thing. mpv supports the Matroska ChapterSegmentEditionUID (https://github.com/mpv-player/mpv/pull/258) element. I have made some first quick tests and it works. I need a bit time to understand the correct handling and then I could add a new Matroska menu structure profile for the Matroska menu editor in cE.

Maybe is some help of you required to get working such menu structure.

On the other hand I found out that mpv don't support Matroska Hard-Linking.

And I have started a Github project about Matroska-Playback (https://github.com/hubblec4/Matroska-Playback) to explain Matroska features.

stax76
28th April 2019, 16:41
If you want to do something that large like the script below I recommend creating a C# project in Visual Studio and add a reference to the mpvnet.exe assembly in order to get full code completion. If you've never worked with C# and WinForms before it's gonna be difficult. It might also help to see how other dynamic menu items are added:

https://github.com/stax76/mpv.net/blob/master/mpv.net/MainForm.cs#L79


using mpvnet;
using System.ComponentModel;
using System.Linq;

class Script
{
MainForm MainForm;

public Script()
{
MainForm = mpvnet.MainForm.Instance;
MainForm.ContextMenu.Opening += ContextMenu_Opening;
}

void ContextMenu_Opening(object sender, CancelEventArgs e)
{
// please note that you have to edit the input.conf
// file and add an 'Edition' menu item there
MenuItem menuItem = MainForm.FindMenuItem("Edition");
if (menuItem == null) return;
menuItem.DropDownItems.Clear();
var editionTracks = mp.MediaTracks.Where(track => track.Type == "e");

foreach (MediaTrack track in editionTracks)
{
MenuItem mi = new MenuItem(track.Text);
mi.Action = () => { mp.commandv("set", "edition", track.ID.ToString()); };
mi.Checked = MainForm.MpvEdition == track.ID;
menuItem.DropDownItems.Add(mi);
}
}
}

stax76
4th May 2019, 00:08
Changelog

3.4 (2019-05-03)

new feature added to manage file associations from within the app. It can be found in the menu at: Tools > Manage... Default Binding (https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/inputConf.txt#L149)
new zip download option added
new x86 download option added

3.3 (2019-05-01)

dark mode support was added to the command palette and partly to the input editor
a new icon was designed. Website (https://mpv-net.github.io/mpv.net-web-site/)
all windows (main, conf, input, about, command palette) can now be closed
by just pressing the Escape key
new feature added to open recent files and URLs with the context menu. Default Binding (https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/inputConf.txt#L33)
the info command (i key) now works also for URLs
CSScriptAddon add-on didn't load cs scripts from <startup>\scripts
error handling was improved by showing an improved message box that supports
a text copy feature, a support link and text heading and text folding
libmpv was updated

BetA13
4th May 2019, 01:52
Thanks for the Updates...

quick question, you cant use Madvr with this player right?
Or can you?

just wondering...

stax76
4th May 2019, 02:05
mpv/libmpv cannot use madvr.

hubblec4
4th May 2019, 12:17
No extra Script is working. I get the same errors which I have send you via pm.

And could you please stop using path's at C:\ like Temp folder for windows or the Local Temp folder. After I have started mpv.net there are many folders on C:\ and I don't want delete them all manually ever time.

ALL SETTINGS can be saved in the mpv.net folder in an ini-file.

stax76
4th May 2019, 13:36
@hubblec4

I don't know yet what is causing the problem with the C# script. The message box that is showing you the error has a copy feature in the last release, if you copy the error message I can ask the author of CS-Script what could cause the error.

I'm currently working on a new wiki page that explains how to do an .NET add-on, you could do an .NET add-on then instead of a .NET script, this has the benefit of debugging support.

And could you please stop using path's at C:\ like Temp folder for windows or the Local Temp folder. After I have started mpv.net there are many folders on C:\ and I don't want delete them all manually ever time.

I don't know what you mean, please post one full folder or file path. I did everything I could to support the requests for portable, x86 and zip. It could be a bug.

stax76
4th May 2019, 13:51
Wiki page about add-ons:

https://github.com/stax76/mpv.net/wiki/Addons

stax76
4th May 2019, 15:10
Who knows how this C# code translates to Python:

var editionTracks = mp.MediaTracks.Where(track => track.Type == "e");

edit:

I think it is:

editionTracks = [track for track in mp.MediaTracks if track.Type == "e"]

hubblec4
4th May 2019, 16:59
Here is the error message for the portable version 64bit

CompilerException

c:\Users\Hubblec4\AppData\Local\Temp\CSSCRIPT\dynamic\3220.4f8112b5-c061-406e-92fc-0a9745641f82.tmp(12,41): error CS0123: No overload for 'ContextMenu_Opening' matches delegate 'System.ComponentModel.CancelEventHandler'


csscript.CompilerException: c:\Users\Hubblec4\AppData\Local\Temp\CSSCRIPT\dynamic\3220.4f8112b5-c061-406e-92fc-0a9745641f82.tmp(12,41): error CS0123: No overload for 'ContextMenu_Opening' matches delegate 'System.ComponentModel.CancelEventHandler'

bei csscript.CSExecutor.ProcessCompilingResult(CompilerResults results, CompilerParameters compilerParams, ScriptParser parser, String scriptFileName, String assemblyFileName, String[] additionalDependencies)
bei csscript.CSExecutor.Compile(String scriptFileName)
bei CSScriptLibrary.CSScript.LoadWithConfig(String scriptFile, String assemblyFile, Boolean debugBuild, Settings scriptSettings, String compilerOptions, String[] refAssemblies)
bei CSScriptLibrary.CSScript.LoadCode(String scriptText, String tempFileExtension, String assemblyFile, Boolean debugBuild, String[] refAssemblies)
bei CSScriptLibrary.CodeDomEvaluator.CompileCode(String scriptText)
bei CSScriptLibrary.CodeDomEvaluator.LoadCode(String scriptText, Object[] args)
bei CSScriptAddon.CSScriptAddon..ctor() in C:\Users\frank\Daten\Projekte\CS\mpv.net\CSScriptAddon\CSScriptAddon.vb:Zeile 29.

stax76
4th May 2019, 17:23
Thanks, I'll try to find out what's wrong.

I was able to translate it to python:

import mpvnet
import MenuItem

fn = lambda t: lambda : mp.commandv("set", "edition", str(t.ID))

def ContextMenu_Opening(sender, e):
menuItem = MainForm.FindMenuItem("Editions")
if menuItem is None:
return
menuItem.DropDownItems.Clear()
editionTracks = [track for track in mp.MediaTracks if track.Type == "e"]

for track in editionTracks:
mi = MenuItem(track.Text)
mi.Action = fn(track)
mi.Checked = MainForm.MpvEdition == track.ID
menuItem.DropDownItems.Add(mi)

MainForm = mpvnet.MainForm.Instance
MainForm.ContextMenu.Opening += ContextMenu_Opening

stax76
4th May 2019, 17:36
if you mean the folder

c:\Users\Hubblec4\AppData\Local\Temp\CSSCRIPT

I don't have control over this, to run C# scripts mpv.net uses a third party component called CSSCRIPT which creates this folder, I hope it's not constantly creating new files.

hubblec4
4th May 2019, 20:48
Editions.py works.

Yes I mean this folder.