Page 2 of 3
Re: Windows Media Player Control
Posted: Tue Aug 18, 2020 9:59 am
by jak64
Hello,
thank you very much Justin, that's exactly what i wanted. That's very kind of you.
Have a nice day and above all, protect yourself well against this damn covid-19 virus ...
Re: Windows Media Player Control
Posted: Thu Apr 08, 2021 3:36 pm
by jak64
Hi,
Thank you.= for your program.
I would like to know the current time of the video that is playing to pause it when the video has played a certain number of seconds.
Can you help me ?
Thank you
Re: Windows Media Player Control
Posted: Sun Apr 11, 2021 12:05 pm
by Justin
Hi jak64,
i updated wmpTest.pb example, look at the getCurrentTime() procedure, there is a new entry in the menu Playback -> Get current time to activate it.
Re: Windows Media Player Control
Posted: Mon Apr 12, 2021 8:37 am
by dige
@Justin, thank you very much!! This is the first pb video player, that upscales video smoothly. Great!

Re: Windows Media Player Control
Posted: Mon Apr 12, 2021 4:14 pm
by minimy
Thanks a lot for the code!! work very nice. I was looking the code and trying using a button to go 10 seconds forward or back.
Can you help me please.
This is the procedure code
Code: Select all
Procedure setCurrentTime(pos.d)
Protected.IWMPControls controls
controls = wmp_GetControls(g_wmp)
If controls
If controls\put_currentPosition(@pos)
Debug pos
EndIf
EndIf
EndProcedure
What im doing bad?
Thank you very much and good job!
Re: Windows Media Player Control
Posted: Mon Apr 12, 2021 8:45 pm
by Justin
Hi minimy,
To go 10 secs forward i use this code, it works here:
Code: Select all
;Advances 10 seconds
Procedure forward()
Protected.IWMPControls controls
Protected.d currPos, inCrement
inCrement = 10
controls = wmp_GetControls(g_wmp)
If controls
controls\get_currentPosition(@currPos)
controls\put_currentPosition(currPos + inCrement)
EndIf
EndProcedure
I updated the example with it, to go backward decrease current pos by increment.
Re: Windows Media Player Control
Posted: Tue Apr 13, 2021 8:24 pm
by minimy
hey justin, thanks!! work very good.
Re: Windows Media Player Control
Posted: Mon Apr 26, 2021 3:46 pm
by jak64
Hello Justin,
I used your code, it's great.
When I use it, by changing the voice of the narrator in Windows, by putting a male voice, it is always the female voice that is used by the program.
Can you help me ?
Thank you
Re: Windows Media Player Control
Posted: Fri Apr 30, 2021 12:38 pm
by minimy
Hello Justin, im trying to change player volume, but i cant. I was trying with 'controls' but no work.
Can you help me with this or give me a clue
Thanks you very much!
Re: Windows Media Player Control - Captions!
Posted: Fri Apr 21, 2023 7:54 pm
by gregreen
I love the help here with WMP playback! Very helpful... But...
I need to display closed captions. I think I figured out how to load the .srt file with put_SAMIfileName(filename$) but how do I show the captions?
In the OpenMovie(m.s) procedure I added
Protected.IWMPClosedCaption core2 = wmp_GetCore(g_wmp)
and after the movie loaded: ( core\put_URL(file) )
I added:
core2\put_SAMIfileName(captionfilename$)
but how to make it show?
Thx to anyone who can point me in the right direction.
Re: Windows Media Player Control
Posted: Sat Apr 22, 2023 9:59 am
by Justin
I think that api only works for a control embebed in a HTML page, after using put_captioningId() with the id of the html element that shows the captions it works. There is an example on the windows sdk, this is the result:

You could propbably put the control in a webgadget and should work, but captions are displayed on a separate html element.
Re: Windows Media Player Control
Posted: Sat Apr 22, 2023 8:16 pm
by Justin
I tried with the webgadget and it actually worked, you can overlay the captions using a fixed positioned div.
Look at the captions.pb example on the first post with the ccsample.smi.
First load the ccsample.smi then load a movie.
This is the result:

Re: Windows Media Player Control
Posted: Sun Apr 23, 2023 2:00 am
by gregreen
Thank you Justin, that helps a lot!
Re: Windows Media Player Control
Posted: Sun Apr 23, 2023 12:50 pm
by Justin
Removed some typos from the example and added font proportional to the video height, looks better specially in fullscreen.
Simply changed "font-size: 4vh" in the .smi file, for fixed size use absolute units like pt, px.
Re: Windows Media Player Control
Posted: Mon Apr 24, 2023 8:35 am
by Kwai chang caine
Nice code
Works good here
Thanks for sharing
