Commits

David Bennett committed 49b668d

Added readme and license.

  • Participants
  • Parent commits af1e107

Comments (0)

Files changed (2)

+JWSkin2JS
+=========
+This is a handly little program that converts zipped `JW Player 5`_ `XML/PNG
+skins`_ into self-contained JavaScript.
+
+.. _JW Player 5: http://www.longtailvideo.com/players/
+.. _XML/PNG skins: http://www.longtailvideo.com/support/jw-player/jw-player-for-flash-v5/43/using-jw-player-skins
+
+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: 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::
+
+    <script type="text/javascript" src="http://s3.example.com/js/jwplayer58.js"></script>
+    <script type="text/javascript" src="http://s3.example.com/skins/five.js"></script>
+    <script type="text/javascript">
+        jwplayer('player').setup({
+            flashplayer: 'http://s3.example.com/js/player.swf',
+            skin: 'http://s3.example.com/skins/five.zip',
+            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.

File jwskin2js.py

 #!/usr/bin/env python
+#
+# Copyright (c) 2012 David Bennett
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
 import argparse, os, sys
 from xml.dom.minidom import parseString
 from zipfile import ZipFile