JW Player is a the world's most popular embeddable media player.
- Cross browser: Play your video and audio files easily on all major browsers and mobile devices. Full details here.
- Media formats: Play MP4, WebM, FLV, HLS, YouTube videos, and more.
- Open Source: JW Player is free for non-commercial use. For commercial uses, users must purchase a license.
For documentation and support, please visit the JW Player Support Site.
We have several articles and examples on the JW Player Support Site.
The example below will find the element with an id of myVideoId and render a video player into it. We will then create an event handler to watch for when someone changes the volume.
jwplayer('myVideoId').setup({
file: '/uploads/example.mp4',
});
jwplayer('myVideoId').onVolume(function(event) {
console.log('The volume has changed', event);
});
Note that we could also use functions getVolume, setVolume and others which can be found here.
For our javascript code, we follow the Douglas Crockford Style guide
Before submitting a change be sure to verify it follows our guide by using
grunt jshint
To build the JW Player, you will need the following software:
- Flex SDK 4.1: http://sourceforge.net/adobe/flexsdk/wiki/Downloads/
- Ant 1.7.0: http://ant.apache.org/bindownload.cgi
To compile with Flex and Ant, you'll first need to modify the build.properties
file found in the build
folder:
- Set
flexsdk
to the install location of the Flex SDK (e.g./usr/local/bin/flex/
) - Set
execextension
to.exe
if you're using Windows; otherwise leave it blank.
You can now compile the player using Ant:
ant -buildfile build\build.xml
If the build is successful, the new player assets (jwplayer.js, jwplayer.html5.js, jwplayer.flash.swf) will appear in the bin-release
folder.
The use of the JW Player Open Source edition is governed by a Creative Commons license. You can use, modify, copy, and distribute this edition as long as it’s for non-commercial use, you provide attribution, and share under a similar license. http://www.jwplayer.com/license/