A basic media player application written in x86 and x64 assembler that utilizes the MFPlayer-Library (https://github.com/mrfearless/MFPlayer-Library) - which consists of functions that wrap the MFPlay (https://learn.microsoft.com/en-us/previous-versions/windows/desktop/api/mfplay/) COM implementation of the IMFPMediaPlayer (https://learn.microsoft.com/en-us/previous-versions/windows/desktop/api/mfplay/nn-mfplay-imfpmediaplayer) and IMFPMediaItem (https://learn.microsoft.com/en-us/previous-versions/windows/desktop/api/mfplay/nn-mfplay-imfpmediaitem) objects.
(https://i.postimg.cc/qhbJyF4N/mediaplayer-75.png) (https://postimg.cc/qhbJyF4N)
https://github.com/mrfearless/MediaPlayer (https://github.com/mrfearless/MediaPlayer)
Features- Supports audio and video media that is natively supported by the Microsoft Media Foundation API (https://learn.microsoft.com/en-us/windows/win32/medfound/supported-media-formats-in-media-foundation)
- Player controls via toolbar buttons, menu or context menu: Play/Pause Toggle, Stop, Frame Step, Volume Mute/Unmute, Fullscreen toggle, About, Exit.
- Custom control for Volume slider.
- Custom control for Seekbar slider.
- Custom controls for Labels (for duration of media and current position).
- Fullscreen enter via toolbar button, menu, context menu or F11.
- Fullscreen exit via toolbar button, menu, context menu, F11 or Escape.
- Spacebar toggles play/pause.
- Open media via File menu, context menu, clicking screen logo, clicking play button or drag and drop.
- Uses the FileDialog-Library (https://github.com/mrfearless/FileDialog-Library)
DownloadThe latest releases can be downloaded at https://github.com/mrfearless/mediaplayer/releases (https://github.com/mrfearless/mediaplayer/releases)
Edit: Updated to attach v1.0.0.5 releases and update screenshot.
Hi fearless,
My compliments, very nice work :thumbsup:
Thanks.
There is more features that could be added to it or design changes like proper fullscreen without the controls at the bottom - which was a design choice as I didnt want to go to that length of effort to hide/show them when the mouse was over the video window etc. And stuff like playlist support could be added. But the MediaPlayer application is mainly to verify that the MFPlayer library works ok, but could be a basis for a more fully featured media player in future, or it could be all wrapped up in a single custom control.
Very nice work, compliments :thumbsup:
Biterider
Excellent, my compliments :thumbsup:
Ctrl O seems not to work here on Win10, and I couldn't open a *.ogg file that opens fine with Windows. You might add dragging files on the window.
Otherwise flawless and cute :thup:
Wow, exciting work, congrats!
PS can't eat japanese hieroglyphs in movies names any chance?
Thanks.
@jj2007 - unfortunately the Microsoft Media Foundation doesn't seem to support .ogg files. Just these one listed here: https://learn.microsoft.com/en-us/windows/win32/medfound/supported-media-formats-in-media-foundation (https://learn.microsoft.com/en-us/windows/win32/medfound/supported-media-formats-in-media-foundation)
Drag and drop is included in it, but from reports it seems it might not be working for some people. I found a few interesting forum posts and blogs relating to drag and drop not working properly: https://forum.pellesc.de/index.php?topic=5852.0 (https://forum.pellesc.de/index.php?topic=5852.0) and https://helgeklein.com/blog/how-to-enable-drag-and-drop-for-an-elevated-mfc-application-on-vistawindows-7/ (https://helgeklein.com/blog/how-to-enable-drag-and-drop-for-an-elevated-mfc-application-on-vistawindows-7/)
So I guess I will look into that and use the findings there to adjust, and hopefully it will work for others. Currently I'm running Win10 Pro with a user with admin rights and UAC disabled, which is probably why it seems to work for me.
@greenozon - working on Unicode versions right now, which hopefully will tackle the issues raised on the github repo.
Quote from: fearless on August 30, 2024, 12:27:08 AMunfortunately the Microsoft Media Foundation doesn't seem to support .ogg files.
I vaguely remember that I had to install a codec pack to make them run.
Will it render modern videos encoed by H.265, AV1, or more newwer one?
If you have the hevc codec installed it should work: https://www.windowscentral.com/how-open-heic-and-hevc-files-windows-10s-photos-app (https://www.windowscentral.com/how-open-heic-and-hevc-files-windows-10s-photos-app)
I have the paid hevc codec version from the Microsoft store (few euros) and it displays a .mkv file with the codec: MPEG-H Part2/HEVC H.265 (shown in vlc the codec info)
I really like your coding style. Concise.
The program runs fine on Win 11. It's FAST. I tested a bunch of files without a glitch.
OMG
there is already H.266 (AKA VVC codec)
did you give it a try as well?
I"ve found a very nice collection of modern codec small video samples: https://www.elecard.com/videos (https://www.elecard.com/videos)
it plays only H.264 out of that zoo, unfortunately...
any chance to add support?
(MPC-HC plays 100%)
Hi fearless,
Very very nice!
v1.0.0.1
https://github.com/mrfearless/MediaPlayer/releases/tag/1.0.0.1 (https://github.com/mrfearless/MediaPlayer/releases/tag/1.0.0.1)
- Changed default codebase for x86 and x64 MediaPlayer to use wide/unicode for better handling and display of unicode filenames #2 #3.
- Ini file now is created with BOM to allow unicode - for MRU filenames.
- Ini file prepends a play/pause unicode glyph to its name (helps indicate that it is unicode perhaps?)
- Add clear recent files option (comment/wish from BOSCH on Tuts4you).
- Fix memory leak - missing DragFinish call #4.
- Fix transparent painting issue in about dialog box #1.
- Added use of ChangeWindowMessageFilter to better support drag and drop for UAC blocking drag and drop operations #4.
- Added play rate (slower/faster) buttons and menu items (request from Yashar Mahmoudnia on Tuts4you Telegram).
- Added step 10 seconds (backward/forward) buttons and menu items.
- Add additional accelerators for play rate and step 10 options.
- Add missing accelerator resource for x64 version (Thanks to jj2007).
- Combined toolbars to just one toolbar now.
Hi fearless,
Visiting your GitHub page, I downloaded the new version, keep up the good work :thumbsup:
Thanks Vortex.
A small bug found its way into the x64 version, I have since updated it to fix that, and uploaded it to github and here.
v1.0.0.2
https://github.com/mrfearless/MediaPlayer/releases/tag/1.0.0.2 (https://github.com/mrfearless/MediaPlayer/releases/tag/1.0.0.2)
- Clicking middle logo now toggles between play/pause (for audio playback).
- Removed double click option on main window.
- Moved F11 fullscreen toggle to accelerator table instead of WM_KEYDOWN.
- Fix menu activation not working when pressing Alt key + menu key (IsDialogMessage was the culprit).
- Fix for stepping past duration of media file with play speed increase and step 10.
- Fix for SeekBar position still showing after end of media when play speed is increased.
- Added EN, DE, FR, PL, IT languages using google translate (any mistakes let me know, or requests for languages).
- Added language menu item on menu bar and loading menus based on language selection.
- Made language specific versions of main menu.
- Moved context menu to language specific versions.
- Language setting saved in ini file, and applied when starting MediaPlayer.
- Moved strings (tooltips etc) to string table resource for language change processing.
great news!
quick quesiton: where do you keep the ini file? I didn't find it nearby the exe :)
I keep it in the AppData\Roaming\MediaPlayer folder, which is the recommended place for applications, that wont be affected by Windows complaining or blocking write access - like say if it was installed in Program Files\MediaPlayer and the ini file was located in the same folder. This way a user could place MediaPlayer.exe in one of those protected folders, and it should work fine, as the ini file is located elsewhere.
Located at:
C:\Users\<UserName>\AppData\Roaming\MediaPlayer\⏯ MediaPlayer.ini
Replace <UserName> with your own name, for example:
C:\Users\greenozon\AppData\Roaming\MediaPlayer\⏯ MediaPlayer.ini
thanks! nice
but why do you have that strange symbol - "⏯" in the path?
just curious
https://prnt.sc/1Wr43FDjDXqo (https://prnt.sc/1Wr43FDjDXqo)
also why 2 ini files?
The unicode glyph "⏯" is the play/pause button, used as a hint to someone looking at the .ini file that perhaps as it has a unicode symbol in the name, then perhaps the file also is unicode format.
If someone edits the ini file with notepad or other basic text editor, instead of say notepad++ (which has support for reading the unicode file and writing to it properly) then the BOM byte markers at the beginning of the file (FFh,FEh) will be destroyed, thus rendering the ini file useless as the wide versions of the GetPrivateProfileString, WritePrivateProfileString wont work.
Instead, I check the ini file for the BOM presence and if its not there the ini file gets re-created anew with the BOM - and thus will also delete anything that was in the unreadable non-unicode ini file.
The Ansi version of the ini file doesnt have the play/pause glyph, and is not used, unless you recompile MediaPlayer without the unicode support. It is a leftover from when the first version of MediaPlayer was not compiled with unicode support. You can safely delete it.
v1.0.0.3
https://github.com/mrfearless/MediaPlayer/releases/tag/1.0.0.3 (https://github.com/mrfearless/MediaPlayer/releases/tag/1.0.0.3)
- Limit play speed to between x0.125 and x4.
- Adjusted German translation (thanks to Biterider).
- Added Spanish language menu resources (thanks to Biterider).
- Added Spanish language tooltips (thanks to Biterider).
- Reduced size of resources with sorcery and dark magic.
- Step 10 now only works at normal play speed or below.
- MediaPlayer Engine restart on every media file load.
- Fix video freeze/engine kill when opening a media file with a different codec than previous media file (MediaPlayer Engine restart).
- The i (info/about) button tooltip shows media information for streams when a media file is loaded, otherwise it just displays "About MediaPlayer".
- i button tooltip prepends stream number if total streams > 1
- i button tooltip prepends stream selection (or [-]) if total streams > 2
Quote from: fearless on September 14, 2024, 03:27:34 AMReduced size of resources with sorcery and dark magic.
Now
that's the kind of programming we all want to hear about!
Just updated the x64 version in the post above, it had a tiny crash, so fixed that and re-uploaded it.
Never before had I seen the resources in such a cryptic format *.rtlc
it should be some new revolutionary SW magic, isnt' it? :)
x64 version works well, including drag&drop, thank you :eusa_clap:
I play music noninteractively with a script, using an old Media Player Classic from Windows XP, which can shut itself down when the song is over:
mplayerc.exe /Play /Close "aSong.mp3"
I'd like to replace mplayerc.exe with your MediaPlayer.exe but it doesn't seem to accept command-line arguments except for the file name.
Would it be possible to accept the /Close parameter please?
@vitsoft - Yes I will add that feature in the next version.
v1.0.0.4
https://github.com/mrfearless/MediaPlayer/releases/tag/1.0.0.4 (https://github.com/mrfearless/MediaPlayer/releases/tag/1.0.0.4)
- Added /close command line option to close MediaPlayer once play ends (request from vitsoft on masm32 forum).
- Also added /minimized, /fullscreen and /volume:xx command line options.
- Add Ukrainian language menu resource (thanks to greenozon).
- Add Ukrainian language tooltips (thanks to greenozon).
- Add Persian language menu resources (thanks to Yashar Mahmoudnia).
- Add Persian language tooltips (thanks to Yashar Mahmoudnia).
- Add Right To Left Layout for Persian language selection (thanks to Yashar Mahmoudnia for testing).
- Changed play rate from slower/faster menu and buttons to a playback speed submenu and a button with a dropdown menu.
- Added audio stream switching via a submenu and a dropdown menu (from volume mute toggle button) (request from makson5 on github).
- Playback speed and audio stream menus are dynamically created when a media item is loaded. Otherwise menu will show a menu item showing "Unavailable".
- i button tooltip displays filename as well now.
- Holding CTRL whilst clicking on Help->About or i button will open folder containing MediaPlayer's ini file.
- Fixed menu items width on menus still showing very long widths after clearing MRU list.
- String resources are now compressed with rtlc in a block and are loaded and decompressed per language selection on first access.
- Removed some string resources, icons and bitmaps that are now redundant.
fantastic progress, kudos!
Great job fearless, :thumbsup: :thumbsup:
Any clue how to play .mp4 files from the link via your player?
Link: https://www.elecard.com/videos (https://www.elecard.com/videos)
Thank you.
I tested those media files and others a few weeks ago and found the only ones I could get to play where:
City Hall - AV01
Ushaika river emb. - VP9
Tomsk State University - HEVC/H.265
Tomsk Theater Square - AVC/H264
The other ones did not work.
It may be that certain codecs are required to be installed to get those files to play, especially the HEVC/H.265 - I have the Microsoft HEVC codec installed, purchased from the Microsoft Store.
Hi fearless
Nice lean and efficient interface. Congrats :thumbsup:
Biterider
Quote from: fearless on September 26, 2024, 01:58:04 AMI have the Microsoft HEVC codec installed, purchased from the Microsoft Store.
0.99$ is the price for it?
https://apps.microsoft.com/detail/9nmzlz57r3t7?hl=en-US&gl=US (https://apps.microsoft.com/detail/9nmzlz57r3t7?hl=en-US&gl=US)
@Biterider - thanks. Yes I try to keep the UI simple and clean. Still a few more things that I want to add to it.
@greenozon - yes thats the one, cost me about €1. Also looking at the MS Store, I have the AV1 Video Extension installed as well.
v1.0.0.5
https://github.com/mrfearless/MediaPlayer/releases/tag/1.0.0.5 (https://github.com/mrfearless/MediaPlayer/releases/tag/1.0.0.5)
- Moved Spacebar play/pause toggle to accelerator table instead of WM_KEYDOWN.
- Set focus on media player video window on enter fullscreen to allow Escape key to exit fullscreen.
- Hide controls and cursor after 3 seconds in fullscreen mode, show controls and cursor on WM_MOUSEMOVE or exit of fullscreen.
- Controls do not hide if fullscreen and an audio track is loaded.