| 1 | .. _skinning: |
|---|
| 2 | |
|---|
| 3 | --------------------------------- |
|---|
| 4 | XML-Image Skinning in JW Player 5 |
|---|
| 5 | --------------------------------- |
|---|
| 6 | |
|---|
| 7 | ======== |
|---|
| 8 | Overview |
|---|
| 9 | ======== |
|---|
| 10 | |
|---|
| 11 | With skins, you can customize the face of your JW player. You can alter the design of any of the playerâs four component partsâControlBar, Display, Dock and Playlist, as well as skinning-enabled plugins. Before JW Player 5, it was only possible to build skins using Flash. Now, with JW Player 5, designers can build skins in their graphical editor of choice, and save the visual elements as bitmaps. This allows for rapid prototyping without the need to compile a swf file, and opens up skinning to designers who don't have Flash experience or software. |
|---|
| 12 | |
|---|
| 13 | =============================== |
|---|
| 14 | Supported Graphics File Formats |
|---|
| 15 | =============================== |
|---|
| 16 | |
|---|
| 17 | Bitmap File Formats |
|---|
| 18 | ------------------- |
|---|
| 19 | |
|---|
| 20 | JW Player 5 will accept most commonly used bitmap image formats including: |
|---|
| 21 | * JPG |
|---|
| 22 | * GIF (*Allows Transparency*) |
|---|
| 23 | * PNG (8-Bit) (*Allows Transparency*) |
|---|
| 24 | * PNG (24-Bit) (*Allows Transparency and Partial Transparency*) |
|---|
| 25 | |
|---|
| 26 | *Examples in this guide will use the PNG file format* |
|---|
| 27 | |
|---|
| 28 | .. note:: Animated gif files are not supported. |
|---|
| 29 | |
|---|
| 30 | Other Formats |
|---|
| 31 | ------------- |
|---|
| 32 | |
|---|
| 33 | JW Player 5.2 and up supports the use of SWF assets in the XML skinning format. However, we recommend that designers restrict themselves to the bitmap formats above, since skins created using SWF assets will not compatible with the JW Player for HTML5. |
|---|
| 34 | |
|---|
| 35 | ============= |
|---|
| 36 | Configuration |
|---|
| 37 | ============= |
|---|
| 38 | |
|---|
| 39 | The XML Document |
|---|
| 40 | ---------------- |
|---|
| 41 | |
|---|
| 42 | The XML (Extensible Markup Language) file, or document, contains all the settings for your skinâthe color settings for text and dock elements; margins and font-sizes for the ControlBar; and paths to images for every element in the skin. |
|---|
| 43 | |
|---|
| 44 | Anatomy of the JW Player Skin |
|---|
| 45 | ----------------------------- |
|---|
| 46 | |
|---|
| 47 | A player skin consists of its own settings and its components. Here is an example of an XML document before the elements have been defined: |
|---|
| 48 | |
|---|
| 49 | Basic XML Structure of a Skin |
|---|
| 50 | ............................. |
|---|
| 51 | |
|---|
| 52 | .. code-block:: xml |
|---|
| 53 | |
|---|
| 54 | <?xml version="1.0"?> |
|---|
| 55 | <skin version="1.0" name="SkinName" author="http://www.yoursite.com/"> |
|---|
| 56 | <components> |
|---|
| 57 | <component name="controlbar"> |
|---|
| 58 | <settings> |
|---|
| 59 | <setting name="..." value="..." /> |
|---|
| 60 | </setting> |
|---|
| 61 | <layout> |
|---|
| 62 | ... |
|---|
| 63 | </layout> |
|---|
| 64 | <element name="..." src="..." /> |
|---|
| 65 | <element name="..." src="..." /> |
|---|
| 66 | <element name="..." src="..." /> |
|---|
| 67 | </component> |
|---|
| 68 | <component name="display"> |
|---|
| 69 | <settings> |
|---|
| 70 | <setting name="..." value="..." /> |
|---|
| 71 | </setting> |
|---|
| 72 | <element name="..." src="..." /> |
|---|
| 73 | <element name="..." src="..." /> |
|---|
| 74 | <element name="..." src="..." /> |
|---|
| 75 | </component> |
|---|
| 76 | <component name="dock"> |
|---|
| 77 | <settings> |
|---|
| 78 | <setting name="..." value="..." /> |
|---|
| 79 | </setting> |
|---|
| 80 | <element name="..." src="..." /> |
|---|
| 81 | <element name="..." src="..." /> |
|---|
| 82 | <element name="..." src="..." /> |
|---|
| 83 | </component> |
|---|
| 84 | <component name="playlist"> |
|---|
| 85 | <settings> |
|---|
| 86 | <setting name="..." value="..." /> |
|---|
| 87 | </setting> |
|---|
| 88 | <element name="..." src="..." /> |
|---|
| 89 | <element name="..." src="..." /> |
|---|
| 90 | <element name="..." src="..." /> |
|---|
| 91 | </component> |
|---|
| 92 | </components> |
|---|
| 93 | </skin> |
|---|
| 94 | |
|---|
| 95 | |
|---|
| 96 | Beginning Your XML Skin Document |
|---|
| 97 | ................................ |
|---|
| 98 | |
|---|
| 99 | The opening declaration of your XML document declares that it *IS* an XML document, and establishes that this is a JW Player skin. Inside the skin element are two attributes: *name* and *author*. |
|---|
| 100 | |
|---|
| 101 | .. code-block:: xml |
|---|
| 102 | |
|---|
| 103 | <?xml version="1.0"?> |
|---|
| 104 | <skin version="1.0" name="SkinName" author="http://www.yoursite.com/"> |
|---|
| 105 | |
|---|
| 106 | You can replace these with your skin's name and your website, or your own name if you'd prefer not to have your URL in the *author* attribute. |
|---|
| 107 | |
|---|
| 108 | XML and Linking to Images |
|---|
| 109 | ......................... |
|---|
| 110 | |
|---|
| 111 | Images must reside in a subdirectory corresponding to their parent container of the skin's folder. For instance, Controlbar images should reside in the *controlbar* subdirectory. |
|---|
| 112 | |
|---|
| 113 | ========== |
|---|
| 114 | Components |
|---|
| 115 | ========== |
|---|
| 116 | |
|---|
| 117 | The player's controls are broken into four components. Each of these is defined in a **<component>** tag, and are all placed inside of the skin's **<components>** block. The player controls are: |
|---|
| 118 | |
|---|
| 119 | * controlbar |
|---|
| 120 | * display |
|---|
| 121 | * dock |
|---|
| 122 | * playlist |
|---|
| 123 | |
|---|
| 124 | In addition to player controls, it is also possible to define skinning elements for skinnable plugins as well. These would be placed in another **<component>** tag, with the *name* attribute corresponding to the id of the plugin. |
|---|
| 125 | |
|---|
| 126 | .. image:: ../images/skinning/Components.png |
|---|
| 127 | :alt: Components layout |
|---|
| 128 | |
|---|
| 129 | The Controlbar |
|---|
| 130 | -------------- |
|---|
| 131 | |
|---|
| 132 | The ControlBar component is used more than any of the other JW Player skin components. It controls video playback, shows you your point in time, toggles to full-screen mode and allows you to control the volume. |
|---|
| 133 | |
|---|
| 134 | Controlbar XML Syntax |
|---|
| 135 | ..................... |
|---|
| 136 | |
|---|
| 137 | .. code-block:: xml |
|---|
| 138 | |
|---|
| 139 | <component name="controlbar"> |
|---|
| 140 | <settings> |
|---|
| 141 | <setting name="backgroundcolor" value="0x000000"/> |
|---|
| 142 | <setting name="margin" value="10" />
|
|---|
| 143 | <setting name="font" value="_sans" />
|
|---|
| 144 | <setting name="fontsize" value="10" />
|
|---|
| 145 | <setting name="fontcolor" value="0x000000" />
|
|---|
| 146 | <setting name="fontstyle" value="normal" />
|
|---|
| 147 | <setting name="fontweight" value="normal" />
|
|---|
| 148 | <setting name="buttoncolor" value="0xFFFFFF" />
|
|---|
| 149 | </settings> |
|---|
| 150 | <layout> |
|---|
| 151 | ... |
|---|
| 152 | </layout> |
|---|
| 153 | <elements> |
|---|
| 154 | <element name="background" src="file.png" /> |
|---|
| 155 | <element name="capLeft" src="file.png" /> |
|---|
| 156 | <element name="capRight" src="file.png" /> |
|---|
| 157 | <element name="divider" src="file.png" /> |
|---|
| 158 | |
|---|
| 159 | <element name="playButton" src="file.png" /> |
|---|
| 160 | <element name="playButtonOver" src="file.png" /> |
|---|
| 161 | <element name="pauseButton" src="file.png" /> |
|---|
| 162 | <element name="pauseButtonOver" src="file.png" /> |
|---|
| 163 | |
|---|
| 164 | <element name="prevButton" src="file.png" /> |
|---|
| 165 | <element name="prevButtonOver" src="file.png" /> |
|---|
| 166 | <element name="nextButton" src="file.png" /> |
|---|
| 167 | <element name="nextButtonOver" src="file.png" /> |
|---|
| 168 | |
|---|
| 169 | <element name="stopButton" src="file.png" /> |
|---|
| 170 | <element name="stopButtonOver" src="file.png" /> |
|---|
| 171 | |
|---|
| 172 | <element name="timeSliderRail" src="file.png" /> |
|---|
| 173 | <element name="timeSliderBuffer" src="file.png" /> |
|---|
| 174 | <element name="timeSliderProgress" src="file.png" /> |
|---|
| 175 | <element name="timeSliderThumb" src="file.png" /> |
|---|
| 176 | |
|---|
| 177 | <element name="fullscreenButton" src="file.png" /> |
|---|
| 178 | <element name="fullscreenButtonOver" src="file.png" /> |
|---|
| 179 | <element name="normalscreenButton" src="file.png" /> |
|---|
| 180 | <element name="normalscreenButtonOver" src="file.png" /> |
|---|
| 181 | |
|---|
| 182 | <element name="muteButton" src="file.png" /> |
|---|
| 183 | <element name="muteButtonOver" src="file.png" /> |
|---|
| 184 | <element name="unmuteButton" src="file.png" /> |
|---|
| 185 | <element name="unmuteButtonOver" src="file.png" /> |
|---|
| 186 | |
|---|
| 187 | <element name="volumeSliderRail" src="file.png" /> |
|---|
| 188 | <element name="volumeSliderBuffer" src="file.png" /> |
|---|
| 189 | <element name="volumeSliderProgress" src="file.png" /> |
|---|
| 190 | |
|---|
| 191 | <element name="blankButton" src="file.png" /> |
|---|
| 192 | <element name="blankButtonOver" src="file.png" /> |
|---|
| 193 | </elements> |
|---|
| 194 | </component> |
|---|
| 195 | |
|---|
| 196 | |
|---|
| 197 | Controlbar Settings |
|---|
| 198 | ................... |
|---|
| 199 | |
|---|
| 200 | In the example above, you will notice the bit of code containing the settings element for the ControlBar component. It looks like this: |
|---|
| 201 | |
|---|
| 202 | |
|---|
| 203 | .. code-block:: xml |
|---|
| 204 | |
|---|
| 205 | <settings> |
|---|
| 206 | <setting name="backgroundcolor" value="0x000000"/> |
|---|
| 207 | <setting name="margin" value="10" />
|
|---|
| 208 | <setting name="font" value="_sans" />
|
|---|
| 209 | <setting name="fontsize" value="10" />
|
|---|
| 210 | <setting name="fontcolor" value="0x000000" />
|
|---|
| 211 | <setting name="fontstyle" value="normal" />
|
|---|
| 212 | <setting name="fontweight" value="normal" />
|
|---|
| 213 | <setting name="buttoncolor" value="0xFFFFFF" />
|
|---|
| 214 | </settings> |
|---|
| 215 | |
|---|
| 216 | Here is a list of the Controlbar settings, along with their default values: |
|---|
| 217 | |
|---|
| 218 | .. describe:: backgroundcolor (undefined) |
|---|
| 219 | |
|---|
| 220 | Color to display underneath the controlbar. If the controlbar elements are transparent or semi-transparent, this color will show beneath those elements. If this is not set, the Flash stage will be visible beneath the controlbar. |
|---|
| 221 | |
|---|
| 222 | .. describe:: margin (0) |
|---|
| 223 | |
|---|
| 224 | This is the margin which will wrap around the controlbar when the player is fullscreen mode, or when the player's *controlbar* setting is set to **over**. The value is in pixels. |
|---|
| 225 | |
|---|
| 226 | .. describe:: font (_sans) |
|---|
| 227 | |
|---|
| 228 | The font face for the Controlbar's text fields, **elapsed** and **duration**. (*_sans*, *_serif*, *_typewriter*) |
|---|
| 229 | |
|---|
| 230 | .. describe:: fontsize (10) |
|---|
| 231 | |
|---|
| 232 | The font size of the Controlbar's text fields. |
|---|
| 233 | |
|---|
| 234 | .. describe:: fontweight (normal) |
|---|
| 235 | |
|---|
| 236 | The font weight for the Controlbar's text fields. (*normal*, *bold*) |
|---|
| 237 | |
|---|
| 238 | .. describe:: fontstyle (normal) |
|---|
| 239 | |
|---|
| 240 | The font style for the Controlbar's text fields. (*normal*, *italic*) |
|---|
| 241 | |
|---|
| 242 | .. describe:: fontcolor (undefined) |
|---|
| 243 | |
|---|
| 244 | The color for the Controlbar's text fields. |
|---|
| 245 | |
|---|
| 246 | .. describe:: buttoncolor (undefined) |
|---|
| 247 | |
|---|
| 248 | The color for any custom Controlbar icons. |
|---|
| 249 | |
|---|
| 250 | .. note: Color values are defined in a hexidecimal value for the color, just like in HTML/CSS. So, for instance, you can make a color red in HTML by assigning the corresponding HTML color code value of #FF0000. In this XML document, to make a color red you will input the value as 0xFF0000. As you can see, instead of # you use 0x. |
|---|
| 251 | |
|---|
| 252 | |
|---|
| 253 | The Background Element |
|---|
| 254 | ...................... |
|---|
| 255 | |
|---|
| 256 | **background** is a graphic which stretches horizontally to fit the width of the Controlbar. **capLeft** and **capRight** are placed to the left and right of the background. |
|---|
| 257 | |
|---|
| 258 | |
|---|
| 259 | Caps and Dividers |
|---|
| 260 | ................. |
|---|
| 261 | |
|---|
| 262 | The Controlbar has a few elements which allow you to add space between elements. They are non-functioning bitmaps meant to give space to the right and left edges of the Controlbar. |
|---|
| 263 | |
|---|
| 264 | .. describe:: capLeft |
|---|
| 265 | |
|---|
| 266 | The left cap graphic to your controlbar skin |
|---|
| 267 | |
|---|
| 268 | .. describe:: capRight |
|---|
| 269 | |
|---|
| 270 | The right cap graphic to your controlbar skin |
|---|
| 271 | |
|---|
| 272 | .. describe:: divider |
|---|
| 273 | |
|---|
| 274 | A separator element between buttons and sliders. *(this same element can appear multiple times)* |
|---|
| 275 | |
|---|
| 276 | .. note:: JW Player 5.1 and below will fail to load without the **capLeft**, **capRight** and **volumeSlider** elements in the XML File. This issue was resolved in version 5.2. |
|---|
| 277 | |
|---|
| 278 | Buttons |
|---|
| 279 | ....... |
|---|
| 280 | |
|---|
| 281 | Buttons have two states. The **button** state is visible when the mouse is not hovering over the button. The **buttonOver** state -- which should have the same dimensions as **button** -- is shown when the user hovers the mouse above the button. |
|---|
| 282 | |
|---|
| 283 | The two states of the button elements are: |
|---|
| 284 | |
|---|
| 285 | * **playButton** / playButtonOver |
|---|
| 286 | * **pauseButton** / pauseButtonOver |
|---|
| 287 | * **prevButton** / prevButtonOver |
|---|
| 288 | * **nextButton** / nextButtonOver |
|---|
| 289 | * **stopButton** / stopButtonOver |
|---|
| 290 | * **fullscreenButton** / fullscreenButtonOver |
|---|
| 291 | * **normalscreenButton** / normalscreenButtonOver |
|---|
| 292 | * **muteButton** / muteButtonOver |
|---|
| 293 | * **unmuteButton** / unmuteButtonOver |
|---|
| 294 | * **blankButton** / blankButtonOver |
|---|
| 295 | |
|---|
| 296 | Toggle Buttons |
|---|
| 297 | ++++++++++++++ |
|---|
| 298 | |
|---|
| 299 | Certain buttons replace each other depending on the state of the JW Player. For instance, when a video is playing, the **playButton** is replaced by the **pauseButton** element. |
|---|
| 300 | |
|---|
| 301 | Toggle button pairs: |
|---|
| 302 | |
|---|
| 303 | * **playButton** / pauseButton |
|---|
| 304 | * **fullscreenButton** / normalscreenButton |
|---|
| 305 | * **muteButton** / unmuteButton |
|---|
| 306 | |
|---|
| 307 | The TimeSlider |
|---|
| 308 | .............. |
|---|
| 309 | |
|---|
| 310 | The **timeSlider** element is a unique element which is really several elements stacked on top of each other. Of those elements, three of them automatically scale to a width based on the free space in the player. Those elements are: |
|---|
| 311 | |
|---|
| 312 | .. describe:: timeSliderRail |
|---|
| 313 | |
|---|
| 314 | the *background* graphic which serves as the frame for the timeSlider |
|---|
| 315 | |
|---|
| 316 | .. describe:: timeSliderBuffer |
|---|
| 317 | |
|---|
| 318 | the file's buffer indicator |
|---|
| 319 | |
|---|
| 320 | .. describe:: timeSliderProgress |
|---|
| 321 | |
|---|
| 322 | the file's progress indicator |
|---|
| 323 | |
|---|
| 324 | Additional **timeSlider** elements: |
|---|
| 325 | |
|---|
| 326 | .. describe:: timeSliderThumb |
|---|
| 327 | |
|---|
| 328 | serves as a handle which can be dragged across the progress bar to allow the user to specify a seek position. |
|---|
| 329 | |
|---|
| 330 | .. describe:: timeSliderCapLeft |
|---|
| 331 | |
|---|
| 332 | Left-hand end-cap, placed to the left of the **timeSliderRail** element. |
|---|
| 333 | |
|---|
| 334 | .. describe:: timeSliderCapRight |
|---|
| 335 | |
|---|
| 336 | Right-hand end-cap, placed to the right of the **timeSliderRail** element. |
|---|
| 337 | |
|---|
| 338 | .. image:: ../images/skinning/timeSlider.png |
|---|
| 339 | :alt: TimeSlider Screenshot |
|---|
| 340 | |
|---|
| 341 | |
|---|
| 342 | With that in mind it is important to design your elements to gracefully scale horizontally. The **timeSliderBuffer** and **timeSliderProgress** elements dynamically scale to indicate a percentage of progress of the total file length. |
|---|
| 343 | |
|---|
| 344 | |
|---|
| 345 | The VolumeSlider |
|---|
| 346 | ................ |
|---|
| 347 | |
|---|
| 348 | The **volumeSlider** element is quite similar to the **timeSlider**, except that it does not scale automatically. It will be as large as graphics you produce. |
|---|
| 349 | |
|---|
| 350 | .. describe:: volumeSliderRail |
|---|
| 351 | |
|---|
| 352 | the **background** graphic which serves as the frame for the volumeSlider |
|---|
| 353 | |
|---|
| 354 | .. describe:: volumeSliderBuffer |
|---|
| 355 | |
|---|
| 356 | this shows the potential volume the slider can have. |
|---|
| 357 | |
|---|
| 358 | .. describe:: volumeSliderProgress |
|---|
| 359 | |
|---|
| 360 | this is shows the current level at which the volumeSlider is set. |
|---|
| 361 | |
|---|
| 362 | .. describe:: volumeSliderThumb |
|---|
| 363 | |
|---|
| 364 | the handle to slide the volume, also indicates the volume level. |
|---|
| 365 | |
|---|
| 366 | .. describe:: volumeSliderCapLeft |
|---|
| 367 | |
|---|
| 368 | Left-hand end-cap, placed to the left of the **volumeSliderRail** element. |
|---|
| 369 | |
|---|
| 370 | .. describe:: volumeSliderCapRight |
|---|
| 371 | |
|---|
| 372 | Right-hand end-cap, placed to the right of the **volumeSliderRail** element. |
|---|
| 373 | |
|---|
| 374 | |
|---|
| 375 | the handle to slide the volume, also indicates the volume level. |
|---|
| 376 | |
|---|
| 377 | .. image:: ../images/skinning/volumeSlider.png |
|---|
| 378 | :alt: VolumeSlider Screenshot |
|---|
| 379 | |
|---|
| 380 | |
|---|
| 381 | .. note:: JW Player 5's skinning model will add 5 pixels of padding to each side of the **volumeSlider** if no end-caps are specified. |
|---|
| 382 | .. note:: JW Player 5.1 and below will fail to load without the **volumeSliderRail** element in the XML file. |
|---|
| 383 | |
|---|
| 384 | BlankButton |
|---|
| 385 | ........... |
|---|
| 386 | |
|---|
| 387 | The **blankButton** element is used when plugins insert additional buttons into the Controlbar. This element should simply be a button background; the foreground element will be added by the plugins. |
|---|
| 388 | |
|---|
| 389 | Text Fields |
|---|
| 390 | ........... |
|---|
| 391 | |
|---|
| 392 | Two text fields can be laid out in the controlbar: |
|---|
| 393 | |
|---|
| 394 | .. describe:: elapsed |
|---|
| 395 | |
|---|
| 396 | Amount of time elapsed since the start of the video (format: mm:ss) |
|---|
| 397 | |
|---|
| 398 | .. describe:: duration |
|---|
| 399 | |
|---|
| 400 | Duration of the currently playing video (format: mm:ss) |
|---|
| 401 | |
|---|
| 402 | |
|---|
| 403 | Controlbar Layout |
|---|
| 404 | ................. |
|---|
| 405 | |
|---|
| 406 | The controlbar's components (*buttons*, *text fields*, *sliders* and *dividers*) are laid out according to a block of XML code in the Controlbar section. |
|---|
| 407 | |
|---|
| 408 | Layout XML Syntax |
|---|
| 409 | +++++++++++++++++ |
|---|
| 410 | |
|---|
| 411 | Inside the controlbar's **<component>** block, you can insert an optional **<layout>** block which allows you to override the default controlbar layout. |
|---|
| 412 | |
|---|
| 413 | .. code-block:: xml |
|---|
| 414 | |
|---|
| 415 | <layout> |
|---|
| 416 | <group position="left"> |
|---|
| 417 | <button name="play" /> |
|---|
| 418 | <divider /> |
|---|
| 419 | <button name="prev" /> |
|---|
| 420 | <divider /> |
|---|
| 421 | <button name="next" /> |
|---|
| 422 | <divider /> |
|---|
| 423 | <button name="stop" /> |
|---|
| 424 | <divider /> |
|---|
| 425 | <text name="duration" /> |
|---|
| 426 | <divider /> |
|---|
| 427 | </group> |
|---|
| 428 | <group position="center"> |
|---|
| 429 | <slider name="time" /> |
|---|
| 430 | </group> |
|---|
| 431 | <group position="right"> |
|---|
| 432 | <text name="elapsed" /> |
|---|
| 433 | <divider /> |
|---|
| 434 | <button name="blank" /> |
|---|
| 435 | <divider /> |
|---|
| 436 | <button name="mute" /> |
|---|
| 437 | <slider name="volume" /> |
|---|
| 438 | <divider /> |
|---|
| 439 | <button name="fullscreen" /> |
|---|
| 440 | </group> |
|---|
| 441 | </layout> |
|---|
| 442 | |
|---|
| 443 | Layout Groups |
|---|
| 444 | +++++++++++++ |
|---|
| 445 | |
|---|
| 446 | The Controlbar's layout is made up of three groupings, *left*, *right* and *center*. |
|---|
| 447 | |
|---|
| 448 | * Left: |
|---|
| 449 | |
|---|
| 450 | Elements placed in the **<group position="left">** tag will be placed left to right and be left-aligned. |
|---|
| 451 | |
|---|
| 452 | * Center: |
|---|
| 453 | |
|---|
| 454 | Elements placed in the **<group position="center">** tag will be placed between the *left* and *right* groups. Furthermore, if the **timeSlider** element is placed here, it will be stretched to any space not assigned to other elements. |
|---|
| 455 | |
|---|
| 456 | * Right: |
|---|
| 457 | |
|---|
| 458 | Elements placed in the **<group position="right">** tag will be placed left to right and be right-aligned. |
|---|
| 459 | |
|---|
| 460 | Layout Elements |
|---|
| 461 | +++++++++++++++ |
|---|
| 462 | |
|---|
| 463 | The **<group>** tag can contain the following elements: |
|---|
| 464 | |
|---|
| 465 | .. describe:: <button name="..." /> |
|---|
| 466 | |
|---|
| 467 | Used to place the Controlbar button elements described above. For example, the **play** button would appear as **<button name="play" />** |
|---|
| 468 | |
|---|
| 469 | .. describe:: <text name="..." /> |
|---|
| 470 | |
|---|
| 471 | Used to place the Controlbar text elements, **elapsed** and **duration**. |
|---|
| 472 | |
|---|
| 473 | .. describe:: <slider name="..." /> |
|---|
| 474 | |
|---|
| 475 | Used to place the Controlbar slider elements, **timeSlider** and **volumeSlider**. |
|---|
| 476 | |
|---|
| 477 | .. describe:: <divider /> |
|---|
| 478 | |
|---|
| 479 | Used to place the **divider** element. This tag can define two optional attributes (only one attribute may be used at a time): |
|---|
| 480 | |
|---|
| 481 | * *element*: Allows an arbitrary element to be placed between other elements. If no *element* or *width* attribute is set, the default **divider** graphic is used. Example: |
|---|
| 482 | |
|---|
| 483 | .. code-block:: xml |
|---|
| 484 | |
|---|
| 485 | <divider element="alternate_divider" /> |
|---|
| 486 | * *width*: If this attribute is set, the specified number of pixels will be placed into the layout. No graphical element will be used; the controlbar's **background** element will be visible. Example: |
|---|
| 487 | |
|---|
| 488 | .. code-block:: xml |
|---|
| 489 | |
|---|
| 490 | <divider width="10" /> |
|---|
| 491 | |
|---|
| 492 | |
|---|
| 493 | Controlbar Composition |
|---|
| 494 | ++++++++++++++++++++++ |
|---|
| 495 | |
|---|
| 496 | .. image:: ../images/skinning/controlBar.png |
|---|
| 497 | :alt: Controlbar Screenshot |
|---|
| 498 | |
|---|
| 499 | |
|---|
| 500 | Default Element Order |
|---|
| 501 | +++++++++++++++++++++ |
|---|
| 502 | |
|---|
| 503 | If no **<layout>** block is included in the skin, the player will use a default layout, based on which skin elements have been defined in the **<elements>** block. The elements will be layed out in the following order: |
|---|
| 504 | |
|---|
| 505 | * capLeft |
|---|
| 506 | * playButton/pauseButton |
|---|
| 507 | * prevButton |
|---|
| 508 | * nextButton |
|---|
| 509 | * stopButton |
|---|
| 510 | * divider |
|---|
| 511 | * elapsedText |
|---|
| 512 | * timeSliderCapLeft |
|---|
| 513 | * timeSliderRail/timeSliderBuffer/timeSliderProgress/timeSliderThumb |
|---|
| 514 | * timeSliderCapRight |
|---|
| 515 | * durationText |
|---|
| 516 | * divider (*reused element*) |
|---|
| 517 | * blankButton |
|---|
| 518 | * divider (*reused element*) |
|---|
| 519 | * fullscreenButton/normalscreenButton |
|---|
| 520 | * divider (*reused element*) |
|---|
| 521 | * muteButton/unmuteButton |
|---|
| 522 | * volumeSliderCapLeft |
|---|
| 523 | * volumeSliderRail/volumeSliderBuffer/volumeSliderProgress/volumeSliderThumb |
|---|
| 524 | * volumeSliderCapRight |
|---|
| 525 | * capRight |
|---|
| 526 | |
|---|
| 527 | |
|---|
| 528 | |
|---|
| 529 | Display Icons |
|---|
| 530 | ------------- |
|---|
| 531 | |
|---|
| 532 | Display Icons are the buttons you see in the middle of the player. You see the familiar triangular **play** icon before the movie is playing, and also when you pause. When the user has muted the player, the **Mute** icon appears. Display Icons come in two parts: a global background element to every icon, and the icon itself, which is programmatically centered over the background layer. All images must reside in the *display* subdirectory of the skin. |
|---|
| 533 | |
|---|
| 534 | .. image:: ../images/skinning/Display.png |
|---|
| 535 | :alt: Display Screenshot |
|---|
| 536 | |
|---|
| 537 | .. note:: By default, the **bufferIcon** will rotate clockwise while buffering. |
|---|
| 538 | |
|---|
| 539 | Display XML Syntax |
|---|
| 540 | .................. |
|---|
| 541 | |
|---|
| 542 | .. code-block:: xml |
|---|
| 543 | |
|---|
| 544 | <component name="display"> |
|---|
| 545 | <settings> |
|---|
| 546 | <settings> |
|---|
| 547 | <setting name="backgroundcolor" value="0x000000" /> |
|---|
| 548 | <setting name="bufferrotation" value="15" /> |
|---|
| 549 | <setting name="bufferinterval" value="100" /> |
|---|
| 550 | </settings> |
|---|
| 551 | </settings> |
|---|
| 552 | <elements> |
|---|
| 553 | <element name="background" src="file.png" /> |
|---|
| 554 | <element name="playIcon" src="file.png" /> |
|---|
| 555 | <element name="muteIcon" src="file.png" /> |
|---|
| 556 | <element name="bufferIcon" src="file.png" /> |
|---|
| 557 | </elements> |
|---|
| 558 | </component> |
|---|
| 559 | |
|---|
| 560 | Display Settings |
|---|
| 561 | ................ |
|---|
| 562 | |
|---|
| 563 | Here is a list of Display settings, along with their default values: |
|---|
| 564 | |
|---|
| 565 | .. describe:: backgroundcolor (0x000000) |
|---|
| 566 | |
|---|
| 567 | This is the color of the player's display window, which appears behind any playing media. |
|---|
| 568 | |
|---|
| 569 | .. describe:: bufferrotation (15) |
|---|
| 570 | |
|---|
| 571 | The number of degrees the buffer icon is rotated per rotation. A negative value will result in the buffer rotating counter-clockwise. |
|---|
| 572 | |
|---|
| 573 | .. describe:: bufferinterval (100) |
|---|
| 574 | |
|---|
| 575 | The amount of time, in milliseconds between each buffer icon rotation. |
|---|
| 576 | |
|---|
| 577 | |
|---|
| 578 | |
|---|
| 579 | Dock Icons |
|---|
| 580 | ---------- |
|---|
| 581 | |
|---|
| 582 | Dock Icons elements sit at the top right corner of your player and can be both informative or functional. For instance, if you've installed the HD plugin, once you've toggled High Definition Playback to ON, a small HD Dock Icon will appear in top corner of your player, letting you know you're watching in HD. The Dock Icon only has one element: |
|---|
| 583 | |
|---|
| 584 | * button |
|---|
| 585 | * buttonOver (*the button's mouseover state*) |
|---|
| 586 | |
|---|
| 587 | .. image:: ../images/skinning/Dock.png |
|---|
| 588 | :alt: Dock Screenshot |
|---|
| 589 | |
|---|
| 590 | |
|---|
| 591 | Dock XML Syntax |
|---|
| 592 | ............... |
|---|
| 593 | |
|---|
| 594 | .. code-block:: xml |
|---|
| 595 | |
|---|
| 596 | <component name="dock"> |
|---|
| 597 | <settings> |
|---|
| 598 | <setting name="fontcolor" value="0x000000" /> |
|---|
| 599 | </settings> |
|---|
| 600 | <elements> |
|---|
| 601 | <element name="button" src="file.png" /> |
|---|
| 602 | <element name="buttonOver" src="file.png" /> |
|---|
| 603 | </elements> |
|---|
| 604 | </component> |
|---|
| 605 | |
|---|
| 606 | |
|---|
| 607 | Dock Settings |
|---|
| 608 | ............. |
|---|
| 609 | |
|---|
| 610 | Here is a list of the settings that can be placed in the dock's **<settings>** block, along with their default values: |
|---|
| 611 | |
|---|
| 612 | .. describe:: fontcolor (0x000000) |
|---|
| 613 | |
|---|
| 614 | The color for the Dock buttons' text fields. |
|---|
| 615 | |
|---|
| 616 | |
|---|
| 617 | Playlist |
|---|
| 618 | -------- |
|---|
| 619 | |
|---|
| 620 | There are two main Playlist skin elements; Playlist Items, and the Playlist Slider. Item graphics scale horizontally and are placed behind the description/thumbnail of videos in your playlist. The slider is a vertical scrollbar rail and handle (thumb), with optional top and bottom endcaps. The *background* element serves as the default background of the playlist if there are fewer elements than the height of the playlist. |
|---|
| 621 | |
|---|
| 622 | |
|---|
| 623 | .. image:: ../images/skinning/Playlist.png |
|---|
| 624 | :alt: Playlist Screenshot |
|---|
| 625 | |
|---|
| 626 | The following Playlist elements are available: |
|---|
| 627 | |
|---|
| 628 | .. describe:: background |
|---|
| 629 | |
|---|
| 630 | Stretched behind the playlist items |
|---|
| 631 | |
|---|
| 632 | .. describe:: item |
|---|
| 633 | |
|---|
| 634 | Background graphic for each playlist item. Stretch to the width of the playlist, minus the slider width (if necessary). |
|---|
| 635 | |
|---|
| 636 | .. describe:: itemOver |
|---|
| 637 | |
|---|
| 638 | Over state for **item**. Replaces **item** whenever the user mouses over. |
|---|
| 639 | |
|---|
| 640 | .. describe:: itemImage |
|---|
| 641 | |
|---|
| 642 | Image placeholder. This element is visible when the playlist item does not have an image associated with it. If the playlist item image is present, **itemImage**'s shape serves as a mask around the playlist item image. If the playlist item image has any transparency, **itemImage** will be visible behind it. |
|---|
| 643 | |
|---|
| 644 | .. describe:: itemActive |
|---|
| 645 | |
|---|
| 646 | Active state for **item**. Replaces **item** whenever the corresponding playlist item is the currently playing/loaded playlist item. |
|---|
| 647 | |
|---|
| 648 | .. describe:: sliderRail |
|---|
| 649 | |
|---|
| 650 | Background of the vertical slider. When the playlist's slider is visible, **sliderRail** is stretched to the height of the playlist, minus the height of any end caps. |
|---|
| 651 | |
|---|
| 652 | .. describe:: sliderThumb |
|---|
| 653 | |
|---|
| 654 | Draggable thumb for the vertical slider. This element is stretched vertically, and is proportional to the visible area of the playlist versus its total size. For example, if 50% of the playlist items are currently visible in the playlist, the thumb will be 50% of the height of the playlist. |
|---|
| 655 | |
|---|
| 656 | .. describe:: sliderCapTop |
|---|
| 657 | |
|---|
| 658 | Top end cap for the playlist slider. Placed above **sliderRail**. |
|---|
| 659 | |
|---|
| 660 | .. describe:: sliderCapBottom |
|---|
| 661 | |
|---|
| 662 | Bottom end cap for the playlist slider. Placed below **sliderRail**. |
|---|
| 663 | |
|---|
| 664 | |
|---|
| 665 | Playlist XML Syntax |
|---|
| 666 | ................... |
|---|
| 667 | |
|---|
| 668 | |
|---|
| 669 | .. code-block:: xml |
|---|
| 670 | |
|---|
| 671 | <component name="playlist"> |
|---|
| 672 | <settings> |
|---|
| 673 | <setting name="fontcolor" value="0x999999" /> |
|---|
| 674 | <setting name="overcolor" value="0xFFFFFF" /> |
|---|
| 675 | <setting name="activecolor" value="0x990000" /> |
|---|
| 676 | <setting name="backgroundcolor" value="0x000000"/> |
|---|
| 677 | <setting name="font" value="_sans" /> |
|---|
| 678 | <setting name="fontsize" value="12" /> |
|---|
| 679 | <setting name="fontweight" value="normal" /> |
|---|
| 680 | <setting name="fontstyle" value="normal" /> |
|---|
| 681 | </settings> |
|---|
| 682 | <elements> |
|---|
| 683 | <element name="background" src="background.png" /> |
|---|
| 684 | <element name="item" src="item.png" />
|
|---|
| 685 | <element name="itemOver" src="itemOver.png" />
|
|---|
| 686 | <element name="itemActive" src="itemActive.png" />
|
|---|
| 687 | <element name="itemImage" src="itemImage.png" />
|
|---|
| 688 | <element name="sliderRail" src="sliderRail.png" />
|
|---|
| 689 | <element name="sliderThumb" src="sliderThumb.png" />
|
|---|
| 690 | <element name="sliderCapTop" src="sliderCapTop.png" />
|
|---|
| 691 | <element name="sliderCapBottom" src="sliderCapBottom.png" />
|
|---|
| 692 | </elements> |
|---|
| 693 | </component> |
|---|
| 694 | |
|---|
| 695 | Playlist Settings |
|---|
| 696 | ................. |
|---|
| 697 | |
|---|
| 698 | Here is a list of the settings that can be placed in the dock's **<settings>** block, along with their default values: |
|---|
| 699 | |
|---|
| 700 | .. describe:: fontcolor (undefined) |
|---|
| 701 | |
|---|
| 702 | The color for the Dock buttons' text fields. |
|---|
| 703 | |
|---|
| 704 | .. describe:: overcolor (undefined) |
|---|
| 705 | |
|---|
| 706 | The color for the Dock buttons' text fields when the mouse is hovering over that item. |
|---|
| 707 | |
|---|
| 708 | .. describe:: activecolor (undefined) |
|---|
| 709 | |
|---|
| 710 | The color for the Dock buttons' text fields when that item is the currently active item. |
|---|
| 711 | |
|---|
| 712 | .. describe:: backgroundcolor (undefined) |
|---|
| 713 | |
|---|
| 714 | The playlist's background color. |
|---|
| 715 | |
|---|
| 716 | .. describe:: font (_sans) |
|---|
| 717 | |
|---|
| 718 | Font used for the playlist's text fields (*_sans*, *_serif*, *_typewriter*) |
|---|
| 719 | |
|---|
| 720 | .. describe:: fontsize (undefined) |
|---|
| 721 | |
|---|
| 722 | Font size for the playlist's text fields. By default, the playlist item's title has a fontsize of 13 pixels; the rest of the fields are 11 pixels. If **fontsize** is set, all text fields will have the same font size. |
|---|
| 723 | |
|---|
| 724 | .. describe:: fontstyle (normal) |
|---|
| 725 | |
|---|
| 726 | Can be used to set the font style for the playlist's text fields (*normal*, *italic*) |
|---|
| 727 | |
|---|
| 728 | .. describe:: fontweight (normal) |
|---|
| 729 | |
|---|
| 730 | Can be used to set the font weight for the playlist's text fields (*normal*, *bold*) |
|---|
| 731 | |
|---|
| 732 | |
|---|
| 733 | Plugins |
|---|
| 734 | ------- |
|---|
| 735 | |
|---|
| 736 | Some plugins allow their elements to be skinned as well. If so, you can place those elements directly in your skin, the same way you skin built-in player components. The *name* attribute must match the plugin's *id*. All plugin elements must be placed in a folder whose name also matches the plugin's *id*. |
|---|
| 737 | |
|---|
| 738 | In the following example, the skin defines the HD plugin's two skinnable elements: |
|---|
| 739 | |
|---|
| 740 | .. code-block:: xml |
|---|
| 741 | |
|---|
| 742 | <component name="hd">
|
|---|
| 743 | <elements>
|
|---|
| 744 | <element name="dockIcon" src="dockIcon.png" />
|
|---|
| 745 | <element name="controlbarIcon" src="controlbarIcon.png" />
|
|---|
| 746 | </elements>
|
|---|
| 747 | </component>
|
|---|
| 748 | |
|---|
| 749 | |
|---|
| 750 | |
|---|
| 751 | =================== |
|---|
| 752 | Packaging your Skin |
|---|
| 753 | =================== |
|---|
| 754 | |
|---|
| 755 | Packaging your skin is as easy as zipping the skin XML file along with the subfolders containing the component graphics. |
|---|
| 756 | |
|---|
| 757 | Zip File Structure |
|---|
| 758 | ------------------ |
|---|
| 759 | |
|---|
| 760 | The XML file should named the same as the skin itself. For example, a skin called *myskin* would contain an XML file called *myskin.xml*, and would be zipped into *myskin.zip*. All images belong in their corresponding folders and reside on the same level as the XML file. |
|---|
| 761 | |
|---|
| 762 | * *skin_name*.xml |
|---|
| 763 | * controlbar (folder with images) |
|---|
| 764 | * display (folder with images) |
|---|
| 765 | * dock (folder with images) |
|---|
| 766 | * playlist (folder with images) |
|---|
| 767 | |
|---|
| 768 | Once you have zipped everything up, see :ref:`usingskins` for instructions on embedding your skin into the JW Player. |
|---|
| 769 | |
|---|
| 770 | |
|---|
| 771 | ============= |
|---|
| 772 | Example Skins |
|---|
| 773 | ============= |
|---|
| 774 | |
|---|
| 775 | `Download Example Skin: Beelden <http://developer.longtailvideo.com/trac/changeset/643/skins/beelden?old_path=%2F&format=zip>`_ - Example Skin Source (Files, XML, Photoshop Originals) |
|---|