windows-media-player

basic playback with programmatically created windows media player

老子叫甜甜 提交于 2019-12-18 04:26:10
问题 I was trying to "just quickly integrate" the Windows Media Player via COM to play single files from the local file system or http sources - but due to the sparse documentation and online resources to its usage when not embedding into some kind of an Ole container, i couldn't get that supposedly trivial use-case to work. Initialization etc. works fine, but actually playing some file always fails. Example code, starting with initialization (error handling stripped, basically translated from the

Adding Object or changing its parameter programmatically in C# / ASP.Net

折月煮酒 提交于 2019-12-12 19:19:10
问题 I want to embed Windows Media Player into my ASP.NET page. I do it with this code, which works fine: <OBJECT id='mediaPlayer1' width="180" height="50" classid='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95' codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701' standby='Loading Microsoft Windows Media Player components...' type='application/x-oleobject'> <param name='fileName' value="http.."> <param name='animationatStart' value='true'> <param name=

C# Mediaplayer doesn't play mp3 file from resources

会有一股神秘感。 提交于 2019-12-12 05:13:50
问题 Mediaplayer didn't work for me, so I moved to a simple test project (C# Console App). I added my .mp3 file to the project like this: Right click project name (test) in solution explorer add folder resources Right click the resources folder in solution explorer Add my warn.mp3 file left click the warn.mp3 file Changed Build Action to Resource in the properties window. Sadly, this code doesnt work: namespace test { class Program { public static void Main(string[] args) { MediaPlayer player =

Windows Media Player ctlcontrols.play and URL don't work

丶灬走出姿态 提交于 2019-12-12 04:44:28
问题 private void mediaPlayer_Enter() { string path = Path.GetFullPath(currentTrack.Text); System.Diagnostics.Debug.WriteLine(path); mediaPlayer.URL = path; mediaPlayer.Ctlcontrols.play(); } This is the piece of code which is being called when the state of the media player turns to "media ended". I know that it does execute that line of code but it still doesn't play. It takes the item out of the listbox (which is the playlist) and loads it into the mediaPlayer but does not Automatically play the

Music suddenly stops playing in application

痞子三分冷 提交于 2019-12-12 00:59:24
问题 I have this code: private void OtworzPlikButton_Click(object sender, RoutedEventArgs e) { OpenFileDialog ofd = new OpenFileDialog(); ofd.ShowDialog(); string directory = ofd.FileName; WMPLib.WindowsMediaPlayer wplayer = new WMPLib.WindowsMediaPlayer(); wplayer.URL = directory; wplayer.controls.play(); } I'm getting the file directory from the OpenFileDialog and I am using wplayer to start playing music. At first it is working good but after 20-30 seconds, music suddenly stops playing and I

windows media player stops of playing the song when PlayStateChange changed to play

我怕爱的太早我们不能终老 提交于 2019-12-11 21:19:29
问题 this is my code: Private Sub AxWindowsMediaPlayer1_PlayStateChange(ByVal sender As System.Object, ByVal e As AxWMPLib._WMPOCXEvents_PlayStateChangeEvent) Handles AxWindowsMediaPlayer1.PlayStateChange If AxWindowsMediaPlayer1.playState = WMPPlayState.wmppsMediaEnded Then Dim str As Integer 'the original lblPlayItemIndex.Text = 0 : the index of the first item in the listview str = lblPlayItemIndex.Text + 1 AxWindowsMediaPlayer1.URL = fmPlaylist.lstPlaylist.Items(str).Tag AxWindowsMediaPlayer1

Android WebKit live video streaming through asf file

非 Y 不嫁゛ 提交于 2019-12-11 20:57:58
问题 I have google around and found that Android's media player doesn't support asf. But the built in player of Google Chrome supports asf streaming. Will the WebKit's media player do that too? Can I use webkit's media player in my application to play live streaming?? 回答1: The easier solution is YourMuze FM. YourMuze FM does not provide any content. All they do is simply convert internet radio streams to formats that are suitable for mobile phones. On your desktop computer, go to Welcome to

pause and resume Windows Media Player in C#

本小妞迷上赌 提交于 2019-12-11 20:11:24
问题 I'm making an VoIP application and I just want to be able to pause and resume (and probably check the player state) of Windows Media Player. Solutions I've found on SO refer to WMPLib but this is for embedding WMP in my .NET application. I simply just want to pause and resume the current instance if there is one. Is there documentation for this somewhere? 回答1: One way to do this would be with a plugin for WMP that you could then call. WMPKeys does something like this (only it interacts via

C++ - Running Windows Media Player from Console Application - COM

北战南征 提交于 2019-12-10 12:18:16
问题 I am trying to play a movie using Windows Media Player, later on will add some other functionality. Following is the code I have written: const CLSID CLSID_WindowsMediaPlayer = {0x6BF52A52, 0x394A, 0x11d3, {0xB1, 0x53, 0x00, 0xC0, 0x4F, 0x79, 0xFA, 0xA6 } }; HRESULT hr; IWMPPlayer *pMediaPlayer = NULL; hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); if(FAILED(hr)) { std::cout << "ERR -- Could not Initialize COM engine for you" << std::endl; return 0; } hr = CoCreateInstance(CLSID

AccessViolation exception when form with AxWindowsMediaPlayer closed

依然范特西╮ 提交于 2019-12-10 10:22:17
问题 I have a AxWMPLib.AxWindowsMediaPlayer on a form. When I close the form, I get "Attempted to read or write protected memory. This is often an indication that other memory is corrupt." exception. It is OK with hiding the form but not with closing. Everything's fine when the component is removed from the form. This is Winforms .Net3.5. Any help appreciated. 回答1: This was happening to me, and it was when closing the form during a key press. Seems the WMP control will cause problems if it has a