Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. Load video in form

Load video in form

Scheduled Pinned Locked Moved Visual Basic
csharptutorialquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Tim Yong
    wrote on last edited by
    #1

    Hi All, Do any one know how to display a video clip in the form itself and not run it separately using VB .NET? Please advice Thanks Best Regards Tim Yong

    D U 2 Replies Last reply
    0
    • T Tim Yong

      Hi All, Do any one know how to display a video clip in the form itself and not run it separately using VB .NET? Please advice Thanks Best Regards Tim Yong

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      The simplest way to do this would be to add the "Windows Media Player" to your ToolBox, then drag and drop the control onto your form. You could then set it up to drop the user interface and then just tell it which file to play. Player.uiMode[^] from the Windows Media Player 10 SDK docs. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

      1 Reply Last reply
      0
      • T Tim Yong

        Hi All, Do any one know how to display a video clip in the form itself and not run it separately using VB .NET? Please advice Thanks Best Regards Tim Yong

        U Offline
        U Offline
        User 2192404
        wrote on last edited by
        #3

        'first of all you have to import a called QuartzTypeLib 'declear globle variables Dim bAudio As IBasicAudio Dim bvideo As IBasicVideo Dim mEvent As IMediaEvent Dim vdoWindow As IVideoWindow Dim mCtrl As IMediaControl Dim mpos As IMediaPosition Public Const WS_VISIBLE = &H10000000 'call remove media to remove oldloded media ******************************************************** Public Sub RemoveMedia() Try DisableCtrl() If Not mCtrl Is Nothing Then mCtrl.Stop() End If If Not vdoWindow Is Nothing Then 'vdoWindow.Owner = Nothing End If If Not bAudio Is Nothing Then bAudio = Nothing End If If Not bvideo Is Nothing Then bvideo = Nothing End If If Not mCtrl Is Nothing Then mCtrl = Nothing End If If Not vdoWindow Is Nothing Then vdoWindow = Nothing End If If Not mpos Is Nothing Then mpos = Nothing End If Catch ex As Exception MsgBox(ex.Message) End Try End Sub ********************************************************* call loadMedia to load new media file to be plaed prove file name and path as string in the function ********************************************************** Public Sub LoadMedia(ByVal data As String) On Error GoTo OpenFileError mCtrl = New FilgraphManager Call mCtrl.RenderFile(data) bAudio = mCtrl bAudio.Volume = 0 'Loudest bAudio.Balance = 0 'Centered bvideo = mCtrl vdoWindow = mCtrl vdoWindow.WindowStyle = WS_VISIBLE 'WS_VISIBLE = &H10000000 vdoWindow.Top = 0 vdoWindow.Left = 0 vdoWindow.Width = mainWindow.Width vdoWindow.Height = mainWindow.Height vdoWindow.Owner = mainWindow.Handle.ToInt64 mEvent = mCtrl mpos = mCtrl mpos.Rate = 1 'Normal forward playback speed Me.panMedia.Text = "File Loaded" PosBar.Maximum = mpos.Duration EnableCtrl() SetTotalTime() Exit Sub OpenFileError: Err.Clear() Resume Next End Sub ******************************************************** user myCtrl.Play(),myCtrl.Stop(),myCtrl.Pause() to play stop and pause.and take only picture box as the window t

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups