I try to use WMPlayer.OCX and play loop for better solution than GIF file. But it has black frame before start playing the vdo.
How to fix black frame as vdo clip?
Thanks in advance for any help and suggestion.
![Image](https://s3.gifyu.com/images/ezgif.com-video-to-gif437fcf73e86a6c60.gif)
ukoenig wrote:Dutch,
I noticed a short loading-time during the loops
here is a free Video-editor / cutter to check the frames
at the beginning and end.
32 and 64 bit-version
https://www.fosshub.com/Avidemux.html
regards
Uwe
Code: Select all | Expand
if oActiveX :controls:currentPosition > oActiveX :currentMedia:duration - 0.01
oActiveX :controls:currentPosition := 0
endif
AntoninoP wrote:I tryied too, and the only solution I found is do manually the loop:Code: Select all | Expand
if oActiveX :controls:currentPosition > oActiveX :currentMedia:duration - 0.01
oActiveX :controls:currentPosition := 0
endif
https://stackoverflow.com/questions/25938149/windows-media-player-seamless-looping-of-video
As they suggest you can create a timer to do this check.
Code: Select all | Expand
DEFINE TIMER oTimer INTERVAL 100 ACTION (if( oActiveX :controls:currentPosition > oActiveX :currentMedia:duration - 0.01, (oActiveX :controls:currentPosition := 0.01), if(oActiveX :controls:currentPosition > 0.1, oActiveX :Show() , ) ))
Code: Select all | Expand
oActiveX = TActiveX():New( oDlg, "WMPlayer.OCX", nTop, nLeft, nWidth, nHeight )
oActiveX :Hide()
dutch wrote:Dear AntoninoP and Uwe,
I can fix it now.
- Show in TIMERCode: Select all | Expand
DEFINE TIMER oTimer INTERVAL 100 ACTION (if( oActiveX :controls:currentPosition > oActiveX :currentMedia:duration - 0.01, (oActiveX :controls:currentPosition := 0.01), if(oActiveX :controls:currentPosition > 0.1, oActiveX :Show() , ) ))
- Hide() at DIALOG INITCode: Select all | Expand
oActiveX = TActiveX():New( oDlg, "WMPlayer.OCX", nTop, nLeft, nWidth, nHeight )
oActiveX :Hide()
ukoenig wrote:Dutch,
I'm just thinking about a possible dialog fade-in-effect
for the video that will cover the first frames
just a idea not tested yet.
regards
Uwe
Code: Select all | Expand
oActiveX:Settings:AutoStart := .T.
bOldError := ERRORBLOCK( { | e | BREAK( e ) } )
BEGIN SEQUENCE
oActiveX:URL := cPlayFile
Code: Select all | Expand
oActiveX:Settings:AutoStart := .F.
bOldError := ERRORBLOCK( { | e | BREAK( e ) } )
BEGIN SEQUENCE
oActiveX:URL := cPlayFile
oActiveX:controls:currentPosition := nFirstFrame
oActiveX:Controls:Play()