Source

jwskin2js /

Filename Size Date modified Message
1.7 KB
4.3 KB

JWSkin2JS

This is a handy little program that converts zipped JW Player 5 XML/PNG skins into a single self-contained JavaScript file.

To use a skin for HTML5 mode, you normally have to unzip it and upload the XML and all the PNG images to the same location as the ZIP.

This can be problematic if you're hosting the skin on a different domain (e.g. a CDN) because JavaScript is restricted from loading content on other domains.

Python 2.7 is required.

Usage:

python jwskin2js.py [-h] [-o jsfile] zipfile

Compile a JW Player 5 skin to JavaScript.

positional arguments:
  zipfile

optional arguments:
  -h, --help            show this help message and exit
  -o jsfile, --output jsfile

Include in your page like so:

<div id="player">Loading the player...</div>
<script type="text/javascript" src="http://s3.example.com/js/jwplayer.js"></script>
<script type="text/javascript" src="http://s3.example.com/skins/glow.js"></script>
<script type="text/javascript">
    jwplayer('player').setup({
        modes: [{
            type: 'flash',
            src: 'http://s3.example.com/js/player.swf',
            config: {skin: 'http://s3.example.com/skins/glow.zip'}
        },
        {
            type: 'html5',
            config: {skin: ''}
        }],
        file: 'http://s3.example.com/video.mp4',
        width: 640,
        height: 360
    });
</script>

Note

You still need to include the ZIP skin for it to work in Flash mode.