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.
Related
I'm creating a page which has a number of images. While the images are loading I want to display a loading gif in place of the image. The trouble is, because I'm testing it locally the images all load immediately so I can't see the image loader that I'm trying to implement. Is there a way to simulate the slower image loading that you would get on a public website?
I'm using c# and jquery
If you don't want the entire site/page to load slowly but would rather have just the image delayed, you could use a service like deelay.me
Usage:
http://www.deelay.me/{delay_time_in_ms}/{full_url_to_img}
Example
http://www.deelay.me/3000/http://placehold.it/300x500
While developing webpages (whatever technology), it's very useful to use a developer tool like Chrome developper tool for multiple purpose.
With it, you can do what you want : simulate slow network connection.
See 'Emulate slow network connections' part of the official documentation : https://developers.google.com/web/tools/chrome-devtools/network-performance/network-conditions
I think you can add a custom network throttling profile and set a very low download like 1kb/s
I need some advice on what is the best practice to build an online audio library with ASP.Net + C# + MSSQL. Some key requirements are as follows:
The audio files are stored in database in binary type
On the web UI, user can click on an audio icon to play the audio. The audio will be very short, a few secs max, so there is no need to provide controls except and "play" button.
For playing audio, I don't want to launch a media player explicitly. I just want user to click and s/he will hear the sound.
In addition, I want to stream the audio and I don't want user to be able to download the audio file.
Can anyone shed some light on how to implement this, in particular the playing audio part?
I would use the jQuery Media Plugin. It's freakin awesome!
I would then create an .ashx handler for playing the audio files, and pass those to the media plugin in jQuery.
You can follow this Code Project article, it shows you how to do just about everything you need, except they upload videos. You can easily tweak the code to allow JUST audio though.
It sounds like a very fun project, good luck!
I have a WPF Kiosk application and it has a background timer that will redirect the user back to the home page when there is no user activity. When the Kiosk is sitting on the home page for an extended period of time, I want it to have some sort of screensaver. The screensaver would basically have to pull images/videos/flash files from a folder and automatically cycle through them repeatedly until a user is active again.
The dispatch timer should be easy enough to handle the idling, but my question is what is the best way to handle the cycling of the images/videos? Is there a control that will do this for me? I'm sure I can load all of the images and videos, but I'm not sure how to display them to the user in WPF.
I'd need to display the image for a few seconds each, but videos or flash files need to play to completion before being swapped out.
I believe that you'll need to handle each of these cases separately. I assume that you know how to use an Image element, so I won't provide a link to that.
For media files, you can use the built-in Media Element class, which supports WMV and MPG files, and has properties and events for all that you would expect it to (play/pause/stop, Media ended, etc.).
For Flash, it gets a little trickier, as there is no built-in support for this that I'm aware of. Here is an MSDN thread that discusses how to do this.
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.
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.).