Page 1 of 1

VIDEO

Posted: Fri Oct 11, 2019 5:36 am
by MIGUELON
Hi everyone, I need to play a VIDEO
Any idea how to do it
Thank you

Miguel

Re: VIDEO

Posted: Fri Oct 11, 2019 8:49 am
by Auge_Ohr
MIGUELON wrote:Hi everyone, I need to play a VIDEO
Any idea how to do it
use XppFd,EXE (Formdesigner) and DragDrop WMP (Windows Media Player) Control to Forum.

Code: Select all

   bOldError := ERRORBLOCK( { | e | BREAK( e ) } )
   BEGIN SEQUENCE
      // Create an ActiveX instance in the Form client area, and wrap it in an Xbase++ class instance
      oWMP := XBPACTIVEXCONTROL() :new( oAnzeig,, { 0, 0 - nHidepanel }, aSize )
      // oWMP:CLSID     := "WMPlayer.OCX.7"
      oWMP:CLSID := "{6BF52A52-394A-11D3-B153-00C04F79FAA6}"
      oWMP:create()
   RECOVER USING oError
      IF oError:subCode == 6500
         MSGBOX( "Error creating ActiveX Control." + CRLF + ;
                 "Please make sure M$ Mediaplayer 9 Componends" + CRLF + ;
                 "WMP.OCX are installed on your computer.", ;
                 "WMPlayer Sample" )

         oWMP := NIL
         QUIT
      ENDIF
   END SEQUENCE
   ERRORBLOCK( bOldError )
to load File and Play

Code: Select all

   bOldError := ERRORBLOCK( { | e | BREAK( e ) } )
   BEGIN SEQUENCE
        oWMP:URL := cPlayFile
   RECOVER           
        ERRORBLOCK( bOldError )
        MSGBOX( cPathFile + " coud not be opend", "load URL" )
         oWMP:Controls:stop()
         RETURN
   END SEQUENCE
   ERRORBLOCK( bOldError )

Re: VIDEO

Posted: Sat Oct 12, 2019 12:37 am
by MIGUELON
Thank you very much Jimmy, I thought Roger had some function to visualize Video like the one he has to see images "DC_BitMapDraw"
But your code is also very useful to me. :clap:

Thank you
Michael

Re: VIDEO

Posted: Mon Oct 14, 2019 9:44 am
by rdonnay
What kind of video do you have? Is it a MP4 file?

I haven't written any samples for that but it's very easy using DCACTIVEXCONTROL.

Jimmy's sample doesn't show how to do it using eXpress++ dialogs.

Re: VIDEO

Posted: Tue Oct 15, 2019 9:23 am
by MIGUELON
Hi Roger that was my question, the type of video file can be mp4.
But I would like to play this video with the eXpress dialogs.
The idea is to play several videos that are in a folder to advertise on a second screen.
For now I have done it with "DC_BitMapDraw" teaching images but I want to change and be able to teach MP4 videos

Thank you
Michael

Re: VIDEO

Posted: Tue Oct 15, 2019 10:00 am
by Auge_Ohr
hi,
MIGUELON wrote:Hi Roger that was my question, the type of video file can be mp4.
But I would like to play this video with the eXpress dialogs.
i guess it is not a Problem to place a ActiveX into eXpress++ dialogs ... just change the Parent.

MP4 is just a "Container" like AVI or MKV but it does not say anything about Video Codec which is need to decode.

Windows Media Player is limited in Audio/Video Codec. it can happen that WMP say : no Codec

so you need a "Codec Pack". i recommend FFDshow
https://sourceforge.net/projects/ffdshow-tryout/
FFDshow use Directshow and you can get Stream and "manipulate" it.

M$ don't want Directshow which do not support DRM so there own M$ Codec have highest "Merit".
you need something like Win7DSFilterTweaker.exe (work also unter Windows 10) to change to FFDshow and "override" M$ "Merit"
http://www.codecguide.com/windows7_pref ... weaker.htm

now we get Video but no Audio ... hm
it is while "Mixer" get no Direct-Audio Stream. we have to use MatroskaSplitter.exe to split Stream.
https://haali.su/mkv/

now you can play almost all Type of Video where Original WMP have fail before.
MIGUELON wrote: The idea is to play several videos that are in a folder to advertise on a second screen.
For now I have done it with "DC_BitMapDraw" teaching images but I want to change and be able to teach MP4 videos
to play more than 1 Video it need "more"

you need to recognize when Video "End" so you have to look at

Code: Select all

::oWMP:currentMedia:Duration
and compare it with

Code: Select all

 ::oWMP:Controls:CurrentPosition
as you see this are Property so it will not "fire" Event in this case
but there are Events like "EndOfStream", "PositionChange" or "DisplayModeChange" so it depend on what you want to do.

---

as i say 1st Step to play is easy but if you want "more" it get more complicate.
WMP_Darkmode.jpg
WMP_Darkmode.jpg (364.46 KiB) Viewed 10164 times