Provide DirectShow filter for Windows Media Player ActiveX control in C# application - directshow

I'm using Windows Media Player ActiveX control in C# application. Also I have third-party DirectShow filter (Wasabi Marlin) which I need to use for video playback.
As far as I know, the Windows Media Player is able to use DirectShow filters. How can I provide the filter to WMP control? I searched in control's object model but didn't find anything useful...

Note that Windows Media Player attempts to use Media Foundation first, and if failed to play the file back, it falls back to DirectShow.
When WMP requests DirectShow to render a file, filter graph manager goes through existng file and protocol associations in order to pick proper source filter. That is, the filter of interest needs to be registered as described in the following MSDN topic:
Registering a Custom File Type
It can be file extension registration, or custom protocol handler. See also relevant discussion on MSDN Forums:
File type registration problem with Media Player on Vista

Related

Open scanner from web page (JavaEE or asp.net)

I know that you cannot access a peripheral (like the scanner) from a web page, but i saw a method for acceding "a TWAIN Scanner" using .net, but it is a paid solution and plus the use has to download and install a file before using the online scanner, and it is only limited to twain scanners (if i got it right?).
Also i saw another method, that consist of downloading a java applet (very old??), but it does not work on google chrome, and need special permission on firefox.
so my question is there any method, using JavaEE or asp.net, to let the user access the scanner from a web page??
Thank you.

How can I detect the device from which my website is accessed?

I have .NET website that is mainly built for desktop browsers but I'm currently making a mobile version of it. What I'm trying to do is load the website according to the device on which it is accessed by the user. Is there a way that I can get information about the user's device when they request the site?
Regards,
Sumit.
As suggested by others you can use the System.Web.HttpBrowserCapabilities class accessible through Request.Browser however without updated browser definition files the information is completely worthless.
For example, if you use Request.Browser.IsMobileDevice this should give you what you want, but is based on a set of very dated regular expressions in your .NET framework folders in Windows.
You can see the kind of problems that can be encountered on a (currently unanswered and unloved) post here on Stack Overflow.
If you do not plan on keeping the browser definition files up to date (which is no small task) then quite simply do not go down this route.
If you simply want to know whether the user is viewing on a mobile device then here are a few options:
Detect Mobile Browsers
51Degrees.mobi
WURFL
User Agent Info
Some of those are free, some aren't and if you are really only interested in whether it is a mobile device, my recommendation would be to use Detect Mobile Browsers.
Take a look at the HttpBrowserCapabilities class.
Enables the server to gather information on the capabilities of the browser that is running on the client.
This is actually exposed on the Request property of the Page object - in an ASP.NET page you can do the following:
var browserCap = this.Request.Browser;
You can examine the HttpRequest.Browser property - MSDN link.
If you are looking for something more low level: http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.useragent(v=vs.90).aspx
A commercial alernative is BrowserHawk

Flash/FLV Media Player with .NET API

I am looking for a media player which I can control via an ASP.NET/Javascript API and also set playlists dynamically (ie from a datasource).
I don't think you'll find one that is specifically .net orientated. However, quite a lot will use XML for playlists. So, your best bet would be to generate an XML file 'on-the-fly' from your Datasource and pass it the FLV Player via an .ashx handler.
You can try to integrate with JW FLV Player:
http://www.longtailvideo.com/
It has the features you require:
It supports xml playlists
It can be controlled with javascript
It's not designed to integrate specifically with .NET, but I doubt there are any flv flash players that are.
I've used it with java and php.
There is one commercial player that implemented as web control and can be simple dragged from toolbox - http://aspnetflashvideo.com/. To set FLV file to playback you simple set MovieURL property to correct location and thats all...

ASP.NET: Record Sound From A Web App?

I'm contemplating adding a voice recording to some posts on my site. I'm wondering if there is an ASP.NET library out there that will allow me to:
Press a button to start recording
Record what I'm saying through my comp's built in microphone
Save the file as a .wav or some other popular sound file
As of now, I will be the sole user of this function, but it would still be nice to have in my bag of tricks in case I want to pull it out later for a client.
It is not doable without the help of a plugin. Browsers simply don't support voice recording.
You could choose from:
Make a SilverLight applet.
The flashPlayer can record too.
find a java Applet that can do this.
Make an activeX Plugin (since you have affinity to asp)
use your os provided voice recorder, save the file and upload it. Playback via browser is easy
You solution will involve a flash componet (outside of rendering the markup that invokes the flash component). The ASP.NET stack won't be able to do it. Silverlight doesn't seem able to do it.
Here is how.
Here's the problem: the browser does not allow this level of hardware access by an application. You could however achieve this either through Java, Flash or ActiveX (Yuk! don't do it) should the end user allow the access to occur however there are a number of cavaets. Here's a great thread where like-minded people like yourself are approaching the same challenge:
http://drupal.org/node/69242
If I were cornered to do this I would create a signed Java Applet.
not directly from asp.net since asp.net is server side and you need access to the client side microphone - however the new adobe flash player has the ability to access the mircophone so in theory you could use flash to record then upload to your site.
See ListenUp sdk. I found a bulletin board called english-test.net that is using the sdk to post voices.
You'll need some client-side code to achieve this as regular HTML doesn't support audio input and upload.
The ActiveX control Active Audio Record 2.0 claims to support recording audio and uploading it to an ASP.NET web server. I've never tried it though.

How to capture image from client webcam in asp.net

I am working on an ASP.Net application and I want users to be able to take a picture with their local webcam and then upload it to the server.
I can, of course, rely on users doing this manually via their locally installed software, save the image as a file and do a normal file upload. However, what I really want to do is incorporate it all into a UI in the browser.
I know this means accessing local resources so do I need an ActiveX control or Silverlight or is there something I could do in Javascript for example?
This is initially intended for an Intranet app so I can have control of the client's environemnt, including stipulating the browser etc, which means I can use an ActiveX control if I have to. However, it would be nice if I could write this in a generic way so it could be used in an internet app generally (happy to stipulate that it only works on Windows clients but would be good to get it to work in FireFox).
Thanks.
The only acceptable and universal way to this for now is Flash/Flex application. Flash player presets literally in every browser in the world and all of them has such capability.
VideoCap Pro is quite popular, and it offers an ActiveX version, have you checked it out?
This sounds very suspicious to me. You realize the nefarious applications this could be applied to, right? A web page that when a user browses to it, unknownst to them, their webcam snaps a pic of them. ... I don't like it.
You could use the Nimbb API to do the webcam video recording inside a browser.
It is possible to get the image from client webcam in asp.net, you have to install the Silverlight 4 with Visual Studio 2010:
Go to following link:
http://wildermuth.com/2009/11/23/Taking_a_WebCam_Photo_with_Silverlight

Resources