CYCho Posted April 18, 2023 Share Posted April 18, 2023 (edited) I recently bumped into winmm.dll and found that it was the resource file of Sound.au3 UDF for all of its audio functions. I was interested in learning its video funtions as well to find if it could replace WMPlayer.OCX in my zPlayer. I have been a bit dissatisfied with WMPlayer object because it required a resizing process for a simple toggle between play and pause. This made the video to flicker and it was annoying. That was the reason for going back to the earlier version of zPlayer, knowing that WMPlayer object embedded in IE may not be supported by Windows in the near future. Edit: Attached is a media player based on wimm.dll. Much of the time I spent to make this player was on video playback. I foresee that this player will ultimately be the future version of my zPlayer. I had a lot of fun working on this. And I have to say thank you to many of forum members for helping me out when I had difficulties. If an error is found, I would expect that you would kindly let me know. If you download the latest version, hopefully the error would have been corrected already. (File updated on August 15, 2023) ==> Please visit here for the latest update. WINMM.DLL Media Player.zip Edited November 5, 2023 by CYCho Skeletor, ptrex, Shark007 and 1 other 4 zPlayer - A Small Audio and Video Player Time Sync + SystemTimeAdjustment Link to comment Share on other sites More sharing options...
Skeletor Posted April 18, 2023 Share Posted April 18, 2023 I ran into an issue where it could not play the file due to a codec issue, however instead of exting the program, rather return back to the main gui. Else $sMsg = $sFile & @CRLF & @CRLF $sMsg &= "This file cannot be loaded by this player. Please check if proper codec is installed." & @CRLF & @CRLF $sMsg &= "Do you want to try again?" Local $iRes = MsgBox(4, "Load error", $sMsg) If $iRes = 7 Then GUICtrlSetState($idFolder, $GUI_Enable) Return _WinAPI_SetWindowPos($vcGUI, $HWND_BOTTOM, Default, Default, Default, Default, BitOR($SWP_NOACTIVATE, $SWP_SHOWWINDOW, $SWP_NOMOVE, $SWP_NOSIZE )) Else GUICtrlSetState($idFile, $GUI_Enable) GUICtrlSetState($idFolder, $GUI_Enable) Return EndIf EndIf To me, when the program asks to try again, it will do so on the same file, when you state No, you telling it you want to load a different file. CYCho 1 Kind RegardsSkeletor "Coffee: my defense against going postal." Microsoft Office Splash Screen | Basic Notepad Program (Beginner) | Transparent Splash Screen | Full Screen UI Link to comment Share on other sites More sharing options...
Skeletor Posted April 18, 2023 Share Posted April 18, 2023 (edited) Also maybe you want to center the GUI Global $hGUI, $guiWidth = 320, $guiHeight = 60, $guiMsg, $idTitle, $idStreamed, $idSlider, $idLength, $idRandom, $idPlay Global $idPrevious, $idRepeat, $idNext, $idUp, $idDown, $idFile, $idFolder, $idNotes $hGUI = GUICreate("WINMM.DLL Media Player", $guiWidth, $guiHeight, (@DesktopWidth - $guiWidth) /2, (@DesktopHeight - $guiHeight) /2) ; Main GUI Edited April 18, 2023 by Skeletor CYCho 1 Kind RegardsSkeletor "Coffee: my defense against going postal." Microsoft Office Splash Screen | Basic Notepad Program (Beginner) | Transparent Splash Screen | Full Screen UI Link to comment Share on other sites More sharing options...
CYCho Posted April 18, 2023 Author Share Posted April 18, 2023 @Skeletor, Thanks for your comments. My code shows how we can interact with winmm.dll. You can make changes to suit your purpose. zPlayer - A Small Audio and Video Player Time Sync + SystemTimeAdjustment Link to comment Share on other sites More sharing options...
ptrex Posted April 18, 2023 Share Posted April 18, 2023 Maybe this can help CYCho 1 Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New Link to comment Share on other sites More sharing options...
CYCho Posted April 19, 2023 Author Share Posted April 19, 2023 (edited) I found that, in a long movie, the _Fullscreen() function needs some wait time between mciSendString("seek myMedia to " & $iPos) and mciSendString("play myMedia fullscreen"). Otherwise the fullscreen mode would start playing from position 0. Local $iPos = mciSendString("status myMedia position") mciSendString("stop myMedia") mciSendString("seek myMedia to " & $iPos) Sleep(100) mciSendString("play myMedia fullscreen") Edited April 19, 2023 by CYCho zPlayer - A Small Audio and Video Player Time Sync + SystemTimeAdjustment Link to comment Share on other sites More sharing options...
CYCho Posted May 12, 2023 Author Share Posted May 12, 2023 (edited) Recently @ioa747 showed us how to make a fullscreen GUI here. I asked myself if I could apply the code to my winmm.dll player. I found that, in order to do it, the video window should be opened in popup style to start with and make it a child of my own GUI so that I could resize and move the video window around. It was done and it works fine. But there is one difference between fullscreen mode offered by winmm.dll and the popup style fullscreen mode: the dll method keeps the aspect ratio of image, but the popup style ignores aspect ratio when in fullscreen. winmm.dll surrounds the image with black bars to keep the aspect ratio if the screen resolution is not exactly the same as the source's aspect ratio. I know that some people like it and some others don't. Anyway, I made a simple player with fullscreen mode in popup style and uploaded it in the first post of this topic. This version does not have a GUI except for the video and totally depends on hotkeys for basic operation. The script is amply commented, so I hope it is pretty easy to read. Edit: This feature was integrated into the original code. Edited May 16, 2023 by CYCho zPlayer - A Small Audio and Video Player Time Sync + SystemTimeAdjustment Link to comment Share on other sites More sharing options...
CYCho Posted May 16, 2023 Author Share Posted May 16, 2023 I just uploaded, in the first post of this topic, a revised version of this player. A lot of improvements were made in maximized and fullscreen mode of video window and in graphical controls overlayed on video window. I also corrected the error in calculation of total and streamed lengths: I found that some files have number of frames instead of milliseconds as the length. I had to forcefully set the timer format to milliseconds before obtaining the length. Shark007 1 zPlayer - A Small Audio and Video Player Time Sync + SystemTimeAdjustment Link to comment Share on other sites More sharing options...
Shark007 Posted May 17, 2023 Share Posted May 17, 2023 (edited) Thanks for sharing! Using the script in the 1st post tagged with, (Updated at 07:30 of May 31, 2023 UTC) In this release, I have not added any GUI scaling at all. I opted to just do some subtle changes to the main GUI only to make it more presentable with all Windows Display Scaling presentations. I tested it with 100 % all the way through to 225 % scaling. @CYCho, I suggest you review the subtle changes I have made in this release and consider adopting them into your own. Attachment removed. Edited May 31, 2023 by Shark007 updated to sync with 1st post. CYCho 1 Link to comment Share on other sites More sharing options...
CYCho Posted May 17, 2023 Author Share Posted May 17, 2023 The progress bar has been revised to make changing streaming positions much smoother. I used GUICtrlCreateSlider function before, and the performance was less than satisfactory. So I made my own. zPlayer - A Small Audio and Video Player Time Sync + SystemTimeAdjustment Link to comment Share on other sites More sharing options...
CYCho Posted May 24, 2023 Author Share Posted May 24, 2023 (edited) I am just a user of video files and do not have any expertise on how they are made or how they work. I found that some video files would not change their aspect ratios when I change the dimensions. According to my limited experience, mp4, webm and flv files usually stretch to whatever dimension I dictate, but mkv and avi files stick to their original aspect ratios and fill the remaining spaces with black or white background colors. Sometimes they fill the extra spaces with parts of their own images. The behaviour was unpredictable, causing an unexpected result when I maximize the window or turn it into a fullscreen. Now I found a solution. As you can see in my code, the video window($hVideo) is created by winmm.dll in popup style and I dock the video to my own GUI($hVideoGUI). When I change the positions of $hVideoGUI, the code changes the positions of $hVideo so that the $hVideo fills the entire client area of $hVideoGUI. By moving $hVideo to a 0-width and 0-height window before moving it to a desired size, I could unequivocally fill the extra spaces with black background. Edited May 24, 2023 by CYCho zPlayer - A Small Audio and Video Player Time Sync + SystemTimeAdjustment Link to comment Share on other sites More sharing options...
Shark007 Posted May 24, 2023 Share Posted May 24, 2023 (edited) On 5/24/2023 at 7:26 AM, CYCho said: I am just a user of video files <snip> The issues that you are currently experiencing, such as mciSendString("play myMedia fullscreen"), are caused by the codecs you have installed on your system for playback. Klite is only useful if you also use their included player for all of your playback. If you want to use a Windows supplied player, you'll need to use a codec package specifically designed for Windows players. If you have used Klites GUI to select the 64bit WMP as default, have a look at the file wmsetup.log found inside the Windows temp folder. That file is loaded with errors caused by Klite. My software leaves that file clean and error free. I distribute a portable codec package (no installer) with a highly configurable GUI written in AutoIt that defaults to using LAV filters and the 64bit WMP but I also include very useful alternative codecs produced by the MPC-BE Dev Team (extremely active development) because their codecs do not cause any issues for WMP or for winmm.dll. Just search my username and get the ADVANCED package. Use Launcher64.exe to get it set up. It will auto-remove Klite for you if it is still installed. Next, use the AutoUpdate feature found on the Help TAB because I have several unpublished updates specifically for use with winmm.dll that will be installed by the update feature. After AutoUpdate completes and no further updates are available, go have a look on the Misc TAB and checkout the checkbox [x] Windows MCI player. That checkbox uses winmm.dl. Hover that checkbox for up to date info! Plenty of tooltips to help you learn the GUI and of particular interest, hover the WMP suggested settings checkbox for pertinent information. I rarely promote my own software in public forums but you needed my help. Edited June 18, 2023 by Shark007 editted for clarity CYCho 1 Link to comment Share on other sites More sharing options...
CYCho Posted May 24, 2023 Author Share Posted May 24, 2023 (edited) @Shark007, I just visited your website. You are just great. You are gving me a new arena to play in. Thanks a lot. Edited May 24, 2023 by CYCho zPlayer - A Small Audio and Video Player Time Sync + SystemTimeAdjustment Link to comment Share on other sites More sharing options...
CYCho Posted May 28, 2023 Author Share Posted May 28, 2023 I modified the code so that the aspect ratio of the source file is kept throughout, including when the window is maximized or stretched to fullscreen. zPlayer - A Small Audio and Video Player Time Sync + SystemTimeAdjustment Link to comment Share on other sites More sharing options...
Shark007 Posted May 28, 2023 Share Posted May 28, 2023 This is coming along quite nicely. Thanks once again for sharing your work. Link to comment Share on other sites More sharing options...
CYCho Posted May 30, 2023 Author Share Posted May 30, 2023 (edited) It was my intention to make the main GUI as small as possible. One problem with it is that the slider is very short, too. A short slider is OK for most of audio files, but the movement of shuttlecock is too slow for a long video. So I made the video control in the video window as wide as the video image. Edited May 30, 2023 by CYCho zPlayer - A Small Audio and Video Player Time Sync + SystemTimeAdjustment Link to comment Share on other sites More sharing options...
CYCho Posted May 31, 2023 Author Share Posted May 31, 2023 (edited) On 5/17/2023 at 6:23 PM, Shark007 said: @CYCho, I suggest you review the subtle changes I have made in this release and consider adopting them into your own. Thank you for your testing the code and making a valuable suggestion. I adopted your suggestion and uploaded the revised code. I also made relevant changes in _Play(), _Pause(), _Previous() and _Next() functions. Thanks again for sparing time on this. Edited May 31, 2023 by CYCho zPlayer - A Small Audio and Video Player Time Sync + SystemTimeAdjustment Link to comment Share on other sites More sharing options...
Shark007 Posted May 31, 2023 Share Posted May 31, 2023 After reviewing and testing the release marked (Updated at 12:20 of May 31, 2023 UTC) Perfection. CYCho 1 Link to comment Share on other sites More sharing options...
Shark007 Posted June 2, 2023 Share Posted June 2, 2023 (edited) some code to share with you. Disable sleep during playback _WinAPI_SetThreadExecutionState(BitOR($ES_DISPLAY_REQUIRED, $ES_CONTINUOUS, $ES_SYSTEM_REQUIRED, $ES_AWAYMODE_REQUIRED)) re-enable user sleep settings _WinAPI_SetThreadExecutionState($ES_CONTINUOUS) Edited June 2, 2023 by Shark007 Link to comment Share on other sites More sharing options...
CYCho Posted June 2, 2023 Author Share Posted June 2, 2023 (edited) 46 minutes ago, Shark007 said: Disable sleep during playback I never knew this function existed and it never was a problem for me because I have no screen saver nor system sleep set. Now that you mentioned it, I think it would be good idea to incorporate these codes. Thanks. Edit: @Shark007, Would it be OK to use _WinAPI_SetThreadExecutionState(BitOR($ES_DISPLAY_REQUIRED, $ES_CONTINUOUS, $ES_SYSTEM_REQUIRED, $ES_AWAYMODE_REQUIRED)) everytime starting to play a new file and use _WinAPI_SetThreadExecutionState($ES_CONTINUOUS) when exiting the program? Or, would this latter code be recommended when the payback is paused as well? Edited June 2, 2023 by CYCho zPlayer - A Small Audio and Video Player Time Sync + SystemTimeAdjustment Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now