wmp

C#写COM组件,JS调用控件

微笑、不失礼 提交于 2020-03-07 05:02:31
1、c#2005中新建项目,类型为类库,项目名为AddCom确定。   配置:右键点击解决方案资源管理器中的AddCom,选择“属性”,选择“生成”,选择“为COM Interop注册(_P)” 2、打开AssemblyInfo.cs文件,设置[assembly: ComVisible(true)],如果不改则不能被其他程序调用 3、编写com组件会用到guid(全球唯一ID),编写com组件必须要用到。c#会默认生成一个放在AssemblyInfo.cs,如没有生成,网上下一个生成guid的软件,有很多呢。 4、c#中源代码如下,按如下方法编写代码后生成工程,/bin/release中得到AddCom.dll。 using System; using System.Collections.Generic; using System.Text; using System.Runtime.InteropServices; namespace AddCom { [Guid("298D881C-E2A3-4638-B872-73EADE25511C")] public interface AddComInterface { [DispId(1)] int iadd(int a, int b); } [Guid("2C5B7580-4038-4d90-BABD-8B83FCE5A467")

C# Windows Forms capture a image from embeded Windows Media Player

家住魔仙堡 提交于 2020-01-02 10:18:30
问题 I have a windows forms application written in C# which uses embedded Windows Media Player (AxInterop.WMPLib.dll and WMPLib.dll) to play some video files. Now I need to add an option to capture image from video on button click. If I set the windowless option to true, I am able to capture an image of a video, but when I set the windowless option to true I don't see a video image on some computers. Without the windowless option I only get a black screen with this code: System.Drawing.Image ret =

How to check what version of Windows Media Player is installed on the machine?

人盡茶涼 提交于 2019-12-29 08:09:33
问题 As far as I know Windows Media Player 10 is the minimum requirement for WPF MediaElement to work. What is a decent way to programmatically (from .NET) check if WMP is present, and its version? 回答1: The method I used in my installer is to check this registry value: HKLM Software\Microsoft\MediaPlayer\PlayerUpgrade PlayerVersion The PlayerVersion value will be set to a string like "10,0,0,0". (Note that commas, not periods, are used to separate the numbers.) You need to extract the first number

C# - Play videos from resources in wmp component

最后都变了- 提交于 2019-12-25 15:54:12
问题 I have a wmp component in a C# Windows Forms and i want it to play a video (.avi) from the solution's resources. I need to know the code for the wmp component to find the video. Suggestions? 回答1: Currently there is a way over streaming the file. First of all, we need a place where it should be always possible string streamPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\"; Next Step an Instance of the MediaPlayer WindowsMediaPlayer wmp = new WindowsMediaPlayer(

Seeking in .avi file using C#

人盡茶涼 提交于 2019-12-24 07:10:09
问题 First of all, I'm new to C#, so bear with me. I am making an application, that shows an .avi file in windows media player like this: private void button1_Click(object sender, EventArgs e) { axWindowsMediaPlayer1.URL = @"C:BlaBla\Family Guy\Season 10\S10E16.HDTV.x264-LOL.avi"; } I've found out that you cant fastforward or fastrewind in an .avi file, because it's not indexed. But using the WMP-slider of axWindowsMediaPlayer1, you can set the file to play at a specific point. For instance, start

Java control Windows Media Player with Java

ぐ巨炮叔叔 提交于 2019-12-23 16:34:15
问题 I have seen some Java servers wich can control WMP with an android device or such. But how do you make a server that controls WMP. What do you need for it? Thanks. 回答1: Windows Media Player supports UPnP for server discovering and DLNA for remote controlling. Say if you want to create a client app (Android or whatsoever using Java) to remote control Windows Media Player: Use UPnP to discover available WMP server on network with zero configuration. Use DLNA to remote control available WMP

Do VLC or WMP ActiveX controls accept Stream objects?

寵の児 提交于 2019-12-22 14:40:26
问题 I've got a WCF service that stories media files and returns them to consuming applications in the form of a Stream object. The issue arises when the consuming application wants to stream the media using MediaElement. As you all know, MediaElement doesn't accept Stream objects. Can I get around this by using a VLC or WMP ActiveX control? Would either of these two controls allow me to play streaming media? 回答1: Both of those two activex controls support various types of streaming media, but

Do VLC or WMP ActiveX controls accept Stream objects?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-22 14:38:29
问题 I've got a WCF service that stories media files and returns them to consuming applications in the form of a Stream object. The issue arises when the consuming application wants to stream the media using MediaElement. As you all know, MediaElement doesn't accept Stream objects. Can I get around this by using a VLC or WMP ActiveX control? Would either of these two controls allow me to play streaming media? 回答1: Both of those two activex controls support various types of streaming media, but

Need a way to retrieve the current playing song from Zune and Windows Media Player with Python

你。 提交于 2019-12-18 21:53:58
问题 An Application of mine retrieves the current playing song from a multitude of music players. However, I'm having great trouble implementing Zune and Windows Media Player. I've done a lot of googling on the subject, unfortunately it's only confusing me more and more. What I would normally do for my other applications: Iterate over all open windows every 4 seconds Get the title of all windows Check title for a pattern (Ie, " - Spotify " ) If it's there, adjust the title for output. WMP Does not

Need a way to retrieve the current playing song from Zune and Windows Media Player with Python

↘锁芯ラ 提交于 2019-12-18 21:53:27
问题 An Application of mine retrieves the current playing song from a multitude of music players. However, I'm having great trouble implementing Zune and Windows Media Player. I've done a lot of googling on the subject, unfortunately it's only confusing me more and more. What I would normally do for my other applications: Iterate over all open windows every 4 seconds Get the title of all windows Check title for a pattern (Ie, " - Spotify " ) If it's there, adjust the title for output. WMP Does not