I am about to create a video upload function to a cms. But havent dealt with video and video player functionality before.

So my question is what file extensions i should tjeck for under validation in the upload script?

Are the a video player which is working in all browsers, and any hints on how to integrate it would be greatly appreciated.

What video player would you guys recommend and why..?

Hope to hear from some video upload gurus in here :-)

All the best, Klemme

Recommended Answers

All 2 Replies

First of all, you should not depend on file extensions for validation. Both the file extensions and the mime-type supplied by the browser are easily forged, and very unreliable as points for validation. If you want this to be secure, you need to verify the actual file data on the server. Look into using the fileinfo extension for that.

As for players with good browser support, there are a few. One of my favorites is MediaElement.js. It's worked great for me in the past.

These types of players work by detecting the best method your browser knows to play video and audio. If it supports the HTML5 elements, it'll use those. If not then it'll use Flash or Silverlight. You'll also likely have to double (or tripple) encode your media files if you want them to work on all platforms. Some browsers support WebM, but others will only support H.264. And some will play MP3 files, while others can not. (There is a table of browser support in the MediaElement link above.)

Be a part of the DaniWeb community

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