| 1 | <!doctype html> |
|---|
| 2 | <html> |
|---|
| 3 | <head> |
|---|
| 4 | <title>Controlbar CSS test</title> |
|---|
| 5 | <script src="../bin-debug/jwplayer.js"></script> |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | <style type="text/css"> |
|---|
| 9 | #player { |
|---|
| 10 | width: 720px; |
|---|
| 11 | height: 426px; |
|---|
| 12 | position: relative; |
|---|
| 13 | background-image: url('/testing/files/bunny_preview.png'); |
|---|
| 14 | background-size: 100% 100%; |
|---|
| 15 | } |
|---|
| 16 | |
|---|
| 17 | </style> |
|---|
| 18 | |
|---|
| 19 | <script type="text/javascript"> |
|---|
| 20 | var cb; |
|---|
| 21 | var form; |
|---|
| 22 | |
|---|
| 23 | function update(form) { |
|---|
| 24 | document.getElementById("player").style.width = form.size.value + "px"; |
|---|
| 25 | cb.resize(100, 100); |
|---|
| 26 | cb.setBuffer(form.buf.value / 100); |
|---|
| 27 | cb.setProgress(form.pct.value / 100); |
|---|
| 28 | } |
|---|
| 29 | |
|---|
| 30 | function init() { |
|---|
| 31 | form = document.getElementById("form"); |
|---|
| 32 | cb = new jwplayer.html5.controlbar(1, {skin: form.skin.options[form.skin.selectedIndex].value}); |
|---|
| 33 | setTimeout(function() { |
|---|
| 34 | document.getElementById('player').appendChild(cb.getDisplayElement()); |
|---|
| 35 | }, 1000); |
|---|
| 36 | } |
|---|
| 37 | |
|---|
| 38 | function replaceCB(skin) { |
|---|
| 39 | document.getElementById('player').removeChild(cb.getDisplayElement()); |
|---|
| 40 | var newcb = new jwplayer.html5.controlbar(1, {skin: skin.options[skin.selectedIndex].value}); |
|---|
| 41 | setTimeout(function() { |
|---|
| 42 | document.getElementById('player').appendChild(newcb.getDisplayElement()); |
|---|
| 43 | cb = newcb; |
|---|
| 44 | }, 500); |
|---|
| 45 | } |
|---|
| 46 | </script> |
|---|
| 47 | </head> |
|---|
| 48 | |
|---|
| 49 | <body onload="init()"> |
|---|
| 50 | <form id="form" onsubmit="update(this); return false;"> |
|---|
| 51 | width: <input name="size" value="720" style="width: 50px"> |
|---|
| 52 | buffer: <input name="buf" value="70" style="width: 50px"> |
|---|
| 53 | pct: <input name="pct" value="10" style="width: 50px"> |
|---|
| 54 | skin: <select name="skin" onchange="replaceCB(this)"> |
|---|
| 55 | <option value="">default</option> |
|---|
| 56 | <option value="/skins/beelden/beelden.xml" selected>beelden</option> |
|---|
| 57 | <option value="/skins/glow/src/glow.xml">glow</option> |
|---|
| 58 | <option value="/skins/five/five.xml">five</option> |
|---|
| 59 | <option value="/tags/skins/snel/snel.xml">snel</option> |
|---|
| 60 | <option value="/skins/stijl/stijl.xml">stijl</option> |
|---|
| 61 | <option value="/skins/bekle/bekle.xml">bekle</option> |
|---|
| 62 | </select> |
|---|
| 63 | <input type="submit" style="opacity:0; left: -10000px"/> |
|---|
| 64 | </form> |
|---|
| 65 | |
|---|
| 66 | |
|---|
| 67 | <div id="player"> |
|---|
| 68 | </div> |
|---|
| 69 | |
|---|
| 70 | </body> |
|---|
| 71 | </html> |
|---|