| 1 | <!DOCTYPE html> |
|---|
| 2 | <html lang="en"> |
|---|
| 3 | <head> |
|---|
| 4 | |
|---|
| 5 | <meta charset="UTF-8"> |
|---|
| 6 | <script type="text/javascript" src="assets/jwplayer.min.js"></script> |
|---|
| 7 | <title>Captions in Playlist</title> |
|---|
| 8 | <style> |
|---|
| 9 | body { padding: 50px; font: 13px/20px Arial; background: #EEE; } |
|---|
| 10 | form,p, ul { margin-top: 20px; } |
|---|
| 11 | #player { -webkit-box-shadow: 0 0 5px #999; background: #000; color:#FFF; line-height:270px; text-align: center; } |
|---|
| 12 | </style> |
|---|
| 13 | |
|---|
| 14 | </head> |
|---|
| 15 | <body> |
|---|
| 16 | |
|---|
| 17 | <h2>Captions in Playlist</h2> |
|---|
| 18 | |
|---|
| 19 | <div id="player"></div> |
|---|
| 20 | <script type="text/javascript"> |
|---|
| 21 | function loadPlaylist(list) { |
|---|
| 22 | var options = { |
|---|
| 23 | controlbar: 'bottom', |
|---|
| 24 | flashplayer: 'assets/player.swf', |
|---|
| 25 | height: 300, |
|---|
| 26 | 'playlist.position': 'right', |
|---|
| 27 | 'playlist.size': 320, |
|---|
| 28 | plugins: { |
|---|
| 29 | '../captions.js': {} |
|---|
| 30 | }, |
|---|
| 31 | stretching: 'fill', |
|---|
| 32 | width: 800 |
|---|
| 33 | } |
|---|
| 34 | if(typeof(list) == 'string') { |
|---|
| 35 | options.file = list; |
|---|
| 36 | } else { |
|---|
| 37 | options.playlist = list; |
|---|
| 38 | } |
|---|
| 39 | jwplayer("player").setup(options); |
|---|
| 40 | }; |
|---|
| 41 | |
|---|
| 42 | var playlist = [{ |
|---|
| 43 | title: 'Coronation Street', |
|---|
| 44 | description: 'Single, external XML captions.', |
|---|
| 45 | file: 'http://content.bitsontherun.com/videos/7OCSON1y-393434.flv', |
|---|
| 46 | image: 'http://content.bitsontherun.com/thumbs/7OCSON1y-320.jpg', |
|---|
| 47 | 'captions.file': 'assets/corrie.xml' |
|---|
| 48 | },{ |
|---|
| 49 | title:'Big Buck Bunny', |
|---|
| 50 | description: 'Single, embedded MP4 captions.', |
|---|
| 51 | file: 'http://content.bitsontherun.com/videos/aytCR4cx-393434.mp4', |
|---|
| 52 | image: 'http://content.bitsontherun.com/thumbs/aytCR4cx-320.jpg' |
|---|
| 53 | },{ |
|---|
| 54 | title: 'Men With Talent', |
|---|
| 55 | description: 'No captions at all.', |
|---|
| 56 | file: 'http://content.bitsontherun.com/videos/SAs4hE5G-364766.mp4', |
|---|
| 57 | image: 'http://content.bitsontherun.com/thumbs/SAs4hE5G-320.jpg' |
|---|
| 58 | },{ |
|---|
| 59 | title: 'Global Timoto', |
|---|
| 60 | description: 'Multiple, embedded MP4 captions.', |
|---|
| 61 | file: 'http://content.bitsontherun.com/videos/w5VkaqJ1-393434.mp4', |
|---|
| 62 | image: 'http://content.bitsontherun.com/thumbs/w5VkaqJ1-320.jpg' |
|---|
| 63 | },{ |
|---|
| 64 | title: 'Sintel', |
|---|
| 65 | description: 'Multiple, external SRT captions.', |
|---|
| 66 | file: 'http://content.bitsontherun.com/videos/q1fx20VZ-364765.mp4', |
|---|
| 67 | image: 'http://content.bitsontherun.com/thumbs/q1fx20VZ-320.jpg', |
|---|
| 68 | 'captions.files': 'assets/sintel-dut.txt,assets/sintel-eng.txt,assets/sintel-fra.txt,assets/sintel-deu.txt,assets/sintel-ita.txt,assets/sintel-pol.txt,assets/sintel-por.txt,assets/sintel-rus.txt,assets/sintel-spa.txt' |
|---|
| 69 | }]; |
|---|
| 70 | </script> |
|---|
| 71 | |
|---|
| 72 | <ul> |
|---|
| 73 | <li><a href="javascript:loadPlaylist('assets/playlist.xml')">RSS Playlist</a></li> |
|---|
| 74 | <li><a href="javascript:loadPlaylist(playlist)">Inline playlist</a></li> |
|---|
| 75 | </ul> |
|---|
| 76 | <ul> |
|---|
| 77 | <li><a href="javascript:jwplayer().load({file:'http://content.bitsontherun.com/videos/7OCSON1y-393434.flv','captions.file':'assets/corrie.xml',title: 'Coronation Street'})">load() one video</a> |
|---|
| 78 | <li><a href="javascript:jwplayer().load('assets/playlist.xml')">load() RSS feed</a> |
|---|
| 79 | </ul> |
|---|
| 80 | |
|---|
| 81 | <p>Check whether the correct captions are shown.<br/> |
|---|
| 82 | Also check whether the button displays the correct state (on, off, not set). |
|---|
| 83 | </p><p> |
|---|
| 84 | The last two examples test the load() call of the API.<br/> |
|---|
| 85 | They only work if the player is already visible |
|---|
| 86 | </p> |
|---|
| 87 | |
|---|
| 88 | |
|---|
| 89 | </body> |
|---|
| 90 | </html> |
|---|