MattyD Posted Thursday at 08:45 PM Posted Thursday at 08:45 PM yeah no worries.. How's this? You should hopefully be able to get/set the property in both its string and numeric forms. Func _MediaPlayer_GetStretch($iMPIdx, $bAsString = False) Local $vStretch If $iMPIdx < 1 Or $iMPIdx >= UBound($__g_apPlayers) Then Return False _WinRT_SwitchInterface($__g_apMPElements[$iMPIdx], $sIID_IMediaPlayerElement) If Not @error Then $vStretch = IMediaPlayerElement_GetStretch($__g_apMPElements[$iMPIdx]) If @error Then Return SetError(@error, @extended, -1) If $bAsString Then $vStretch = _WinRT_GetEnum($mStretch, $vStretch) Return $vStretch EndFunc Func _MediaPlayer_SetStretch($iMPIdx, $vStretch) If $iMPIdx < 1 Or $iMPIdx >= UBound($__g_apPlayers) Then Return False _WinRT_SwitchInterface($__g_apMPElements[$iMPIdx], $sIID_IMediaPlayerElement) If Not @error Then If IsString($vStretch) Then $vStretch = _WinRT_GetEnum($mStretch, $vStretch) IMediaPlayerElement_SetStretch($__g_apMPElements[$iMPIdx], $vStretch) EndIf Return SetError(@error, @extended, @error = $S_OK) EndFunc ;~ Field : None = 0 (Microsoft.UI.Xaml.Media.Stretch) ;~ Field : Fill = 1 (Microsoft.UI.Xaml.Media.Stretch) ;~ Field : Uniform = 2 (Microsoft.UI.Xaml.Media.Stretch) ;~ Field : UniformToFill = 3 (Microsoft.UI.Xaml.Media.Stretch) _MediaPlayer_SetStretch($hPlayer1, "UniformToFill") ConsoleWrite("stretch = " & _MediaPlayer_GetStretch($hPlayer1, True) & @CRLF) WildByDesign 1
argumentum Posted Thursday at 09:12 PM Posted Thursday at 09:12 PM Stretching it would look ugly. I was thinking of proportional by... , any means. WildByDesign 1 Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting.
MattyD Posted Thursday at 09:56 PM Posted Thursday at 09:56 PM yep, so it looks like none is native res, cropped to size of player. fill is stretched/squished to player size Uniform is pillar/letter box UniformToFill will maintain aspect and crop whatever doesn't fit. WildByDesign 1
WildByDesign Posted Thursday at 10:05 PM Author Posted Thursday at 10:05 PM 1 hour ago, MattyD said: You should hopefully be able to get/set the property in both its string and numeric forms. Thank you so much for this, Matty. Being able to use string is a bonus as well since I may very well make it so that the user can choose which stretch option in the config file. I haven't had a chance to play around with it much yet since I just got my butt kicked by Au3Stripper for around 2 hours. I finally won that fight! 🤪 MattyD 1
WildByDesign Posted Thursday at 10:08 PM Author Posted Thursday at 10:08 PM 54 minutes ago, argumentum said: Stretching it would look ugly. I was thinking of proportional by... , any means. I'm thinking UniformToFill might be best for times when aspect ratio does not match. I can actually do some logic where the stretch property depends on the aspect ratio of each monitor in comparison to the video file. I may still do volume control with hot keys or something but I'm not even sure if sound makes sense on live wallpapers or not.
argumentum Posted Thursday at 10:35 PM Posted Thursday at 10:35 PM 25 minutes ago, WildByDesign said: not even sure if sound makes sense on live wallpapers or not. No it wouldn't. ( nor a live wallpaper ) My screen is always with all kinds of windows open. Never get to see the wallpaper 🤷♂️ WildByDesign and SOLVE-SMART 1 1 Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting.
WildByDesign Posted Friday at 12:10 AM Author Posted Friday at 12:10 AM 3 hours ago, MattyD said: You should hopefully be able to get/set the property in both its string and numeric forms. I got a chance to test the functions now and they work beautifully. It's really interesting getting to change it and see how different videos of other aspect ratios behave. Thanks again. MattyD 1
WildByDesign Posted Friday at 06:10 PM Author Posted Friday at 06:10 PM (edited) I updated the script in the first post. On a per-monitor basis, I made it so that if the monitor aspect ratio is equal to the aspect ratio for the video, it will use the default Uniform value. If the aspect ratio is not equal, it will set the UniformToFill value. This should deal with the issue of black bars (letterboxing) being added on the top/bottom or sides of the video. It will simply crop some parts of the video and not stretch it. I also fixed an issue where the screen would be black briefly before the video started playing. I just had to ensure that the video was fully loaded before showing the GUI(s). @argumentum I know that you are not a fan of moving wallpapers, but if you have a moment, would you be willing to test this latest script? The reason why I ask is because your ultrawide secondary monitor is a different aspect ratio and therefore a good example to test whether or not UniformToFill is the better option for mismatching aspect ratios between video and monitor. I think that it makes sense but I don't have another monitor that is a different ratio. EDIT: And I also made sure that the Start button (and Win key) trigger should play the video on any OS language. It was likely only working with English OS before. Edited Friday at 06:15 PM by WildByDesign argumentum and SOLVE-SMART 2
argumentum Posted Friday at 09:33 PM Posted Friday at 09:33 PM Perfect, beautiful, awesome. It all shows and works as advertised 💯 SOLVE-SMART and WildByDesign 1 1 Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting.
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