how to give onClick event of video clips? - c#

I have a website where I am displaying few videos on a .aspx page. Now my requirement is when some one clicks on these videos I want to navigate them to some other URL. Thanks.

If you talking about just wrapping an HTML link around the video itself, then you just need to do this
... video tags ...
around the video tag blocks (not sure what you are using for video playback).
If you are talking about inside of the video itself, then you need to explain a little more about what you are using to playback the video (Flash, etc.).

Related

Can't play videos with webbrowser control

I have a webbrowsercontrol and I want to play videos from youtube and vimeo.
At first I couldn't even load youtube.com and it was saying that I had to eneble javascript, so I did and I added this IsScriptEnabled="True" property in <phone:WebBrowser/> and then the page loaded, But when I press on a video to play it says "video not available" on youtube, and "your phone can't play this video" on dailymotion.
I used this code:
VideoStream.Navigate(new Uri("http://www.dailymotion.com/", UriKind.Absolute));
I'm not sure about the exact problem but i think it's flash related. I had the same problem when I used WebBrowser.
If noone else has a better solution you could at least use this solution for youtube videos:
a video link ends like this: watch?v=XXXXX
just add &html5=1 to enforce html5 video playback. --> watch?v=XXXXX&html5=1
If you want to only show the video: --> https://www.youtube.com/embed/XXXX?&autoplay=1&rel=0&html5=1
As far as I know, if the Internet explorer in your machine can play the flash video, then the “WebBrowser” control in .Net framework can also do this, so please make sure the IE in your machine works fine with the flash ActiveX control.

Capturing Images from Playing Video File

I am developing C# desktop application and referring this link to Play video file http://www.codeproject.com/Articles/2632/DirectShow-MediaPlayer-in-C , now from this playing video file ,when I click on this panel (shown in above link ) how to capture Images from playing video file,I searched but I found all examples showing capturing Images from some device(for eg.webcam,etc..) ,In my case Its not device it's file which I am browsing from Directory and Playing ,as I am new to this Video capturing Please direct me how I can do this
"Capture" normally refers to image acquisition when you obtain the image from external source. You want to take a copy of currently displayed video frame instead. There are several ways to do it and when it comes to playback when video is being visualized, the video renderers typically offer GetCurrentImage method which returns a copy of currently displayed video frame, possibly even converted to RGB.
Method syntax slightly differs between video renderer versions.
See previous topics on achieving this:
take picture from webcam c# (references sample application from DirectShow.NET)
IBasicVideo CetCurrentImage catastrophic failure(DirectShow.NET)
Also:
Best DirectShow way to capture image from web cam preview ? SampleGrabber is deprecated
Grabbing images from a DVD using direct show
You need a filter which captures screen and sends the video down the stream.
In the DirectShow Library there is a sample filter called PushSource and inside there is PushSourceDesktop.
At Codeplex there are Examples like this (Click me) or Information (Click me) about Filters.
You can also use a "SampleGrabber" DirectShow filter: just place it in the filter chain between your source filter and render filter.
More info about SampleGrabber:
see MSDN

Slideshow with music Control photoalbum like Asp.net

I am searching for an Asp.net control like this one ,that can animate and make dynamically a slideshow with photos from database and music and then show in my asp.net page
Link here:
http://doctorbilic.com/cartea/
The above is coded in PHP
If you want to use Silverlight, then here is what you need:
These links are to source code to make a slideshow
http://www.codeplex.com/SlideShow
http://www.codeplex.com/SlideShow2
This link is to a blog entry on how to add sound to your Silverlight application
http://blogs.silverlight.net/blogs/msnow/archive/2008/07/25/tip-of-the-day-22-how-to-add-sound-effects-music-and-video-to-your-silverlight-app.aspx
Using those together will get you what you want.
Also look at this page. They have a product that will do it for you (also in silverlight) for about $50
This was done in Flash, actually. But you can try using jQuery with all its effects to achieve something close to that.

How to play a audio sound in a web page as a background music

I want to play an audio file whenever my page gets loaded onto the client browser. And if a user presses a pause button on the web page then the sound gets paused until he leaves the sound and can resume as well. ?
Here's some examples. But as some said before, its not the best idea to have sound. But if yo do at least have a toggle to mute, turn the volume down or disable it totally.
The easy musicplayer for flash is a easy-to-set up MP3 player solution that does what you need. It provides "play" and "pause" buttons.
Until HTML 5, flash is going to be your best solution, this is mostly because it's an intrusion to have a page commandeer control of the user's speakers, and thus why people have recommended not doing this at all or making it so that the user must explicitly click something.
Here's a page with some freebie flash player options:
http://www.premiumbeat.com/flash_resources/free_flash_music_player/
I found this web site helpful for setting up a sound file from within a page. In my case, I only wanted it to play if they clicked something. I would agree with others here who suggested that.
This web site
http://www.phon.ucl.ac.uk/home/mark/audio/play.htm
One problem I have is when I have a number of web pages open and one of them starts making a sound, it is very difficult to find the page to get it to shut up. It is better to have the user launch the sound.
I guess achieving the same with jquery plugins won't be less exciting!
The jquery mediaplayer does the same. Using this jquery plugin, you can play your media player files without the need of windows media player. The limitation is that this works only with the media player type of files.
Further, since mp3 files are highly used in web pages, we could use the bssound jquery plugin to embed mp3 file in our web page.

ASP.NET video and audio handler

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!
It consists of two parts.
A handler or something that streams the video under the hood.
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.
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.

Categories