Hi, I recently made some short videos with my Canon digital camera.The reason for it is to embed one or more in my web site. I searched on the Internet but I did not find much help, a lot of the posts suggest to download some software.I don't think is necessary and don't like to keep installing a lot of programs if I don't need to.Can somebody give me the code to insert in my page? The name of m y video is: MVI_2849, the extension I believe is avi?

Recommended Answers

All 6 Replies

Playing video in a web page is fairly easy. The trick is to include the correct elements so that its cross-browser compatible. One of the easiest ways is to host the video in youtube, then embed the videos in your web pages. However, if you have the video file and you want to host it yourself, you can.

However, .AVI is not going to be the best format. To make this cross-browser compatible, you want to first convert your video into the following formats: .mp4, .webm, .ogg

Here is a reference article you can look at for some additional details:
How to Play Videos in HTML
HTML5 Video

Hi thanks for your reply I have a question:

<div class="video">
<a href="MVI_2849.avi"><img src="images/video-tour.jpg" alt=""/></a>

It works great for me, so what is wrong with it? Security? It's just a video.

So what you are doing here is creating a link directly to the video file. You mentioned in your first post that you wanted to embed the videos. This is not embedding. When a user clicks the link, the web server will take the action depending on its configuration regarding .avi files. The typical action is for the web server to send the file to the browsers (like you generally experience when downloading other files).

So please clarify what it is exactly you are trying to achieve with regard to user experience and behavior.

Hi, I see what you mean I was just concerned about starting the video by clicking on a image and that was it.I realize there is more to it though I am not quite sure I understand exactly the difference between embedding the video or starting it by clicking on a link.Could you explain to me please? Thank you.

When the video is embedded in be webpage, the visitor doesn't need to actually download the file prior to watching it. The video is is watched as its streamed.

If you have ever watched a YouTube video, you should have noticed that the video stream is not fully downloaded when you start watching the video. The visitor also doesn't need any additional software loaded as long as the browser supports the video element being used. In the example links I provided above, you may have noticed that the best approach is to supply multiple formats and hope that the browser supports one of the. To be able to see the video.

In the case of a link as in your example, when the user clicks on it, the video file is Dow loaded and then a program on the visitors computer will need to start to display the video. You have to hope that the visitor has a program (and codecs) installed otherwise, the computer will just display an error to the user.

The embedded option allows you to have more control of the video.

I understand thanks for the explanation, as a matter of fact I watch you tube often and noticed what you are saying.Funny thing though in my case when I click on the link yhe video starts immediately don't ask me why. Of course it might not work with all browsers like you say.Thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.