Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27403

VS 2012 Play videos with Media Player via code without putting control on form at design time

$
0
0
I am using the code below to play audio files in a "file manager" type app. What I'm wondering is if there's any reason I can't use a similar tactic to show "previews" of movie files (ie. mpg's).

If possible, I'd like to do so via code (not by putting the WMP control on the form at design time), and display the video without the control buttons (play, pause, stop, etc.).

Thoughts? Thanks!


Code:

Imports WMPLib
Code:

Dim WithEvents player As WMPLib.WindowsMediaPlayer
Code:

Private Sub playFile(ByVal url As String)
        player = New WMPLib.WindowsMediaPlayer
        player.URL = url
        player.controls.play()
    End Sub


Viewing all articles
Browse latest Browse all 27403

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>