windows-media-player

How to add multiple files to a playlist

旧巷老猫 提交于 2019-11-28 22:03:45
I have one OpenFileDialog control that has Multiselect = true . Now I want to add each file to windows media player playlist but I have no idea how to do that and there is no good example on the internet. if (ofdSong.ShowDialog() == DialogResult.OK) { foreach (string file in ofdSong.FileNames) { //Code to add file to the playlist } } a1204773 With help of DJ KRAZE that gave me the example link and JayJay who wrote that example, here is the solution. WMPLib.IWMPPlaylist playlist = wmp.playlistCollection.newPlaylist("myplaylist"); WMPLib.IWMPMedia media; if (ofdSong.ShowDialog() == DialogResult

Getting windows media player currently playing song

余生颓废 提交于 2019-11-28 10:41:58
问题 Is there a way I can get currently plaaying song from Windows Media Player by C# with .NET? Any API that will work with all Windows Media Player versions? 回答1: I think what HPT suggested should work. But if you want to access it using C#, please refer to http://msdn.microsoft.com/en-us/library/dd562405%28VS.85%29.aspx 来源: https://stackoverflow.com/questions/3681576/getting-windows-media-player-currently-playing-song

Unable to call WMP's controls.play() function in VisualBasic

此生再无相见时 提交于 2019-11-28 01:19:44
I have the following code: http://pastebin.com/EgjbzqA2 which is basically just a stripped down version of http://www.dreamincode.net/forums/topic/57357-mymusic-player/ . I want the program to play one file repeatedly, however, this function doesn't work for some reason. The program plays each file once and then stops. Private Sub Player3_PlayStateChange(ByVal NewState As Integer) Handles Player3.PlayStateChange Static Dim PlayAllowed As Boolean = True Select Case CType(NewState, WMPLib.WMPPlayState) Case WMPLib.WMPPlayState.wmppsReady If PlayAllowed Then Player3.controls.play() End If Case

How to add multiple files to a playlist

隐身守侯 提交于 2019-11-27 14:11:25
问题 I have one OpenFileDialog control that has Multiselect = true . Now I want to add each file to windows media player playlist but I have no idea how to do that and there is no good example on the internet. if (ofdSong.ShowDialog() == DialogResult.OK) { foreach (string file in ofdSong.FileNames) { //Code to add file to the playlist } } 回答1: With help of DJ KRAZE that gave me the example link and JayJay who wrote that example, here is the solution. WMPLib.IWMPPlaylist playlist = wmp

Windows Media Player control - get/set video position?

我的梦境 提交于 2019-11-27 05:53:25
问题 I am using Windows Media Player ActiveX (axWindowsMediaPlayer) component in C# WinForms application. Is it possible to get and set the current position of the video that is being played using this control? 回答1: axWindowsMediaPlayer1.Ctlcontrols.currentPosition = positionInSeconds; 来源: https://stackoverflow.com/questions/5590291/windows-media-player-control-get-set-video-position

Unable to call WMP's controls.play() function in VisualBasic

ぃ、小莉子 提交于 2019-11-26 23:30:42
问题 I have the following code: http://pastebin.com/EgjbzqA2 which is basically just a stripped down version of http://www.dreamincode.net/forums/topic/57357-mymusic-player/. I want the program to play one file repeatedly, however, this function doesn't work for some reason. The program plays each file once and then stops. Private Sub Player3_PlayStateChange(ByVal NewState As Integer) Handles Player3.PlayStateChange Static Dim PlayAllowed As Boolean = True Select Case CType(NewState, WMPLib