right way to embed/use mediaelement.js

1.9k Views Asked by At

I'm looking for the right way to embed the mediaelement.js player.

I have to add the player dynamically because I don't know the URL of the video at the beginning. The video will always be a MP4-video. How can I make sure that every browser uses the right player/plugin to be able to display the video? Current versions of Firefox for example can playback HTML5 video but it doesn't support MP4 - in this case the HTML5-video with flash fallback works but what about silverlight? I want to make sure that I'm doing this the right way (JS-only or jQuery-based doesn't matter).

1

There are 1 best solutions below

3
Kevin Brydon On

MediaElement (and all other html5 video wrappers) is designed to take all this worry away. If a clients browser supports html5 video but not mp4 natively (as is the case with all browsers except IE9+ and Safari) then it will try to play the mp4 using the flash player.

You may wish to encode your videos is other formats such as ogv or webm to enable other browsers to use their native html5 functionality.

The documentation can be found on the mediaelement github site.