I failed to find a solution to the bug I asked about in another question: https://www.c-sharpcorner.com/forums/mediaelements-donsharp39t-work-as-expected
So, I decided to find a different way to run sound files. After some searching, I found a possible way.
This way, the sounds load and play correctly. However, this doesn't solve the problem fully.
1) First, it does work with audio, but doesn't work with video files. When loading a video file, I only hear relevant sound from it, but don't see any visual. Why that happens, and how it can be solved? I am not sure that I am right, but maybe I need to assign the width, height and margin to this WMPLib.WindowsMediaPlayer? If it's so, I can't find a way to assign new values.
I tried:
But I get error that there is no such definition. In my game, screen size can be different, depending on desired resolution, so I need to have an option to edit those values.
2) Second - many of MediaElements have events of "MediaOpened", "MediaEnded" and "MouseDown". Is there a way to "copy" those events to WMPLib.WindowsMediaPlayer?
I don't know the correct way to write it in code, so apologize for giving so "crude" example.
What I want:
And what I don't want: let's consider that MediaEnded of vcoThis activates the void called "EndThisAudio".
I don't want it that way:
Again, apologize for so ugly description. I mean, I want to take relevant events from "vcoThis", when both "vcoThis" can be different MediaElements, and they can have different events. Assigning one and same event \ void for all cases won't fit my needs.
Summary:
I need to understand how to:
1) Assign new width, height and margin to WMPLib.WindowsMediaPlayer
2) "Copy" relevant events from relevant MediaElement to WMPLib.WindowsMediaPlayer.