views:

288

answers:

2

I am using ASP.NET's "handler" to show images in an application. I need to play files of audio and video like I do with the image: I recover it from database and show it on an aspx page. Can I create a "handler" for the video and the audio? I don't want that a dialog box is opened asking to the user if he wants to play or save the video file.

I want to play it like YouTube does.

Maybe I can use silverlight for that.

Thank you!

+1  A: 

It consists of two parts.

  1. A handler or something that streams the video under the hood.
  2. A client (can be implemented in Silverlight or Flash) that's on an standard HTML page that fetches the video from the handler and displays it.
Mehrdad Afshari
and how can I read from silverlight the video stream provided?
VansFannel
This might help in that case: http://www.codeproject.com/KB/silverlight/VideoCarouselControl.aspx
Mehrdad Afshari
A: 

It's certainly possible to write a handler that pulls video/audio content out of a database and streams it to the client. That would work much the same was as your existing image one.

The way to stop the dialog is to present your video within a video viewing control on the web page. For example, a silverlight control with a MediaElement in it.

Check out this guide to writing a silverlight media player: http://www.learn-silverlight-tutorial.com/StreamingMediaUsingSilverlight.cfm

This won't necessarily be the most performant way of serving video content, if you want lots of performance, look into buying commercial media streaming solution that can be integrated with your site.

d4nt