Results 1 to 5 of 5

Thread: [VB6, twinBASIC] ucSimplePlayer: Simple video playback control

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    6,983

    [VB6, twinBASIC] ucSimplePlayer: Simple video playback control

    ucSimplePlayer v1.1.3
    Name:  ss.jpg
Views: 212
Size:  31.1 KB

    This is a simple video player UserControl for VB6, twinBASIC, and VBA, supporting both 32bit and 64bit. It's just a thin wrapper over the IMFPMediaPlayer media player control that's part of Windows Media Foundation. While MS recommends using IMFEngine, that doesn't support Windows 7.

    All the basic features are covered:
    • Play
    • Pause
    • Stop
    • Volume
    • Mute
    • Balance
    • Seek
    • Playback rate
    • Duration
    • Fullscreen

    The VB6 project file and ucSimplePlayDemo.twinproj have basic players implementing the control and its functions using the control as a UserControl.

    ucSimplePlayer.twinproj is to compile an OCX which you could then use in VB6/tB plus other hosts like VBA 32bit/64bit.

    It will automatically toggle full screen when you double click the video, to disable this change .AllowFullscreen to False. You can still use the manual toggle (.Fullscreen = True/False),

    Requirements
    Windows 7 or newer
    VB6 (.ctl or .ocx), or
    twinBASIC (.tbcontrol/.twin or .ocx)

    VBA can only use this project as an OCX. Use twinBASIC to compile the OCX matching your Office bitness, or download the precompiled ocx from Releases. Tested in MS Office Excel 2021 64bit.

    Note for OCX: If you compile it yourself using the free Community Edition of twinBASIC, the x64 ocx will show a splash screen when first loaded. Use the precompiled build or subscribe yourself to avoid this.

    Download from project repository
    Last edited by fafalone; Mar 28th, 2025 at 03:00 PM.

  2. #2
    Fanatic Member
    Join Date
    Jun 2016
    Location
    España
    Posts
    588

    Re: [VB6, twinBASIC] ucSimplePlayer: Simple video playback control

    Very good project, I love it. It works very well.
    There's one thing I really like about the players. I don't know if it can be implemented.
    Thumbnail preview when you move the cursor over the slider. Would this be possible?

    All the best

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    6,983

    Re: [VB6, twinBASIC] ucSimplePlayer: Simple video playback control

    Doesn't look like there's a way through the simplified player here, but it should be possible to open another instance of the file based on the code used by the VideoThumbnails project (originally by -Franky- and modified for tB/WinDevLib/x64 by me). I'll give it a shot tonight.

  4. #4

    Thread Starter
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    6,983

    Re: [VB6, twinBASIC] ucSimplePlayer: Simple video playback control

    PROJECT UPDATED: v2.2.5
    New version adds stream selection (video and audio only, sorry this type of player doesn't seem to support subtitles), AR lock option, and timer for VBA people to keep playback position synced.
    Code:
    'Version 2.2.5
    '-Added ability to select different video and audio streams:
    '   Use GetVideoStreams/GetAudioStreams to get the number and their 
    '   names/languages, then use ActiveVideoStream/ActiveAudioStream
    '   properties to set the 1-based number of the active stream.
    '-Added PreserveAspectRatio property (default True)
    '-Added PlayerKeyUp and PlayerClick events
    '-The Demo projects show how to use the above by showing a context menu
    ' when the player is right clicked, allowing you to switch tracks and 
    ' toggle aspect ratio and fullscreen.
    '-Added sub GetNativeSize to get original size of video w/o scaling
    '-Added PlayTimer event to make it easy for VBA clients to synchronize
    '   a progress indicator, since there's no native Timer. Control with:
    '      .EnablePlayTimer 
    '      .PlayTimerInterval (default 500ms)

  5. #5
    Fanatic Member
    Join Date
    Jun 2016
    Location
    España
    Posts
    588

    Re: [VB6, twinBASIC] ucSimplePlayer: Simple video playback control

    good job master Fafalone thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width