Jump to content

zPlayer - a small audio and video player based on winmm.dll

   (1 review)

5 Screenshots

About This File

This file is the source code for zPlayer, which is a stand-alone, simple, intuitive and easy-to-use, yet fully functional media player.  I made this to suit my purpose and you can tweak it to your taste.  zPlayer is powered by winmm.dll which is an integral part of Windows. 

This player has the following features:

- No 3rd party dependencies. This player is made with Windows components and standard AutoIt UDFs only
- Play back all formats of digital media files as far as proper codecs are installed in the computer
- Video window is independent of other windows. Minimal GUI for music
- Can load files, folders or an audio CD for playback
- Playlists are automatically generated in sorted and shuffled orders and saved in the folder
- Playlist is hidden by default, availbable when desired
- Context menus available:  Play this file,  File properties, Search internet, Go to this folder, Remove from playlist
- A double-click on any item plays that item
- Search strings in the playlist
- Forward, backward, pause, change folder
- A-B repeat, current file repeat and multiple-file repeat functions
- Increase/decrease/mute program sound volume. Synchronized with Windows Volume Mixer
- Save play-back environment when terminating a session and resume that environment in the next session
- 'Resume playback' option for a file left off in the middle of playback. Audio fade-in when playback is resumed
- Hotkeys available for most of the functions
- Very small footprint: very low CPU and memory usage

If you find an error, please download the latest version as most probably the error may have been corrected already. Otherwise I would appreciate it very much if you could kindly let me know.

Note: zPlayer is the name I used when I introduced the early version of this player in my blog back in early 2009 and, therefore, has nothing to do with the mobile media player of the same name which started marketing in 2015.


Version - April 8, 2024
1. Fixed: The column header text of playlist listview could be incorrect when a certain sequence of actions took place.

Version - March 27, 2024
1. Fixed: There was a typo in _LoadFiles() function resulting in open failure when "Load File" button is selected.

Version - March 26, 2024
1. Changed: If the player could not open a file or a file which the player tried to open did not exist, the player exited after a warning message. Now the player moves to the next item in the playlist after a warning message.

Version - March 18, 2024
1. Fixed: A lot of rearrangement of existing code was necessary to adopt CD playback and this caused a misbehaviour in an area which worked well previously. Now all functions for media files associated with playlist, such as "resume playback", are available to CD tracks as well.
2. Added: _VolumeSync() adlib function to synchronize volume and mute operations of zPlayer with those of Windows Volume Mixer. User can change the volume or mute the sound either in zPlayer or in Windows Volume Mixer. ISimpleAudioVolume interface was used for this purpose.
3. Changed: Once the program sound was muted, the muted state persisted even when the user loaded another folder. Now the muted state is maintained only when zPlayer moves to the next file in a looping process. When the user selects another file or folder, it is unmuted.
4. Changed: Got rid of "Reload" button in playlist window. It had been added in Version to handle random flickering phenomenon. This phenomenon was fixed in Version, and it never happened ever since.

Version - March 5, 2024
1. Changed: When an audio CD is played, zPlayer cannot save the playlist on the CD. So all the player features relying on playlist could not be appiled to CD. Program was changed to save CD playlist in zPlayer.ini file which resides in the script directory. Now zPlayer can resume the playing environment when you move to the CD drive including "resume playback" option. The program has a simple code to verify if the currently mounted CD is the same as the one played last time when the playlist was saved. The relatively small number of tracks on a CD made this possible. This change was more complicated than I first thought, so much so that I decided to call this release a Beta version. If I don't find any major bug during the next couple of weeks, I will make it a formal release. Your feedback is most welcome.
2. Fixed: I had used only "mciSendString" function of winmm.dll for all audio and video playback. It was OK until the addition of CD playback feature. "mciSendString" did not have suitable command strings to control audio volume level for CD playback. This problem was solved by using "waveOutSetVolume" function of the same dll for all audio volume controls of zPlayer.
3. Fixed: zPlayer would not loop to the first track after playing the last track in some CDs.

Version - February 8, 2024
1. Fixed: Setting the file numbers for multi-file repeat function could result in error in certain cases.
2. Fixed: Moving to previous file, via Ctrl+Alt+Left Arrow or ◀ icon, failed while multi-file repeat function was in effect if the immediate previous file was a non-repeat file.

Version - February 5, 2024
1. Added: Support for audio CD. You can load an entire CD via 'Load Folder' menu, or one or more tracks via 'Load File' menu.
2. Fixed: There was a problem in getting file properties when individual files in a root directory were loaded via 'Load File' menu.

Version - Janyary 25, 2024
1. Fixed: Brief, but unintended, flashing of video controls in the center of video image occurred at the beginning of video if the mouse pointer happened to be at the bottom part of upcoming video window.

Version - January 14, 2024
1. Fixed: When the player was playing a video file in fullscreen mode and moved on to another video file, the next file failed to inherit the fullscreen mode. This behaviour was evident when a music file was in between the two video files.

Version - January 11, 2024
1. Fixed: The flickering of listview control in playlist window. Since this happened randomly and quite rarely for an unknown reason, I have no way to confirm that the problem was really fixed. Even though I could not find any clue in AutoIt Help, I suspected that the mere existence of control IDs for context menu could randomly cause the problem. In order to prevent pile-up of expired context menus, I previously had a routine to delete existing menu items just before creating a new set. But now the menu items are deleted immediately after the close of context menu popup. I have not noticed any incidence of flickering for several days now. I hope the problem was fixed.
2. Fixed: Video image intermittently failed to stretch to fullscreen while in paused mode.
3. Added: A dialog box for confirmation of removing an item from playlist when 'Remove from playlist' context menu is selected.
4. Added: An adlib function to check the position and size of video window at 500ms interval. The video control is resized only if there was a change in the video position or size. Previously several functions, such as _FullScreen() and WM_MOVE(), called the resize funtion on their own, thus sometimes duplicating the resize function calls.
5. Changed: If the player moves on to a new file while the file property window is open, the file properties will be updated with those of the new file.
6. Changed: When file property function or internet search function is called, hotkeys and context menus act differently now. Hotkeys always work on current file, while context menus always work on any item selected in the playlist.

Version - January 8, 2024
1. Improved: Substantially reduced time for obtaining file properties. It was done by reducing the number of GetDetailsOf() function calls from all available column numbers(>320) to 25 essential ones. Most file types take less than 500 milliseconds per file, while a large mp4 file may take more than 1.5 seconds.
2. Added: "File Property Column Numbers" key in zPlayer.ini file. The default values are GetDetailsOf() column numbers valid for recent Windows versions. If your OS support different numbers, you must change the ini file key value to suit your OS.
3. Added: "Reload" button in the playlist. I found rare instances of playlist flickering after a context menu is executed. The flickers can be stopped by reloading the playlist.
4. Added: "Esc" hotkey to turn video fullscreen off. This hotkey is effective only when video is in fullscreen mode.
5. Changed: When GUIs are set to their default positions by Ctrl+Alt+w hotkey, larger GUIs are activated first so that smaller ones become visible on top of larger ones.

Version - December 26, 2023
1. Item 4 of changes made in Version was a wrong choice. Out of more than 10,000 media files I have, only 64 had problems, and this did not justify the extra time spent on obtaining the media length by a different method. The problematic files were all from one folder which contained files that I collected from unknown sources about 20 years ago and all of them had non-standard bitrates such as 201. I thought I had better throw them away.  So I reverted to shell.application method for initial process of making a new playlist. Instead, the program will check the length using winmm.dll command string while the file is actually playing and dynamically update the playlist if necessay.

Version - December 24, 2023
1. Added GUICtrlSetState($idFolder, $GUI_FOCUS) here and there to make "Change Folder" button of main GUI to get focus upon closure of any other GUI.
2. Fixed: Shuffle/Sort button in main GUI could get focused only by tab key, not by arrow key. Now arrow keys can also move the focus to and from Shuffle/Sort button.
3. Fixed: When the Rescan button in playlist window is clicked, the non-used playlist (e.g. zPlaylist-Shuffled.txt when zPlaylist.txt was being played back) was created with Length column empty.
4. Changed: The method of obtaining the media lengths in the playlist was changed from shell.application object to winmm.dll command string. Shell.application is 2 to 3 times faster but it produced wrong (mostly shorter) lengths for some media files for an unknown reason.

Version - December 18, 2023
1. Fixed: 'Resume Playback' position was not saved correctly when playlist was unloaded by clicking Unload button or by pressing Ctrl+Alt+u.
2. Fixed: Marquee adlib function for title display in the main GUI, once registered, was not properly unregistered even when the length of title did not require the function.

Version - December 11, 2023
1. Corrected: An error occurred when video fullscreen was turned on by F11 hotkey while video window was not visible. Now F11 hotkey is valid only when the center point of video is visible.

Version - November 22, 2023
1. Corrected: An error occurred when the following sequence of actions took place:
    (1) While a video file is playing, click the taskbar icon of zPlayer and minimize all GUIs.
    (2) While all GUIs are minimized, the player moves on to the next file, which happens to be an audio file.
    (3) While an audio file is playing, click the taskbar icon of zPlayer again.
    (4) I would expect to see the main GUI only. But an empty $hVideoGUI remained on the screen as well.
2. Changed the function of Ctrl+Alt+w hotkey. Now it will bring up all open GUIs to the foreground and move them to their default positions.

Version - November 14, 2023
1. Corrected: Error when "Find Next" button is clicked in the playlist window. There must have been some foul-up in making changes somewhere else.

Version - November 3, 2023
1. Corrected: The closing parenthesis missing for the folder name in the playlist column header when a root folder of a drive is loaded.
2. Corrected: A-B repeat and multi-file repeat setup windows not working as intended when the video window is in maximized or fullscreen mode.
3. Eliminated redundant process of getting the total length of a playlist when the playlist is shuffled or sorted. Previously, _GetLength() function was called as a part of _PlaylistLoad() function , but now it is called separately as needed.
4. Changed the term "shuttle" to "progress bar" and "streaming" to "playback" to alleviate any confusion. The small rectangular progress bar moves along the slider to indicate current media position.

Version - October 10, 2023
1. Corrected the problem of total media length of the playlist not showing after removal of an item from the playlist by way of context menu.
2. Revised Help file to show file types which can be played back by winmm.dll without installing additional codecs.

Version - September 28, 2023
1. Corrected the problem of Windows Defender incorrectly detecting zPlayer.exe as malware. Through comparison of codes, I found that using WinSetState function to hide video control GUI caused the false detection. The problem was solved by using GUISetState instead of WinSetState.

Version - September 26, 2023
1. A minor error was found and corrected. When I clicked zPlayer icon on the taskbar to hide all open GUIs, the video control on video window, which is almost transparent, remained on the screen.
2. Some spelling mistakes in Help window were corrected.

Version - September 22, 2023
1. When a folder is selected, and if the folder has media files in both the top-level and sub-level folders, an option will be given to include or exclude the files in sub-level folders. If a playlist file already exists in the folder, this option will be skipped. If the user wants to change the scope of inclusion, the playlist should be deleted before selecting that folder, or the Rescan button clicked in playlist window.
2. If the mouse moves over zPlayer icon on the Windows taskbar, the current file name will appear in a tooltip. Clicking this icon will hide or show all open GUIs.

Version - September 12, 2023
1. Made changes here and there including some major ones, to accomodate virtual listview, which was not as a simple task as it seemed at first.

Version - September 09, 2023
1. Changed the method of adding items to playlist from _GUIListView_AddArray() to virtual listview, which is much faster and allows colored background without flickering.
2. Added multi-file repeat function, which can be set-up in a little GUI invoked by clicking the total length label at the right side of progress bar. As I listen to a large playlist, sometimes I feel like repeating several items, Beethoven's Symphony 9, movements 1 to 4, for example, out of a collection of several hundred classical music titles. In order to visualize this set-up, the player displays selected items in pink background.

Version (August 27, 2023) and Version (August 29, 2023)
1. Added Ctrl+Alt+s hotkey to perform shuffle/sort functions. - Version
2. Fixed error in the process of removing an item from the playlist, an aftermath of adding length column in the playlist. - Version
3. Added a column to playlist to show length of each file. The total length of the playlist is also displayed in the file name column header. - Version
Note: When you load a folder for the first time, the player will get media lengths in the background and fill the Length column of the playlist. During this time, media will keep playing but Shuffle/Sort, Load/Unload, Rescan and Reshuffle functions will be disabled and media title will be displayed in red color. This process will take about 15 seconds for a folder containing 500 media files. Playlists created by the former versions are compatible with this version, but it is recommended that all previous playlists be deleted before running this version. If you have a manually-made playlist, you may keep it.

Version - August 14, 2023
1. Added $SS_NOPREFIX in the style of title display label, so that "&" symbol contained in the file name is displayed correctly.
2. Improved A-B repeat set-up and cancel procedures.

Version - August 7, 2023
1. A new hotkey(Ctrl+Alt+t) was defined to set "Always On Top" attribute of main GUI on or off.
2. Provided for the possibility of A-P Repeat set-up window to be positioned on the left side of main GUI, in case the user has moved the main GUI to the right side of the screen.

Version - August 4, 2023
1. Changed the color of media control icons(Unicode characters) in main GUI from default black to gray. The black icons looked too conspicuous compared to other components nearby.
2. Corrected a minor error in A-B repeat set-up function where starting and ending positions entered in seconds instead of mm:ss format failed to work correctly.
3. Corrected errors in re-creation of playlists after 'Reshuffle' or 'Remove from playlist' operations.
4. Added a procedure to ensure the integrity of existing zPlaylist.txt and zPlaylist-Shuffled.txt files when loading a folder.

Version - July 29, 2023
1. Changed writing mode of files from UTF-8 to UTF-16 to handle double-byte characters correctly.
2. Added a function to accommodate manually-made playlist which contains files from different folders.
3. Added some details about playlist in Help contents and changed zPlayer_ReadMe file format from text to PDF.

Version - July 23, 2023
1. Changed playback engine from IE-embdded WMPlayer.ocx to Winmm.dll.
2. Reduced the main GUI to a bare minimum and the playlist window is hidden by default.
3. To cope with the reduced GUI, the name of current file flows in marquee style.
4. Added an option to load files instead of folders.
5. Implemented A-B repeat function.
6. Implemented audio fade-in when resuming playback from the last streamed position.
7. Changed default position of video window from right upper corner of screen to center.
8. The media control in video window is hidden by default and becomes visible when mouse hovers over the bottom of the window.
9. The length of progress bar in video window is as long as the width of the window.
10. Eliminated file installs and used unicode characters instead for all media controls.
11. Unless the video window is maximized or stretched to fullscreen, its size is forcefully adjusted to keep the source aspect ratio.


Edited by CYCho

What's New in Version


Version - April 10, 2024
1. Fixed: Support for custom-made playlist was prone to error.

The hash value of compiled exe file, as attached hereto, is SHA256: afe6abedfde51c0a37329e2636c60053aee3d307c76beb38460ee52072ade836.
As of this release, the compiled file is flagged by Windows Defender as malicious. I have submitted the file to Microsoft for removal of this file from detection list.

Exit: As of April 19, 2024, Windows Defender, with its latest Security Intelligence Update, does not flag the compiled exe file as malicious.

User Feedback

You may only provide a review once you have downloaded the file.

Works well, is super fast to open, and is very responsive. A great replacement to Windows Media player if you're using the same directory for your tasks.

Link to review
  • Create New...