0

On the backend of a site I am making for my client, I have an input for my client to put a Dropbox URL to an mp4 file to play on the frontend (he doesn't want to host the files on the server itself).

But, with VideoJS, it looks like I may need a WebM for some browsers and MP4 for others.

Is there a way to make MP4 work with VideoJS in all browsers?

My client doesn't want to have to use 2 or 3 different file types for each video, and wants to just use one mp4 file.

Is this possible?

Nathan
  • 11,814
  • 11
  • 50
  • 93

2 Answers2

1

It is. If the browser can't play MP4 natively (e.g. Firefox), video.js uses a lightweight Flash component to play MP4. This is the default behaviour.

misterben
  • 7,455
  • 2
  • 26
  • 47
  • 1
    doesn't work: http://help.videojs.com/discussions/problems/1632-flash-fallback-not-working-on-httpvideojscom-front-page – Travis Webb Apr 29 '13 at 16:06
1

i used ffmpeg to convert the videos for mp4. After converted, the video works on IE, chrome and firefox.

i called a file that execute the following:

define('DS', DIRECTORY_SEPARATOR);
define('SOURCE_PATH', 'put the source path here' . DS);
define('DESTINY_PATH', 'put the destiny path here' .DS);

$cmd = ('ffmpeg -i ' .SOURCE_PATH. name of source file  . ' ' .DESTINY_PATH. name of  destiny file . '.mp4');
exec($cmd);

define('SOURCE_PATH', 'put the source path here' . DS);
define('DESTINY_PATH', 'put the destiny path here' .DS);

$cmd = ('ffmpeg -i ' .SOURCE_PATH. name of source file  . ' ' .DESTINY_PATH. name of destiny file . '.mp4');
exec($cmd);
B. Almeida
  • 35
  • 7