Changeset 2217
- Timestamp:
- 05/30/12 06:05:55 (12 months ago)
- Location:
- branches/jw6
- Files:
-
- 1 added
- 61 edited
-
bin-debug/jwplayer.flash.swf (modified) (previous)
-
bin-debug/jwplayer.html5.js (modified) (46 diffs)
-
bin-debug/jwplayer.js (modified) (51 diffs)
-
jwplayer.flash.swf (modified) (previous)
-
jwplayer.html5.js (modified) (1 diff)
-
jwplayer.js (modified) (1 diff)
-
src/flash/com/longtailvideo/jwplayer/controller/Controller.as (modified) (8 diffs)
-
src/flash/com/longtailvideo/jwplayer/controller/MediaProviderLoader.as (modified) (3 diffs)
-
src/flash/com/longtailvideo/jwplayer/controller/PlayerSetup.as (modified) (2 diffs)
-
src/flash/com/longtailvideo/jwplayer/controller/PluginLoader.as (modified) (5 diffs)
-
src/flash/com/longtailvideo/jwplayer/events/MediaEvent.as (modified) (4 diffs)
-
src/flash/com/longtailvideo/jwplayer/media/HTTPMediaProvider.as (modified) (3 diffs)
-
src/flash/com/longtailvideo/jwplayer/media/IMediaProvider.as (added)
-
src/flash/com/longtailvideo/jwplayer/media/MediaProvider.as (modified) (5 diffs)
-
src/flash/com/longtailvideo/jwplayer/media/RTMPMediaProvider.as (modified) (6 diffs)
-
src/flash/com/longtailvideo/jwplayer/media/VideoMediaProvider.as (modified) (7 diffs)
-
src/flash/com/longtailvideo/jwplayer/model/Model.as (modified) (6 diffs)
-
src/flash/com/longtailvideo/jwplayer/model/PlayerConfig.as (modified) (1 diff)
-
src/flash/com/longtailvideo/jwplayer/model/Playlist.as (modified) (1 diff)
-
src/flash/com/longtailvideo/jwplayer/model/PlaylistItem.as (modified) (9 diffs)
-
src/flash/com/longtailvideo/jwplayer/model/PlaylistItemLevel.as (modified) (2 diffs)
-
src/flash/com/longtailvideo/jwplayer/parsers/JWParser.as (modified) (2 diffs)
-
src/flash/com/longtailvideo/jwplayer/parsers/LoadbalanceParser.as (modified) (1 diff)
-
src/flash/com/longtailvideo/jwplayer/parsers/ParserFactory.as (modified) (1 diff)
-
src/flash/com/longtailvideo/jwplayer/player/IPlayer.as (modified) (1 diff)
-
src/flash/com/longtailvideo/jwplayer/player/InstreamPlayer.as (modified) (1 diff)
-
src/flash/com/longtailvideo/jwplayer/player/JavascriptAPI.as (modified) (3 diffs)
-
src/flash/com/longtailvideo/jwplayer/player/Player.as (modified) (2 diffs)
-
src/flash/com/longtailvideo/jwplayer/player/PlayerState.as (modified) (1 diff)
-
src/flash/com/longtailvideo/jwplayer/player/PlayerVersion.as (modified) (1 diff)
-
src/flash/com/longtailvideo/jwplayer/utils/AssetLoader.as (modified) (4 diffs)
-
src/flash/com/longtailvideo/jwplayer/utils/JavascriptSerialization.as (modified) (1 diff)
-
src/flash/com/longtailvideo/jwplayer/utils/Strings.as (modified) (1 diff)
-
src/flash/com/longtailvideo/jwplayer/view/View.as (modified) (1 diff)
-
src/flash/com/longtailvideo/jwplayer/view/components/ControlbarComponent.as (modified) (1 diff)
-
src/flash/com/longtailvideo/jwplayer/view/skins/PNGSkin.as (modified) (1 diff)
-
src/flash/com/longtailvideo/jwplayer/view/skins/ZIPSkin.as (modified) (2 diffs)
-
src/js/api/jwplayer.api.js (modified) (2 diffs)
-
src/js/embed/jwplayer.embed.config.js (modified) (2 diffs)
-
src/js/embed/jwplayer.embed.download.js (modified) (3 diffs)
-
src/js/embed/jwplayer.embed.flash.js (modified) (7 diffs)
-
src/js/embed/jwplayer.embed.html5.js (modified) (5 diffs)
-
src/js/embed/jwplayer.embed.js (modified) (4 diffs)
-
src/js/events/jwplayer.events.js (modified) (1 diff)
-
src/js/html5/jwplayer.html5.controller.js (modified) (4 diffs)
-
src/js/html5/jwplayer.html5.display.js (modified) (9 diffs)
-
src/js/html5/jwplayer.html5.js (modified) (1 diff)
-
src/js/html5/jwplayer.html5.player.js (modified) (3 diffs)
-
src/js/html5/jwplayer.html5.playlistloader.js (modified) (1 diff)
-
src/js/html5/jwplayer.html5.setup.js (modified) (4 diffs)
-
src/js/html5/jwplayer.html5.skin.js (modified) (1 diff)
-
src/js/html5/jwplayer.html5.skinloader.js (modified) (3 diffs)
-
src/js/html5/jwplayer.html5.video.js (modified) (15 diffs)
-
src/js/html5/jwplayer.html5.view.js (modified) (3 diffs)
-
src/js/html5/utils/jwplayer.html5.utils.js (modified) (2 diffs)
-
src/js/jwplayer.js (modified) (1 diff)
-
src/js/playlist/jwplayer.playlist.item.js (modified) (2 diffs)
-
src/js/playlist/jwplayer.playlist.source.js (modified) (1 diff)
-
src/js/plugins/jwplayer.plugins.plugin.js (modified) (6 diffs)
-
src/js/plugins/jwplayer.plugins.pluginloader.js (modified) (6 diffs)
-
src/js/utils/jwplayer.utils.js (modified) (11 diffs)
-
test/audio.html (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/jw6/bin-debug/jwplayer.html5.js
r2203 r2217 7 7 (function(jwplayer) { 8 8 jwplayer.html5 = {}; 9 jwplayer.html5.version = '6.0.22 03';9 jwplayer.html5.version = '6.0.2217'; 10 10 })(jwplayer);/** 11 11 * HTML5-only utilities for the JW Player. … … 15 15 */ 16 16 (function(utils) { 17 17 var DOCUMENT = document, WINDOW = window; 18 18 19 /** 19 20 * Basic serialization: string representations of booleans and numbers are … … 37 38 } 38 39 } 39 40 41 42 utils.sortSources = function(sources) { 43 var sorted = {}; 44 if (sources) { 45 for (var i=0; i<sources.length; i++) { 46 var type = sources[i].type, 47 file = sources[i].file; 48 if (!type) { 49 type = utils.extension(file); 50 sources[i].type = type; 51 } 52 if (!sorted[type]) sorted[type] = []; 53 sorted[type].push(sources[i]); 54 } 55 } 56 return sorted; 57 } 58 59 /** Loads an XML file into a DOM object * */ 60 utils.ajax = function(xmldocpath, completecallback, errorcallback) { 61 var xmlhttp; 62 if (_isCrossdomain(xmldocpath) && utils.exists(WINDOW.XDomainRequest)) { 63 // IE9 64 xmlhttp = new XDomainRequest(); 65 xmlhttp.onload = _ajaxComplete(xmlhttp, xmldocpath, completecallback, errorcallback); 66 xmlhttp.onerror = _ajaxError(errorcallback, xmldocpath, xmlhttp); 67 } else if (utils.exists(WINDOW.XMLHttpRequest)) { 68 // Firefox, Chrome, Opera, Safari 69 xmlhttp = new XMLHttpRequest(); 70 xmlhttp.onreadystatechange = _readyStateChangeHandler(xmlhttp, xmldocpath, completecallback, errorcallback); 71 xmlhttp.onerror = _ajaxError(errorcallback, xmldocpath); 72 } else { 73 if (errorcallback) errorcallback(); 74 } 75 76 try { 77 xmlhttp.open("GET", xmldocpath, true); 78 xmlhttp.send(null); 79 } catch (error) { 80 if (errorcallback) errorcallback(xmldocpath); 81 } 82 return xmlhttp; 83 }; 84 85 function _isCrossdomain(path) { 86 if (path && path.indexOf("://") >= 0) { 87 if (path.split("/")[2] != WINDOW.location.href.split("/")[2]) 88 return true 89 } 90 return false; 91 } 92 93 function _ajaxError(errorcallback, xmldocpath, xmlhttp) { 94 return function() { 95 errorcallback("Error loading file"); 96 } 97 } 98 99 function _readyStateChangeHandler(xmlhttp, xmldocpath, completecallback, errorcallback) { 100 return function() { 101 if (xmlhttp.readyState === 4) { 102 switch (xmlhttp.status) { 103 case 200: 104 _ajaxComplete(xmlhttp, xmldocpath, completecallback, errorcallback)(); 105 break; 106 case 404: 107 errorcallback("File not found"); 108 } 109 } 110 } 111 } 112 113 function _ajaxComplete(xmlhttp, xmldocpath, completecallback, errorcallback) { 114 return function() { 115 // Handle the case where an XML document was returned with an incorrect MIME type. 116 if (!utils.exists(xmlhttp.responseXML)) { 117 try { 118 var parsedXML; 119 // Parse XML in FF/Chrome/Safari/Opera 120 if (WINDOW.DOMParser) { 121 parsedXML = (new DOMParser()).parseFromString(xmlhttp.responseText,"text/xml"); 122 } else { 123 // Internet Explorer 124 parsedXML = new ActiveXObject("Microsoft.XMLDOM"); 125 parsedXML.async="false"; 126 parsedXML.loadXML(xmlhttp.responseText); 127 } 128 if (parsedXML) { 129 xmlhttp = utils.extend({}, xmlhttp, {responseXML:parsedXML}); 130 } 131 } catch(e) { 132 if (errorcallback) errorcallback(xmldocpath); 133 return; 134 } 135 } 136 completecallback(xmlhttp); 137 } 138 } 139 140 /** 141 * Cleans up a css dimension (e.g. '420px') and returns an integer. 142 */ 143 utils.parseDimension = function(dimension) { 144 if (typeof dimension == "string") { 145 if (dimension === "") { 146 return 0; 147 } else if (dimension.lastIndexOf("%") > -1) { 148 return dimension; 149 } else { 150 return parseInt(dimension.replace("px", ""), 10); 151 } 152 } 153 return dimension; 154 } 155 156 157 158 /** Format the elapsed / remaining text. **/ 159 utils.timeFormat = function(sec) { 160 if (sec > 0) { 161 var str = Math.floor(sec / 60) < 10 ? "0" + Math.floor(sec / 60) + ":" : Math.floor(sec / 60) + ":"; 162 str += Math.floor(sec % 60) < 10 ? "0" + Math.floor(sec % 60) : Math.floor(sec % 60); 163 return str; 164 } else { 165 return "00:00"; 166 } 167 } 168 169 /** Replacement for getBoundingClientRect, which isn't supported in iOS 3.1.2 **/ 170 utils.getBoundingClientRect = function(element) { 171 if (typeof element.getBoundingClientRect == "function") { 172 return element.getBoundingClientRect(); 173 } else { 174 return { 175 left: element.offsetLeft + DOCUMENT.body.scrollLeft, 176 top: element.offsetTop + DOCUMENT.body.scrollTop, 177 width: element.offsetWidth, 178 height: element.offsetHeight 179 }; 180 } 181 } 182 183 184 40 185 })(jwplayer.utils);/** 41 186 * Utility methods for the JW Player. … … 1591 1736 function _setStretching(stretching) { 1592 1737 _model.stretching = stretching; 1738 // TODO: Send stretching event 1593 1739 _view.resize(); 1594 1740 } … … 1635 1781 } 1636 1782 1637 1638 1783 function _setCurrentQuality(quality) { 1784 _video.setCurrentQuality(quality); 1785 } 1786 1787 function _getCurrentQuality() { 1788 if (_video) return _video.getCurrentQuality(); 1789 else return -1; 1790 } 1791 1792 function _getQualityLevels() { 1793 if (_video) return _video.getQualityLevels(); 1794 else return null; 1795 } 1796 1639 1797 /** Used for the InStream API **/ 1640 1798 function _detachMedia() { … … 1675 1833 } 1676 1834 1677 1678 1835 /** Controller API / public methods **/ 1679 1836 this.play = _waitForReady(_play); … … 1691 1848 this.detachMedia = _detachMedia; 1692 1849 this.attachMedia = _attachMedia; 1850 this.setCurrentQuality = _waitForReady(_setCurrentQuality); 1851 this.getCurrentQuality = _getCurrentQuality; 1852 this.getQualityLevels = _getQualityLevels; 1693 1853 1694 1854 this.playerReady = _playerReady; … … 1741 1901 D_CLASS = ".jwdisplay", 1742 1902 D_PREVIEW_CLASS = ".jwpreview", 1903 D_ERROR_CLASS = ".jwerror", 1743 1904 1744 1905 /** Some CSS constants we should use for minimization **/ … … 1746 1907 JW_CSS_NONE = "none", 1747 1908 JW_CSS_100PCT = "100%", 1909 JW_CSS_HIDDEN = "hidden", 1748 1910 JW_CSS_SMOOTH_EASE = "opacity .25s"; 1749 1911 … … 1755 1917 _image, _imageWidth, _imageHeight, _imageURL, 1756 1918 _icons = {}, 1919 _errorState = false, 1920 _errorText, 1757 1921 _hiding, 1758 1922 _button, … … 1780 1944 _api.jwAddEventListener(events.JWPLAYER_PLAYER_STATE, _stateHandler); 1781 1945 _api.jwAddEventListener(events.JWPLAYER_PLAYLIST_ITEM, _itemHandler); 1782 1946 _api.jwAddEventListener(events.JWPLAYER_MEDIA_ERROR, _errorHandler); 1947 1783 1948 _display.addEventListener('click', _clickHandler, false); 1784 1949 1785 1950 _createIcons(); 1951 _createTextFields(); 1786 1952 1787 1953 _stateHandler({newstate:states.IDLE}); … … 1867 2033 } 1868 2034 2035 2036 function _createTextFields() { 2037 _errorText = DOCUMENT.createElement("div"); 2038 _errorText.className = "jwerror"; 2039 _display.appendChild(_errorText); 2040 } 2041 1869 2042 function _setIcon(name) { 1870 2043 if (!_config.showicons) return; … … 1912 2085 case states.COMPLETED: 1913 2086 case states.IDLE: 1914 _setVisibility(D_PREVIEW_CLASS, true); 1915 _setIcon('play'); 2087 if (!_errorState) { 2088 _setVisibility(D_PREVIEW_CLASS, true); 2089 _setIcon('play'); 2090 } 1916 2091 break; 1917 2092 case states.BUFFERING: 2093 _clearError(); 1918 2094 _setIcon('buffer'); 1919 2095 break; … … 1970 2146 } 1971 2147 2148 function _errorHandler(evt) { 2149 _errorState = true; 2150 _setIcon(); 2151 _css(_internalSelector(D_ERROR_CLASS), { 2152 display: "table" 2153 }); 2154 _errorText.innerHTML = "<p>" + evt.message + "</p>"; 2155 } 2156 2157 function _clearError() { 2158 _errorState = false; 2159 _css(_internalSelector(D_ERROR_CLASS), { 2160 display: "none" 2161 }); 2162 _errorText.innerHTML = ""; 2163 } 2164 2165 1972 2166 function _redraw() { 1973 2167 utils.stretch(_api.jwGetStretching(), _preview, _display.clientWidth, _display.clientHeight, _imageWidth, _imageHeight); … … 2010 2204 width: JW_CSS_100PCT, 2011 2205 height: JW_CSS_100PCT, 2012 overflow: 'hidden',2206 overflow: JW_CSS_HIDDEN, 2013 2207 opacity: 0 2014 2208 }); … … 2019 2213 height: JW_CSS_100PCT, 2020 2214 background: 'no-repeat center', 2021 overflow: 'hidden' 2215 overflow: JW_CSS_HIDDEN 2216 }); 2217 2218 _css(D_CLASS + ' ' + D_ERROR_CLASS, { 2219 display: "none", 2220 position: JW_CSS_ABSOLUTE, 2221 width: JW_CSS_100PCT, 2222 height: JW_CSS_100PCT 2223 }); 2224 2225 _css(D_CLASS + ' ' + D_ERROR_CLASS + ' p', { 2226 display: "table-cell", 2227 'vertical-align': "middle", 2228 'text-align': "center", 2229 background: 'rgba(0, 0, 0, 0.5)', 2230 color: '#fff' 2022 2231 }); 2023 2232 … … 2547 2756 (function(html5) { 2548 2757 html5.player = function(config) { 2549 var _api = this, 2550 _model = new html5.model(config), 2551 _view = new html5.view(this, _model), 2758 var _api = this, 2759 _model, 2760 _view, 2761 _controller, 2762 _instreamPlayer; 2763 2764 function _init() { 2765 _model = new html5.model(config); 2766 _api.id = _model.id; 2767 _view = new html5.view(_api, _model); 2552 2768 _controller = new html5.controller(_model, _view); 2553 2554 function _init() { 2555 _api.id = _model.id; 2769 2770 _initializeAPI(); 2556 2771 2557 2772 var setup = new html5.setup(_model, _view, _controller); … … 2566 2781 2567 2782 function _errorHandler(evt) { 2568 jwplayer.utils.log('There was a problem setting up the player: ' + evt.message); 2569 } 2570 2571 /** Methods **/ 2572 2573 _api.jwPlay = _controller.play; 2574 _api.jwPause = _controller.pause; 2575 _api.jwStop = _controller.stop; 2576 _api.jwSeek = _controller.seek; 2577 _api.jwSetVolume = _controller.setVolume; 2578 _api.jwSetMute = _controller.setMute; 2579 _api.jwLoad = _controller.load; 2580 _api.jwPlaylistNext = _controller.next; 2581 _api.jwPlaylistPrev = _controller.prev; 2582 _api.jwPlaylistItem = _controller.item; 2583 _api.jwSetFullscreen = _controller.setFullscreen; 2584 _api.jwResize = _view.resize; 2585 _api.jwSeekDrag = _model.seekDrag; 2586 _api.jwSetStretching = _controller.setStretching; 2587 2588 2783 jwplayer.utils.log('There was a problem setting up the player: ', evt); 2784 } 2785 2786 function _initializeAPI() { 2787 2788 /** Methods **/ 2789 _api.jwPlay = _controller.play; 2790 _api.jwPause = _controller.pause; 2791 _api.jwStop = _controller.stop; 2792 _api.jwSeek = _controller.seek; 2793 _api.jwSetVolume = _controller.setVolume; 2794 _api.jwSetMute = _controller.setMute; 2795 _api.jwLoad = _controller.load; 2796 _api.jwPlaylistNext = _controller.next; 2797 _api.jwPlaylistPrev = _controller.prev; 2798 _api.jwPlaylistItem = _controller.item; 2799 _api.jwSetFullscreen = _controller.setFullscreen; 2800 _api.jwResize = _view.resize; 2801 _api.jwSeekDrag = _model.seekDrag; 2802 _api.jwSetStretching = _controller.setStretching; 2803 _api.jwGetQualityLevels = _controller.getQualityLevels; 2804 _api.jwGetCurrentQuality = _controller.getCurrentQuality; 2805 _api.jwSetCurrentQuality = _controller.setCurrentQuality; 2806 2807 2808 _api.jwGetPlaylistIndex = _statevarFactory('item'); 2809 _api.jwGetPosition = _statevarFactory('position'); 2810 _api.jwGetDuration = _statevarFactory('duration'); 2811 _api.jwGetBuffer = _statevarFactory('buffer'); 2812 _api.jwGetWidth = _statevarFactory('width'); 2813 _api.jwGetHeight = _statevarFactory('height'); 2814 _api.jwGetFullscreen = _statevarFactory('fullscreen'); 2815 _api.jwGetVolume = _statevarFactory('volume'); 2816 _api.jwGetMute = _statevarFactory('mute'); 2817 _api.jwGetState = _statevarFactory('state'); 2818 _api.jwGetStretching = _statevarFactory('stretching'); 2819 _api.jwGetPlaylist = _statevarFactory('playlist'); 2820 2821 /** InStream API **/ 2822 _api.jwDetachMedia = _controller.detachMedia; 2823 _api.jwAttachMedia = _controller.attachMedia; 2824 2825 _api.jwLoadInstream = function(item, options) { 2826 if (!_instreamPlayer) { 2827 _instreamPlayer = new html5.instream(_api, _model, _view, _controller); 2828 } 2829 setTimeout(function() { 2830 _instreamPlayer.load(item, options); 2831 }, 10); 2832 } 2833 2834 _api.jwInstreamDestroy = function() { 2835 if (_instreamPlayer) { 2836 _instreamPlayer.jwInstreamDestroy(); 2837 } 2838 } 2839 2840 /** Events **/ 2841 _api.jwAddEventListener = _controller.addEventListener; 2842 _api.jwRemoveEventListener = _controller.removeEventListener; 2843 2844 2845 } 2589 2846 2590 2847 /** Getters **/ … … 2596 2853 } 2597 2854 2598 _api.jwGetPlaylistIndex = _statevarFactory('item'); 2599 _api.jwGetPosition = _statevarFactory('position'); 2600 _api.jwGetDuration = _statevarFactory('duration'); 2601 _api.jwGetBuffer = _statevarFactory('buffer'); 2602 _api.jwGetWidth = _statevarFactory('width'); 2603 _api.jwGetHeight = _statevarFactory('height'); 2604 _api.jwGetFullscreen = _statevarFactory('fullscreen'); 2605 _api.jwGetVolume = _statevarFactory('volume'); 2606 _api.jwGetMute = _statevarFactory('mute'); 2607 _api.jwGetState = _statevarFactory('state'); 2608 _api.jwGetStretching = _statevarFactory('stretching'); 2609 _api.jwGetPlaylist = _statevarFactory('playlist'); 2610 2611 2612 /** InStream API **/ 2613 _api.jwDetachMedia = _controller.detachMedia; 2614 _api.jwAttachMedia = _controller.attachMedia; 2615 2616 var _instreamPlayer; 2617 2618 _api.jwLoadInstream = function(item, options) { 2619 if (!_instreamPlayer) { 2620 _instreamPlayer = new html5.instream(_api, _model, _view, _controller); 2621 } 2622 setTimeout(function() { 2623 _instreamPlayer.load(item, options); 2624 }, 10); 2625 } 2626 2627 _api.jwInstreamDestroy = function() { 2628 if (_instreamPlayer) { 2629 _instreamPlayer.jwInstreamDestroy(); 2630 } 2631 } 2632 2633 /** Events **/ 2634 _api.jwAddEventListener = _controller.addEventListener; 2635 _api.jwRemoveEventListener = _controller.removeEventListener; 2636 2637 2855 2856 2638 2857 _init(); 2639 2858 } … … 3014 3233 rss = rss.nextSibling; 3015 3234 } 3016 var playlistObj = html5.parsers.rssparser.parse(rss); 3017 _eventDispatcher.sendEvent(events.JWPLAYER_PLAYLIST_LOADED, { 3018 playlist: new _jw.playlist(playlistObj) 3019 }); 3235 3236 if (html5.parsers.localName(rss) != "rss") { 3237 _playlistError("Playlist is not a valid RSS feed."); 3238 return; 3239 } 3240 3241 var playlist = new _jw.playlist(html5.parsers.rssparser.parse(rss)); 3242 // TODO: full source inspection here - need to detect if there are playable sources in the list 3243 if (playlist && playlist.length && playlist[0].sources && playlist[0].sources.length && playlist[0].sources[0].file) { 3244 _eventDispatcher.sendEvent(events.JWPLAYER_PLAYLIST_LOADED, { 3245 playlist: playlist 3246 }); 3247 } else { 3248 _playlistError("No playable sources found"); 3249 } 3020 3250 } catch (e) { 3021 3251 _playlistError('Could not load the playlist.'); … … 3121 3351 function _loadSkin() { 3122 3352 _skin = new html5.skin(); 3123 _skin.load(_model.config.skin, _skinLoaded );3353 _skin.load(_model.config.skin, _skinLoaded, _skinError); 3124 3354 } 3125 3355 … … 3127 3357 _taskComplete(LOAD_SKIN); 3128 3358 } 3129 3359 3360 function _skinError(message) { 3361 _error("Error loading skin: " + message); 3362 } 3363 3130 3364 function _loadPlaylist() { 3131 3365 switch(utils.typeOf(_model.config.playlist)) { … … 3148 3382 3149 3383 function _playlistError(evt) { 3150 _error( evt.message);3384 _error("Error loading playlist: " + evt.message); 3151 3385 } 3152 3386 … … 3184 3418 function _error(message) { 3185 3419 _errorState = true; 3186 _eventDispatcher.sendEvent(events.JWPLAYER_ERROR, {message: message}); 3420 _eventDispatcher.sendEvent(events.JWPLAYER_ERROR, {message: message}); 3421 _view.setupError(message); 3187 3422 } 3188 3423 … … 3207 3442 var _loaded = false; 3208 3443 3209 this.load = function(path, c allback) {3444 this.load = function(path, completeCallback, errorCallback) { 3210 3445 new html5.skinloader(path, function(skin) { 3211 3446 _loaded = true; 3212 3447 _components = skin; 3213 callback(); 3214 }, function() { 3215 new html5.skinloader("", function(skin) { 3216 _loaded = true; 3217 _components = skin; 3218 callback(); 3219 }); 3448 if (typeof completeCallback == "function") completeCallback(); 3449 }, function(message) { 3450 if (typeof errorCallback == "function") errorCallback(message); 3220 3451 }); 3221 3452 … … 3276 3507 _loadSkin(html5.defaultskin().xml); 3277 3508 } else { 3509 if (_utils.extension(_skinPath) != "xml") { 3510 _errorHandler("Skin not a valid file type"); 3511 return; 3512 } 3278 3513 _utils.ajax(_utils.getAbsolutePath(_skinPath), function(xmlrequest) { 3279 3514 try { … … 3286 3521 } 3287 3522 _loadSkin(html5.defaultskin().xml); 3288 }, function( path) {3289 _ loadSkin(html5.defaultskin().xml);3523 }, function(message) { 3524 _errorHandler(message); 3290 3525 }); 3291 3526 } … … 3395 3630 _error = true; 3396 3631 _resetCompleteIntervalTest(); 3397 _errorHandler( );3632 _errorHandler("Skin image not found: " + this.src); 3398 3633 }; 3399 3634 … … 3499 3734 _type, 3500 3735 // Reference to the video tag 3501 _sourcesByType,3502 // All sources organized by type3503 3736 _videotag, 3504 3737 // Current duration … … 3527 3760 _eventDispatcher = new events.eventdispatcher(), 3528 3761 // Whether or not we're listening to video tag events 3529 _attached = false; 3530 3531 utils.extend(this, _eventDispatcher); 3762 _attached = false, 3763 // Sources, sorted by type 3764 _sourcesByType = {}, 3765 // Quality levels 3766 _levels, 3767 // Current quality level index 3768 _currentQuality = -1, 3769 // Reference to self 3770 _this = this; 3771 3772 utils.extend(_this, _eventDispatcher); 3532 3773 3533 3774 // Constructor … … 3615 3856 function _errorHandler(evt) { 3616 3857 if (!_attached) return; 3617 utils.log("Error: %o", _videotag.error); 3858 utils.log("Error playing media: %o", _videotag.error); 3859 _eventDispatcher.sendEvent(events.JWPLAYER_MEDIA_ERROR, {message: "Error loading media: File could not be played"}); 3618 3860 _setState(states.IDLE); 3619 3861 } … … 3634 3876 } 3635 3877 3636 function _sortSources(sources) { 3637 var sorted = {}; 3638 if (sources) { 3639 for (var i=0; i<sources.length; i++) { 3640 var type = sources[i].type, 3641 file = sources[i].file; 3642 if (!type) { 3643 type = utils.extension(file); 3644 sources[i].type = type; 3645 } 3646 if (!sorted[type]) sorted[type] = []; 3647 sorted[type].push(sources[i]); 3648 } 3649 } 3650 return sorted; 3651 } 3652 3653 this.load = function(item) { 3878 function _sendLevels(levels) { 3879 if (utils.typeOf(levels)=="array" && levels.length > 0) { 3880 var publicLevels = []; 3881 for (var i=0; i<levels.length; i++) { 3882 var level = levels[i], publicLevel = {}; 3883 publicLevel.label = _levelLabel(level) ? _levelLabel(level) : i; 3884 if (level.width) publicLevel.width = level.width; 3885 if (level.height) publicLevel.height = level.height; 3886 if (level.bitrate) publicLevel.bitrate = level.bitrate; 3887 publicLevels[i] = publicLevel; 3888 } 3889 _eventDispatcher.sendEvent(events.JWPLAYER_MEDIA_LEVELS, { levels: publicLevels, currentQuality: _currentQuality }); 3890 } 3891 } 3892 3893 function _levelLabel(level) { 3894 if (level.label) return level.label; 3895 else if (level.height) return level.height + "p"; 3896 else if (level.width) return (level.width * 9 / 16) + "p"; 3897 else if (level.bitrate) return level.bitrate + "kbps"; 3898 else return 0; 3899 } 3900 3901 _this.load = function(item) { 3654 3902 if (!_attached) return; 3655 3903 … … 3661 3909 _position = 0; 3662 3910 3663 _sourcesByType = _sortSources(_item.sources);3911 _sourcesByType = utils.sortSources(_item.sources); 3664 3912 _type = _selectType(); 3665 3913 … … 3669 3917 } 3670 3918 3671 _source = _sourcesByType[_type][0]; 3919 if (_currentQuality < 0) _currentQuality = 0; 3920 _levels = _sourcesByType[_type]; 3921 _sendLevels(_levels); 3922 3923 _source = _levels[_currentQuality]; 3672 3924 3673 3925 _setState(states.BUFFERING); … … 3682 3934 } 3683 3935 3684 var _stop = this.stop = function() {3936 var _stop = _this.stop = function() { 3685 3937 if (!_attached) return; 3686 3938 _videotag.removeAttribute("src"); 3687 3939 _videotag.load(); 3940 _currentQuality = -1; 3688 3941 clearInterval(_bufferInterval); 3689 3942 _setState(states.IDLE); 3690 3943 } 3691 3944 3692 this.play = function() {3945 _this.play = function() { 3693 3946 if (_attached) _videotag.play(); 3694 3947 } 3695 3948 3696 var _pause = this.pause = function() {3949 var _pause = _this.pause = function() { 3697 3950 if (_attached) { 3698 3951 _videotag.pause(); … … 3701 3954 } 3702 3955 3703 this.seekDrag = function(state) {3956 _this.seekDrag = function(state) { 3704 3957 if (!_attached) return; 3705 3958 _dragging = state; … … 3708 3961 } 3709 3962 3710 var _seek = this.seek = function(pos) {3963 var _seek = _this.seek = function(pos) { 3711 3964 if (!_attached) return; 3712 3965 if (_videotag.readyState >= _videotag.HAVE_FUTURE_DATA) { … … 3724 3977 } 3725 3978 3726 var _volume = this.volume = function(vol) {3979 var _volume = _this.volume = function(vol) { 3727 3980 _videotag.volume = vol / 100; 3728 3981 } … … 3737 3990 } 3738 3991 3739 this.mute = function(state) {3992 _this.mute = function(state) { 3740 3993 if (!utils.exists(state)) state = !_videotag.mute; 3741 3994 if (state) { … … 3797 4050 function _complete() { 3798 4051 //_stop(); 4052 _currentQuality = -1; 3799 4053 _setState(states.IDLE); 3800 4054 _sendEvent(events.JWPLAYER_MEDIA_BEFORECOMPLETE); … … 3806 4060 * Return the video tag and stop listening to events 3807 4061 */ 3808 this.detachMedia = function() {4062 _this.detachMedia = function() { 3809 4063 _attached = false; 3810 4064 return _videotag; … … 3814 4068 * Begin listening to events again 3815 4069 */ 3816 this.attachMedia = function() {4070 _this.attachMedia = function() { 3817 4071 _attached = true; 3818 4072 } … … 3820 4074 // Provide access to video tag 3821 4075 // TODO: remove; used by InStream 3822 this.getTag = function() {4076 _this.getTag = function() { 3823 4077 return _videotag; 3824 4078 } 3825 4079 3826 this.audioMode = function() {4080 _this.audioMode = function() { 3827 4081 return (_type && _extensions[_type].html5 && _extensions[_type].html5.indexOf("audio") == 0); 3828 4082 } 3829 4083 4084 _this.setCurrentQuality = function(quality) { 4085 if (_currentQuality == quality) return; 4086 4087 if (quality >=0) { 4088 if (_levels && _levels.length > quality) { 4089 _currentQuality = quality; 4090 _sendEvent(events.JWPLAYER_MEDIA_QUALITY_CHANGED, { currentQuality: quality, levels: _levels} ); 4091 var currentTime = _videotag.currentTime; 4092 _this.load(_item); 4093 _this.seek(currentTime); 4094 } 4095 } 4096 } 4097 4098 _this.getCurrentQuality = function() { 4099 return _currentQuality; 4100 } 4101 4102 _this.getQualityLevels = function() { 4103 return _levels; 4104 } 4105 3830 4106 // Call constructor 3831 4107 _init(videotag); … … 3889 4165 utils.extend(this, _eventDispatcher); 3890 4166 4167 function _init() { 4168 _playerElement = _createElement("div", PLAYER_CLASS); 4169 _playerElement.id = _api.id; 4170 4171 var replace = document.getElementById(_api.id); 4172 replace.parentNode.replaceChild(_playerElement, replace); 4173 } 4174 3891 4175 this.setup = function(skin) { 3892 4176 _api.skin = skin; 3893 3894 _playerElement = _createElement("div", PLAYER_CLASS);3895 _playerElement.id = _api.id;3896 3897 var replace = document.getElementById(_api.id);3898 replace.parentNode.replaceChild(_playerElement, replace);3899 4177 3900 4178 _container = _createElement("span", VIEW_MAIN_CONTAINER_CLASS); … … 4105 4383 this.resizeMedia = _resizeMedia; 4106 4384 4107 this.completeSetup = function() {4385 var _completeSetup = this.completeSetup = function() { 4108 4386 _css(_internalSelector(), {opacity: 1}); 4109 4387 } 4110 4388 4111 4389 /** 4112 * Listen for keystrokes. Currently only ESC is recognized, to switch out of fullscreen mode. 4390 * Listen for keystrokes while in fullscreen mode. 4391 * ESC returns from fullscreen 4392 * SPACE toggles playback 4113 4393 **/ 4114 4394 function _keyHandler(evt) { 4115 switch (evt.keyCode) {4116 // ESC4117 case 27:4118 if (_model.fullscreen) {4395 if (_model.fullscreen) { 4396 switch (evt.keyCode) { 4397 // ESC 4398 case 27: 4119 4399 _fullscreen(false); 4120 } 4121 break; 4122 // SPACE 4123 case 32: 4124 _api.jwPlay() 4125 break; 4400 break; 4401 // SPACE 4402 // case 32: 4403 // if (_model.state == states.PLAYING || _model.state = states.BUFFERING) 4404 // _api.jwPause(); 4405 // break; 4406 } 4126 4407 } 4127 4408 } … … 4265 4546 } 4266 4547 4548 this.setupError = function(message) { 4549 jwplayer.embed.errorScreen(_playerElement, message); 4550 _completeSetup(); 4551 } 4552 4267 4553 function _setVisibility(selector, state) { 4268 4554 _css(selector, { display: state ? "block" : "none" }); 4269 4555 } 4556 4557 _init(); 4270 4558 4271 4559 -
branches/jw6/bin-debug/jwplayer.js
r2203 r2217 19 19 var $jw = jwplayer; 20 20 21 jwplayer.version = '6.0.22 03';21 jwplayer.version = '6.0.2217'; 22 22 23 23 // "Shiv" method for older IE browsers; required for parsing media tags … … 31 31 */ 32 32 (function(jwplayer) { 33 var DOCUMENT = document, WINDOW = window; 33 var DOCUMENT = document, WINDOW = window, NAVIGATOR = navigator, 34 UNDEFINED = "undefined", STRING = "string", OBJECT = "object"; 34 35 35 36 //Declare namespace … … 45 46 utils.exists = function(item) { 46 47 switch (typeof (item)) { 47 case "string":48 case STRING: 48 49 return (item.length > 0); 49 50 break; 50 case "object":51 case OBJECT: 51 52 return (item !== null); 52 case "undefined":53 case UNDEFINED: 53 54 return false; 54 55 } … … 111 112 for ( var i = 1; i < args.length; i++) { 112 113 for ( var element in args[i]) { 113 args[0][element] = args[i][element]; 114 if (utils.exists(args[i][element])) { 115 args[0][element] = args[i][element]; 116 } 114 117 } 115 118 } … … 118 121 return null; 119 122 }; 120 121 /**122 * Cleans up a css dimension (e.g. '420px') and returns an integer.123 */124 utils.parseDimension = function(dimension) {125 if (typeof dimension == "string") {126 if (dimension === "") {127 return 0;128 } else if (dimension.lastIndexOf("%") > -1) {129 return dimension;130 } else {131 return parseInt(dimension.replace("px", ""), 10);132 }133 }134 return dimension;135 }136 137 /** Format the elapsed / remaining text. **/138 utils.timeFormat = function(sec) {139 if (sec > 0) {140 var str = Math.floor(sec / 60) < 10 ? "0" + Math.floor(sec / 60) + ":" : Math.floor(sec / 60) + ":";141 str += Math.floor(sec % 60) < 10 ? "0" + Math.floor(sec % 60) : Math.floor(sec % 60);142 return str;143 } else {144 return "00:00";145 }146 }147 123 148 124 /** Logger * */ 149 125 utils.log = function(msg, obj) { 150 if (typeof console != "undefined" && typeof console.log != "undefined") {126 if (typeof console != UNDEFINED && typeof console.log != UNDEFINED) { 151 127 if (obj) { 152 128 console.log(msg, obj); … … 157 133 }; 158 134 159 /** Replacement for getBoundingClientRect, which isn't supported in iOS 3.1.2 **/160 utils.getBoundingClientRect = function(element) {161 if (typeof element.getBoundingClientRect == "function") {162 return element.getBoundingClientRect();163 } else {164 return {165 left: element.offsetLeft + DOCUMENT.body.scrollLeft,166 top: element.offsetTop + DOCUMENT.body.scrollTop,167 width: element.offsetWidth,168 height: element.offsetHeight169 };170 }171 }172 173 135 var _userAgentMatch = utils.userAgentMatch = function(regex) { 174 var agent = navigator.userAgent.toLowerCase();136 var agent = NAVIGATOR.userAgent.toLowerCase(); 175 137 return (agent.match(regex) !== null); 176 138 }; … … 218 180 } 219 181 220 /** Loads an XML file into a DOM object * */221 utils.ajax = function(xmldocpath, completecallback, errorcallback) {222 var xmlhttp;223 if (_isCrossdomain(xmldocpath) && utils.exists(WINDOW.XDomainRequest)) {224 // IE9225 xmlhttp = new XDomainRequest();226 xmlhttp.onload = _ajaxComplete(xmlhttp, xmldocpath, completecallback, errorcallback);227 xmlhttp.onerror = _ajaxError(errorcallback, xmldocpath, xmlhttp);228 } else if (utils.exists(WINDOW.XMLHttpRequest)) {229 // Firefox, Chrome, Opera, Safari230 xmlhttp = new XMLHttpRequest();231 xmlhttp.onreadystatechange = _readyStateChangeHandler(xmlhttp, xmldocpath, completecallback, errorcallback);232 xmlhttp.onerror = _ajaxError(errorcallback, xmldocpath);233 } else {234 if (errorcallback) errorcallback();235 }236 237 try {238 xmlhttp.open("GET", xmldocpath, true);239 xmlhttp.send(null);240 } catch (error) {241 if (errorcallback) errorcallback(xmldocpath);242 }243 return xmlhttp;244 };245 246 function _isCrossdomain(path) {247 if (path && path.indexOf("://") >= 0) {248 if (path.split("/")[2] != WINDOW.location.href.split("/")[2])249 return true250 }251 return false;252 }253 254 function _ajaxError(errorcallback, xmldocpath, xmlhttp) {255 return function() {256 errorcallback(xmldocpath);257 }258 }259 260 function _readyStateChangeHandler(xmlhttp, xmldocpath, completecallback, errorcallback) {261 return function() {262 if (xmlhttp.readyState === 4) {263 if (xmlhttp.status == 200) {264 _ajaxComplete(xmlhttp, xmldocpath, completecallback, errorcallback)();265 } else if (errorcallback) {266 errorcallback(xmldocpath);267 }268 }269 }270 }271 272 function _ajaxComplete(xmlhttp, xmldocpath, completecallback, errorcallback) {273 return function() {274 // Handle the case where an XML document was returned with an incorrect MIME type.275 if (!utils.exists(xmlhttp.responseXML)) {276 try {277 var parsedXML;278 // Parse XML in FF/Chrome/Safari/Opera279 if (WINDOW.DOMParser) {280 parsedXML = (new DOMParser()).parseFromString(xmlhttp.responseText,"text/xml");281 } else {282 // Internet Explorer283 parsedXML = new ActiveXObject("Microsoft.XMLDOM");284 parsedXML.async="false";285 parsedXML.loadXML(xmlhttp.responseText);286 }287 if (parsedXML) {288 xmlhttp = utils.extend({}, xmlhttp, {responseXML:parsedXML});289 }290 } catch(e) {291 if (errorcallback) errorcallback(xmldocpath);292 return;293 }294 }295 completecallback(xmlhttp);296 }297 }298 182 299 183 /** Returns the true type of an object * */ … … 314 198 translated.fullscreen = translated.message == "true" ? true : false; 315 199 delete translated.message; 316 } else if (typeof translated.data == "object") {200 } else if (typeof translated.data == OBJECT) { 317 201 // Takes ViewEvent "data" block and moves it up a level 318 202 translated = utils.extend(translated, translated.data); 319 203 delete translated.data; 320 } else if (typeof translated.metadata == "object") {204 } else if (typeof translated.metadata == OBJECT) { 321 205 utils.deepReplaceKeyName(translated.metadata, ["__dot__","__spc__","__dsh__"], ["."," ","-"]); 322 206 } … … 333 217 334 218 /** 335 * Detects whether or not the current player has flash capabilities 336 * TODO: Add minimum flash version constraint: 9.0.115 219 * If the browser has flash capabilities, return the flash version 337 220 */ 338 utils.hasFlash = function() { 339 if (typeof navigator.plugins != "undefined" && typeof navigator.plugins['Shockwave Flash'] != "undefined") { 340 return true; 341 } 342 if (typeof WINDOW.ActiveXObject != "undefined") { 221 utils.flashVersion = function() { 222 var plugins = NAVIGATOR.plugins, flash; 223 if (plugins != UNDEFINED) { 224 flash = plugins['Shockwave Flash']; 225 if (flash) { 226 return parseInt(flash.description.replace(/\D+(\d+)\..*/, "$1")); 227 } 228 } 229 if (typeof WINDOW.ActiveXObject != UNDEFINED) { 343 230 try { 344 new ActiveXObject("ShockwaveFlash.ShockwaveFlash"); 345 return true 231 flash = new ActiveXObject("ShockwaveFlash.ShockwaveFlash"); 232 if (flash) { 233 return parseInt(flash.GetVariable("$version").split(" ")[1].split(",")[0]); 234 } 346 235 } catch (err) { 347 236 } 348 237 } 349 return false; 350 }; 351 352 353 /** Wraps an HTML element with another element * */ 354 utils.wrap = function(originalElement, appendedElement) { 355 if (originalElement.parentNode) { 356 originalElement.parentNode.replaceChild(appendedElement, originalElement); 357 } 358 appendedElement.appendChild(originalElement); 359 }; 360 238 return 0; 239 }; 240 241 361 242 /** Finds the location of jwplayer.js and returns the path **/ 362 243 utils.getScriptPath = function(scriptName) { … … 381 262 * @returns The modified object. 382 263 */ 383 jwplayer.utils.deepReplaceKeyName = function(obj, searchString, replaceString) {264 utils.deepReplaceKeyName = function(obj, searchString, replaceString) { 384 265 switch (jwplayer.utils.typeOf(obj)) { 385 266 case "array": … … 389 270 } 390 271 break; 391 case "object":272 case OBJECT: 392 273 for ( var key in obj) { 393 274 var searches, replacements; … … 415 296 } 416 297 return obj; 417 } 418 298 }; 299 300 301 /** 302 * Types of plugin paths 303 */ 304 var _pluginPathType = utils.pluginPathType = { 305 ABSOLUTE : 0, 306 RELATIVE : 1, 307 CDN : 2 308 } 309 310 /* 311 * Test cases getPathType('hd') getPathType('hd-1') getPathType('hd-1.4') 312 * 313 * getPathType('http://plugins.longtailvideo.com/5/hd/hd.swf') 314 * getPathType('http://plugins.longtailvideo.com/5/hd/hd-1.swf') 315 * getPathType('http://plugins.longtailvideo.com/5/hd/hd-1.4.swf') 316 * 317 * getPathType('./hd.swf') getPathType('./hd-1.swf') 318 * getPathType('./hd-1.4.swf') 319 */ 320 utils.getPluginPathType = function(path) { 321 if (typeof path != STRING) { 322 return; 323 } 324 path = path.split("?")[0]; 325 var protocol = path.indexOf("://"); 326 if (protocol > 0) { 327 return _pluginPathType.ABSOLUTE; 328 } 329 var folder = path.indexOf("/"); 330 var extension = utils.extension(path); 331 if (protocol < 0 && folder < 0 && (!extension || !isNaN(extension))) { 332 return _pluginPathType.CDN; 333 } 334 return _pluginPathType.RELATIVE; 335 }; 336 337 338 /** 339 * Extracts a plugin name from a string 340 */ 341 utils.getPluginName = function(pluginName) { 342 /** Regex locates the characters after the last slash, until it encounters a dash. **/ 343 return pluginName.replace(/^.*\/([^-]*)-?.*\.(swf|js)$/, "$1") 344 }; 345 346 /** 347 * Extracts a plugin version from a string 348 */ 349 utils.getPluginVersion = function(pluginName) { 350 return pluginName.replace(/[^-]*-?([^\.]*).*$/, "$1"); 351 }; 352 353 /** 354 * Determines if a URL is a YouTube link 355 */ 356 utils.isYouTube = function(path) { 357 return (path.indexOf("youtube.com") > -1 || path.indexOf("youtu.be") > -1); 358 }; 359 419 360 })(jwplayer);/** 420 361 * JW Player Media Extension to Mime Type mapping … … 709 650 JWPLAYER_MEDIA_META : 'jwplayerMediaMeta', 710 651 JWPLAYER_MEDIA_MUTE : 'jwplayerMediaMute', 652 JWPLAYER_MEDIA_LEVELS: 'jwplayerMediaLevels', 653 JWPLAYER_MEDIA_LEVEL_CHANGED: 'jwplayerMediaLevelChanged', 711 654 712 655 // State events … … 926 869 * @version 5.8 927 870 */ 928 (function(jwplayer) { 929 jwplayer.plugins.pluginmodes = { 930 FLASH: "FLASH", 931 JAVASCRIPT: "JAVASCRIPT", 932 HYBRID: "HYBRID" 933 } 934 935 jwplayer.plugins.plugin = function(url) { 936 var _repo = "http://plugins.longtailvideo.com" 937 var _status = jwplayer.utils.loaderstatus.NEW; 938 var _flashPath; 939 var _js; 940 var _completeTimeout; 941 942 var _eventDispatcher = new jwplayer.events.eventdispatcher(); 943 jwplayer.utils.extend(this, _eventDispatcher); 871 (function(plugins) { 872 var utils = jwplayer.utils, events = jwplayer.events, UNDEFINED = "undefined"; 873 874 plugins.pluginmodes = { 875 FLASH: 0, 876 JAVASCRIPT: 1, 877 HYBRID: 2 878 } 879 880 plugins.plugin = function(url) { 881 var _repo = "http://plugins.longtailvideo.com", 882 _status = utils.loaderstatus.NEW, 883 _flashPath, 884 _js, 885 _completeTimeout; 886 887 var _eventDispatcher = new events.eventdispatcher(); 888 utils.extend(this, _eventDispatcher); 944 889 945 890 function getJSPath() { 946 switch ( jwplayer.utils.getPluginPathType(url)) {947 case jwplayer.utils.pluginPathType.ABSOLUTE:891 switch (utils.getPluginPathType(url)) { 892 case utils.pluginPathType.ABSOLUTE: 948 893 return url; 949 case jwplayer.utils.pluginPathType.RELATIVE:950 return jwplayer.utils.getAbsolutePath(url, window.location.href);951 case jwplayer.utils.pluginPathType.CDN:952 var pluginName = jwplayer.utils.getPluginName(url);953 var pluginVersion = jwplayer.utils.getPluginVersion(url);894 case utils.pluginPathType.RELATIVE: 895 return utils.getAbsolutePath(url, window.location.href); 896 case utils.pluginPathType.CDN: 897 var pluginName = utils.getPluginName(url); 898 var pluginVersion = utils.getPluginVersion(url); 954 899 var repo = (window.location.href.indexOf("https://") == 0) ? _repo.replace("http://", "https://secure") : _repo; 955 900 return repo + "/" + jwplayer.version.split(".")[0] + "/" + pluginName + "/" … … 960 905 function completeHandler(evt) { 961 906 _completeTimeout = setTimeout(function(){ 962 _status = jwplayer.utils.loaderstatus.COMPLETE;963 _eventDispatcher.sendEvent( jwplayer.events.COMPLETE);907 _status = utils.loaderstatus.COMPLETE; 908 _eventDispatcher.sendEvent(events.COMPLETE); 964 909 }, 1000); 965 910 } 966 911 967 912 function errorHandler(evt) { 968 _status = jwplayer.utils.loaderstatus.ERROR;969 _eventDispatcher.sendEvent( jwplayer.events.ERROR);913 _status = utils.loaderstatus.ERROR; 914 _eventDispatcher.sendEvent(events.ERROR); 970 915 } 971 916 972 917 this.load = function() { 973 if (_status == jwplayer.utils.loaderstatus.NEW) {918 if (_status == utils.loaderstatus.NEW) { 974 919 if (url.lastIndexOf(".swf") > 0) { 975 920 _flashPath = url; 976 _status = jwplayer.utils.loaderstatus.COMPLETE;977 _eventDispatcher.sendEvent( jwplayer.events.COMPLETE);921 _status = utils.loaderstatus.COMPLETE; 922 _eventDispatcher.sendEvent(events.COMPLETE); 978 923 return; 979 924 } 980 _status = jwplayer.utils.loaderstatus.LOADING;981 var _loader = new jwplayer.utils.scriptloader(getJSPath());925 _status = utils.loaderstatus.LOADING; 926 var _loader = new utils.scriptloader(getJSPath()); 982 927 // Complete doesn't matter - we're waiting for registerPlugin 983 _loader.addEventListener( jwplayer.events.COMPLETE, completeHandler);984 _loader.addEventListener( jwplayer.events.ERROR, errorHandler);928 _loader.addEventListener(events.COMPLETE, completeHandler); 929 _loader.addEventListener(events.ERROR, errorHandler); 985 930 _loader.load(); 986 931 } … … 1002 947 _flashPath = id; 1003 948 } 1004 _status = jwplayer.utils.loaderstatus.COMPLETE;1005 _eventDispatcher.sendEvent( jwplayer.events.COMPLETE);949 _status = utils.loaderstatus.COMPLETE; 950 _eventDispatcher.sendEvent(events.COMPLETE); 1006 951 } 1007 952 … … 1011 956 1012 957 this.getPluginName = function() { 1013 return jwplayer.utils.getPluginName(url);958 return utils.getPluginName(url); 1014 959 } 1015 960 1016 961 this.getFlashPath = function() { 1017 962 if (_flashPath) { 1018 switch ( jwplayer.utils.getPluginPathType(_flashPath)) {1019 case jwplayer.utils.pluginPathType.ABSOLUTE:963 switch (utils.getPluginPathType(_flashPath)) { 964 case utils.pluginPathType.ABSOLUTE: 1020 965 return _flashPath; 1021 case jwplayer.utils.pluginPathType.RELATIVE:966 case utils.pluginPathType.RELATIVE: 1022 967 if (url.lastIndexOf(".swf") > 0) { 1023 return jwplayer.utils.getAbsolutePath(_flashPath, window.location.href);968 return utils.getAbsolutePath(_flashPath, window.location.href); 1024 969 } 1025 return jwplayer.utils.getAbsolutePath(_flashPath, getJSPath());1026 case jwplayer.utils.pluginPathType.CDN:970 return utils.getAbsolutePath(_flashPath, getJSPath()); 971 case utils.pluginPathType.CDN: 1027 972 if (_flashPath.indexOf("-") > -1){ 1028 973 return _flashPath+"h"; … … 1039 984 1040 985 this.getPluginmode = function() { 1041 if (typeof _flashPath != "undefined"1042 && typeof _js != "undefined") {1043 return jwplayer.plugins.pluginmodes.HYBRID;1044 } else if (typeof _flashPath != "undefined") {1045 return jwplayer.plugins.pluginmodes.FLASH;1046 } else if (typeof _js != "undefined") {1047 return jwplayer.plugins.pluginmodes.JAVASCRIPT;986 if (typeof _flashPath != UNDEFINED 987 && typeof _js != UNDEFINED) { 988 return plugins.pluginmodes.HYBRID; 989 } else if (typeof _flashPath != UNDEFINED) { 990 return plugins.pluginmodes.FLASH; 991 } else if (typeof _js != UNDEFINED) { 992 return plugins.pluginmodes.JAVASCRIPT; 1048 993 } 1049 994 } … … 1058 1003 } 1059 1004 1060 })(jwplayer );1005 })(jwplayer.plugins); 1061 1006 /** 1062 1007 * Loads plugins for a player … … 1065 1010 */ 1066 1011 (function(jwplayer) { 1012 var utils = jwplayer.utils, events = jwplayer.events; 1067 1013 1068 1014 jwplayer.plugins.pluginloader = function(model, config) { 1069 var _plugins = {}; 1070 var _status = jwplayer.utils.loaderstatus.NEW; 1071 var _loading = false; 1072 var _iscomplete = false; 1073 var _eventDispatcher = new jwplayer.events.eventdispatcher(); 1074 jwplayer.utils.extend(this, _eventDispatcher); 1015 var _plugins = {}, 1016 _status = utils.loaderstatus.NEW, 1017 _loading = false, 1018 _iscomplete = false, 1019 _errorState = false, 1020 _eventDispatcher = new events.eventdispatcher(); 1021 1022 1023 utils.extend(this, _eventDispatcher); 1075 1024 1076 1025 /* … … 1088 1037 */ 1089 1038 function _complete() { 1090 if (!_iscomplete) { 1039 if (_errorState) { 1040 _eventDispatcher.sendEvent(events.ERROR); 1041 } else if (!_iscomplete) { 1091 1042 _iscomplete = true; 1092 _status = jwplayer.utils.loaderstatus.COMPLETE;1093 _eventDispatcher.sendEvent( jwplayer.events.COMPLETE);1043 _status = utils.loaderstatus.COMPLETE; 1044 _eventDispatcher.sendEvent(events.COMPLETE); 1094 1045 } 1095 1046 } … … 1101 1052 for (plugin in _plugins) { 1102 1053 var status = _plugins[plugin].getStatus(); 1103 if (status == jwplayer.utils.loaderstatus.LOADING 1104 || status == jwplayer.utils.loaderstatus.NEW) { 1054 if (status == utils.loaderstatus.LOADING || status == utils.loaderstatus.NEW) { 1105 1055 incomplete++; 1106 1056 } … … 1136 1086 jsplugins.plugins[pluginName] = _plugins[plugin].getNewInstance(api, config.plugins[plugin], div); 1137 1087 jsplugins.length++; 1138 if (typeof jsplugins.plugins[pluginName].resize != "undefined") { 1139 api.onReady(resizer(jsplugins.plugins[pluginName], div, true)); 1140 api.onResize(resizer(jsplugins.plugins[pluginName], div)); 1141 } 1088 api.onReady(resizer(jsplugins.plugins[pluginName], div, true)); 1089 api.onResize(resizer(jsplugins.plugins[pluginName], div)); 1142 1090 } 1143 1091 } … … 1149 1097 1150 1098 this.load = function() { 1151 _status = jwplayer.utils.loaderstatus.LOADING; 1099 // Must be a hash map 1100 if (utils.typeOf(config) != "object") { 1101 _checkComplete(); 1102 return; 1103 } 1104 1105 _status = utils.loaderstatus.LOADING; 1152 1106 _loading = true; 1153 1107 1154 1108 /** First pass to create the plugins and add listeners **/ 1155 1109 for (var plugin in config) { 1156 if ( jwplayer.utils.exists(plugin)) {1110 if (utils.exists(plugin)) { 1157 1111 _plugins[plugin] = model.addPlugin(plugin); 1158 _plugins[plugin].addEventListener( jwplayer.events.COMPLETE, _checkComplete);1159 _plugins[plugin].addEventListener( jwplayer.events.ERROR, _checkComplete);1112 _plugins[plugin].addEventListener(events.COMPLETE, _checkComplete); 1113 _plugins[plugin].addEventListener(events.ERROR, _pluginError); 1160 1114 } 1161 1115 } … … 1173 1127 } 1174 1128 1175 this.pluginFailed = function() { 1176 _complete(); 1129 var _pluginError = this.pluginFailed = function() { 1130 if (!_errorState) { 1131 _errorState = true; 1132 _complete(); 1133 } 1177 1134 } 1178 1135 … … 1218 1175 mediaid: "", 1219 1176 title: "", 1220 1221 1177 duration: -1, 1222 1223 1178 sources: [] 1224 }; 1225 1226 1227 var _playlistitem = jwplayer.utils.extend({}, _defaults, config); 1179 }, 1180 1181 _playlistitem = jwplayer.utils.extend({}, _defaults, config); 1228 1182 1229 1183 /* … … 1243 1197 } 1244 1198 */ 1245 1199 1246 1200 return _playlistitem; 1247 1201 }; … … 1253 1207 */ 1254 1208 (function(playlist) { 1209 var UNDEF = undefined, 1210 utils = jwplayer.utils, 1211 defaults = { 1212 file: UNDEF, 1213 width: UNDEF, 1214 label: UNDEF, 1215 bitrate: UNDEF, 1216 type: UNDEF 1217 }; 1218 1255 1219 playlist.source = function(config) { 1256 var _source = { 1257 file: "", 1258 width: 0, 1259 label: undefined, 1260 type: undefined 1261 }; 1262 1263 for (var property in _source) { 1264 if (jwplayer.utils.exists(config[property])) { 1220 var _source = utils.extend({}, defaults); 1221 1222 for (var property in defaults) { 1223 if (utils.exists(config[property])) { 1265 1224 _source[property] = config[property]; 1225 // Actively move from config to source 1226 delete config[property]; 1266 1227 } 1267 1228 } … … 1277 1238 */ 1278 1239 (function(jwplayer) { 1279 var _utils = jwplayer.utils,1280 _events = jwplayer.events;1240 var utils = jwplayer.utils, 1241 events = jwplayer.events; 1281 1242 1282 1243 var embed = jwplayer.embed = function(playerApi) { 1283 // var mediaConfig = _utils.mediaparser.parseMedia(playerApi.container); 1284 var _config = new embed.config(playerApi.config); 1285 _config.id = playerApi.id; 1286 1287 var _pluginloader = jwplayer.plugins.loadPlugins(playerApi.id, _config.plugins); 1244 // var mediaConfig = utils.mediaparser.parseMedia(playerApi.container); 1245 var _config = new embed.config(playerApi.config), 1246 _container, 1247 _errorText = "Error loading player: ", 1248 _pluginloader = jwplayer.plugins.loadPlugins(playerApi.id, _config.plugins); 1249 1250 _config.id = playerApi.id; 1251 _container = document.getElementById(playerApi.id); 1288 1252 1289 1253 function _setupEvents(api, events) { … … 1296 1260 1297 1261 function _embedPlayer() { 1298 var container = document.getElementById(playerApi.id); 1299 1300 if (_pluginloader.getStatus() == _utils.loaderstatus.COMPLETE) { 1262 if (utils.typeOf(_config.playlist) == "array" && _config.playlist.length < 2) { 1263 if (_config.playlist.length == 0 || !_config.playlist[0].sources || _config.playlist[0].sources.length == 0) { 1264 _sourceError(); 1265 return; 1266 } 1267 } 1268 1269 if (_pluginloader.getStatus() == utils.loaderstatus.COMPLETE) { 1301 1270 for (var mode = 0; mode < _config.modes.length; mode++) { 1302 1271 if (_config.modes[mode].type && embed[_config.modes[mode].type]) { 1303 1272 var modeconfig = _config.modes[mode].config; 1304 var configClone = _utils.extend({}, modeconfig ? embed.config.addConfig(_config, modeconfig) : _config); 1305 var embedder = new embed[_config.modes[mode].type](container, _config.modes[mode], configClone, _pluginloader, playerApi); 1273 var configClone = utils.extend({}, modeconfig ? embed.config.addConfig(_config, modeconfig) : _config); 1274 1275 var embedder = new embed[_config.modes[mode].type](_container, _config.modes[mode], configClone, _pluginloader, playerApi); 1306 1276 if (embedder.supportsConfig()) { 1277 embedder.addEventListener(events.ERROR, _embedError); 1307 1278 embedder.embed(); 1308 1309 _setupEvents(playerApi, _config.events); 1310 1279 _setupEvents(playerApi, configClone.events); 1311 1280 return playerApi; 1312 1281 } … … 1314 1283 } 1315 1284 1285 1286 1316 1287 if (_config.fallback) { 1317 _utils.log("No suitable players found and fallback enabled");1318 new embed.download( container, _config);1288 utils.log("No suitable players found and fallback enabled"); 1289 new embed.download(_container, _config, _sourceError); 1319 1290 } else { 1320 _utils.log("No suitable players found and fallback disabled");1291 utils.log("No suitable players found and fallback disabled"); 1321 1292 } 1322 1293 1323 // new embed.logo( _utils.extend({1294 // new embed.logo(utils.extend({ 1324 1295 // hide: true 1325 1296 // }, _config.components.logo), "none", playerApi.id); … … 1327 1298 }; 1328 1299 1329 _pluginloader.addEventListener(_events.COMPLETE, _embedPlayer); 1330 _pluginloader.addEventListener(_events.ERROR, _embedPlayer); 1300 function _embedError(evt) { 1301 _errorScreen(_container, _errorText + evt.message); 1302 } 1303 1304 function _pluginError(evt) { 1305 _errorScreen(_container, _errorText + "Could not load plugins"); 1306 } 1307 1308 function _sourceError() { 1309 _errorScreen(_container, _errorText + "No media sources found"); 1310 } 1311 1312 function _errorScreen(container, message) { 1313 var style = container.style; 1314 style.backgroundColor = "#000"; 1315 style.color = "#FFF"; 1316 style.width = utils.styleDimension(_config.width); 1317 style.height = utils.styleDimension(_config.height); 1318 style.display = "table"; 1319 style.padding = "50px"; 1320 1321 var text = document.createElement("p"); 1322 text.style.verticalAlign = "middle"; 1323 text.style.textAlign = "center"; 1324 text.style.display = "table-cell"; 1325 text.innerHTML = message; 1326 1327 container.innerHTML = ""; 1328 container.appendChild(text); 1329 } 1330 1331 // Make this publicly accessible so the HTML5 player can error out on setup using the same code 1332 jwplayer.embed.errorScreen = _errorScreen; 1333 1334 _pluginloader.addEventListener(events.COMPLETE, _embedPlayer); 1335 _pluginloader.addEventListener(events.ERROR, _pluginError); 1331 1336 _pluginloader.load(); 1332 1337 … … 1351 1356 for (var i=0; i<modes.length; i++) { 1352 1357 var mode = modes[i].type; 1353 modes[i].src = players[mode] ? players[mode] : base + "jwplayer." + mode + (mode == "flash" ? ".swf" : ".js"); 1358 if (!modes[i].src) { 1359 modes[i].src = players[mode] ? players[mode] : base + "jwplayer." + mode + (mode == "flash" ? ".swf" : ".js"); 1360 } 1354 1361 } 1355 1362 } … … 1404 1411 _moveProperty(config, singleSource, "file"); 1405 1412 _moveProperty(config, singleSource, "type"); 1406 singleItem.sources = [singleSource];1413 singleItem.sources = singleSource.file ? [singleSource] : []; 1407 1414 } 1408 1415 } 1409 1416 1410 1417 config.playlist = [singleItem]; 1418 } else { 1419 // Use JW Player playlist items to normalize sources of existing playlist items 1420 for (var i=0; i<config.playlist.length; i++) { 1421 config.playlist[i] = new jwplayer.playlist.item(config.playlist[i]); 1422 } 1411 1423 } 1412 1424 } … … 1532 1544 JW_CSS_ABSOLUTE = "absolute"; 1533 1545 1534 embed.download = function(_container, _options ) {1546 embed.download = function(_container, _options, _errorCallback) { 1535 1547 var params = utils.extend({}, _options), 1536 1548 _display, … … 1548 1560 function _embed() { 1549 1561 if (params.playlist && params.playlist.length) { 1550 try { 1551 _file = params.playlist[0].sources[0].file; 1552 _image = params.playlist[0].image; 1553 } catch(e) { 1554 return; 1562 // TODO: make sure source can be downloaded (mp4, flv, webm, aac, mp3 or vorbis) 1563 // If no downlaodable files, and youtube, display youtube 1564 // If nothing, show error message 1565 var file, image, youtube; 1566 for (var i=0; i<params.playlist[0].sources.length; i++) { 1567 var source = params.playlist[0].sources[i]; 1568 if (source.file) { 1569 if (("mp4,mp4,flv,webm,aac,mp3,vorbis").split().indexOf(source.type) > -1) { 1570 file = source.file; 1571 image = source.image; 1572 continue; 1573 } else if (utils.isYouTube(source.file)){ 1574 youtube = source.file; 1575 } 1576 } 1555 1577 } 1556 1578 } else { … … 1558 1580 } 1559 1581 1560 if (_logo.prefix) { 1561 _logo.prefix += jwplayer.version.split(/\W/).splice(0, 2).join("/") + "/"; 1562 } 1563 1564 _buildElements(); 1565 _styleElements(); 1582 if (file) { 1583 _file = file; 1584 _image = image; 1585 if (_logo.prefix) { 1586 _logo.prefix += jwplayer.version.split(/\W/).splice(0, 2).join("/") + "/"; 1587 } 1588 _buildElements(); 1589 _styleElements(); 1590 } else if (youtube) { 1591 alert("Youtube goes here: " + youtube); 1592 } else { 1593 _errorCallback(); 1594 } 1566 1595 } 1567 1596 … … 1644 1673 */ 1645 1674 (function(jwplayer) { 1646 var utils = jwplayer.utils ;1675 var utils = jwplayer.utils, events = jwplayer.events; 1647 1676 1648 1677 jwplayer.embed.flash = function(_container, _player, _options, _loader, _api) { 1678 var _eventDispatcher = new jwplayer.events.eventdispatcher(), 1679 _flashVersion = utils.flashVersion(); 1680 utils.extend(this, _eventDispatcher); 1681 1682 1649 1683 function appendAttribute(object, name, value) { 1650 1684 var param = document.createElement('param'); … … 1660 1694 } 1661 1695 var display = document.getElementById(_api.id).getPluginConfig("display"); 1662 plugin.resize(display.width, display.height); 1696 if (typeof plugin.resize == "function") { 1697 plugin.resize(display.width, display.height); 1698 } 1663 1699 div.style.left = display.x; 1664 1700 div.style.top = display.h; … … 1743 1779 _options.id = _api.id; 1744 1780 1781 // If Flash is installed, but the version is too low, display an error. 1782 if (_flashVersion < 10) { 1783 _eventDispatcher.sendEvent(events.ERROR, {message:"Flash version must be 10.0 or greater"}); 1784 return false; 1785 } 1786 1745 1787 var _wrapper; 1746 1788 … … 1756 1798 _wrapper.style.width = utils.styleDimension(params.width); 1757 1799 _wrapper.style.height= utils.styleDimension(params.height); 1758 utils.wrap(_container, _wrapper); 1800 _container.parentNode.replaceChild(_wrapper, _container); 1801 _wrapper.appendChild(_container); 1759 1802 } 1760 1803 … … 1823 1866 html += '</object>'; 1824 1867 1825 utils.setOuterHTML(_container, html);1868 _container.outerHTML = html; 1826 1869 1827 1870 flashPlayer = document.getElementById(_container.id); … … 1841 1884 appendAttribute(obj, 'wmode', wmode); 1842 1885 appendAttribute(obj, 'flashvars', flashvars); 1886 1887 obj.onerror = function() { 1888 alert("does this work?"); 1889 } 1890 1843 1891 _container.parentNode.replaceChild(obj, _container); 1844 1892 flashPlayer = obj; … … 1852 1900 */ 1853 1901 this.supportsConfig = function() { 1854 if ( utils.hasFlash()) {1902 if (_flashVersion) { 1855 1903 if (_options) { 1856 1904 try { … … 1913 1961 */ 1914 1962 (function(jwplayer) { 1915 var utils = jwplayer.utils, extensionmap = utils.extensionmap ;1963 var utils = jwplayer.utils, extensionmap = utils.extensionmap, events = jwplayer.events; 1916 1964 1917 1965 jwplayer.embed.html5 = function(_container, _player, _options, _loader, _api) { 1966 var _this = this, 1967 _eventdispatcher = new events.eventdispatcher(); 1968 1969 utils.extend(_this, _eventdispatcher); 1970 1971 1918 1972 function _resizePlugin (plugin, div, onready) { 1919 1973 return function(evt) { … … 1922 1976 displayarea.appendChild(div); 1923 1977 } 1924 plugin.resize(displayarea.clientWidth, displayarea.clientHeight); 1978 if (typeof plugin.resize == "function") { 1979 plugin.resize(displayarea.clientWidth, displayarea.clientHeight); 1980 } 1925 1981 div.left = displayarea.style.left; 1926 1982 div.top = displayarea.style.top; … … 1928 1984 } 1929 1985 1930 this.embed = function() {1986 _this.embed = function() { 1931 1987 if (jwplayer.html5) { 1932 1988 _loader.setupPlugins(_api, _options, _resizePlugin); … … 1949 2005 } else { 1950 2006 var scriptLoader = new utils.scriptloader(_player.src); 1951 scriptLoader.addEventListener(jwplayer.events.COMPLETE, this.embed); 2007 scriptLoader.addEventListener(events.ERROR, _loadError); 2008 scriptLoader.addEventListener(events.COMPLETE, _this.embed); 1952 2009 scriptLoader.load(); 1953 2010 } 2011 } 2012 2013 function _loadError(evt) { 2014 _this.sendEvent(evt.type, {message: "HTML5 player not found"}); 1954 2015 } 1955 2016 … … 1959 2020 * @return {Boolean} 1960 2021 */ 1961 this.supportsConfig = function() {2022 _this.supportsConfig = function() { 1962 2023 if (!!jwplayer.vid.canPlayType) { 1963 2024 try { … … 2303 2364 return _instream; 2304 2365 }; 2366 _this.getQualityLevels = function() { 2367 return _callInternal("jwGetQualityLevels"); 2368 }; 2369 _this.getCurrentQuality = function() { 2370 return _callInternal("jwGetCurrentQuality"); 2371 }; 2372 _this.setCurrentQuality = function(level) { 2373 _callInternal("jwSetCurrentQuality", level); 2374 }; 2305 2375 2306 2376 var _eventMapping = { … … 2321 2391 onBeforePlay: events.JWPLAYER_MEDIA_BEFOREPLAY, 2322 2392 onBeforeComplete: events.JWPLAYER_MEDIA_BEFORECOMPLETE, 2323 onDisplayClick: events.JWPLAYER_DISPLAY_CLICK 2393 onDisplayClick: events.JWPLAYER_DISPLAY_CLICK, 2394 onQualityLevels: events.JWPLAYER_MEDIA_LEVELS, 2395 onQualityChange: events.JWPLAYER_MEDIA_LEVEL_CHANGED 2324 2396 }; 2325 2397 -
branches/jw6/jwplayer.html5.js
r2203 r2217 1 (function(a){a.html5={};a.html5.version="6.0.22 03"})(jwplayer);(function(a){a.serialize=function(b){if(b==null){return null}else{if(b=="true"){return true}else{if(b=="false"){return false}else{if(isNaN(Number(b))||b.length>5||b.length==0){return b}else{return Number(b)}}}}}})(jwplayer.utils);(function(a){var b=a.animations=function(){};b.rotate=function(c,d){a.transform(c,"rotate("+d+"deg)")}})(jwplayer.utils);(function(h){var a={},g,b={};function f(){var k=document.createElement("style");k.type="text/css";document.getElementsByTagName("head")[0].appendChild(k);return k}h.css=function(k,n,l){if(!h.exists(l)){l=false}if(h.isIE()){if(!g){g=f()}}else{if(!a[k]){a[k]=f()}}if(!b[k]){b[k]={}}for(var m in n){var o=j(m,n[m],l);if(h.exists(b[k][m])&&!h.exists(o)){delete b[k][m]}else{b[k][m]=o}}if(h.isIE()){e()}else{d(k,a[k])}};function j(m,n,k){if(typeof n==="undefined"){return undefined}var l=k?" !important":"";if(!isNaN(n)){switch(m){case"z-index":case"opacity":return n+l;break;default:if(m.match(/color/i)){return"#"+h.pad(n.toString(16),6)+l}else{if(n===0){return 0+l}else{return Math.ceil(n)+"px"+l}}break}}else{return n+l}}function e(){var k="\n";for(var l in b){k+=c(l)}g.innerHTML=k}function d(k,l){if(l){l.innerHTML=c(k)}}function c(k){var l=k+"{\n";var n=b[k];for(var m in n){l+=" "+m+": "+n[m]+";\n"}l+="}\n";return l}h.clearCss=function(l){for(var m in b){if(m.indexOf(l)>=0){delete b[m]}}for(var k in a){if(k.indexOf(l)>=0){a[k].innerHTML=""}}}})(jwplayer.utils);(function(a){var b=a.exists;a.scale=function(f,e,d,h,j){var g;if(!b(e)){e=1}if(!b(d)){d=1}if(!b(h)){h=0}if(!b(j)){j=0}if(e==1&&d==1&&h==0&&j==0){g=""}else{g="scale("+e+","+d+") translate("+h+"px,"+j+"px)"}};a.transform=function(d,f){var e=d.style;if(b(f)){e.webkitTransform=f;e.MozTransform=f;e.msTransform=f;e.OTransform=f}};a.stretch=function(m,r,q,j,o,k){if(!r){return}if(!m){m=c.UNIFORM}if(!q||!j||!o||!k){return}var e=q/o,h=j/k,p=0,l=0,d={},f=(r.tagName.toLowerCase()=="video"),g=false,n;if(f){a.transform(r)}n="jw"+m.toLowerCase();switch(m.toLowerCase()){case c.FILL:if(e>h){o=o*e;k=k*e}else{o=o*h;k=k*h}case c.NONE:e=h=1;case c.EXACTFIT:g=true;break;case c.UNIFORM:default:if(e>h){o=o*h;k=k*h;if(o/q>0.95){g=true;n="jwexactfit";e=Math.ceil(100*q/o)/100;h=1}}else{o=o*e;k=k*e;if(k/j>0.95){g=true;n="jwexactfit";h=Math.ceil(100*j/k)/100;e=1}}break}if(f){if(g){r.style.width=o+"px";r.style.height=k+"px";p=((q-o)/2)/e;l=((j-k)/2)/h;a.scale(r,e,h,p,l)}else{r.style.width="";r.style.height=""}}else{r.className=r.className.replace(/\s*jw(none|exactfit|uniform|fill)/g,"");r.className+=" "+n}};var c=a.stretching={NONE:"none",FILL:"fill",UNIFORM:"uniform",EXACTFIT:"exactfit"}})(jwplayer.utils);(function(a){a.parsers={localName:function(b){if(!b){return""}else{if(b.localName){return b.localName}else{if(b.baseName){return b.baseName}else{return""}}}},textContent:function(b){if(!b){return""}else{if(b.textContent){return b.textContent}else{if(b.text){return b.text}else{return""}}}},getChildNode:function(c,b){return c.childNodes[b]},numChildren:function(b){if(b.childNodes){return b.childNodes.length}else{return 0}}}})(jwplayer.html5);(function(b){var a=b.html5.parsers;var d=a.jwparser=function(){};var c="jwplayer";d.parseEntry=function(h,j){for(var f=0;f<h.childNodes.length;f++){var g=h.childNodes[f];if(g.prefix==c){var e=a.localName(g);j[e]=b.utils.serialize(a.textContent(g));if(e=="file"&&j.sources){delete j.sources}}if(!j.file){j.file=j.link}}return j}})(jwplayer);(function(e){var b=jwplayer.utils,h=b.xmlAttribute,c=e.localName,a=e.textContent,d=e.numChildren;var g=e.mediaparser=function(){};var f="media";g.parseGroup=function(m,n){for(var k=0;k<d(m);k++){var l=m.childNodes[k];if(l.prefix==f){if(!c(l)){continue}switch(c(l).toLowerCase()){case"content":n.file=h(l,"url");if(h(l,"duration")){n.duration=b.seconds(h(l,"duration"))}if(d(l)>0){n=g.parseGroup(l,n)}if(h(l,"url")){if(!n.sources){n.sources=[]}n.sources.push({file:h(l,"url"),type:h(l,"type"),width:h(l,"width"),label:h(l,"height")?h(l,"height")+"p":undefined})}break;case"title":n.title=a(l);break;case"description":n.description=a(l);break;case"guid":n.mediaid=a(l);break;case"thumbnail":n.image=h(l,"url");break;case"player":var j=l.url;break;case"group":g.parseGroup(l,n);break}}}return n}})(jwplayer.html5.parsers);(function(g){var b=jwplayer.utils,a=g.textContent,e=g.getChildNode,f=g.numChildren,d=g.localName;g.rssparser={};g.rssparser.parse=function(o){var h=[];for(var m=0;m<f(o);m++){var n=e(o,m),k=d(n).toLowerCase();if(k=="channel"){for(var l=0;l<f(n);l++){var p=e(n,l);if(d(p).toLowerCase()=="item"){h.push(c(p))}}}}return h};function c(l){var m={};for(var j=0;j<l.childNodes.length;j++){var k=l.childNodes[j];var h=d(k);if(!h){continue}switch(h.toLowerCase()){case"enclosure":m.file=b.xmlAttribute(k,"url");break;case"title":m.title=a(k);break;case"pubdate":m.date=a(k);break;case"description":m.description=a(k);break;case"link":m.link=a(k);break;case"category":if(m.tags){m.tags+=a(k)}else{m.tags=a(k)}break}}m=g.mediaparser.parseGroup(l,m);m=g.jwparser.parseEntry(l,m);return new jwplayer.playlist.item(m)}})(jwplayer.html5.parsers);(function(n){var w=n.html5,h=n.utils,k=n.events,r=n.events.state,q=h.css,b="button",p="text",e="divider",s="slider",f="relative",g="absolute",a="none",o="block",u="inline",m="inline-block",j="hidden",c="left",x="right",l="100%",t="width .25s linear, left .25s linear, opacity .25s, background .25s, visibility .25s",v=".jwcontrolbar",d=document;w.controlbar=function(E,at){var C,Y,D={margin:10,font:"Arial,sans-serif",fontsize:10,fontcolor:parseInt("000000",16),fontstyle:"normal",fontweight:"bold",layout:{left:{position:"left",elements:[{name:"play",type:b},{name:"divider",type:e},{name:"prev",type:b},{name:"divider",type:e},{name:"next",type:b},{name:"divider",type:e},{name:"elapsed",type:p}]},center:{position:"center",elements:[{name:"time",type:s}]},right:{position:"right",elements:[{name:"duration",type:p},{name:"blank",type:b},{name:"divider",type:e},{name:"mute",type:b},{name:"volume",type:s},{name:"divider",type:e},{name:"fullscreen",type:b}]}}},W,aC,an,aA,aq,aK,L,O,ak=false,au=0,ab={play:"pause",mute:"unmute",fullscreen:"normalscreen"},aB={play:false,mute:false,fullscreen:false},B={play:ag,mute:P,fullscreen:ad,next:A,prev:aj},F={time:aa,volume:aF};function aE(){an={};C=E;aq=C.id+"_controlbar";aK=L=0;aA=Q();aA.id=aq;aA.className="jwcontrolbar";window.addEventListener("mousemove",aJ,false);window.addEventListener("mouseup",aJ,false);Y=C.skin;aC=Y.getComponentLayout("controlbar");if(!aC){aC=D.layout}h.clearCss("#"+aq);Z();aw();y();R();G();aG()}function y(){C.jwAddEventListener(n.events.JWPLAYER_MEDIA_TIME,aL);C.jwAddEventListener(n.events.JWPLAYER_PLAYER_STATE,I);C.jwAddEventListener(n.events.JWPLAYER_MEDIA_MUTE,aG);C.jwAddEventListener(n.events.JWPLAYER_MEDIA_VOLUME,G);C.jwAddEventListener(n.events.JWPLAYER_MEDIA_BUFFER,M);C.jwAddEventListener(n.events.JWPLAYER_FULLSCREEN,H);C.jwAddEventListener(n.events.JWPLAYER_PLAYLIST_LOADED,R)}function aL(aN){var aM=false,aO;if(an.elapsed){aO=h.timeFormat(aN.position);an.elapsed.innerHTML=aO;aM=(aO.length!=h.timeFormat(L).length)}if(an.duration){aO=h.timeFormat(aN.duration);an.duration.innerHTML=aO;aM=(aM||(aO.length!=h.timeFormat(aK).length))}if(aN.duration>0){az(aN.position/aN.duration)}else{az(0)}aK=aN.duration;L=aN.position;if(aM){U()}}function I(aM){switch(aM.newstate){case r.BUFFERING:case r.PLAYING:q(av(".jwtimeSliderThumb"),{opacity:1});V("play",true);break;case r.PAUSED:if(!ak){V("play",false)}break;case r.IDLE:V("play",false);q(av(".jwtimeSliderThumb"),{opacity:0});if(an.timeRail){an.timeRail.className="jwrail";setTimeout(function(){an.timeRail.className+=" jwsmooth"},100)}aD(0);aL({position:0,duration:0});break;case r.COMPLETED:q(av(),{opacity:0});break}}function aG(){var aM=C.jwGetMute();V("mute",aM);z(aM?0:O)}function G(){O=C.jwGetVolume()/100;z(O)}function M(aM){aD(aM.bufferPercent/100)}function H(aM){V("fullscreen",aM.fullscreen)}function R(aM){if(C.jwGetPlaylist().length<2){q(av(".jwnext"),{display:"none"});q(av(".jwprev"),{display:"none"})}else{q(av(".jwnext"),{display:undefined});q(av(".jwprev"),{display:undefined})}U()}function Z(){W=h.extend({},D,Y.getComponentSettings("controlbar"),at);q("#"+aq,{height:af("background").height,bottom:W.margin?W.margin:0,left:W.margin?W.margin:0,right:W.margin?W.margin:0});q(av(".jwtext"),{font:W.fontsize+"px/"+af("background").height+"px "+W.font,color:W.fontcolor,"font-weight":W.fontweight,"font-style":W.fontstyle,"text-align":"center",padding:"0 5px"})}function av(aM){return"#"+aq+(aM?" "+aM:"")}function Q(){return d.createElement("span")}function aw(){var aO=ao("capLeft");var aN=ao("capRight");var aM=ao("background",{position:g,left:af("capLeft").width,right:af("capRight").width,"background-repeat":"repeat-x"},true);if(aM){aA.appendChild(aM)}if(aO){aA.appendChild(aO)}ax();if(aN){aA.appendChild(aN)}}function S(aM){switch(aM.type){case e:return ai(aM);break;case p:return ap(aM.name);break;case b:if(aM.name!="blank"){return ah(aM.name)}break;case s:return T(aM.name);break}}function ao(aO,aR,aN,aT){var aQ=Q();aQ.className="jw"+aO;var aM=aT?" left center":" center";var aP=af(aO);aQ.innerHTML=" ";if(!aP||aP.src==""){return}var aS;if(aN){aS={background:"url('"+aP.src+"') repeat-x "+aM}}else{aS={background:"url('"+aP.src+"') no-repeat"+aM,width:aP.width}}q(av(".jw"+aO),h.extend(aS,aR));an[aO]=aQ;return aQ}function ah(aO){if(!af(aO+"Button").src){return null}var aP=d.createElement("button");aP.className="jw"+aO;aP.addEventListener("click",al(aO),false);var aQ=af(aO+"Button");var aN=af(aO+"ButtonOver");aP.innerHTML=" ";X(av(".jw"+aO),aQ,aN);var aM=ab[aO];if(aM){X(av(".jw"+aO+".jwtoggle"),af(aM+"Button"),af(aM+"ButtonOver"))}an[aO]=aP;return aP}function X(aM,aN,aO){if(!aN.src){return}q(aM,{width:aN.width,background:"url("+aN.src+") center no-repeat"});if(aO.src){q(aM+":hover",{background:"url("+aO.src+") center no-repeat"})}}function al(aM){return function(){if(B[aM]){B[aM]()}}}function ag(){if(aB.play){C.jwPause()}else{C.jwPlay()}}function P(){C.jwSetMute();aG({mute:aB.mute})}function aF(aM){if(aM<0.1){aM=0}if(aM>0.9){aM=1}C.jwSetVolume(aM*100);z(aM)}function aa(aM){C.jwSeek(aM*aK)}function ad(){C.jwSetFullscreen()}function A(){C.jwPlaylistNext()}function aj(){C.jwPlaylistNext()}function V(aM,aN){if(!h.exists(aN)){aN=!aB[aM]}if(an[aM]){an[aM].className="jw"+aM+(aN?" jwtoggle jwtoggling":" jwtoggling");setTimeout(function(){an[aM].className=an[aM].className.replace(" jwtoggling","")},100)}aB[aM]=aN}function N(aM){return aq+"_"+aM}function ap(aM,aQ){var aO=Q();aO.id=N(aM);aO.className="jwtext jw"+aM;var aN={};var aP=af(aM+"Background");if(aP.src){aN.background="url("+aP.src+") no-repeat center";aN["background-size"]="100% "+af("background").height+"px"}q(av(".jw"+aM),aN);aO.innerHTML="00:00";an[aM]=aO;return aO}function ai(aN){if(aN.width){var aM=Q();aM.className="jwblankDivider";q(aM,{width:parseInt(aN.width)});return aM}else{if(aN.element){return ao(aN.element)}else{return ao(aN.name)}}}function T(aM){var aP=Q();aP.className="jwslider jw"+aM;var aO=ao(aM+"SliderCapLeft");var aN=ao(aM+"SliderCapRight");var aQ=ar(aM);if(aO){aP.appendChild(aO)}aP.appendChild(aQ);if(aO){aP.appendChild(aN)}q(av(".jw"+aM+" .jwrail"),{left:af(aM+"SliderCapLeft").width,right:af(aM+"SliderCapRight").width,});an[aM]=aP;if(aM=="time"){aI(aP);az(0);aD(0)}else{if(aM=="volume"){ay(aP)}}return aP}function ar(aO){var aR=Q();aR.className="jwrail jwsmooth";var aM=["Rail","Buffer","Progress"];for(var aQ=0;aQ<aM.length;aQ++){var aP=ao(aO+"Slider"+aM[aQ],null,true,(aO=="volume"));if(aP){aP.className+=" jwstretch";aR.appendChild(aP)}}var aN=ao(aO+"SliderThumb");if(aN){q(av("."+aN.className),{opacity:0});aN.className+=" jwthumb";aR.appendChild(aN)}aR.addEventListener("mousedown",J(aO),false);an[aO+"Rail"]=aR;return aR}function K(){var aM=C.jwGetState();return(aM==r.IDLE||aM==r.COMPLETED)}function J(aM){return(function(aN){if(aN.button!=0){return}an[aM+"Rail"].className="jwrail";if(aM=="time"){if(!K()){C.jwSeekDrag(true);ak=aM}}else{ak=aM}})}function aJ(aM){if(!ak||aM.button!=0){return}var aQ=an[ak].getElementsByClassName("jwrail")[0],aR=h.getBoundingClientRect(aQ),aP=(aM.clientX-aR.left)/aR.width;if(aM.type=="mouseup"){var aN=ak;if(aN=="time"){C.jwSeekDrag(false)}an[aN+"Rail"].className="jwrail jwsmooth";ak=null;F[aN](aP)}else{if(ak=="time"){az(aP)}else{z(aP)}var aO=(new Date()).getTime();if(aO-au>500){au=aO;F[ak](aP)}}}function aI(aM){if(an.timeSliderThumb){q(av(".jwtimeSliderThumb"),{"margin-left":(af("timeSliderThumb").width/-2)})}aD(0);az(0)}function ay(aO){var aN=af("volumeSliderCapLeft").width,aM=af("volumeSliderCapRight").width,aP=af("volumeSliderRail").width;q(av(".jwvolume"),{width:(aN+aP+aM)})}var ac={};function ax(){aH("left");aH("center");aH("right");aA.appendChild(ac.left);aA.appendChild(ac.center);aA.appendChild(ac.right);q(av(".jwright"),{right:af("capRight").width})}function aH(aN){var aM=Q();aM.className="jwgroup jw"+aN;ac[aN]=aM;if(aC[aN]){ae(aC[aN],ac[aN])}}function ae(aP,aM){if(aP&&aP.elements.length>0){for(var aO=0;aO<aP.elements.length;aO++){var aN=S(aP.elements[aO]);if(aN){aM.appendChild(aN)}}}}var U=this.redraw=function(){Z();q(av(".jwgroup.jwcenter"),{left:Math.round(h.parseDimension(ac.left.offsetWidth)+af("capLeft").width),right:Math.round(h.parseDimension(ac.right.offsetWidth)+af("capRight").width)})};this.getDisplayElement=function(){return aA};function aD(aM){aM=Math.min(Math.max(0,aM),1);if(an.timeSliderBuffer){an.timeSliderBuffer.style.width=aM*100+"%"}}function am(aM,aO,aP){var aN=100*Math.min(Math.max(0,aO),1)+"%";if(an[aM+"SliderProgress"]){an[aM+"SliderProgress"].style.width=aN}if(an[aM+"SliderThumb"]){an[aM+"SliderThumb"].style.left=aN}}function z(aM){am("volume",aM,true)}function az(aM){am("time",aM)}function af(aM){var aN=Y.getSkinElement("controlbar",aM);if(aN){return aN}else{return{width:0,height:0,src:"",image:undefined,ready:false}}}this.show=function(){q(av(),{opacity:1,visibility:"visible"})};this.hide=function(){q(av(),{opacity:0,visibility:j})};aE()};q(v,{position:g,overflow:j,visibility:j,opacity:0,"-webkit-transition":t,"-moz-transition":t,"-o-transition":t});q(v+" span",{height:l,"-webkit-user-select":a,"-webkit-user-drag":a,"user-select":a,"user-drag":a});q(v+" .jwgroup",{display:u});q(v+" span, "+v+" .jwgroup button,"+v+" .jwleft",{position:f,"float":c});q(v+" .jwright",{position:g});q(v+" .jwcenter",{position:g});q(v+" button",{display:m,height:l,border:a,cursor:"pointer","-webkit-transition":t,"-moz-transition":t,"-o-transition":t});q(v+" .jwcapRight,"+v+" .jwtimeSliderCapRight,"+v+" .jwvolumeSliderCapRight",{right:0,position:g});q(v+" .jwtime,"+v+" .jwgroup span.jwstretch",{position:g,height:l,width:l,left:0});q(v+" .jwrail,"+v+" .jwthumb",{position:g,height:l,cursor:"pointer"});q(v+" .jwtime .jwsmooth span",{"-webkit-transition":t,"-moz-transition":t,"-o-transition":t});q(v+" .jwdivider+.jwdivider",{display:a});q(v+" .jwtext",{padding:"0 5px","text-align":"center"});q(v+" .jwtoggling",{"-webkit-transition":a,"-moz-transition":a,"-o-transition":a})})(jwplayer);(function(d){var c=d.html5,a=d.utils,e=d.events,b=e.state;c.controller=function(j,z){var G=j,g=z,q=j.getVideo(),y=this,n=new e.eventdispatcher(G.id,G.config.debug),f=false,t=[];a.extend(this,n);function r(){G.addEventListener(e.JWPLAYER_MEDIA_BUFFER_FULL,D);G.addEventListener(e.JWPLAYER_MEDIA_COMPLETE,function(M){setTimeout(u,25)})}function I(M){if(!f){f=true;g.completeSetup();n.sendEvent(M.type,M);if(d.utils.exists(window.playerReady)){playerReady(M)}n.sendEvent(d.events.JWPLAYER_PLAYLIST_LOADED,{playlist:G.playlist});n.sendEvent(d.events.JWPLAYER_PLAYLIST_ITEM,{index:G.item});G.addGlobalListener(J);g.addGlobalListener(J);L();if(G.autostart&&!a.isIOS()){x()}while(t.length>0){var N=t.shift();A(N.method,N.arguments)}}}function J(M){n.sendEvent(M.type,M)}function D(M){q.play()}function L(M){o();switch(a.typeOf(M)){case"string":G.setPlaylist(new d.playlist({file:M}));G.setItem(0);break;case"object":case"array":G.setPlaylist(new d.playlist(M));G.setItem(0);break;case"number":G.setItem(M);break}}var s,m,p;function x(){try{m=x;if(!s){s=true;n.sendEvent(e.JWPLAYER_MEDIA_BEFOREPLAY);s=false;if(p){p=false;m=null;return}}if(K()){q.load(G.playlist[G.item])}else{if(G.state==b.PAUSED){q.play()}}return true}catch(M){n.sendEvent(e.JWPLAYER_ERROR,M);m=null}return false}function o(){m=null;try{if(!K()){q.stop()}if(s){p=true}return true}catch(M){n.sendEvent(e.JWPLAYER_ERROR,M)}return false}function H(){try{switch(G.state){case b.PLAYING:case b.BUFFERING:q.pause();break;default:if(s){p=true}}return true}catch(M){n.sendEvent(e.JWPLAYER_ERROR,M)}return false;if(G.state==b.PLAYING||G.state==b.BUFFERING){q.pause()}}function K(){return(G.state==b.IDLE||G.state==b.COMPLETED)}function E(M){q.seek(M)}function C(M){g.fullscreen(M)}function w(M){G.stretching=M;g.resize()}function v(M){L(M);x()}function k(){v(G.item-1)}function l(){v(G.item+1)}function u(){if(!K()){return}m=u;switch(G.repeat.toLowerCase()){case"single":x();break;case"always":l();break;case"list":if(G.item==G.playlist.length-1){L(0);G.setState(b.COMPLETED)}else{l()}break;default:G.setState(b.COMPLETED);break}}function B(){try{return G.getVideo().detachMedia()}catch(M){return null}}function h(){try{var M=G.getVideo().attachMedia();if(typeof m=="function"){m()}}catch(N){return null}}function F(M){return function(){if(f){A(M,arguments)}else{t.push({method:M,arguments:arguments})}}}function A(O,N){var M=[];for(i=0;i<N.length;i++){M.push(N[i])}O.apply(this,M)}this.play=F(x);this.pause=F(H);this.seek=F(E);this.stop=F(o);this.load=F(L);this.next=F(l);this.prev=F(k);this.item=F(v);this.setVolume=F(G.setVolume);this.setMute=F(G.setMute);this.setFullscreen=F(C);this.setStretching=F(w);this.detachMedia=B;this.attachMedia=h;this.playerReady=I;r()}})(jwplayer);(function(a){a.html5.defaultskin=function(){this.text='<?xml version="1.0" ?><skin author="LongTail Video" name="Five" version="1.1"><components><component name="controlbar"><settings><setting name="margin" value="0"/><setting name="fontsize" value="11"/><setting name="fontcolor" value="0x000000"/></settings><layout><group position="left"><button name="play"/><divider name="divider"/><button name="prev"/><divider name="divider"/><button name="next"/><divider name="divider"/><text name="elapsed"/></group><group position="center"><slider name="time"/></group><group position="right"><text name="duration"/><divider name="divider"/><button name="mute"/><slider name="volume"/><divider name="divider"/><button name="fullscreen"/></group></layout><elements><element name="background" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAYCAYAAADd5VyeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAFdJREFUeNqczMsOgCAMRFEw/v/PtkAfUNg6aEx0lieZmyOC0mV5jIHQe0dwdwQzQ1DdQEQRWhOEWhtCKRWBuSAQMcBJzAlgzvkRjrTtR+MJbtF4vywBBgAcr05Vhd9mLAAAAABJRU5ErkJggg=="/><element name="divider" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAYCAYAAAA7zJfaAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAC5JREFUeNpimDlzZgMTAxAQTQgICDAwiYqKMjCJiYlBWcLCwgxMzMzMRJsCEGAAXVQDrCAU8IQAAAAASUVORK5CYII="/><element name="playButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAYCAYAAAAVibZIAAAANUlEQVR42u2RsQkAAAjD/NTTPaW6dXLrINJA1kBpGPMAjDWmOgp1HFQXx+b1KOefO4oxY57R73YnVYCQUCQAAAAASUVORK5CYII="/><element name="pauseButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAYCAYAAAAVibZIAAAAIUlEQVQ4jWNgGAWjYOiD/0gYG3/U0FFDB4Oho2AUDAYAAEwiL9HrpdMVAAAAAElFTkSuQmCC"/><element name="prevButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAYCAYAAAAVibZIAAAAQklEQVQ4y2NgGAWjYOiD/1AMA/JAfB5NjCJD/YH4PRaLyDa0H4lNNUP/DxlD59PCUBCIp3ZEwYA+NZLUKBgFgwEAAN+HLX9sB8u8AAAAAElFTkSuQmCC"/><element name="nextButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAYCAYAAAAVibZIAAAAQElEQVQ4y2NgGAWjYOiD/0B8Hojl0cT+U2ooCL8HYn9qGwrD/bQw9P+QMXQ+tSMqnpoRBUpS+tRMUqNgFAwGAADxZy1/mHvFnAAAAABJRU5ErkJggg=="/><element name="timeSliderRail" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAOElEQVRIDe3BwQkAIRADwAhhw/nU/kWwUK+KPITMABFh19Y+F0acY8CJvX9wYpXgRElwolSIiMf9ZWEDhtwurFsAAAAASUVORK5CYII="/><element name="timeSliderBuffer" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAN0lEQVRIDe3BwQkAMQwDMBcc55mRe9zi7RR+FCwBEWG39vcfGHFm4MTuhhMlwYlVBSdKhYh43AW/LQMKm1spzwAAAABJRU5ErkJggg=="/><element name="timeSliderProgress" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAIElEQVRIiWNgGAWjYBTQBfynMR61YCRYMApGwSigMQAAiVWPcbq6UkIAAAAASUVORK5CYII="/><element name="timeSliderThumb" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAYCAYAAAAyJzegAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAEVJREFUeNpiYBhaYD4Q/4fSDAxNza3/oQJgDOIz8fDwoGgB8ZnY2NhQBEF8JhZWFhRBEJ+JlYUVRRDEx6oSu5OGCAAIMAC30g1QKMx9igAAAABJRU5ErkJggg=="/><element name="muteButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAYCAYAAADKx8xXAAAAJklEQVQ4y2NgGAUjDcwH4v/kaPxPikZkxcNVI9mBQ5XoGAWDFwAAsKAXKQQmfbUAAAAASUVORK5CYII="/><element name="unmuteButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAYCAYAAADKx8xXAAAAMklEQVQ4y2NgGAWDHPyntub5xBr6Hwv/Pzk2/yfVG/8psRFE25Oq8T+tQnsIaB4FVAcAi2YVysVY52AAAAAASUVORK5CYII="/><element name="volumeSliderRail" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYAgMAAACdGdVrAAAACVBMVEUAAACmpqampqbBXAu8AAAAAnRSTlMAgJsrThgAAAArSURBVAhbY2AgErBAyA4I2QEhOyBkB4TsYOhAoaCCUCUwDTDtMMNgRuMHAFB5FoGH5T0UAAAAAElFTkSuQmCC"/><element name="volumeSliderProgress" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYAgMAAACdGdVrAAAACVBMVEUAAAAAAAAAAACDY+nAAAAAAnRSTlMAgJsrThgAAAArSURBVAhbY2AgErBAyA4I2QEhOyBkB4TsYOhAoaCCUCUwDTDtMMNgRuMHAFB5FoGH5T0UAAAAAElFTkSuQmCC"/><element name="volumeSliderCapRight" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAYCAYAAAAyJzegAAAAFElEQVQYV2P8//8/AzpgHBUc7oIAGZdH0RjKN8EAAAAASUVORK5CYII="/><element name="fullscreenButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAQklEQVRIiWNgGAWjYMiD/0iYFDmSLbDHImdPLQtgBpEiR7Zl2NijAA5oEkT/0Whi5UiyAJ8BVMsHNMtoo2AUDAIAAGdcIN3IDNXoAAAAAElFTkSuQmCC"/><element name="normalscreenButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAP0lEQVRIx2NgGAWjYMiD/1RSQ5QB/wmIUWzJfzx8qhj+n4DYCAY0DyJ7PBbYU8sHMEvwiZFtODXUjIJRMJgBACpWIN2ZxdPTAAAAAElFTkSuQmCC"/></elements></component><component name="display"><settings><setting name="bufferinterval" value="150"/><setting name="bufferrotation" value="90"/></settings><elements><element name="background" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAGJJREFUeNrs0UERACAMBLGDwUf9S0JI/1jg36yDzK6quhnUzrCAgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgX873e0wMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDBw8gQYACnjBI/ihM8BAAAAAElFTkSuQmCC"/><element name="playIcon" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAiUlEQVR42u3XSw2AMBREURwgAQlIQAISKgUpSEFKJeCg5b0E0kWBTVcD9ySTsL0Jn9IBAAAA+K2UUrBlW/Rr5ZDoIeeuoFkxJD9ss03aIXXQqB9SttoG7ZA6qNcOKdttiwcJh9RB+iFl4SshkRBuLR72+9cvH0SOKI2HRo7x/Fi1/uoCAAAAwLsD8ki99IlO2dQAAAAASUVORK5CYII="/><element name="bufferIcon" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAACBklEQVR42u3Zv0sCYRzH8USTzOsHHEWGkC1HgaDgkktGDjUYtDQ01RDSljQ1BLU02+rk1NTm2NLq4Nx/0L/h9fnCd3j4cnZe1/U8xiO8h3uurufF0/3COd/3/0UWYiEWYiEWYiGJQ+J8xuPxKhXjEMZANinjIZhkGuVRNioE4wVURo4JkHm0xKWmhRAc1bh1EyCUw5BcBIjHiApKa4CErko6DEJwuRo6IRKzyJD8FJAyI3Zp2zRImiBcRhlfo5RtlxCcE3CcDNpGrhYIT2IhAJKilO0VRmzJ32fAMTpBTS0QMfGwlcuKMRftE0DJ0wCJdcOsCkBdXP3Mh9CEFUBTPS9mDZJBG6io4aqVzMdCokCw9H3kT6j/C/9iDdSeUMNC7DkyyxAs/Rk6Qss8FPWRZgdVtUH4DjxEn1zxh+/zj1wHlf4MQhNGrwqA6sY40U8JonRJwEQh+AO3AvCG6gHv4U7IY4krxkroWoAOkoQMGfCBrgIm+YBGqPENpIJ66CJg3x66Y0gnSUidAEEnNr9jjLiWMn5DiWP0OC/oAsCgkq43xBdGDMQr7YASP/vEkHvdl1+JOCcEV5sC4hGEOzTlPuKgd0b0xD4JkRcOgnRRTjdErkYhAsQVq6IdUuPJtmk7BCL3t/h88cx91pKQkI/pkDx6pmYTIjEoxiHsN1YWYiEWYiEWknhflZ5IErA5nr8AAAAASUVORK5CYII="/></elements></component><component name="dock"><settings><setting name="fontcolor" value="0xffffff"/></settings><elements><element name="button" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAGJJREFUeNrs2TEBADAIxMCnGtjxL6luaqE7Fwc3p2bmZlEnywIGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYG/q262z0EBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgZOngADAE0iAsIr/u2qAAAAAElFTkSuQmCC"/></elements></component><component name="playlist"><settings><setting name="backgroundcolor" value="0xe6e6e6"/><setting name="fontcolor" value="0x000000"/></settings><elements><element name="item" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAABPCAYAAAAJMDwFAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQpJREFUeNrs1sGKhDAQRdHY+P+fqr1WSXQpojsLLHIONAzMTh6pO9RaW4F7y/GbH37/09/T9f8/344IhoVhkcfYmsTCi4VhYVjwfmP5CAQMqxTLwinEsNBYoLFwCjEseLexfANCGku94xRiWGgsCGgsH4GIYVkWGguNhcYCjYXGQmOBxsIpRLyDxkJjobFAY6GxcApBvPPdYa3b6ivgFOIU4sUCw8Kw6LaxJBYx8a7ecQoxLAwLDIsk8a7d8WJhWPR9Cl1CvFgkinf1jhcLw8KwwLBIEu/aHS8WaV4sDxZeLAyL3uNdvePFwrAwLDAsksS7didiWHaFU4hhYVgQEO/qHS8WhkXXdgEGAKAsO7NPrr2OAAAAAElFTkSuQmCC"/><element name="itemImage" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADsAAAA7CAIAAABKR2XkAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAK5JREFUeNrslksKwCAMRGvplfzcf6VeQDyA57ABwW0XjVDpm0WILtrhOURNa+3YSuexm67eO4xxTCpgDGMYkwoYwxjGMCYVMIYxjJlun3LcVWWtfdx5KWXGOWfn3FxKLzu6vzC1VvWD896nlEZV//gSxzvleEjozqou/VkRQogxSiNV+q9Pt2l3aIVpU0rhBuFdwbuCVMAYxjDGMamAMYxhjGNSAWMYw/hfjm8BBgDatbXqT4uvsgAAAABJRU5ErkJggg=="/><element name="sliderCapTop" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAKCAYAAABBq/VWAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABNJREFUeNpiYBgFo2AUjBwAEGAAA/IAAdBu5L8AAAAASUVORK5CYII="/><element name="sliderRail" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAECAYAAAB7oZQmAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABxJREFUeNpiZCAeOGARO0CMRiYGOoDhYwlAgAEAYPMBCML0c4MAAAAASUVORK5CYII="/><element name="sliderThumb" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAECAYAAAB7oZQmAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABtJREFUeNpiZCAO/Mcjx0hIMxMDHcDwsQQgwABz1wEIMGLXPQAAAABJRU5ErkJggg=="/><element name="sliderCapBottom" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAKCAYAAABBq/VWAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABNJREFUeNpiYBgFo2AUjBwAEGAAA/IAAdBu5L8AAAAASUVORK5CYII="/></elements></component></components></skin>';this.xml=null;if(window.DOMParser){parser=new DOMParser();this.xml=parser.parseFromString(this.text,"text/xml")}else{this.xml=new ActiveXObject("Microsoft.XMLDOM");this.xml.async="false";this.xml.loadXML(this.text)}return this}})(jwplayer);(function(e){var k=jwplayer.utils,m=jwplayer.events,n=m.state,l=k.animations.rotate,h=k.css,j=document,a=".jwdisplay",g=".jwpreview",b="absolute",c="none",f="100%",d="opacity .25s";e.display=function(F,T){var M=F,B=F.skin,v,o,t,y,N,R,E={},p,D,P,I,z=k.extend({backgroundcolor:"#000",showicons:true},B.getComponentSettings("display"),T);_bufferRotation=!k.exists(z.bufferrotation)?15:parseInt(z.bufferrotation,10),_bufferInterval=!k.exists(z.bufferinterval)?100:parseInt(z.bufferinterval,10),_eventDispatcher=new m.eventdispatcher();k.extend(this,_eventDispatcher);function C(){v=j.createElement("div");v.id=M.id+"_display";v.className="jwdisplay";o=j.createElement("div");o.className="jwpreview";v.appendChild(o);M.jwAddEventListener(m.JWPLAYER_PLAYER_STATE,A);M.jwAddEventListener(m.JWPLAYER_PLAYLIST_ITEM,L);v.addEventListener("click",O,false);s();A({newstate:n.IDLE})}function O(V){switch(M.jwGetState()){case n.PLAYING:case n.BUFFERING:M.jwPause();break;default:M.jwPlay();break}_eventDispatcher.sendEvent(m.JWPLAYER_DISPLAY_CLICK)}function s(){var V=["play","buffer"];for(var Y=0;Y<V.length;Y++){var ac=V[Y],aa=G(ac+"Icon"),X=G(ac+"IconOver"),Z=j.createElement("div"),W=G("background"),ab=G("backgroundOver");button=j.createElement("button");if(aa){button.className="jw"+ac;Z.className="jwicon";button.appendChild(Z);x("#"+v.id+" ."+button.className,W,ab);x("#"+v.id+" ."+button.className+" div",aa,X);if(ab||X){button.addEventListener("mouseover",H(button),false);button.addEventListener("mouseout",K(button),false)}E[ac]=button}}}function H(V){return function(W){if(V.className.indexOf("jwhover")<0){V.className+=" jwhover"}if(V.childNodes[0].className.indexOf("jwhover")<0){V.childNodes[0].className+=" jwhover"}}}function K(V){return function(W){V.className=V.className.replace(" jwhover","");V.childNodes[0].className=V.childNodes[0].className.replace(" jwhover","")}}function x(V,W,X){if(!(W&&W.src)){return}h(V,{width:W.width,height:W.height,"margin-left":W.width/-2,"margin-top":W.height/-2,background:"url("+W.src+") center no-repeat"});if(X&&X.src){h(V+".jwhover",{background:"url("+X.src+") center no-repeat"})}}function U(V){if(!z.showicons){return}if(D){v.removeChild(D)}D=E[V];if(D){v.appendChild(D)}if(V=="buffer"){P=0;I=setInterval(function(){P+=_bufferRotation;l(D.childNodes[0],P%360)},_bufferInterval)}}function L(){var V=M.jwGetPlaylist()[M.jwGetPlaylistIndex()];var W=V?V.image:"";if(t!=W){t=W;Q(g,false);w()}}var J;function A(V){clearTimeout(J);J=setTimeout(function(){r(V.newstate)},100)}function r(V){clearInterval(I);switch(V){case n.COMPLETED:case n.IDLE:Q(g,true);U("play");break;case n.BUFFERING:U("buffer");break;case n.PLAYING:U();break;case n.PAUSED:U("play");break}}this.hidePreview=function(V){Q(g,!V)};this.getDisplayElement=function(){return v};function u(V){return"#"+v.id+" "+V}function w(){if(t){var V=new Image();V.addEventListener("load",S,false);V.src=t}else{Q(g,false);y=N=0}}function S(){y=this.width;N=this.height;q();if(t){h(u(g),{"background-image":"url("+t+")"})}}function G(V){var W=B.getSkinElement("display",V);if(W){return W}return null}function q(){k.stretch(M.jwGetStretching(),o,v.clientWidth,v.clientHeight,y,N)}this.redraw=q;function Q(V,W){h(u(V),{opacity:W?1:0})}this.show=function(){Q("",true)};this.hide=function(){Q("",false)};this.getBGColor=function(){return z.backgroundcolor};this.setAlternateClickHandler=function(V){_alternateClickHandler=V};this.revertAlternateClickHandler=function(){_alternateClickHandler=undefined};C()};h(a,{position:b,cursor:"pointer",width:f,height:f,overflow:"hidden",opacity:0});h(a+" .jwpreview",{position:b,width:f,height:f,background:"no-repeat center",overflow:"hidden"});h(a+", "+a+" *",{"-webkit-transition":d,"-moz-transition":d,"-o-transition":d});h(a+" button, "+a+" .jwicon",{border:c,position:b,left:"50%",top:"50%",padding:0,cursor:"pointer"})})(jwplayer.html5);(function(a){var e=jwplayer,c=e.utils,d=e.events,b=d.state,f=e.playlist;a.instream=function(C,q,B,D){var x={controlbarseekable:"always",controlbarpausable:true,controlbarstoppable:true,playlistclickable:true};var z,E,G=C,I=q,n=B,A=D,v,L,s,K,j,k,l,p,u,m=false,o,h,r=this;this.load=function(P,O){g();m=true;E=c.extend(x,O);z=new f.item(P);J();h=document.createElement("div");h.id=r.id+"_instream_container";A.detachMedia();v=l.getTag();k=I.playlist[I.item];j=G.jwGetState();if(j==b.BUFFERING||j==b.PLAYING){v.pause()}L=v.src?v.src:v.currentSrc;s=v.innerHTML;K=v.currentTime;u=new a.display(r);u.setAlternateClickHandler(function(Q){if(_fakemodel.state==b.PAUSED){r.jwInstreamPlay()}else{H(d.JWPLAYER_INSTREAM_CLICK,Q)}});h.appendChild(u.getDisplayElement());if(!c.isMobile()){p=new a.controlbar(r);h.appendChild(p.getDisplayElement())}n.setupInstream(h,v);t();l.load(z)};this.jwInstreamDestroy=function(O){if(!m){return}m=false;if(j!=b.IDLE){l.load(k,false)}else{l.stop(true)}l.detachMedia();n.destroyInstream();if(p){try{p.getDisplayElement().parentNode.removeChild(p.getDisplayElement())}catch(P){}}H(d.JWPLAYER_INSTREAM_DESTROYED,{reason:(O?"complete":"destroyed")},true);A.attachMedia();if(j==b.BUFFERING||j==b.PLAYING){v.play();if(I.playlist[I.item]==k){I.getVideo().seek(K)}}return};this.jwInstreamAddEventListener=function(O,P){o.addEventListener(O,P)};this.jwInstreamRemoveEventListener=function(O,P){o.removeEventListener(O,P)};this.jwInstreamPlay=function(){if(!m){return}l.play(true)};this.jwInstreamPause=function(){if(!m){return}l.pause(true)};this.jwInstreamSeek=function(O){if(!m){return}l.seek(O)};this.jwInstreamGetState=function(){if(!m){return undefined}return _fakemodel.state};this.jwInstreamGetPosition=function(){if(!m){return undefined}return _fakemodel.position};this.jwInstreamGetDuration=function(){if(!m){return undefined}return _fakemodel.duration};this.playlistClickable=function(){return(!m||E.playlistclickable.toString().toLowerCase()=="true")};function w(){_fakemodel=new a.model({});o=new d.eventdispatcher();G.jwAddEventListener(d.JWPLAYER_RESIZE,t);G.jwAddEventListener(d.JWPLAYER_FULLSCREEN,t)}function g(){A.setMute(I.mute);A.setVolume(I.volume)}function J(){if(!l){l=new a.video(I.getVideo().getTag());l.addGlobalListener(M);l.addEventListener(d.JWPLAYER_MEDIA_META,N);l.addEventListener(d.JWPLAYER_MEDIA_COMPLETE,y);l.addEventListener(d.JWPLAYER_MEDIA_BUFFER_FULL,F)}l.attachMedia()}function M(O){if(m){H(O.type,O)}}function F(O){if(m){l.play()}}function y(O){if(m){setTimeout(function(){r.jwInstreamDestroy(true)},10)}}function N(O){if(O.metadata.width&&O.metadata.height){n.resizeMedia()}}function H(O,P,Q){if(m||Q){o.sendEvent(O,P)}}function t(){if(p){p.redraw()}if(u){u.redraw()}}this.jwPlay=function(O){if(E.controlbarpausable.toString().toLowerCase()=="true"){this.jwInstreamPlay()}};this.jwPause=function(O){if(E.controlbarpausable.toString().toLowerCase()=="true"){this.jwInstreamPause()}};this.jwStop=function(){if(E.controlbarstoppable.toString().toLowerCase()=="true"){this.jwInstreamDestroy();G.jwStop()}};this.jwSeek=function(O){switch(E.controlbarseekable.toLowerCase()){case"always":this.jwInstreamSeek(O);break;case"backwards":if(_fakemodel.position>O){this.jwInstreamSeek(O)}break}};this.jwGetPosition=function(){};this.jwGetDuration=function(){};this.jwGetWidth=G.jwGetWidth;this.jwGetHeight=G.jwGetHeight;this.jwGetFullscreen=G.jwGetFullscreen;this.jwSetFullscreen=G.jwSetFullscreen;this.jwGetVolume=function(){return I.volume};this.jwSetVolume=function(O){l.volume(O);G.jwSetVolume(O)};this.jwGetMute=function(){return I.mute};this.jwSetMute=function(O){l.mute(O);G.jwSetMute(O)};this.jwGetState=function(){return _fakemodel.state};this.jwGetPlaylist=function(){return[z]};this.jwGetPlaylistIndex=function(){return 0};this.jwGetStretching=function(){return I.config.stretching};this.jwAddEventListener=function(P,O){o.addEventListener(P,O)};this.jwRemoveEventListener=function(P,O){o.removeEventListener(P,O)};this.skin=G.skin;this.id=G.id+"_instream";w();return this}})(jwplayer.html5);(function(b){var a=jwplayer.utils,c=jwplayer.events,d=undefined;b.model=function(f){var m=this,h,o,p=a.getCookies(),e={};_defaults={autostart:false,controlbar:true,debug:d,height:320,icons:true,item:0,mobilecontrols:false,mute:false,playlist:[],playlistposition:"right",playlistsize:0,repeat:"list",skin:d,stretching:a.stretching.UNIFORM,volume:90,width:480};function l(q){for(var r in q){q[r]=a.serialize(q[r])}return q}function n(){a.extend(m,new c.eventdispatcher());m.config=l(a.extend({},_defaults,p,f));a.extend(m,{id:f.id,state:c.state.IDLE,position:0,buffer:0,},m.config);k();m.setItem(m.config.item);o=document.createElement("video");h=new b.video(o);h.volume(m.volume);h.mute(m.mute);h.addGlobalListener(g)}function k(){e.display={showicons:m.icons};e.controlbar={}}var j={};j[c.JWPLAYER_MEDIA_MUTE]="mute";j[c.JWPLAYER_MEDIA_VOLUME]="volume";j[c.JWPLAYER_PLAYER_STATE]="newstate->state";j[c.JWPLAYER_MEDIA_BUFFER]="bufferPercent->buffer";j[c.JWPLAYER_MEDIA_TIME]="position";function g(q){var s=j[q.type];if(s){var t=s.split("->"),u=t[0],r=t[1]?t[1]:u;if(m[r]!=q[u]){m[r]=q[u];m.sendEvent(q.type,q)}}else{m.sendEvent(q.type,q)}}m.setState=function(q){var r=m.state;m.state=q;if(q!=r){m.sendEvent(c.JWPLAYER_PLAYER_STATE,{newstate:m.state,oldstate:r})}};m.getVideo=function(){return h};m.seekDrag=function(q){h.seekDrag(q)};m.setFullscreen=function(q){if(q!=m.fullscreen){m.fullscreen=q;m.sendEvent(c.JWPLAYER_FULLSCREEN,{fullscreen:q})}};m.setPlaylist=function(q){m.playlist=q;m.sendEvent(c.JWPLAYER_PLAYLIST_LOADED,{playlist:q})};m.setItem=function(q){var r;if(q==m.playlist.length||q<-1){r=0}else{if(q==-1||q>m.playlist.length){r=m.playlist.length-1}else{r=q}}if(r!=m.item){m.item=r;m.sendEvent(c.JWPLAYER_PLAYLIST_ITEM,{index:m.item})}};m.setVolume=function(q){if(m.mute&&q>0){m.setMute(false)}q=Math.round(q);a.saveCookie("volume",q);h.volume(q)};m.setMute=function(q){if(!a.exists(q)){q=!m.mute}a.saveCookie("mute",q);h.mute(q)};m.componentConfig=function(q){return e[q]};n()}})(jwplayer.html5);(function(a){a.player=function(c){var l=this,j=new a.model(c),f=new a.view(this,j),g=new a.controller(j,f);function k(){l.id=j.id;var m=new a.setup(j,f,g);m.addEventListener(jwplayer.events.JWPLAYER_READY,d);m.addEventListener(jwplayer.events.JWPLAYER_ERROR,h);m.start()}function d(m){g.playerReady(m)}function h(m){jwplayer.utils.log("There was a problem setting up the player: "+m.message)}l.jwPlay=g.play;l.jwPause=g.pause;l.jwStop=g.stop;l.jwSeek=g.seek;l.jwSetVolume=g.setVolume;l.jwSetMute=g.setMute;l.jwLoad=g.load;l.jwPlaylistNext=g.next;l.jwPlaylistPrev=g.prev;l.jwPlaylistItem=g.item;l.jwSetFullscreen=g.setFullscreen;l.jwResize=f.resize;l.jwSeekDrag=j.seekDrag;l.jwSetStretching=g.setStretching;function e(m){return function(){return j[m]}}l.jwGetPlaylistIndex=e("item");l.jwGetPosition=e("position");l.jwGetDuration=e("duration");l.jwGetBuffer=e("buffer");l.jwGetWidth=e("width");l.jwGetHeight=e("height");l.jwGetFullscreen=e("fullscreen");l.jwGetVolume=e("volume");l.jwGetMute=e("mute");l.jwGetState=e("state");l.jwGetStretching=e("stretching");l.jwGetPlaylist=e("playlist");l.jwDetachMedia=g.detachMedia;l.jwAttachMedia=g.attachMedia;var b;l.jwLoadInstream=function(n,m){if(!b){b=new a.instream(l,j,f,g)}setTimeout(function(){b.load(n,m)},10)};l.jwInstreamDestroy=function(){if(b){b.jwInstreamDestroy()}};l.jwAddEventListener=g.addEventListener;l.jwRemoveEventListener=g.removeEventListener;k()}})(jwplayer.html5);(function(f){var d={size:180,itemheight:60,thumbs:true,fontcolor:"#000000",overcolor:"",activecolor:"",backgroundcolor:"#f8f8f8",font:"_sans",fontsize:"",fontstyle:"",fontweight:""},k={_sans:"Arial, Helvetica, sans-serif",_serif:"Times, Times New Roman, serif",_typewriter:"Courier New, Courier, monospace"},m=jwplayer.utils,h=m.css,e=jwplayer.events,l=".jwplaylist",j=document,a="absolute",b="relative",c="hidden",g="100%";f.playlistcomponent=function(A,M){var G=A,v=G.skin,o=m.extend({},d,G.skin.getComponentSettings("playlist"),M),H,n,q,p,u=-1,r={background:undefined,item:undefined,itemOver:undefined,itemImage:undefined,itemActive:undefined};this.getDisplayElement=function(){return H};this.redraw=function(){};this.show=function(){_show(H)};this.hide=function(){_hide(H)};function s(){H=K("div","jwplaylist");H.id=G.id+"_jwplayer_playlistcomponent";J();if(r.item){o.itemheight=r.item.height}x();G.jwAddEventListener(jwplayer.events.JWPLAYER_PLAYLIST_LOADED,B);G.jwAddEventListener(jwplayer.events.JWPLAYER_PLAYLIST_ITEM,E)}function t(N){return"#"+H.id+(N?" ."+N:"")}function x(){var R=0,Q=0,N=0,P=o.itemheight,T=o.fontsize;m.clearCss(t());h(t("jwlist"),{"background-image":r.background?" url("+r.background.src+")":"","background-color":o.backgroundcolor,color:o.fontcolor,font:o.fontweight+" "+o.fontstyle+" "+(T?T:11)+"px "+(k[o.font]?k[o.font]:k._sans)});if(r.itemImage){R=(P-r.itemImage.height)/2;Q=r.itemImage.width;N=r.itemImage.height}else{Q=P*4/3;N=P}h(t("jwplaylistimg"),{height:N,width:Q,margin:R});h(t("jwlist li"),{"background-image":r.item?"url("+r.item.src+")":"",height:P,"background-size":g+" "+P+"px",cursor:"pointer"});var O={overflow:"hidden"};if(o.activecolor!==""){O.color=o.activecolor}if(r.itemActive){O["background-image"]="url("+r.itemActive.src+")"}h(t("jwlist li.active"),O);var S={overflow:"hidden"};if(o.overcolor!==""){S.color=o.overcolor}if(r.itemOver){S["background-image"]="url("+r.itemOver.src+")"}h(t("jwlist li:hover"),S);h(t("jwtextwrapper"),{padding:"5px 5px 0 "+(R?0:"5px"),height:P-5,position:b});h(t("jwtitle"),{height:T?T+10:20,"line-height":T?T+10:20,overflow:"hidden",display:"inline-block",width:g,"font-size":T?T:13,"font-weight":o.fontweight?o.fontweight:"bold"});h(t("jwdescription"),{display:"block","line-height":T?T+4:16,overflow:"hidden",height:P,position:b});h(t("jwduration"),{position:"absolute",right:5})}function y(){var N=K("ul","jwlist");N.id=H.id+"_ul"+Math.round(Math.random()*10000000);return N}function z(Q){var V=n[Q],U=K("li","jwitem");U.id=p.id+"_item_"+Q;var R=K("div","jwplaylistimg jwfill");if(F()&&(V.image||V["playlist.image"]||r.itemImage)){var S;if(V["playlist.image"]){S=V["playlist.image"]}else{if(V.image){S=V.image}else{if(r.itemImage){S=r.itemImage.src}}}h("#"+U.id+" .jwplaylistimg",{"background-image":S?"url("+S+")":null});L(U,R)}var N=K("div","jwtextwrapper");var T=K("span","jwtitle");T.innerHTML=V?V.title:"";L(N,T);if(V.description){var P=K("span","jwdescription");P.innerHTML=V.description;L(N,P)}if(V.duration>0){var O=K("span","jwduration");O.innerHTML=m.timeFormat(V.duration);L(T,O)}L(U,N);return U}function K(O,N){var P=j.createElement(O);if(N){P.className=N}return P}function L(N,O){N.appendChild(O)}function B(O){H.innerHTML="";n=C();if(!n){return}items=[];p=y();for(var P=0;P<n.length;P++){var N=z(P);N.onclick=I(P);L(p,N);items.push(N)}u=G.jwGetPlaylistIndex();L(H,p);if(m.isIOS()&&window.iScroll){p.style.height=o.itemheight*n.length+"px";var Q=new iScroll(H.id)}}function C(){var O=G.jwGetPlaylist();var P=[];for(var N=0;N<O.length;N++){if(!O[N]["ova.hidden"]){P.push(O[N])}}return P}function I(N){return function(){G.jwPlaylistItem(N);G.jwPlay(true)}}function w(){p.scrollTop=G.jwGetPlaylistIndex()*o.itemheight}function F(){return o.thumbs.toString().toLowerCase()=="true"}function E(N){if(u>=0){j.getElementById(p.id+"_item_"+u).className="jwitem";u=N.index}j.getElementById(p.id+"_item_"+N.index).className="jwitem active";w()}function J(){for(var N in r){r[N]=D(N)}}function D(N){return v.getSkinElement("playlist",N)}s();return this};h(l,{overflow:c,position:a,width:g,height:g});h(l+" .jwplaylistimg",{position:b,width:g,"float":"left",margin:"0 5px 0 0",background:"#000",overflow:c});h(l+" .jwlist",{width:g,height:g,"list-style":"none",margin:0,padding:0,"overflow-y":"auto"});h(l+" .jwlist li",{width:g});h(l+" .jwtextwrapper",{overflow:c})})(jwplayer.html5);(function(b){var d=jwplayer,a=d.utils,c=d.events;b.playlistloader=function(){var f=new c.eventdispatcher();a.extend(this,f);this.load=function(h){a.ajax(h,g,e)};function g(j){try{var l=j.responseXML.firstChild;if(b.parsers.localName(l)=="xml"){l=l.nextSibling}var h=b.parsers.rssparser.parse(l);f.sendEvent(c.JWPLAYER_PLAYLIST_LOADED,{playlist:new d.playlist(h)})}catch(k){e("Could not load the playlist.")}}function e(h){f.sendEvent(c.JWPLAYER_ERROR,{message:h?h:"Could not load playlist an unknown reason."})}}})(jwplayer.html5);(function(f){var h=jwplayer,l=h.utils,m=h.events,a=h.playlist,j=1,e=2,d=3,k=4,c=5,b=6,g=7;f.setup=function(s,H,I){var L=s,q=H,F=I,u={},C={},A,z=new m.eventdispatcher(),v=false,w=[];function t(){r(j,p);r(e,P,j);r(d,y,j);r(k,K,d);r(c,O,k+","+e);r(b,J,c+","+d);r(g,D,b)}function r(Q,S,R){w.push({name:Q,method:S,depends:R})}function G(){for(var S=0;S<w.length;S++){var Q=w[S];if(N(Q.depends)){w.splice(S,1);try{Q.method();G()}catch(R){x(R.message)}return}}if(w.length>0&&!v){setTimeout(G,500)}}function N(S){if(!S){return true}var R=S.toString().split(",");for(var Q=0;Q<R.length;Q++){if(!u[R[Q]]){return false}}return true}function o(Q){u[Q]=true}function p(){o(j)}function P(){A=new f.skin();A.load(L.config.skin,B)}function B(Q){o(e)}function y(){switch(l.typeOf(L.config.playlist)){case"string":var Q=new f.playlistloader();Q.addEventListener(m.JWPLAYER_PLAYLIST_LOADED,n);Q.addEventListener(m.JWPLAYER_ERROR,E);Q.load(L.config.playlist);break;case"array":L.playlist=new a(L.config.playlist);o(d)}}function n(Q){L.setPlaylist(Q.playlist);o(d)}function E(Q){x(Q.message)}function K(){var R=L.playlist[L.item].image;if(R){var Q=new Image();Q.addEventListener("load",M,false);Q.addEventListener("error",M,false);Q.src=R}else{o(k)}}function M(Q){o(k)}function O(){q.setup(A);o(c)}function J(){o(b)}function D(){z.sendEvent(m.JWPLAYER_READY);o(g)}function x(Q){v=true;z.sendEvent(m.JWPLAYER_ERROR,{message:Q})}l.extend(this,z);this.start=G;t()}})(jwplayer.html5);(function(a){a.skin=function(){var b={};var c=false;this.load=function(d,e){new a.skinloader(d,function(f){c=true;b=f;e()},function(){new a.skinloader("",function(f){c=true;b=f;e()})})};this.getSkinElement=function(d,e){if(c){try{return b[d].elements[e]}catch(f){jwplayer.utils.log("No such skin component / element: ",[d,e])}}return null};this.getComponentSettings=function(d){if(c&&b&&b[d]){return b[d].settings}return null};this.getComponentLayout=function(d){if(c){var e=b[d].layout;if(e&&(e.left||e.right||e.center)){return b[d].layout}}return null}}})(jwplayer.html5);(function(a){var b=jwplayer.utils;a.skinloader=function(g,q,l){var p={};var d=q;var m=l;var f=true;var k;var o=g;var t=false;function n(){if(typeof o!="string"||o===""){e(a.defaultskin().xml)}else{b.ajax(b.getAbsolutePath(o),function(u){try{if(b.exists(u.responseXML)){e(u.responseXML);return}}catch(v){j()}e(a.defaultskin().xml)},function(u){e(a.defaultskin().xml)})}}function e(y){var E=y.getElementsByTagName("component");if(E.length===0){return}for(var H=0;H<E.length;H++){var C=E[H].getAttribute("name");var B={settings:{},elements:{},layout:{}};p[C]=B;var G=E[H].getElementsByTagName("elements")[0].getElementsByTagName("element");for(var F=0;F<G.length;F++){c(G[F],C)}var z=E[H].getElementsByTagName("settings")[0];if(z&&z.childNodes.length>0){var K=z.getElementsByTagName("setting");for(var O=0;O<K.length;O++){var Q=K[O].getAttribute("name");var I=K[O].getAttribute("value");if(/color$/.test(Q)){I=b.stringToColor(I)}p[C].settings[Q]=I}}var L=E[H].getElementsByTagName("layout")[0];if(L&&L.childNodes.length>0){var M=L.getElementsByTagName("group");for(var x=0;x<M.length;x++){var A=M[x];p[C].layout[A.getAttribute("position")]={elements:[]};for(var P=0;P<A.attributes.length;P++){var D=A.attributes[P];p[C].layout[A.getAttribute("position")][D.name]=D.value}var N=A.getElementsByTagName("*");for(var w=0;w<N.length;w++){var u=N[w];p[C].layout[A.getAttribute("position")].elements.push({type:u.tagName});for(var v=0;v<u.attributes.length;v++){var J=u.attributes[v];p[C].layout[A.getAttribute("position")].elements[w][J.name]=J.value}if(!b.exists(p[C].layout[A.getAttribute("position")].elements[w].name)){p[C].layout[A.getAttribute("position")].elements[w].name=u.tagName}}}}f=false;s()}}function s(){clearInterval(k);if(!t){k=setInterval(function(){r()},100)}}function c(z,y){var x=new Image();var u=z.getAttribute("name");var w=z.getAttribute("src");var B;if(w.indexOf("data:image/png;base64,")===0){B=w}else{var v=b.getAbsolutePath(o);var A=v.substr(0,v.lastIndexOf("/"));B=[A,y,w].join("/")}p[y].elements[u]={height:0,width:0,src:"",ready:false,image:x};x.onload=function(C){h(x,u,y)};x.onerror=function(C){t=true;s();m()};x.src=B}function j(){for(var v in p){var x=p[v];for(var u in x.elements){var y=x.elements[u];var w=y.image;w.onload=null;w.onerror=null;delete y.image;delete x.elements[u]}delete p[v]}}function r(){for(var u in p){if(u!="properties"){for(var v in p[u].elements){if(!p[u].elements[v].ready){return}}}}if(f===false){clearInterval(k);d(p)}}function h(u,w,v){if(p[v]&&p[v].elements[w]){p[v].elements[w].height=u.height;p[v].elements[w].width=u.width;p[v].elements[w].src=u.src;p[v].elements[w].ready=true;s()}else{b.log("Loaded an image for a missing element: "+v+"."+w)}}n()}})(jwplayer.html5);(function(c){var a=c.utils,d=c.events,b=d.state;c.html5.video=function(Q){var K={abort:x,canplay:o,canplaythrough:x,durationchange:z,emptied:x,ended:x,error:k,loadeddata:x,loadedmetadata:o,loadstart:x,pause:P,play:P,playing:P,progress:x,ratechange:x,readystatechange:x,seeked:x,seeking:x,stalled:x,suspend:x,timeupdate:R,volumechange:j,waiting:s},v=a.extensionmap,A,F,W,C,t,V,m,N,U,E,L,B,e=b.IDLE,G,l=-1,D=-1,H=new d.eventdispatcher(),q=false;a.extend(this,H);function S(X){t=X;M();t.controls=true;t.controls=false;q=true}function M(){for(var X in K){t.addEventListener(X,K[X],false)}}function p(X,Y){if(q){H.sendEvent(X,Y)}}function x(X){}function z(X){if(!q){return}if(V<0){V=t.duration}R()}function R(X){if(!q){return}if(e==b.PLAYING&&!B){m=t.currentTime;p(d.JWPLAYER_MEDIA_TIME,{position:m,duration:V});if(m>=V&&V>0){O()}}}function o(X){if(!q){return}if(!U){U=true;n();if(L>0){y(L)}}}function n(){if(!E){E=true;p(d.JWPLAYER_MEDIA_BUFFER_FULL)}}function P(X){if(!q||B){return}if(t.paused){g()}else{u(b.PLAYING)}}function s(X){if(!q){return}u(b.BUFFERING)}function k(X){if(!q){return}a.log("Error: %o",t.error);u(b.IDLE)}function f(X){var Y=v[X];return(!!Y&&!!Y.html5&&t.canPlayType(Y.html5))}function r(){for(var X in C){if(f(X)){return X}}return null}function J(Y){var X={};if(Y){for(var aa=0;aa<Y.length;aa++){var ab=Y[aa].type,Z=Y[aa].file;if(!ab){ab=a.extension(Z);Y[aa].type=ab}if(!X[ab]){X[ab]=[]}X[ab].push(Y[aa])}}return X}this.load=function(X){if(!q){return}A=X;U=false;E=false;L=0;V=X.duration?X.duration:-1;m=0;C=J(A.sources);W=r();if(!W){a.log("Could not find a file to play.");return}F=C[W][0];u(b.BUFFERING);t.src=F.file;t.load();l=setInterval(h,100);if(a.isIPod()){n()}};var w=this.stop=function(){if(!q){return}t.removeAttribute("src");t.load();clearInterval(l);u(b.IDLE)};this.play=function(){if(q){t.play()}};var g=this.pause=function(){if(q){t.pause();u(b.PAUSED)}};this.seekDrag=function(X){if(!q){return}B=X;if(X){t.pause()}else{t.play()}};var y=this.seek=function(X){if(!q){return}if(t.readyState>=t.HAVE_FUTURE_DATA){L=0;if(!B){p(d.JWPLAYER_MEDIA_SEEK,{position:m,offset:X})}t.currentTime=X}else{L=X}};var T=this.volume=function(X){t.volume=X/100};function j(X){p(d.JWPLAYER_MEDIA_VOLUME,{volume:Math.round(t.volume*100)});p(d.JWPLAYER_MEDIA_MUTE,{mute:t.muted})}this.mute=function(X){if(!a.exists(X)){X=!t.mute}if(X){if(!t.muted){G=t.volume*100;t.muted=true;T(0)}}else{if(t.muted){T(G);t.muted=false}}};function u(X){if(X==b.PAUSED&&e==b.IDLE){return}if(B){return}if(e!=X){var Y=e;e=X;p(d.JWPLAYER_PLAYER_STATE,{oldstate:Y,newstate:X})}}function h(){if(!q){return}var X=I();if(X!=D){D=X;p(d.JWPLAYER_MEDIA_BUFFER,{bufferPercent:Math.round(D*100)})}if(X>=1){clearInterval(l)}}function I(){if(t.buffered.length==0||t.duration==0){return 0}else{return t.buffered.end(t.buffered.length-1)/t.duration}}function O(){u(b.IDLE);p(d.JWPLAYER_MEDIA_BEFORECOMPLETE);p(d.JWPLAYER_MEDIA_COMPLETE)}this.detachMedia=function(){q=false;return t};this.attachMedia=function(){q=true};this.getTag=function(){return t};this.audioMode=function(){return(W&&v[W].html5&&v[W].html5.indexOf("audio")==0)};S(Q)}})(jwplayer);(function(h){var m=jwplayer,r=m.utils,a=jwplayer.events,d=a.state,o=r.css,e=document,l="jwplayer",b="."+l+".jwfullscreen",n="jwmain",t="jwinstream",s="jwvideo",c="jwcontrols",f="jwplaylistcontainer",q="opacity .5s ease",k="100%",g="absolute",p=" !important",j="hidden";h.view=function(E,z){var D=E,B=z,W,N,M,Z,v=0,ag=2000,x,am,H,af,an,ai,J,A=r.isMobile(),ap=r.isIPad(),S=(ap&&B.mobilecontrols),ab=new a.eventdispatcher();r.extend(this,ab);this.setup=function(at){D.skin=at;W=ah("div",l);W.id=D.id;var ar=document.getElementById(D.id);ar.parentNode.replaceChild(W,ar);N=ah("span",n);am=ah("span",s);x=B.getVideo().getTag();am.appendChild(x);M=ah("span",c);H=ah("span",t);Z=ah("span",f);u();N.appendChild(am);N.appendChild(M);N.appendChild(H);W.appendChild(N);W.appendChild(Z);e.addEventListener("webkitfullscreenchange",aj,false);e.addEventListener("mozfullscreenchange",aj,false);e.addEventListener("keydown",ac,false);D.jwAddEventListener(a.JWPLAYER_PLAYER_STATE,F);F({newstate:d.IDLE});M.addEventListener("mouseout",aa,false);M.addEventListener("mousemove",ao,false);if(af){af.getDisplayElement().addEventListener("mousemove",V,false);af.getDisplayElement().addEventListener("mouseout",al,false)}};function ah(at,ar){var au=e.createElement(at);if(ar){au.className=ar}return au}function ao(){clearTimeout(v);if(D.jwGetState()==d.PLAYING||D.jwGetState()==d.PAUSED){L();if(!ae){v=setTimeout(aa,ag)}}}var ae=false;function V(){clearTimeout(v);ae=true}function al(){ae=false}function aa(){if(D.jwGetState()==d.PLAYING||D.jwGetState()==d.PAUSED){G()}clearTimeout(v);v=0}function u(){var at=B.width,ar=B.height,au=B.componentConfig("controlbar");displaySettings=B.componentConfig("display");an=new h.display(D,displaySettings);an.addEventListener(a.JWPLAYER_DISPLAY_CLICK,function(av){ab.sendEvent(av.type,av)});M.appendChild(an.getDisplayElement());if(B.playlistsize&&B.playlistposition&&B.playlistposition!="none"){ai=new h.playlistcomponent(D,{});Z.appendChild(ai.getDisplayElement())}if(!A||S){af=new h.controlbar(D,au);M.appendChild(af.getDisplayElement());if(S){L()}}else{x.controls=true}T(at,ar)}var Q=this.fullscreen=function(ar){if(!r.exists(ar)){ar=!B.fullscreen}if(ar){if(!B.fullscreen){U(true);if(W.requestFullScreen){W.requestFullScreen()}else{if(W.mozRequestFullScreen){W.mozRequestFullScreen()}else{if(W.webkitRequestFullScreen){W.webkitRequestFullScreen()}}}B.setFullscreen(true)}}else{U(false);if(B.fullscreen){if(e.cancelFullScreen){e.cancelFullScreen()}else{if(e.mozCancelFullScreen){e.mozCancelFullScreen()}else{if(e.webkitCancelFullScreen){e.webkitCancelFullScreen()}}}B.setFullscreen(false)}}};function T(au,ar){if(r.exists(au)&&r.exists(ar)){o(Y(),{width:au,height:ar});B.width=au;B.height=ar}if(an){an.redraw()}if(af){af.redraw()}var aw=B.playlistsize,ax=B.playlistposition;if(ai&&aw&&ax){ai.redraw();var at={display:"block"},av={};at[ax]=0;av[ax]=aw;if(ax=="left"||ax=="right"){at.width=aw}else{at.height=aw}o(Y(f),at);o(Y(n),av)}y(ar);C();return}function y(ar){J=(!!af&&ar<=40&&ar.toString().indexOf("%")<0);if(J){B.componentConfig("controlbar").margin=0;af.redraw();L();K();O(false)}else{ak(D.jwGetState())}o(Y(),{"background-color":J?"transparent":an.getBGColor()})}function C(){r.stretch(B.stretching,x,am.clientWidth,am.clientHeight,x.videoWidth,x.videoHeight)}this.resize=T;this.resizeMedia=C;this.completeSetup=function(){o(Y(),{opacity:1})};function ac(ar){switch(ar.keyCode){case 27:if(B.fullscreen){Q(false)}break;case 32:D.jwPlay();break}}function U(ar){if(ar){W.className+=" jwfullscreen"}else{W.className=W.className.replace(/\s+jwfullscreen/,"")}}function aq(){var ar=[e.mozFullScreenElement,e.webkitCurrentFullScreenElement];for(var at=0;at<ar.length;at++){if(ar[at]&&ar[at].id==D.id){return true}}return false}function aj(ar){B.setFullscreen(aq());Q(B.fullscreen)}function L(){if(af&&B.controlbar){af.show()}}function G(){if(af&&!J&&!S){af.hide()}}function w(){if(an&&!J){an.show()}}function K(){if(an){an.hide()}}function I(){G();K()}function ad(){L();w()}function O(ar){ar=ar&&!J;o(Y(s),{visibility:ar?"visible":"hidden",opacity:ar?1:0})}var P;function F(ar){clearTimeout(P);P=setTimeout(function(){ak(ar.newstate)},100)}function ak(ar){switch(ar){case d.PLAYING:if(!B.getVideo().audioMode()||A){O(true);C();an.hidePreview(true);if(A){if(ap&&!S){x.controls=true}else{K()}}}ao();break;case d.COMPLETED:case d.IDLE:if(!A){O(false)}G();an.hidePreview(false);w();if(ap){x.controls=false}break;case d.BUFFERING:if(A){O(true)}else{ad()}break;case d.PAUSED:if(!A||S){ad()}else{if(ap){x.controls=false}}break}}function Y(ar){return"#"+D.id+(ar?" ."+ar:"")}this.setupInstream=function(ar,at){X(Y(t),true);X(Y(c),false);H.appendChild(ar);_instreamVideo=at;F({newstate:d.PLAYING});_instreamMode=true};var R=this.destroyInstream=function(){X(Y(t),false);X(Y(c),true);H.innerHTML="";_instreamVideo=null;_instreamMode=false;T(B.width,B.height)};function X(ar,at){o(ar,{display:at?"block":"none"})}};o("."+l,{position:"relative",overflow:"hidden",opacity:0,"-webkit-transition":q,"-moz-transition":q,"-o-transition":q});o("."+n,{position:g,left:0,right:0,top:0,bottom:0,"-webkit-transition":q,"-moz-transition":q,"-o-transition":q});o("."+s+" ,."+c,{position:g,height:k,width:k,"-webkit-transition":q,"-moz-transition":q,"-o-transition":q});o("."+s,{visibility:"hidden"});o("."+s+" video",{background:"transparent",width:k,height:k});o("."+f,{position:g,height:k,width:k,display:"none"});o("."+t,{overflow:"hidden",position:g,top:0,left:0,bottom:0,right:0,display:"none"});o(b,{width:k,height:k,left:0,right:0,top:0,bottom:0,"z-index":1000,position:"fixed"},true);o(b+" ."+n,{left:0,right:0,top:0,bottom:0},true);o(b+" ."+f,{display:"none"},true);o("."+l+" .jwuniform",{"background-size":"contain"+p});o("."+l+" .jwfill",{"background-size":"cover"+p,"background-position":"center"});o("."+l+" .jwexactfit",{"background-size":k+" "+k+p})})(jwplayer.html5);1 (function(a){a.html5={};a.html5.version="6.0.2217"})(jwplayer);(function(a){var f=document,d=window;a.serialize=function(h){if(h==null){return null}else{if(h=="true"){return true}else{if(h=="false"){return false}else{if(isNaN(Number(h))||h.length>5||h.length==0){return h}else{return Number(h)}}}}};a.sortSources=function(j){var h={};if(j){for(var l=0;l<j.length;l++){var m=j[l].type,k=j[l].file;if(!m){m=a.extension(k);j[l].type=m}if(!h[m]){h[m]=[]}h[m].push(j[l])}}return h};a.ajax=function(m,l,h){var k;if(b(m)&&a.exists(d.XDomainRequest)){k=new XDomainRequest();k.onload=e(k,m,l,h);k.onerror=c(h,m,k)}else{if(a.exists(d.XMLHttpRequest)){k=new XMLHttpRequest();k.onreadystatechange=g(k,m,l,h);k.onerror=c(h,m)}else{if(h){h()}}}try{k.open("GET",m,true);k.send(null)}catch(j){if(h){h(m)}}return k};function b(h){if(h&&h.indexOf("://")>=0){if(h.split("/")[2]!=d.location.href.split("/")[2]){return true}}return false}function c(h,k,j){return function(){h("Error loading file")}}function g(j,l,k,h){return function(){if(j.readyState===4){switch(j.status){case 200:e(j,l,k,h)();break;case 404:h("File not found")}}}}function e(j,l,k,h){return function(){if(!a.exists(j.responseXML)){try{var m;if(d.DOMParser){m=(new DOMParser()).parseFromString(j.responseText,"text/xml")}else{m=new ActiveXObject("Microsoft.XMLDOM");m.async="false";m.loadXML(j.responseText)}if(m){j=a.extend({},j,{responseXML:m})}}catch(n){if(h){h(l)}return}}k(j)}}a.parseDimension=function(h){if(typeof h=="string"){if(h===""){return 0}else{if(h.lastIndexOf("%")>-1){return h}else{return parseInt(h.replace("px",""),10)}}}return h};a.timeFormat=function(h){if(h>0){var j=Math.floor(h/60)<10?"0"+Math.floor(h/60)+":":Math.floor(h/60)+":";j+=Math.floor(h%60)<10?"0"+Math.floor(h%60):Math.floor(h%60);return j}else{return"00:00"}};a.getBoundingClientRect=function(h){if(typeof h.getBoundingClientRect=="function"){return h.getBoundingClientRect()}else{return{left:h.offsetLeft+f.body.scrollLeft,top:h.offsetTop+f.body.scrollTop,width:h.offsetWidth,height:h.offsetHeight}}}})(jwplayer.utils);(function(a){var b=a.animations=function(){};b.rotate=function(c,d){a.transform(c,"rotate("+d+"deg)")}})(jwplayer.utils);(function(h){var a={},g,b={};function f(){var k=document.createElement("style");k.type="text/css";document.getElementsByTagName("head")[0].appendChild(k);return k}h.css=function(k,n,l){if(!h.exists(l)){l=false}if(h.isIE()){if(!g){g=f()}}else{if(!a[k]){a[k]=f()}}if(!b[k]){b[k]={}}for(var m in n){var o=j(m,n[m],l);if(h.exists(b[k][m])&&!h.exists(o)){delete b[k][m]}else{b[k][m]=o}}if(h.isIE()){e()}else{d(k,a[k])}};function j(m,n,k){if(typeof n==="undefined"){return undefined}var l=k?" !important":"";if(!isNaN(n)){switch(m){case"z-index":case"opacity":return n+l;break;default:if(m.match(/color/i)){return"#"+h.pad(n.toString(16),6)+l}else{if(n===0){return 0+l}else{return Math.ceil(n)+"px"+l}}break}}else{return n+l}}function e(){var k="\n";for(var l in b){k+=c(l)}g.innerHTML=k}function d(k,l){if(l){l.innerHTML=c(k)}}function c(k){var l=k+"{\n";var n=b[k];for(var m in n){l+=" "+m+": "+n[m]+";\n"}l+="}\n";return l}h.clearCss=function(l){for(var m in b){if(m.indexOf(l)>=0){delete b[m]}}for(var k in a){if(k.indexOf(l)>=0){a[k].innerHTML=""}}}})(jwplayer.utils);(function(a){var b=a.exists;a.scale=function(f,e,d,h,j){var g;if(!b(e)){e=1}if(!b(d)){d=1}if(!b(h)){h=0}if(!b(j)){j=0}if(e==1&&d==1&&h==0&&j==0){g=""}else{g="scale("+e+","+d+") translate("+h+"px,"+j+"px)"}};a.transform=function(d,f){var e=d.style;if(b(f)){e.webkitTransform=f;e.MozTransform=f;e.msTransform=f;e.OTransform=f}};a.stretch=function(m,r,q,j,o,k){if(!r){return}if(!m){m=c.UNIFORM}if(!q||!j||!o||!k){return}var e=q/o,h=j/k,p=0,l=0,d={},f=(r.tagName.toLowerCase()=="video"),g=false,n;if(f){a.transform(r)}n="jw"+m.toLowerCase();switch(m.toLowerCase()){case c.FILL:if(e>h){o=o*e;k=k*e}else{o=o*h;k=k*h}case c.NONE:e=h=1;case c.EXACTFIT:g=true;break;case c.UNIFORM:default:if(e>h){o=o*h;k=k*h;if(o/q>0.95){g=true;n="jwexactfit";e=Math.ceil(100*q/o)/100;h=1}}else{o=o*e;k=k*e;if(k/j>0.95){g=true;n="jwexactfit";h=Math.ceil(100*j/k)/100;e=1}}break}if(f){if(g){r.style.width=o+"px";r.style.height=k+"px";p=((q-o)/2)/e;l=((j-k)/2)/h;a.scale(r,e,h,p,l)}else{r.style.width="";r.style.height=""}}else{r.className=r.className.replace(/\s*jw(none|exactfit|uniform|fill)/g,"");r.className+=" "+n}};var c=a.stretching={NONE:"none",FILL:"fill",UNIFORM:"uniform",EXACTFIT:"exactfit"}})(jwplayer.utils);(function(a){a.parsers={localName:function(b){if(!b){return""}else{if(b.localName){return b.localName}else{if(b.baseName){return b.baseName}else{return""}}}},textContent:function(b){if(!b){return""}else{if(b.textContent){return b.textContent}else{if(b.text){return b.text}else{return""}}}},getChildNode:function(c,b){return c.childNodes[b]},numChildren:function(b){if(b.childNodes){return b.childNodes.length}else{return 0}}}})(jwplayer.html5);(function(b){var a=b.html5.parsers;var d=a.jwparser=function(){};var c="jwplayer";d.parseEntry=function(h,j){for(var f=0;f<h.childNodes.length;f++){var g=h.childNodes[f];if(g.prefix==c){var e=a.localName(g);j[e]=b.utils.serialize(a.textContent(g));if(e=="file"&&j.sources){delete j.sources}}if(!j.file){j.file=j.link}}return j}})(jwplayer);(function(e){var b=jwplayer.utils,h=b.xmlAttribute,c=e.localName,a=e.textContent,d=e.numChildren;var g=e.mediaparser=function(){};var f="media";g.parseGroup=function(m,n){for(var k=0;k<d(m);k++){var l=m.childNodes[k];if(l.prefix==f){if(!c(l)){continue}switch(c(l).toLowerCase()){case"content":n.file=h(l,"url");if(h(l,"duration")){n.duration=b.seconds(h(l,"duration"))}if(d(l)>0){n=g.parseGroup(l,n)}if(h(l,"url")){if(!n.sources){n.sources=[]}n.sources.push({file:h(l,"url"),type:h(l,"type"),width:h(l,"width"),label:h(l,"height")?h(l,"height")+"p":undefined})}break;case"title":n.title=a(l);break;case"description":n.description=a(l);break;case"guid":n.mediaid=a(l);break;case"thumbnail":n.image=h(l,"url");break;case"player":var j=l.url;break;case"group":g.parseGroup(l,n);break}}}return n}})(jwplayer.html5.parsers);(function(g){var b=jwplayer.utils,a=g.textContent,e=g.getChildNode,f=g.numChildren,d=g.localName;g.rssparser={};g.rssparser.parse=function(o){var h=[];for(var m=0;m<f(o);m++){var n=e(o,m),k=d(n).toLowerCase();if(k=="channel"){for(var l=0;l<f(n);l++){var p=e(n,l);if(d(p).toLowerCase()=="item"){h.push(c(p))}}}}return h};function c(l){var m={};for(var j=0;j<l.childNodes.length;j++){var k=l.childNodes[j];var h=d(k);if(!h){continue}switch(h.toLowerCase()){case"enclosure":m.file=b.xmlAttribute(k,"url");break;case"title":m.title=a(k);break;case"pubdate":m.date=a(k);break;case"description":m.description=a(k);break;case"link":m.link=a(k);break;case"category":if(m.tags){m.tags+=a(k)}else{m.tags=a(k)}break}}m=g.mediaparser.parseGroup(l,m);m=g.jwparser.parseEntry(l,m);return new jwplayer.playlist.item(m)}})(jwplayer.html5.parsers);(function(n){var w=n.html5,h=n.utils,k=n.events,r=n.events.state,q=h.css,b="button",p="text",e="divider",s="slider",f="relative",g="absolute",a="none",o="block",u="inline",m="inline-block",j="hidden",c="left",x="right",l="100%",t="width .25s linear, left .25s linear, opacity .25s, background .25s, visibility .25s",v=".jwcontrolbar",d=document;w.controlbar=function(E,at){var C,Y,D={margin:10,font:"Arial,sans-serif",fontsize:10,fontcolor:parseInt("000000",16),fontstyle:"normal",fontweight:"bold",layout:{left:{position:"left",elements:[{name:"play",type:b},{name:"divider",type:e},{name:"prev",type:b},{name:"divider",type:e},{name:"next",type:b},{name:"divider",type:e},{name:"elapsed",type:p}]},center:{position:"center",elements:[{name:"time",type:s}]},right:{position:"right",elements:[{name:"duration",type:p},{name:"blank",type:b},{name:"divider",type:e},{name:"mute",type:b},{name:"volume",type:s},{name:"divider",type:e},{name:"fullscreen",type:b}]}}},W,aC,an,aA,aq,aK,L,O,ak=false,au=0,ab={play:"pause",mute:"unmute",fullscreen:"normalscreen"},aB={play:false,mute:false,fullscreen:false},B={play:ag,mute:P,fullscreen:ad,next:A,prev:aj},F={time:aa,volume:aF};function aE(){an={};C=E;aq=C.id+"_controlbar";aK=L=0;aA=Q();aA.id=aq;aA.className="jwcontrolbar";window.addEventListener("mousemove",aJ,false);window.addEventListener("mouseup",aJ,false);Y=C.skin;aC=Y.getComponentLayout("controlbar");if(!aC){aC=D.layout}h.clearCss("#"+aq);Z();aw();y();R();G();aG()}function y(){C.jwAddEventListener(n.events.JWPLAYER_MEDIA_TIME,aL);C.jwAddEventListener(n.events.JWPLAYER_PLAYER_STATE,I);C.jwAddEventListener(n.events.JWPLAYER_MEDIA_MUTE,aG);C.jwAddEventListener(n.events.JWPLAYER_MEDIA_VOLUME,G);C.jwAddEventListener(n.events.JWPLAYER_MEDIA_BUFFER,M);C.jwAddEventListener(n.events.JWPLAYER_FULLSCREEN,H);C.jwAddEventListener(n.events.JWPLAYER_PLAYLIST_LOADED,R)}function aL(aN){var aM=false,aO;if(an.elapsed){aO=h.timeFormat(aN.position);an.elapsed.innerHTML=aO;aM=(aO.length!=h.timeFormat(L).length)}if(an.duration){aO=h.timeFormat(aN.duration);an.duration.innerHTML=aO;aM=(aM||(aO.length!=h.timeFormat(aK).length))}if(aN.duration>0){az(aN.position/aN.duration)}else{az(0)}aK=aN.duration;L=aN.position;if(aM){U()}}function I(aM){switch(aM.newstate){case r.BUFFERING:case r.PLAYING:q(av(".jwtimeSliderThumb"),{opacity:1});V("play",true);break;case r.PAUSED:if(!ak){V("play",false)}break;case r.IDLE:V("play",false);q(av(".jwtimeSliderThumb"),{opacity:0});if(an.timeRail){an.timeRail.className="jwrail";setTimeout(function(){an.timeRail.className+=" jwsmooth"},100)}aD(0);aL({position:0,duration:0});break;case r.COMPLETED:q(av(),{opacity:0});break}}function aG(){var aM=C.jwGetMute();V("mute",aM);z(aM?0:O)}function G(){O=C.jwGetVolume()/100;z(O)}function M(aM){aD(aM.bufferPercent/100)}function H(aM){V("fullscreen",aM.fullscreen)}function R(aM){if(C.jwGetPlaylist().length<2){q(av(".jwnext"),{display:"none"});q(av(".jwprev"),{display:"none"})}else{q(av(".jwnext"),{display:undefined});q(av(".jwprev"),{display:undefined})}U()}function Z(){W=h.extend({},D,Y.getComponentSettings("controlbar"),at);q("#"+aq,{height:af("background").height,bottom:W.margin?W.margin:0,left:W.margin?W.margin:0,right:W.margin?W.margin:0});q(av(".jwtext"),{font:W.fontsize+"px/"+af("background").height+"px "+W.font,color:W.fontcolor,"font-weight":W.fontweight,"font-style":W.fontstyle,"text-align":"center",padding:"0 5px"})}function av(aM){return"#"+aq+(aM?" "+aM:"")}function Q(){return d.createElement("span")}function aw(){var aO=ao("capLeft");var aN=ao("capRight");var aM=ao("background",{position:g,left:af("capLeft").width,right:af("capRight").width,"background-repeat":"repeat-x"},true);if(aM){aA.appendChild(aM)}if(aO){aA.appendChild(aO)}ax();if(aN){aA.appendChild(aN)}}function S(aM){switch(aM.type){case e:return ai(aM);break;case p:return ap(aM.name);break;case b:if(aM.name!="blank"){return ah(aM.name)}break;case s:return T(aM.name);break}}function ao(aO,aR,aN,aT){var aQ=Q();aQ.className="jw"+aO;var aM=aT?" left center":" center";var aP=af(aO);aQ.innerHTML=" ";if(!aP||aP.src==""){return}var aS;if(aN){aS={background:"url('"+aP.src+"') repeat-x "+aM}}else{aS={background:"url('"+aP.src+"') no-repeat"+aM,width:aP.width}}q(av(".jw"+aO),h.extend(aS,aR));an[aO]=aQ;return aQ}function ah(aO){if(!af(aO+"Button").src){return null}var aP=d.createElement("button");aP.className="jw"+aO;aP.addEventListener("click",al(aO),false);var aQ=af(aO+"Button");var aN=af(aO+"ButtonOver");aP.innerHTML=" ";X(av(".jw"+aO),aQ,aN);var aM=ab[aO];if(aM){X(av(".jw"+aO+".jwtoggle"),af(aM+"Button"),af(aM+"ButtonOver"))}an[aO]=aP;return aP}function X(aM,aN,aO){if(!aN.src){return}q(aM,{width:aN.width,background:"url("+aN.src+") center no-repeat"});if(aO.src){q(aM+":hover",{background:"url("+aO.src+") center no-repeat"})}}function al(aM){return function(){if(B[aM]){B[aM]()}}}function ag(){if(aB.play){C.jwPause()}else{C.jwPlay()}}function P(){C.jwSetMute();aG({mute:aB.mute})}function aF(aM){if(aM<0.1){aM=0}if(aM>0.9){aM=1}C.jwSetVolume(aM*100);z(aM)}function aa(aM){C.jwSeek(aM*aK)}function ad(){C.jwSetFullscreen()}function A(){C.jwPlaylistNext()}function aj(){C.jwPlaylistNext()}function V(aM,aN){if(!h.exists(aN)){aN=!aB[aM]}if(an[aM]){an[aM].className="jw"+aM+(aN?" jwtoggle jwtoggling":" jwtoggling");setTimeout(function(){an[aM].className=an[aM].className.replace(" jwtoggling","")},100)}aB[aM]=aN}function N(aM){return aq+"_"+aM}function ap(aM,aQ){var aO=Q();aO.id=N(aM);aO.className="jwtext jw"+aM;var aN={};var aP=af(aM+"Background");if(aP.src){aN.background="url("+aP.src+") no-repeat center";aN["background-size"]="100% "+af("background").height+"px"}q(av(".jw"+aM),aN);aO.innerHTML="00:00";an[aM]=aO;return aO}function ai(aN){if(aN.width){var aM=Q();aM.className="jwblankDivider";q(aM,{width:parseInt(aN.width)});return aM}else{if(aN.element){return ao(aN.element)}else{return ao(aN.name)}}}function T(aM){var aP=Q();aP.className="jwslider jw"+aM;var aO=ao(aM+"SliderCapLeft");var aN=ao(aM+"SliderCapRight");var aQ=ar(aM);if(aO){aP.appendChild(aO)}aP.appendChild(aQ);if(aO){aP.appendChild(aN)}q(av(".jw"+aM+" .jwrail"),{left:af(aM+"SliderCapLeft").width,right:af(aM+"SliderCapRight").width,});an[aM]=aP;if(aM=="time"){aI(aP);az(0);aD(0)}else{if(aM=="volume"){ay(aP)}}return aP}function ar(aO){var aR=Q();aR.className="jwrail jwsmooth";var aM=["Rail","Buffer","Progress"];for(var aQ=0;aQ<aM.length;aQ++){var aP=ao(aO+"Slider"+aM[aQ],null,true,(aO=="volume"));if(aP){aP.className+=" jwstretch";aR.appendChild(aP)}}var aN=ao(aO+"SliderThumb");if(aN){q(av("."+aN.className),{opacity:0});aN.className+=" jwthumb";aR.appendChild(aN)}aR.addEventListener("mousedown",J(aO),false);an[aO+"Rail"]=aR;return aR}function K(){var aM=C.jwGetState();return(aM==r.IDLE||aM==r.COMPLETED)}function J(aM){return(function(aN){if(aN.button!=0){return}an[aM+"Rail"].className="jwrail";if(aM=="time"){if(!K()){C.jwSeekDrag(true);ak=aM}}else{ak=aM}})}function aJ(aM){if(!ak||aM.button!=0){return}var aQ=an[ak].getElementsByClassName("jwrail")[0],aR=h.getBoundingClientRect(aQ),aP=(aM.clientX-aR.left)/aR.width;if(aM.type=="mouseup"){var aN=ak;if(aN=="time"){C.jwSeekDrag(false)}an[aN+"Rail"].className="jwrail jwsmooth";ak=null;F[aN](aP)}else{if(ak=="time"){az(aP)}else{z(aP)}var aO=(new Date()).getTime();if(aO-au>500){au=aO;F[ak](aP)}}}function aI(aM){if(an.timeSliderThumb){q(av(".jwtimeSliderThumb"),{"margin-left":(af("timeSliderThumb").width/-2)})}aD(0);az(0)}function ay(aO){var aN=af("volumeSliderCapLeft").width,aM=af("volumeSliderCapRight").width,aP=af("volumeSliderRail").width;q(av(".jwvolume"),{width:(aN+aP+aM)})}var ac={};function ax(){aH("left");aH("center");aH("right");aA.appendChild(ac.left);aA.appendChild(ac.center);aA.appendChild(ac.right);q(av(".jwright"),{right:af("capRight").width})}function aH(aN){var aM=Q();aM.className="jwgroup jw"+aN;ac[aN]=aM;if(aC[aN]){ae(aC[aN],ac[aN])}}function ae(aP,aM){if(aP&&aP.elements.length>0){for(var aO=0;aO<aP.elements.length;aO++){var aN=S(aP.elements[aO]);if(aN){aM.appendChild(aN)}}}}var U=this.redraw=function(){Z();q(av(".jwgroup.jwcenter"),{left:Math.round(h.parseDimension(ac.left.offsetWidth)+af("capLeft").width),right:Math.round(h.parseDimension(ac.right.offsetWidth)+af("capRight").width)})};this.getDisplayElement=function(){return aA};function aD(aM){aM=Math.min(Math.max(0,aM),1);if(an.timeSliderBuffer){an.timeSliderBuffer.style.width=aM*100+"%"}}function am(aM,aO,aP){var aN=100*Math.min(Math.max(0,aO),1)+"%";if(an[aM+"SliderProgress"]){an[aM+"SliderProgress"].style.width=aN}if(an[aM+"SliderThumb"]){an[aM+"SliderThumb"].style.left=aN}}function z(aM){am("volume",aM,true)}function az(aM){am("time",aM)}function af(aM){var aN=Y.getSkinElement("controlbar",aM);if(aN){return aN}else{return{width:0,height:0,src:"",image:undefined,ready:false}}}this.show=function(){q(av(),{opacity:1,visibility:"visible"})};this.hide=function(){q(av(),{opacity:0,visibility:j})};aE()};q(v,{position:g,overflow:j,visibility:j,opacity:0,"-webkit-transition":t,"-moz-transition":t,"-o-transition":t});q(v+" span",{height:l,"-webkit-user-select":a,"-webkit-user-drag":a,"user-select":a,"user-drag":a});q(v+" .jwgroup",{display:u});q(v+" span, "+v+" .jwgroup button,"+v+" .jwleft",{position:f,"float":c});q(v+" .jwright",{position:g});q(v+" .jwcenter",{position:g});q(v+" button",{display:m,height:l,border:a,cursor:"pointer","-webkit-transition":t,"-moz-transition":t,"-o-transition":t});q(v+" .jwcapRight,"+v+" .jwtimeSliderCapRight,"+v+" .jwvolumeSliderCapRight",{right:0,position:g});q(v+" .jwtime,"+v+" .jwgroup span.jwstretch",{position:g,height:l,width:l,left:0});q(v+" .jwrail,"+v+" .jwthumb",{position:g,height:l,cursor:"pointer"});q(v+" .jwtime .jwsmooth span",{"-webkit-transition":t,"-moz-transition":t,"-o-transition":t});q(v+" .jwdivider+.jwdivider",{display:a});q(v+" .jwtext",{padding:"0 5px","text-align":"center"});q(v+" .jwtoggling",{"-webkit-transition":a,"-moz-transition":a,"-o-transition":a})})(jwplayer);(function(d){var c=d.html5,a=d.utils,e=d.events,b=e.state;c.controller=function(j,A){var H=j,g=A,r=j.getVideo(),z=this,o=new e.eventdispatcher(H.id,H.config.debug),f=false,u=[];a.extend(this,o);function s(){H.addEventListener(e.JWPLAYER_MEDIA_BUFFER_FULL,E);H.addEventListener(e.JWPLAYER_MEDIA_COMPLETE,function(P){setTimeout(v,25)})}function K(P){if(!f){f=true;g.completeSetup();o.sendEvent(P.type,P);if(d.utils.exists(window.playerReady)){playerReady(P)}o.sendEvent(d.events.JWPLAYER_PLAYLIST_LOADED,{playlist:H.playlist});o.sendEvent(d.events.JWPLAYER_PLAYLIST_ITEM,{index:H.item});H.addGlobalListener(M);g.addGlobalListener(M);O();if(H.autostart&&!a.isIOS()){y()}while(u.length>0){var Q=u.shift();B(Q.method,Q.arguments)}}}function M(P){o.sendEvent(P.type,P)}function E(P){r.play()}function O(P){p();switch(a.typeOf(P)){case"string":H.setPlaylist(new d.playlist({file:P}));H.setItem(0);break;case"object":case"array":H.setPlaylist(new d.playlist(P));H.setItem(0);break;case"number":H.setItem(P);break}}var t,n,q;function y(){try{n=y;if(!t){t=true;o.sendEvent(e.JWPLAYER_MEDIA_BEFOREPLAY);t=false;if(q){q=false;n=null;return}}if(N()){r.load(H.playlist[H.item])}else{if(H.state==b.PAUSED){r.play()}}return true}catch(P){o.sendEvent(e.JWPLAYER_ERROR,P);n=null}return false}function p(){n=null;try{if(!N()){r.stop()}if(t){q=true}return true}catch(P){o.sendEvent(e.JWPLAYER_ERROR,P)}return false}function J(){try{switch(H.state){case b.PLAYING:case b.BUFFERING:r.pause();break;default:if(t){q=true}}return true}catch(P){o.sendEvent(e.JWPLAYER_ERROR,P)}return false;if(H.state==b.PLAYING||H.state==b.BUFFERING){r.pause()}}function N(){return(H.state==b.IDLE||H.state==b.COMPLETED)}function F(P){r.seek(P)}function D(P){g.fullscreen(P)}function x(P){H.stretching=P;g.resize()}function w(P){O(P);y()}function k(){w(H.item-1)}function l(){w(H.item+1)}function v(){if(!N()){return}n=v;switch(H.repeat.toLowerCase()){case"single":y();break;case"always":l();break;case"list":if(H.item==H.playlist.length-1){O(0);H.setState(b.COMPLETED)}else{l()}break;default:H.setState(b.COMPLETED);break}}function L(P){r.setCurrentQuality(P)}function I(){if(r){return r.getCurrentQuality()}else{return -1}}function m(){if(r){return r.getQualityLevels()}else{return null}}function C(){try{return H.getVideo().detachMedia()}catch(P){return null}}function h(){try{var P=H.getVideo().attachMedia();if(typeof n=="function"){n()}}catch(Q){return null}}function G(P){return function(){if(f){B(P,arguments)}else{u.push({method:P,arguments:arguments})}}}function B(R,Q){var P=[];for(i=0;i<Q.length;i++){P.push(Q[i])}R.apply(this,P)}this.play=G(y);this.pause=G(J);this.seek=G(F);this.stop=G(p);this.load=G(O);this.next=G(l);this.prev=G(k);this.item=G(w);this.setVolume=G(H.setVolume);this.setMute=G(H.setMute);this.setFullscreen=G(D);this.setStretching=G(x);this.detachMedia=C;this.attachMedia=h;this.setCurrentQuality=G(L);this.getCurrentQuality=I;this.getQualityLevels=m;this.playerReady=K;s()}})(jwplayer);(function(a){a.html5.defaultskin=function(){this.text='<?xml version="1.0" ?><skin author="LongTail Video" name="Five" version="1.1"><components><component name="controlbar"><settings><setting name="margin" value="0"/><setting name="fontsize" value="11"/><setting name="fontcolor" value="0x000000"/></settings><layout><group position="left"><button name="play"/><divider name="divider"/><button name="prev"/><divider name="divider"/><button name="next"/><divider name="divider"/><text name="elapsed"/></group><group position="center"><slider name="time"/></group><group position="right"><text name="duration"/><divider name="divider"/><button name="mute"/><slider name="volume"/><divider name="divider"/><button name="fullscreen"/></group></layout><elements><element name="background" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAYCAYAAADd5VyeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAFdJREFUeNqczMsOgCAMRFEw/v/PtkAfUNg6aEx0lieZmyOC0mV5jIHQe0dwdwQzQ1DdQEQRWhOEWhtCKRWBuSAQMcBJzAlgzvkRjrTtR+MJbtF4vywBBgAcr05Vhd9mLAAAAABJRU5ErkJggg=="/><element name="divider" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAYCAYAAAA7zJfaAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAC5JREFUeNpimDlzZgMTAxAQTQgICDAwiYqKMjCJiYlBWcLCwgxMzMzMRJsCEGAAXVQDrCAU8IQAAAAASUVORK5CYII="/><element name="playButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAYCAYAAAAVibZIAAAANUlEQVR42u2RsQkAAAjD/NTTPaW6dXLrINJA1kBpGPMAjDWmOgp1HFQXx+b1KOefO4oxY57R73YnVYCQUCQAAAAASUVORK5CYII="/><element name="pauseButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAYCAYAAAAVibZIAAAAIUlEQVQ4jWNgGAWjYOiD/0gYG3/U0FFDB4Oho2AUDAYAAEwiL9HrpdMVAAAAAElFTkSuQmCC"/><element name="prevButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAYCAYAAAAVibZIAAAAQklEQVQ4y2NgGAWjYOiD/1AMA/JAfB5NjCJD/YH4PRaLyDa0H4lNNUP/DxlD59PCUBCIp3ZEwYA+NZLUKBgFgwEAAN+HLX9sB8u8AAAAAElFTkSuQmCC"/><element name="nextButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAYCAYAAAAVibZIAAAAQElEQVQ4y2NgGAWjYOiD/0B8Hojl0cT+U2ooCL8HYn9qGwrD/bQw9P+QMXQ+tSMqnpoRBUpS+tRMUqNgFAwGAADxZy1/mHvFnAAAAABJRU5ErkJggg=="/><element name="timeSliderRail" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAOElEQVRIDe3BwQkAIRADwAhhw/nU/kWwUK+KPITMABFh19Y+F0acY8CJvX9wYpXgRElwolSIiMf9ZWEDhtwurFsAAAAASUVORK5CYII="/><element name="timeSliderBuffer" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAN0lEQVRIDe3BwQkAMQwDMBcc55mRe9zi7RR+FCwBEWG39vcfGHFm4MTuhhMlwYlVBSdKhYh43AW/LQMKm1spzwAAAABJRU5ErkJggg=="/><element name="timeSliderProgress" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAIElEQVRIiWNgGAWjYBTQBfynMR61YCRYMApGwSigMQAAiVWPcbq6UkIAAAAASUVORK5CYII="/><element name="timeSliderThumb" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAYCAYAAAAyJzegAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAEVJREFUeNpiYBhaYD4Q/4fSDAxNza3/oQJgDOIz8fDwoGgB8ZnY2NhQBEF8JhZWFhRBEJ+JlYUVRRDEx6oSu5OGCAAIMAC30g1QKMx9igAAAABJRU5ErkJggg=="/><element name="muteButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAYCAYAAADKx8xXAAAAJklEQVQ4y2NgGAUjDcwH4v/kaPxPikZkxcNVI9mBQ5XoGAWDFwAAsKAXKQQmfbUAAAAASUVORK5CYII="/><element name="unmuteButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAYCAYAAADKx8xXAAAAMklEQVQ4y2NgGAWDHPyntub5xBr6Hwv/Pzk2/yfVG/8psRFE25Oq8T+tQnsIaB4FVAcAi2YVysVY52AAAAAASUVORK5CYII="/><element name="volumeSliderRail" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYAgMAAACdGdVrAAAACVBMVEUAAACmpqampqbBXAu8AAAAAnRSTlMAgJsrThgAAAArSURBVAhbY2AgErBAyA4I2QEhOyBkB4TsYOhAoaCCUCUwDTDtMMNgRuMHAFB5FoGH5T0UAAAAAElFTkSuQmCC"/><element name="volumeSliderProgress" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYAgMAAACdGdVrAAAACVBMVEUAAAAAAAAAAACDY+nAAAAAAnRSTlMAgJsrThgAAAArSURBVAhbY2AgErBAyA4I2QEhOyBkB4TsYOhAoaCCUCUwDTDtMMNgRuMHAFB5FoGH5T0UAAAAAElFTkSuQmCC"/><element name="volumeSliderCapRight" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAYCAYAAAAyJzegAAAAFElEQVQYV2P8//8/AzpgHBUc7oIAGZdH0RjKN8EAAAAASUVORK5CYII="/><element name="fullscreenButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAQklEQVRIiWNgGAWjYMiD/0iYFDmSLbDHImdPLQtgBpEiR7Zl2NijAA5oEkT/0Whi5UiyAJ8BVMsHNMtoo2AUDAIAAGdcIN3IDNXoAAAAAElFTkSuQmCC"/><element name="normalscreenButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAP0lEQVRIx2NgGAWjYMiD/1RSQ5QB/wmIUWzJfzx8qhj+n4DYCAY0DyJ7PBbYU8sHMEvwiZFtODXUjIJRMJgBACpWIN2ZxdPTAAAAAElFTkSuQmCC"/></elements></component><component name="display"><settings><setting name="bufferinterval" value="150"/><setting name="bufferrotation" value="90"/></settings><elements><element name="background" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAGJJREFUeNrs0UERACAMBLGDwUf9S0JI/1jg36yDzK6quhnUzrCAgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgX873e0wMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDBw8gQYACnjBI/ihM8BAAAAAElFTkSuQmCC"/><element name="playIcon" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAiUlEQVR42u3XSw2AMBREURwgAQlIQAISKgUpSEFKJeCg5b0E0kWBTVcD9ySTsL0Jn9IBAAAA+K2UUrBlW/Rr5ZDoIeeuoFkxJD9ss03aIXXQqB9SttoG7ZA6qNcOKdttiwcJh9RB+iFl4SshkRBuLR72+9cvH0SOKI2HRo7x/Fi1/uoCAAAAwLsD8ki99IlO2dQAAAAASUVORK5CYII="/><element name="bufferIcon" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAACBklEQVR42u3Zv0sCYRzH8USTzOsHHEWGkC1HgaDgkktGDjUYtDQ01RDSljQ1BLU02+rk1NTm2NLq4Nx/0L/h9fnCd3j4cnZe1/U8xiO8h3uurufF0/3COd/3/0UWYiEWYiEWYiGJQ+J8xuPxKhXjEMZANinjIZhkGuVRNioE4wVURo4JkHm0xKWmhRAc1bh1EyCUw5BcBIjHiApKa4CErko6DEJwuRo6IRKzyJD8FJAyI3Zp2zRImiBcRhlfo5RtlxCcE3CcDNpGrhYIT2IhAJKilO0VRmzJ32fAMTpBTS0QMfGwlcuKMRftE0DJ0wCJdcOsCkBdXP3Mh9CEFUBTPS9mDZJBG6io4aqVzMdCokCw9H3kT6j/C/9iDdSeUMNC7DkyyxAs/Rk6Qss8FPWRZgdVtUH4DjxEn1zxh+/zj1wHlf4MQhNGrwqA6sY40U8JonRJwEQh+AO3AvCG6gHv4U7IY4krxkroWoAOkoQMGfCBrgIm+YBGqPENpIJ66CJg3x66Y0gnSUidAEEnNr9jjLiWMn5DiWP0OC/oAsCgkq43xBdGDMQr7YASP/vEkHvdl1+JOCcEV5sC4hGEOzTlPuKgd0b0xD4JkRcOgnRRTjdErkYhAsQVq6IdUuPJtmk7BCL3t/h88cx91pKQkI/pkDx6pmYTIjEoxiHsN1YWYiEWYiEWknhflZ5IErA5nr8AAAAASUVORK5CYII="/></elements></component><component name="dock"><settings><setting name="fontcolor" value="0xffffff"/></settings><elements><element name="button" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAGJJREFUeNrs2TEBADAIxMCnGtjxL6luaqE7Fwc3p2bmZlEnywIGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYG/q262z0EBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgZOngADAE0iAsIr/u2qAAAAAElFTkSuQmCC"/></elements></component><component name="playlist"><settings><setting name="backgroundcolor" value="0xe6e6e6"/><setting name="fontcolor" value="0x000000"/></settings><elements><element name="item" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAABPCAYAAAAJMDwFAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQpJREFUeNrs1sGKhDAQRdHY+P+fqr1WSXQpojsLLHIONAzMTh6pO9RaW4F7y/GbH37/09/T9f8/344IhoVhkcfYmsTCi4VhYVjwfmP5CAQMqxTLwinEsNBYoLFwCjEseLexfANCGku94xRiWGgsCGgsH4GIYVkWGguNhcYCjYXGQmOBxsIpRLyDxkJjobFAY6GxcApBvPPdYa3b6ivgFOIU4sUCw8Kw6LaxJBYx8a7ecQoxLAwLDIsk8a7d8WJhWPR9Cl1CvFgkinf1jhcLw8KwwLBIEu/aHS8WaV4sDxZeLAyL3uNdvePFwrAwLDAsksS7didiWHaFU4hhYVgQEO/qHS8WhkXXdgEGAKAsO7NPrr2OAAAAAElFTkSuQmCC"/><element name="itemImage" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADsAAAA7CAIAAABKR2XkAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAK5JREFUeNrslksKwCAMRGvplfzcf6VeQDyA57ABwW0XjVDpm0WILtrhOURNa+3YSuexm67eO4xxTCpgDGMYkwoYwxjGMCYVMIYxjJlun3LcVWWtfdx5KWXGOWfn3FxKLzu6vzC1VvWD896nlEZV//gSxzvleEjozqou/VkRQogxSiNV+q9Pt2l3aIVpU0rhBuFdwbuCVMAYxjDGMamAMYxhjGNSAWMYw/hfjm8BBgDatbXqT4uvsgAAAABJRU5ErkJggg=="/><element name="sliderCapTop" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAKCAYAAABBq/VWAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABNJREFUeNpiYBgFo2AUjBwAEGAAA/IAAdBu5L8AAAAASUVORK5CYII="/><element name="sliderRail" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAECAYAAAB7oZQmAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABxJREFUeNpiZCAeOGARO0CMRiYGOoDhYwlAgAEAYPMBCML0c4MAAAAASUVORK5CYII="/><element name="sliderThumb" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAECAYAAAB7oZQmAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABtJREFUeNpiZCAO/Mcjx0hIMxMDHcDwsQQgwABz1wEIMGLXPQAAAABJRU5ErkJggg=="/><element name="sliderCapBottom" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAKCAYAAABBq/VWAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABNJREFUeNpiYBgFo2AUjBwAEGAAA/IAAdBu5L8AAAAASUVORK5CYII="/></elements></component></components></skin>';this.xml=null;if(window.DOMParser){parser=new DOMParser();this.xml=parser.parseFromString(this.text,"text/xml")}else{this.xml=new ActiveXObject("Microsoft.XMLDOM");this.xml.async="false";this.xml.loadXML(this.text)}return this}})(jwplayer);(function(f){var m=jwplayer.utils,o=jwplayer.events,p=o.state,n=m.animations.rotate,k=m.css,l=document,a=".jwdisplay",h=".jwpreview",j=".jwerror",b="absolute",c="none",g="100%",d="hidden",e="opacity .25s";f.display=function(t,O){var s=t,E=t.skin,W,aa,u,H,T,V,ab={},R=false,I,r,L,A,Q,X=m.extend({backgroundcolor:"#000",showicons:true},E.getComponentSettings("display"),O);_bufferRotation=!m.exists(X.bufferrotation)?15:parseInt(X.bufferrotation,10),_bufferInterval=!m.exists(X.bufferinterval)?100:parseInt(X.bufferinterval,10),_eventDispatcher=new o.eventdispatcher();m.extend(this,_eventDispatcher);function U(){W=l.createElement("div");W.id=s.id+"_display";W.className="jwdisplay";aa=l.createElement("div");aa.className="jwpreview";W.appendChild(aa);s.jwAddEventListener(o.JWPLAYER_PLAYER_STATE,x);s.jwAddEventListener(o.JWPLAYER_PLAYLIST_ITEM,v);s.jwAddEventListener(o.JWPLAYER_MEDIA_ERROR,w);W.addEventListener("click",Y,false);S();M();x({newstate:p.IDLE})}function Y(ac){switch(s.jwGetState()){case p.PLAYING:case p.BUFFERING:s.jwPause();break;default:s.jwPlay();break}_eventDispatcher.sendEvent(o.JWPLAYER_DISPLAY_CLICK)}function S(){var ac=["play","buffer"];for(var af=0;af<ac.length;af++){var aj=ac[af],ah=K(aj+"Icon"),ae=K(aj+"IconOver"),ag=l.createElement("div"),ad=K("background"),ai=K("backgroundOver");button=l.createElement("button");if(ah){button.className="jw"+aj;ag.className="jwicon";button.appendChild(ag);F("#"+W.id+" ."+button.className,ad,ai);F("#"+W.id+" ."+button.className+" div",ah,ae);if(ai||ae){button.addEventListener("mouseover",Z(button),false);button.addEventListener("mouseout",q(button),false)}ab[aj]=button}}}function Z(ac){return function(ad){if(ac.className.indexOf("jwhover")<0){ac.className+=" jwhover"}if(ac.childNodes[0].className.indexOf("jwhover")<0){ac.childNodes[0].className+=" jwhover"}}}function q(ac){return function(ad){ac.className=ac.className.replace(" jwhover","");ac.childNodes[0].className=ac.childNodes[0].className.replace(" jwhover","")}}function F(ac,ad,ae){if(!(ad&&ad.src)){return}k(ac,{width:ad.width,height:ad.height,"margin-left":ad.width/-2,"margin-top":ad.height/-2,background:"url("+ad.src+") center no-repeat"});if(ae&&ae.src){k(ac+".jwhover",{background:"url("+ae.src+") center no-repeat"})}}function M(){I=l.createElement("div");I.className="jwerror";W.appendChild(I)}function z(ac){if(!X.showicons){return}if(L){W.removeChild(L)}L=ab[ac];if(L){W.appendChild(L)}if(ac=="buffer"){A=0;Q=setInterval(function(){A+=_bufferRotation;n(L.childNodes[0],A%360)},_bufferInterval)}}function v(){var ac=s.jwGetPlaylist()[s.jwGetPlaylistIndex()];var ad=ac?ac.image:"";if(u!=ad){u=ad;N(h,false);J()}}var G;function x(ac){clearTimeout(G);G=setTimeout(function(){y(ac.newstate)},100)}function y(ac){clearInterval(Q);switch(ac){case p.COMPLETED:case p.IDLE:if(!R){N(h,true);z("play")}break;case p.BUFFERING:B();z("buffer");break;case p.PLAYING:z();break;case p.PAUSED:z("play");break}}this.hidePreview=function(ac){N(h,!ac)};this.getDisplayElement=function(){return W};function P(ac){return"#"+W.id+" "+ac}function J(){if(u){var ac=new Image();ac.addEventListener("load",D,false);ac.src=u}else{N(h,false);H=T=0}}function D(){H=this.width;T=this.height;C();if(u){k(P(h),{"background-image":"url("+u+")"})}}function K(ac){var ad=E.getSkinElement("display",ac);if(ad){return ad}return null}function w(ac){R=true;z();k(P(j),{display:"table"});I.innerHTML="<p>"+ac.message+"</p>"}function B(){R=false;k(P(j),{display:"none"});I.innerHTML=""}function C(){m.stretch(s.jwGetStretching(),aa,W.clientWidth,W.clientHeight,H,T)}this.redraw=C;function N(ac,ad){k(P(ac),{opacity:ad?1:0})}this.show=function(){N("",true)};this.hide=function(){N("",false)};this.getBGColor=function(){return X.backgroundcolor};this.setAlternateClickHandler=function(ac){_alternateClickHandler=ac};this.revertAlternateClickHandler=function(){_alternateClickHandler=undefined};U()};k(a,{position:b,cursor:"pointer",width:g,height:g,overflow:d,opacity:0});k(a+" .jwpreview",{position:b,width:g,height:g,background:"no-repeat center",overflow:d});k(a+" "+j,{display:"none",position:b,width:g,height:g});k(a+" "+j+" p",{display:"table-cell","vertical-align":"middle","text-align":"center",background:"rgba(0, 0, 0, 0.5)",color:"#fff"});k(a+", "+a+" *",{"-webkit-transition":e,"-moz-transition":e,"-o-transition":e});k(a+" button, "+a+" .jwicon",{border:c,position:b,left:"50%",top:"50%",padding:0,cursor:"pointer"})})(jwplayer.html5);(function(a){var e=jwplayer,c=e.utils,d=e.events,b=d.state,f=e.playlist;a.instream=function(C,q,B,D){var x={controlbarseekable:"always",controlbarpausable:true,controlbarstoppable:true,playlistclickable:true};var z,E,G=C,I=q,n=B,A=D,v,L,s,K,j,k,l,p,u,m=false,o,h,r=this;this.load=function(P,O){g();m=true;E=c.extend(x,O);z=new f.item(P);J();h=document.createElement("div");h.id=r.id+"_instream_container";A.detachMedia();v=l.getTag();k=I.playlist[I.item];j=G.jwGetState();if(j==b.BUFFERING||j==b.PLAYING){v.pause()}L=v.src?v.src:v.currentSrc;s=v.innerHTML;K=v.currentTime;u=new a.display(r);u.setAlternateClickHandler(function(Q){if(_fakemodel.state==b.PAUSED){r.jwInstreamPlay()}else{H(d.JWPLAYER_INSTREAM_CLICK,Q)}});h.appendChild(u.getDisplayElement());if(!c.isMobile()){p=new a.controlbar(r);h.appendChild(p.getDisplayElement())}n.setupInstream(h,v);t();l.load(z)};this.jwInstreamDestroy=function(O){if(!m){return}m=false;if(j!=b.IDLE){l.load(k,false)}else{l.stop(true)}l.detachMedia();n.destroyInstream();if(p){try{p.getDisplayElement().parentNode.removeChild(p.getDisplayElement())}catch(P){}}H(d.JWPLAYER_INSTREAM_DESTROYED,{reason:(O?"complete":"destroyed")},true);A.attachMedia();if(j==b.BUFFERING||j==b.PLAYING){v.play();if(I.playlist[I.item]==k){I.getVideo().seek(K)}}return};this.jwInstreamAddEventListener=function(O,P){o.addEventListener(O,P)};this.jwInstreamRemoveEventListener=function(O,P){o.removeEventListener(O,P)};this.jwInstreamPlay=function(){if(!m){return}l.play(true)};this.jwInstreamPause=function(){if(!m){return}l.pause(true)};this.jwInstreamSeek=function(O){if(!m){return}l.seek(O)};this.jwInstreamGetState=function(){if(!m){return undefined}return _fakemodel.state};this.jwInstreamGetPosition=function(){if(!m){return undefined}return _fakemodel.position};this.jwInstreamGetDuration=function(){if(!m){return undefined}return _fakemodel.duration};this.playlistClickable=function(){return(!m||E.playlistclickable.toString().toLowerCase()=="true")};function w(){_fakemodel=new a.model({});o=new d.eventdispatcher();G.jwAddEventListener(d.JWPLAYER_RESIZE,t);G.jwAddEventListener(d.JWPLAYER_FULLSCREEN,t)}function g(){A.setMute(I.mute);A.setVolume(I.volume)}function J(){if(!l){l=new a.video(I.getVideo().getTag());l.addGlobalListener(M);l.addEventListener(d.JWPLAYER_MEDIA_META,N);l.addEventListener(d.JWPLAYER_MEDIA_COMPLETE,y);l.addEventListener(d.JWPLAYER_MEDIA_BUFFER_FULL,F)}l.attachMedia()}function M(O){if(m){H(O.type,O)}}function F(O){if(m){l.play()}}function y(O){if(m){setTimeout(function(){r.jwInstreamDestroy(true)},10)}}function N(O){if(O.metadata.width&&O.metadata.height){n.resizeMedia()}}function H(O,P,Q){if(m||Q){o.sendEvent(O,P)}}function t(){if(p){p.redraw()}if(u){u.redraw()}}this.jwPlay=function(O){if(E.controlbarpausable.toString().toLowerCase()=="true"){this.jwInstreamPlay()}};this.jwPause=function(O){if(E.controlbarpausable.toString().toLowerCase()=="true"){this.jwInstreamPause()}};this.jwStop=function(){if(E.controlbarstoppable.toString().toLowerCase()=="true"){this.jwInstreamDestroy();G.jwStop()}};this.jwSeek=function(O){switch(E.controlbarseekable.toLowerCase()){case"always":this.jwInstreamSeek(O);break;case"backwards":if(_fakemodel.position>O){this.jwInstreamSeek(O)}break}};this.jwGetPosition=function(){};this.jwGetDuration=function(){};this.jwGetWidth=G.jwGetWidth;this.jwGetHeight=G.jwGetHeight;this.jwGetFullscreen=G.jwGetFullscreen;this.jwSetFullscreen=G.jwSetFullscreen;this.jwGetVolume=function(){return I.volume};this.jwSetVolume=function(O){l.volume(O);G.jwSetVolume(O)};this.jwGetMute=function(){return I.mute};this.jwSetMute=function(O){l.mute(O);G.jwSetMute(O)};this.jwGetState=function(){return _fakemodel.state};this.jwGetPlaylist=function(){return[z]};this.jwGetPlaylistIndex=function(){return 0};this.jwGetStretching=function(){return I.config.stretching};this.jwAddEventListener=function(P,O){o.addEventListener(P,O)};this.jwRemoveEventListener=function(P,O){o.removeEventListener(P,O)};this.skin=G.skin;this.id=G.id+"_instream";w();return this}})(jwplayer.html5);(function(b){var a=jwplayer.utils,c=jwplayer.events,d=undefined;b.model=function(f){var m=this,h,o,p=a.getCookies(),e={};_defaults={autostart:false,controlbar:true,debug:d,height:320,icons:true,item:0,mobilecontrols:false,mute:false,playlist:[],playlistposition:"right",playlistsize:0,repeat:"list",skin:d,stretching:a.stretching.UNIFORM,volume:90,width:480};function l(q){for(var r in q){q[r]=a.serialize(q[r])}return q}function n(){a.extend(m,new c.eventdispatcher());m.config=l(a.extend({},_defaults,p,f));a.extend(m,{id:f.id,state:c.state.IDLE,position:0,buffer:0,},m.config);k();m.setItem(m.config.item);o=document.createElement("video");h=new b.video(o);h.volume(m.volume);h.mute(m.mute);h.addGlobalListener(g)}function k(){e.display={showicons:m.icons};e.controlbar={}}var j={};j[c.JWPLAYER_MEDIA_MUTE]="mute";j[c.JWPLAYER_MEDIA_VOLUME]="volume";j[c.JWPLAYER_PLAYER_STATE]="newstate->state";j[c.JWPLAYER_MEDIA_BUFFER]="bufferPercent->buffer";j[c.JWPLAYER_MEDIA_TIME]="position";function g(q){var s=j[q.type];if(s){var t=s.split("->"),u=t[0],r=t[1]?t[1]:u;if(m[r]!=q[u]){m[r]=q[u];m.sendEvent(q.type,q)}}else{m.sendEvent(q.type,q)}}m.setState=function(q){var r=m.state;m.state=q;if(q!=r){m.sendEvent(c.JWPLAYER_PLAYER_STATE,{newstate:m.state,oldstate:r})}};m.getVideo=function(){return h};m.seekDrag=function(q){h.seekDrag(q)};m.setFullscreen=function(q){if(q!=m.fullscreen){m.fullscreen=q;m.sendEvent(c.JWPLAYER_FULLSCREEN,{fullscreen:q})}};m.setPlaylist=function(q){m.playlist=q;m.sendEvent(c.JWPLAYER_PLAYLIST_LOADED,{playlist:q})};m.setItem=function(q){var r;if(q==m.playlist.length||q<-1){r=0}else{if(q==-1||q>m.playlist.length){r=m.playlist.length-1}else{r=q}}if(r!=m.item){m.item=r;m.sendEvent(c.JWPLAYER_PLAYLIST_ITEM,{index:m.item})}};m.setVolume=function(q){if(m.mute&&q>0){m.setMute(false)}q=Math.round(q);a.saveCookie("volume",q);h.volume(q)};m.setMute=function(q){if(!a.exists(q)){q=!m.mute}a.saveCookie("mute",q);h.mute(q)};m.componentConfig=function(q){return e[q]};n()}})(jwplayer.html5);(function(a){a.player=function(c){var m=this,k,g,h,b;function l(){k=new a.model(c);m.id=k.id;g=new a.view(m,k);h=new a.controller(k,g);d();var n=new a.setup(k,g,h);n.addEventListener(jwplayer.events.JWPLAYER_READY,e);n.addEventListener(jwplayer.events.JWPLAYER_ERROR,j);n.start()}function e(n){h.playerReady(n)}function j(n){jwplayer.utils.log("There was a problem setting up the player: ",n)}function d(){m.jwPlay=h.play;m.jwPause=h.pause;m.jwStop=h.stop;m.jwSeek=h.seek;m.jwSetVolume=h.setVolume;m.jwSetMute=h.setMute;m.jwLoad=h.load;m.jwPlaylistNext=h.next;m.jwPlaylistPrev=h.prev;m.jwPlaylistItem=h.item;m.jwSetFullscreen=h.setFullscreen;m.jwResize=g.resize;m.jwSeekDrag=k.seekDrag;m.jwSetStretching=h.setStretching;m.jwGetQualityLevels=h.getQualityLevels;m.jwGetCurrentQuality=h.getCurrentQuality;m.jwSetCurrentQuality=h.setCurrentQuality;m.jwGetPlaylistIndex=f("item");m.jwGetPosition=f("position");m.jwGetDuration=f("duration");m.jwGetBuffer=f("buffer");m.jwGetWidth=f("width");m.jwGetHeight=f("height");m.jwGetFullscreen=f("fullscreen");m.jwGetVolume=f("volume");m.jwGetMute=f("mute");m.jwGetState=f("state");m.jwGetStretching=f("stretching");m.jwGetPlaylist=f("playlist");m.jwDetachMedia=h.detachMedia;m.jwAttachMedia=h.attachMedia;m.jwLoadInstream=function(o,n){if(!b){b=new a.instream(m,k,g,h)}setTimeout(function(){b.load(o,n)},10)};m.jwInstreamDestroy=function(){if(b){b.jwInstreamDestroy()}};m.jwAddEventListener=h.addEventListener;m.jwRemoveEventListener=h.removeEventListener}function f(n){return function(){return k[n]}}l()}})(jwplayer.html5);(function(f){var d={size:180,itemheight:60,thumbs:true,fontcolor:"#000000",overcolor:"",activecolor:"",backgroundcolor:"#f8f8f8",font:"_sans",fontsize:"",fontstyle:"",fontweight:""},k={_sans:"Arial, Helvetica, sans-serif",_serif:"Times, Times New Roman, serif",_typewriter:"Courier New, Courier, monospace"},m=jwplayer.utils,h=m.css,e=jwplayer.events,l=".jwplaylist",j=document,a="absolute",b="relative",c="hidden",g="100%";f.playlistcomponent=function(A,M){var G=A,v=G.skin,o=m.extend({},d,G.skin.getComponentSettings("playlist"),M),H,n,q,p,u=-1,r={background:undefined,item:undefined,itemOver:undefined,itemImage:undefined,itemActive:undefined};this.getDisplayElement=function(){return H};this.redraw=function(){};this.show=function(){_show(H)};this.hide=function(){_hide(H)};function s(){H=K("div","jwplaylist");H.id=G.id+"_jwplayer_playlistcomponent";J();if(r.item){o.itemheight=r.item.height}x();G.jwAddEventListener(jwplayer.events.JWPLAYER_PLAYLIST_LOADED,B);G.jwAddEventListener(jwplayer.events.JWPLAYER_PLAYLIST_ITEM,E)}function t(N){return"#"+H.id+(N?" ."+N:"")}function x(){var R=0,Q=0,N=0,P=o.itemheight,T=o.fontsize;m.clearCss(t());h(t("jwlist"),{"background-image":r.background?" url("+r.background.src+")":"","background-color":o.backgroundcolor,color:o.fontcolor,font:o.fontweight+" "+o.fontstyle+" "+(T?T:11)+"px "+(k[o.font]?k[o.font]:k._sans)});if(r.itemImage){R=(P-r.itemImage.height)/2;Q=r.itemImage.width;N=r.itemImage.height}else{Q=P*4/3;N=P}h(t("jwplaylistimg"),{height:N,width:Q,margin:R});h(t("jwlist li"),{"background-image":r.item?"url("+r.item.src+")":"",height:P,"background-size":g+" "+P+"px",cursor:"pointer"});var O={overflow:"hidden"};if(o.activecolor!==""){O.color=o.activecolor}if(r.itemActive){O["background-image"]="url("+r.itemActive.src+")"}h(t("jwlist li.active"),O);var S={overflow:"hidden"};if(o.overcolor!==""){S.color=o.overcolor}if(r.itemOver){S["background-image"]="url("+r.itemOver.src+")"}h(t("jwlist li:hover"),S);h(t("jwtextwrapper"),{padding:"5px 5px 0 "+(R?0:"5px"),height:P-5,position:b});h(t("jwtitle"),{height:T?T+10:20,"line-height":T?T+10:20,overflow:"hidden",display:"inline-block",width:g,"font-size":T?T:13,"font-weight":o.fontweight?o.fontweight:"bold"});h(t("jwdescription"),{display:"block","line-height":T?T+4:16,overflow:"hidden",height:P,position:b});h(t("jwduration"),{position:"absolute",right:5})}function y(){var N=K("ul","jwlist");N.id=H.id+"_ul"+Math.round(Math.random()*10000000);return N}function z(Q){var V=n[Q],U=K("li","jwitem");U.id=p.id+"_item_"+Q;var R=K("div","jwplaylistimg jwfill");if(F()&&(V.image||V["playlist.image"]||r.itemImage)){var S;if(V["playlist.image"]){S=V["playlist.image"]}else{if(V.image){S=V.image}else{if(r.itemImage){S=r.itemImage.src}}}h("#"+U.id+" .jwplaylistimg",{"background-image":S?"url("+S+")":null});L(U,R)}var N=K("div","jwtextwrapper");var T=K("span","jwtitle");T.innerHTML=V?V.title:"";L(N,T);if(V.description){var P=K("span","jwdescription");P.innerHTML=V.description;L(N,P)}if(V.duration>0){var O=K("span","jwduration");O.innerHTML=m.timeFormat(V.duration);L(T,O)}L(U,N);return U}function K(O,N){var P=j.createElement(O);if(N){P.className=N}return P}function L(N,O){N.appendChild(O)}function B(O){H.innerHTML="";n=C();if(!n){return}items=[];p=y();for(var P=0;P<n.length;P++){var N=z(P);N.onclick=I(P);L(p,N);items.push(N)}u=G.jwGetPlaylistIndex();L(H,p);if(m.isIOS()&&window.iScroll){p.style.height=o.itemheight*n.length+"px";var Q=new iScroll(H.id)}}function C(){var O=G.jwGetPlaylist();var P=[];for(var N=0;N<O.length;N++){if(!O[N]["ova.hidden"]){P.push(O[N])}}return P}function I(N){return function(){G.jwPlaylistItem(N);G.jwPlay(true)}}function w(){p.scrollTop=G.jwGetPlaylistIndex()*o.itemheight}function F(){return o.thumbs.toString().toLowerCase()=="true"}function E(N){if(u>=0){j.getElementById(p.id+"_item_"+u).className="jwitem";u=N.index}j.getElementById(p.id+"_item_"+N.index).className="jwitem active";w()}function J(){for(var N in r){r[N]=D(N)}}function D(N){return v.getSkinElement("playlist",N)}s();return this};h(l,{overflow:c,position:a,width:g,height:g});h(l+" .jwplaylistimg",{position:b,width:g,"float":"left",margin:"0 5px 0 0",background:"#000",overflow:c});h(l+" .jwlist",{width:g,height:g,"list-style":"none",margin:0,padding:0,"overflow-y":"auto"});h(l+" .jwlist li",{width:g});h(l+" .jwtextwrapper",{overflow:c})})(jwplayer.html5);(function(b){var d=jwplayer,a=d.utils,c=d.events;b.playlistloader=function(){var f=new c.eventdispatcher();a.extend(this,f);this.load=function(h){a.ajax(h,g,e)};function g(h){try{var l=h.responseXML.firstChild;if(b.parsers.localName(l)=="xml"){l=l.nextSibling}if(b.parsers.localName(l)!="rss"){e("Playlist is not a valid RSS feed.");return}var k=new d.playlist(b.parsers.rssparser.parse(l));if(k&&k.length&&k[0].sources&&k[0].sources.length&&k[0].sources[0].file){f.sendEvent(c.JWPLAYER_PLAYLIST_LOADED,{playlist:k})}else{e("No playable sources found")}}catch(j){e("Could not load the playlist.")}}function e(h){f.sendEvent(c.JWPLAYER_ERROR,{message:h?h:"Could not load playlist an unknown reason."})}}})(jwplayer.html5);(function(f){var h=jwplayer,l=h.utils,m=h.events,a=h.playlist,j=1,e=2,d=3,k=4,c=5,b=6,g=7;f.setup=function(s,H,I){var L=s,q=H,F=I,u={},C={},A,z=new m.eventdispatcher(),v=false,w=[];function t(){r(j,p);r(e,Q,j);r(d,y,j);r(k,K,d);r(c,P,k+","+e);r(b,J,c+","+d);r(g,D,b)}function r(R,T,S){w.push({name:R,method:T,depends:S})}function G(){for(var T=0;T<w.length;T++){var R=w[T];if(O(R.depends)){w.splice(T,1);try{R.method();G()}catch(S){x(S.message)}return}}if(w.length>0&&!v){setTimeout(G,500)}}function O(T){if(!T){return true}var S=T.toString().split(",");for(var R=0;R<S.length;R++){if(!u[S[R]]){return false}}return true}function o(R){u[R]=true}function p(){o(j)}function Q(){A=new f.skin();A.load(L.config.skin,B,N)}function B(R){o(e)}function N(R){x("Error loading skin: "+R)}function y(){switch(l.typeOf(L.config.playlist)){case"string":var R=new f.playlistloader();R.addEventListener(m.JWPLAYER_PLAYLIST_LOADED,n);R.addEventListener(m.JWPLAYER_ERROR,E);R.load(L.config.playlist);break;case"array":L.playlist=new a(L.config.playlist);o(d)}}function n(R){L.setPlaylist(R.playlist);o(d)}function E(R){x("Error loading playlist: "+R.message)}function K(){var S=L.playlist[L.item].image;if(S){var R=new Image();R.addEventListener("load",M,false);R.addEventListener("error",M,false);R.src=S}else{o(k)}}function M(R){o(k)}function P(){q.setup(A);o(c)}function J(){o(b)}function D(){z.sendEvent(m.JWPLAYER_READY);o(g)}function x(R){v=true;z.sendEvent(m.JWPLAYER_ERROR,{message:R});q.setupError(R)}l.extend(this,z);this.start=G;t()}})(jwplayer.html5);(function(a){a.skin=function(){var b={};var c=false;this.load=function(f,e,d){new a.skinloader(f,function(g){c=true;b=g;if(typeof e=="function"){e()}},function(g){if(typeof d=="function"){d(g)}})};this.getSkinElement=function(d,e){if(c){try{return b[d].elements[e]}catch(f){jwplayer.utils.log("No such skin component / element: ",[d,e])}}return null};this.getComponentSettings=function(d){if(c&&b&&b[d]){return b[d].settings}return null};this.getComponentLayout=function(d){if(c){var e=b[d].layout;if(e&&(e.left||e.right||e.center)){return b[d].layout}}return null}}})(jwplayer.html5);(function(a){var b=jwplayer.utils;a.skinloader=function(g,q,l){var p={};var d=q;var m=l;var f=true;var k;var o=g;var t=false;function n(){if(typeof o!="string"||o===""){e(a.defaultskin().xml)}else{if(b.extension(o)!="xml"){m("Skin not a valid file type");return}b.ajax(b.getAbsolutePath(o),function(u){try{if(b.exists(u.responseXML)){e(u.responseXML);return}}catch(v){j()}e(a.defaultskin().xml)},function(u){m(u)})}}function e(y){var E=y.getElementsByTagName("component");if(E.length===0){return}for(var H=0;H<E.length;H++){var C=E[H].getAttribute("name");var B={settings:{},elements:{},layout:{}};p[C]=B;var G=E[H].getElementsByTagName("elements")[0].getElementsByTagName("element");for(var F=0;F<G.length;F++){c(G[F],C)}var z=E[H].getElementsByTagName("settings")[0];if(z&&z.childNodes.length>0){var K=z.getElementsByTagName("setting");for(var O=0;O<K.length;O++){var Q=K[O].getAttribute("name");var I=K[O].getAttribute("value");if(/color$/.test(Q)){I=b.stringToColor(I)}p[C].settings[Q]=I}}var L=E[H].getElementsByTagName("layout")[0];if(L&&L.childNodes.length>0){var M=L.getElementsByTagName("group");for(var x=0;x<M.length;x++){var A=M[x];p[C].layout[A.getAttribute("position")]={elements:[]};for(var P=0;P<A.attributes.length;P++){var D=A.attributes[P];p[C].layout[A.getAttribute("position")][D.name]=D.value}var N=A.getElementsByTagName("*");for(var w=0;w<N.length;w++){var u=N[w];p[C].layout[A.getAttribute("position")].elements.push({type:u.tagName});for(var v=0;v<u.attributes.length;v++){var J=u.attributes[v];p[C].layout[A.getAttribute("position")].elements[w][J.name]=J.value}if(!b.exists(p[C].layout[A.getAttribute("position")].elements[w].name)){p[C].layout[A.getAttribute("position")].elements[w].name=u.tagName}}}}f=false;s()}}function s(){clearInterval(k);if(!t){k=setInterval(function(){r()},100)}}function c(z,y){var x=new Image();var u=z.getAttribute("name");var w=z.getAttribute("src");var B;if(w.indexOf("data:image/png;base64,")===0){B=w}else{var v=b.getAbsolutePath(o);var A=v.substr(0,v.lastIndexOf("/"));B=[A,y,w].join("/")}p[y].elements[u]={height:0,width:0,src:"",ready:false,image:x};x.onload=function(C){h(x,u,y)};x.onerror=function(C){t=true;s();m("Skin image not found: "+this.src)};x.src=B}function j(){for(var v in p){var x=p[v];for(var u in x.elements){var y=x.elements[u];var w=y.image;w.onload=null;w.onerror=null;delete y.image;delete x.elements[u]}delete p[v]}}function r(){for(var u in p){if(u!="properties"){for(var v in p[u].elements){if(!p[u].elements[v].ready){return}}}}if(f===false){clearInterval(k);d(p)}}function h(u,w,v){if(p[v]&&p[v].elements[w]){p[v].elements[w].height=u.height;p[v].elements[w].width=u.width;p[v].elements[w].src=u.src;p[v].elements[w].ready=true;s()}else{b.log("Loaded an image for a missing element: "+v+"."+w)}}n()}})(jwplayer.html5);(function(c){var a=c.utils,d=c.events,b=d.state;c.html5.video=function(U){var O={abort:z,canplay:q,canplaythrough:z,durationchange:B,emptied:z,ended:z,error:m,loadeddata:z,loadedmetadata:q,loadstart:z,pause:T,play:T,playing:T,progress:z,ratechange:z,readystatechange:z,seeked:z,seeking:z,stalled:z,suspend:z,timeupdate:V,volumechange:l,waiting:u},x=a.extensionmap,D,J,aa,v,Z,o,R,Y,I,P,E,e=b.IDLE,K,n=-1,H=-1,L=new d.eventdispatcher(),s=false,G={},F,C=-1,h=this;a.extend(h,L);function W(ab){v=ab;Q();v.controls=true;v.controls=false;s=true}function Q(){for(var ab in O){v.addEventListener(ab,O[ab],false)}}function r(ab,ac){if(s){L.sendEvent(ab,ac)}}function z(ab){}function B(ab){if(!s){return}if(Z<0){Z=v.duration}V()}function V(ab){if(!s){return}if(e==b.PLAYING&&!E){o=v.currentTime;r(d.JWPLAYER_MEDIA_TIME,{position:o,duration:Z});if(o>=Z&&Z>0){S()}}}function q(ab){if(!s){return}if(!Y){Y=true;p();if(P>0){A(P)}}}function p(){if(!I){I=true;r(d.JWPLAYER_MEDIA_BUFFER_FULL)}}function T(ab){if(!s||E){return}if(v.paused){g()}else{w(b.PLAYING)}}function u(ab){if(!s){return}w(b.BUFFERING)}function m(ab){if(!s){return}a.log("Error playing media: %o",v.error);L.sendEvent(d.JWPLAYER_MEDIA_ERROR,{message:"Error loading media: File could not be played"});w(b.IDLE)}function f(ab){var ac=x[ab];return(!!ac&&!!ac.html5&&v.canPlayType(ac.html5))}function t(){for(var ab in G){if(f(ab)){return ab}}return null}function k(ae){if(a.typeOf(ae)=="array"&&ae.length>0){var ab=[];for(var ad=0;ad<ae.length;ad++){var af=ae[ad],ac={};ac.label=N(af)?N(af):ad;if(af.width){ac.width=af.width}if(af.height){ac.height=af.height}if(af.bitrate){ac.bitrate=af.bitrate}ab[ad]=ac}L.sendEvent(d.JWPLAYER_MEDIA_LEVELS,{levels:ab,currentQuality:C})}}function N(ab){if(ab.label){return ab.label}else{if(ab.height){return ab.height+"p"}else{if(ab.width){return(ab.width*9/16)+"p"}else{if(ab.bitrate){return ab.bitrate+"kbps"}else{return 0}}}}}h.load=function(ab){if(!s){return}D=ab;Y=false;I=false;P=0;Z=ab.duration?ab.duration:-1;o=0;G=a.sortSources(D.sources);aa=t();if(!aa){a.log("Could not find a file to play.");return}if(C<0){C=0}F=G[aa];k(F);J=F[C];w(b.BUFFERING);v.src=J.file;v.load();n=setInterval(j,100);if(a.isIPod()){p()}};var y=h.stop=function(){if(!s){return}v.removeAttribute("src");v.load();C=-1;clearInterval(n);w(b.IDLE)};h.play=function(){if(s){v.play()}};var g=h.pause=function(){if(s){v.pause();w(b.PAUSED)}};h.seekDrag=function(ab){if(!s){return}E=ab;if(ab){v.pause()}else{v.play()}};var A=h.seek=function(ab){if(!s){return}if(v.readyState>=v.HAVE_FUTURE_DATA){P=0;if(!E){r(d.JWPLAYER_MEDIA_SEEK,{position:o,offset:ab})}v.currentTime=ab}else{P=ab}};var X=h.volume=function(ab){v.volume=ab/100};function l(ab){r(d.JWPLAYER_MEDIA_VOLUME,{volume:Math.round(v.volume*100)});r(d.JWPLAYER_MEDIA_MUTE,{mute:v.muted})}h.mute=function(ab){if(!a.exists(ab)){ab=!v.mute}if(ab){if(!v.muted){K=v.volume*100;v.muted=true;X(0)}}else{if(v.muted){X(K);v.muted=false}}};function w(ab){if(ab==b.PAUSED&&e==b.IDLE){return}if(E){return}if(e!=ab){var ac=e;e=ab;r(d.JWPLAYER_PLAYER_STATE,{oldstate:ac,newstate:ab})}}function j(){if(!s){return}var ab=M();if(ab!=H){H=ab;r(d.JWPLAYER_MEDIA_BUFFER,{bufferPercent:Math.round(H*100)})}if(ab>=1){clearInterval(n)}}function M(){if(v.buffered.length==0||v.duration==0){return 0}else{return v.buffered.end(v.buffered.length-1)/v.duration}}function S(){C=-1;w(b.IDLE);r(d.JWPLAYER_MEDIA_BEFORECOMPLETE);r(d.JWPLAYER_MEDIA_COMPLETE)}h.detachMedia=function(){s=false;return v};h.attachMedia=function(){s=true};h.getTag=function(){return v};h.audioMode=function(){return(aa&&x[aa].html5&&x[aa].html5.indexOf("audio")==0)};h.setCurrentQuality=function(ac){if(C==ac){return}if(ac>=0){if(F&&F.length>ac){C=ac;r(d.JWPLAYER_MEDIA_QUALITY_CHANGED,{currentQuality:ac,levels:F});var ab=v.currentTime;h.load(D);h.seek(ab)}}};h.getCurrentQuality=function(){return C};h.getQualityLevels=function(){return F};W(U)}})(jwplayer);(function(h){var m=jwplayer,r=m.utils,a=jwplayer.events,d=a.state,o=r.css,e=document,l="jwplayer",b="."+l+".jwfullscreen",n="jwmain",t="jwinstream",s="jwvideo",c="jwcontrols",f="jwplaylistcontainer",q="opacity .5s ease",k="100%",g="absolute",p=" !important",j="hidden";h.view=function(E,z){var D=E,B=z,X,N,M,aa,v=0,ah=2000,x,ao,H,ag,ap,aj,J,A=r.isMobile(),ar=r.isIPad(),S=(ar&&B.mobilecontrols),ac=new a.eventdispatcher();r.extend(this,ac);function al(){X=ai("div",l);X.id=D.id;var au=document.getElementById(D.id);au.parentNode.replaceChild(X,au)}this.setup=function(au){D.skin=au;N=ai("span",n);ao=ai("span",s);x=B.getVideo().getTag();ao.appendChild(x);M=ai("span",c);H=ai("span",t);aa=ai("span",f);u();N.appendChild(ao);N.appendChild(M);N.appendChild(H);X.appendChild(N);X.appendChild(aa);e.addEventListener("webkitfullscreenchange",ak,false);e.addEventListener("mozfullscreenchange",ak,false);e.addEventListener("keydown",ad,false);D.jwAddEventListener(a.JWPLAYER_PLAYER_STATE,F);F({newstate:d.IDLE});M.addEventListener("mouseout",ab,false);M.addEventListener("mousemove",aq,false);if(ag){ag.getDisplayElement().addEventListener("mousemove",V,false);ag.getDisplayElement().addEventListener("mouseout",an,false)}};function ai(av,au){var aw=e.createElement(av);if(au){aw.className=au}return aw}function aq(){clearTimeout(v);if(D.jwGetState()==d.PLAYING||D.jwGetState()==d.PAUSED){L();if(!af){v=setTimeout(ab,ah)}}}var af=false;function V(){clearTimeout(v);af=true}function an(){af=false}function ab(){if(D.jwGetState()==d.PLAYING||D.jwGetState()==d.PAUSED){G()}clearTimeout(v);v=0}function u(){var av=B.width,au=B.height,aw=B.componentConfig("controlbar");displaySettings=B.componentConfig("display");ap=new h.display(D,displaySettings);ap.addEventListener(a.JWPLAYER_DISPLAY_CLICK,function(ax){ac.sendEvent(ax.type,ax)});M.appendChild(ap.getDisplayElement());if(B.playlistsize&&B.playlistposition&&B.playlistposition!="none"){aj=new h.playlistcomponent(D,{});aa.appendChild(aj.getDisplayElement())}if(!A||S){ag=new h.controlbar(D,aw);M.appendChild(ag.getDisplayElement());if(S){L()}}else{x.controls=true}T(av,au)}var Q=this.fullscreen=function(au){if(!r.exists(au)){au=!B.fullscreen}if(au){if(!B.fullscreen){U(true);if(X.requestFullScreen){X.requestFullScreen()}else{if(X.mozRequestFullScreen){X.mozRequestFullScreen()}else{if(X.webkitRequestFullScreen){X.webkitRequestFullScreen()}}}B.setFullscreen(true)}}else{U(false);if(B.fullscreen){if(e.cancelFullScreen){e.cancelFullScreen()}else{if(e.mozCancelFullScreen){e.mozCancelFullScreen()}else{if(e.webkitCancelFullScreen){e.webkitCancelFullScreen()}}}B.setFullscreen(false)}}};function T(aw,au){if(r.exists(aw)&&r.exists(au)){o(Z(),{width:aw,height:au});B.width=aw;B.height=au}if(ap){ap.redraw()}if(ag){ag.redraw()}var ay=B.playlistsize,az=B.playlistposition;if(aj&&ay&&az){aj.redraw();var av={display:"block"},ax={};av[az]=0;ax[az]=ay;if(az=="left"||az=="right"){av.width=ay}else{av.height=ay}o(Z(f),av);o(Z(n),ax)}y(au);C();return}function y(au){J=(!!ag&&au<=40&&au.toString().indexOf("%")<0);if(J){B.componentConfig("controlbar").margin=0;ag.redraw();L();K();O(false)}else{am(D.jwGetState())}o(Z(),{"background-color":J?"transparent":ap.getBGColor()})}function C(){r.stretch(B.stretching,x,ao.clientWidth,ao.clientHeight,x.videoWidth,x.videoHeight)}this.resize=T;this.resizeMedia=C;var W=this.completeSetup=function(){o(Z(),{opacity:1})};function ad(au){if(B.fullscreen){switch(au.keyCode){case 27:Q(false);break}}}function U(au){if(au){X.className+=" jwfullscreen"}else{X.className=X.className.replace(/\s+jwfullscreen/,"")}}function at(){var au=[e.mozFullScreenElement,e.webkitCurrentFullScreenElement];for(var av=0;av<au.length;av++){if(au[av]&&au[av].id==D.id){return true}}return false}function ak(au){B.setFullscreen(at());Q(B.fullscreen)}function L(){if(ag&&B.controlbar){ag.show()}}function G(){if(ag&&!J&&!S){ag.hide()}}function w(){if(ap&&!J){ap.show()}}function K(){if(ap){ap.hide()}}function I(){G();K()}function ae(){L();w()}function O(au){au=au&&!J;o(Z(s),{visibility:au?"visible":"hidden",opacity:au?1:0})}var P;function F(au){clearTimeout(P);P=setTimeout(function(){am(au.newstate)},100)}function am(au){switch(au){case d.PLAYING:if(!B.getVideo().audioMode()||A){O(true);C();ap.hidePreview(true);if(A){if(ar&&!S){x.controls=true}else{K()}}}aq();break;case d.COMPLETED:case d.IDLE:if(!A){O(false)}G();ap.hidePreview(false);w();if(ar){x.controls=false}break;case d.BUFFERING:if(A){O(true)}else{ae()}break;case d.PAUSED:if(!A||S){ae()}else{if(ar){x.controls=false}}break}}function Z(au){return"#"+D.id+(au?" ."+au:"")}this.setupInstream=function(au,av){Y(Z(t),true);Y(Z(c),false);H.appendChild(au);_instreamVideo=av;F({newstate:d.PLAYING});_instreamMode=true};var R=this.destroyInstream=function(){Y(Z(t),false);Y(Z(c),true);H.innerHTML="";_instreamVideo=null;_instreamMode=false;T(B.width,B.height)};this.setupError=function(au){jwplayer.embed.errorScreen(X,au);W()};function Y(au,av){o(au,{display:av?"block":"none"})}al()};o("."+l,{position:"relative",overflow:"hidden",opacity:0,"-webkit-transition":q,"-moz-transition":q,"-o-transition":q});o("."+n,{position:g,left:0,right:0,top:0,bottom:0,"-webkit-transition":q,"-moz-transition":q,"-o-transition":q});o("."+s+" ,."+c,{position:g,height:k,width:k,"-webkit-transition":q,"-moz-transition":q,"-o-transition":q});o("."+s,{visibility:"hidden"});o("."+s+" video",{background:"transparent",width:k,height:k});o("."+f,{position:g,height:k,width:k,display:"none"});o("."+t,{overflow:"hidden",position:g,top:0,left:0,bottom:0,right:0,display:"none"});o(b,{width:k,height:k,left:0,right:0,top:0,bottom:0,"z-index":1000,position:"fixed"},true);o(b+" ."+n,{left:0,right:0,top:0,bottom:0},true);o(b+" ."+f,{display:"none"},true);o("."+l+" .jwuniform",{"background-size":"contain"+p});o("."+l+" .jwfill",{"background-size":"cover"+p,"background-position":"center"});o("."+l+" .jwexactfit",{"background-size":k+" "+k+p})})(jwplayer.html5); -
branches/jw6/jwplayer.js
r2203 r2217 1 if(typeof jwplayer=="undefined"){jwplayer=function(a){if(jwplayer.api){return jwplayer.api.selectPlayer(a)}};var $jw=jwplayer;jwplayer.version="6.0.22 03";jwplayer.vid=document.createElement("video");jwplayer.audio=document.createElement("audio");jwplayer.source=document.createElement("source");(function(c){var g=document,e=window;var h=c.utils=function(){};h.exists=function(k){switch(typeof(k)){case"string":return(k.length>0);break;case"object":return(k!==null);case"undefined":return false}return true};h.styleDimension=function(k){return k+(k.toString().indexOf("%")>0?"":"px")};h.getAbsolutePath=function(q,p){if(!h.exists(p)){p=g.location.href}if(!h.exists(q)){return undefined}if(a(q)){return q}var r=p.substring(0,p.indexOf("://")+3);var o=p.substring(r.length,p.indexOf("/",r.length+1));var l;if(q.indexOf("/")===0){l=q.split("/")}else{var m=p.split("?")[0];m=m.substring(r.length+o.length+1,m.lastIndexOf("/"));l=m.split("/").concat(q.split("/"))}var k=[];for(var n=0;n<l.length;n++){if(!l[n]||!h.exists(l[n])||l[n]=="."){continue}else{if(l[n]==".."){k.pop()}else{k.push(l[n])}}}return r+o+"/"+k.join("/")};function a(l){if(!h.exists(l)){return}var m=l.indexOf("://");var k=l.indexOf("?");return(m>0&&(k<0||(k>m)))}h.extend=function(){var k=h.extend["arguments"];if(k.length>1){for(var m=1;m<k.length;m++){for(var l in k[m]){k[0][l]=k[m][l]}}return k[0]}return null};h.parseDimension=function(k){if(typeof k=="string"){if(k===""){return 0}else{if(k.lastIndexOf("%")>-1){return k}else{return parseInt(k.replace("px",""),10)}}}return k};h.timeFormat=function(k){if(k>0){var l=Math.floor(k/60)<10?"0"+Math.floor(k/60)+":":Math.floor(k/60)+":";l+=Math.floor(k%60)<10?"0"+Math.floor(k%60):Math.floor(k%60);return l}else{return"00:00"}};h.log=function(l,k){if(typeof console!="undefined"&&typeof console.log!="undefined"){if(k){console.log(l,k)}else{console.log(l)}}};h.getBoundingClientRect=function(k){if(typeof k.getBoundingClientRect=="function"){return k.getBoundingClientRect()}else{return{left:k.offsetLeft+g.body.scrollLeft,top:k.offsetTop+g.body.scrollTop,width:k.offsetWidth,height:k.offsetHeight}}};var d=h.userAgentMatch=function(l){var k=navigator.userAgent.toLowerCase();return(k.match(l)!==null)};h.isIE=function(){return d(/msie/i)};h.isMobile=function(){return d(/(iP(hone|ad|od))|android/i)};h.isIOS=function(){return d(/iP(hone|ad|od)/i)};h.isIPod=function(){return d(/iP(hone|od)/i)};h.isIPad=function(){return d(/iPad/i)};h.saveCookie=function(k,l){g.cookie="jwplayer."+k+"="+l+"; path=/"};h.getCookies=function(){var n={};var m=g.cookie.split("; ");for(var l=0;l<m.length;l++){var k=m[l].split("=");if(k[0].indexOf("jwplayer.")==0){n[k[0].substring(9,k[0].length)]=k[1]}}return n};h.ajax=function(o,n,k){var m;if(b(o)&&h.exists(e.XDomainRequest)){m=new XDomainRequest();m.onload=j(m,o,n,k);m.onerror=i(k,o,m)}else{if(h.exists(e.XMLHttpRequest)){m=new XMLHttpRequest();m.onreadystatechange=f(m,o,n,k);m.onerror=i(k,o)}else{if(k){k()}}}try{m.open("GET",o,true);m.send(null)}catch(l){if(k){k(o)}}return m};function b(k){if(k&&k.indexOf("://")>=0){if(k.split("/")[2]!=e.location.href.split("/")[2]){return true}}return false}function i(k,m,l){return function(){k(m)}}function f(l,n,m,k){return function(){if(l.readyState===4){if(l.status==200){j(l,n,m,k)()}else{if(k){k(n)}}}}}function j(l,n,m,k){return function(){if(!h.exists(l.responseXML)){try{var o;if(e.DOMParser){o=(new DOMParser()).parseFromString(l.responseText,"text/xml")}else{o=new ActiveXObject("Microsoft.XMLDOM");o.async="false";o.loadXML(l.responseText)}if(o){l=h.extend({},l,{responseXML:o})}}catch(p){if(k){k(n)}return}}m(l)}}h.typeOf=function(l){var k=typeof l;if(k==="object"){if(!l){return"null"}return(l instanceof Array)?"array":k}else{return k}};h.translateEventResponse=function(m,k){var o=h.extend({},k);if(m==c.events.JWPLAYER_FULLSCREEN&&!o.fullscreen){o.fullscreen=o.message=="true"?true:false;delete o.message}else{if(typeof o.data=="object"){o=h.extend(o,o.data);delete o.data}else{if(typeof o.metadata=="object"){h.deepReplaceKeyName(o.metadata,["__dot__","__spc__","__dsh__"],["."," ","-"])}}}var l=["position","duration","offset"];for(var n in l){if(o[l[n]]){o[l[n]]=Math.round(o[l[n]]*1000)/1000}}return o};h.hasFlash=function(){if(typeof navigator.plugins!="undefined"&&typeof navigator.plugins["Shockwave Flash"]!="undefined"){return true}if(typeof e.ActiveXObject!="undefined"){try{new ActiveXObject("ShockwaveFlash.ShockwaveFlash");return true}catch(k){}}return false};h.wrap=function(k,l){if(k.parentNode){k.parentNode.replaceChild(l,k)}l.appendChild(k)};h.getScriptPath=function(m){var k=g.getElementsByTagName("script");for(var l=0;l<k.length;l++){var n=k[l].src;if(n&&n.indexOf(m)>=0){return n.substr(0,n.indexOf(m))}}return""};c.utils.deepReplaceKeyName=function(r,m,k){switch(c.utils.typeOf(r)){case"array":for(var o=0;o<r.length;o++){r[o]=c.utils.deepReplaceKeyName(r[o],m,k)}break;case"object":for(var n in r){var q,p;if(m instanceof Array&&k instanceof Array){if(m.length!=k.length){continue}else{q=m;p=k}}else{q=[m];p=[k]}var l=n;for(var o=0;o<q.length;o++){l=l.replace(new RegExp(m[o],"g"),k[o])}r[l]=c.utils.deepReplaceKeyName(r[n],m,k);if(n!=l){delete r[n]}}break}return r}})(jwplayer);(function(i){var b="video/",g="audio/",e="image",h="mp4",f={f4a:g+h,f4v:b+h,mov:b+h,m4a:g+h,m4v:b+h,mp4:b+h,aac:g+"aac",mp3:g+"mp3",ogg:g+"ogg",oga:g+"ogg",ogv:b+"ogg",webm:b+"webm",m3u8:"application/vnd.apple.mpegurl"},b="video",d={flv:b,f4v:b,mov:b,m4a:b,m4v:b,mp4:b,aac:b,mp3:"sound",smil:"rtmp",m3u8:"hls"};var a=i.extensionmap={};for(var c in f){a[c]={html5:f[c]}}for(c in d){if(!a[c]){a[c]={}}a[c].flash=d[c]}})(jwplayer.utils);(function(b){var a=b.loaderstatus={NEW:0,LOADING:1,ERROR:2,COMPLETE:3},c=document;b.scriptloader=function(e){var f=a.NEW,g=jwplayer.events,d=new g.eventdispatcher();b.extend(this,d);this.load=function(){if(f==a.NEW){f=a.LOADING;var h=c.createElement("script");h.onload=function(i){f=a.COMPLETE;d.sendEvent(g.COMPLETE)};h.onerror=function(i){f=a.ERROR;d.sendEvent(g.ERROR)};h.onreadystatechange=function(){if(h.readyState=="loaded"||h.readyState=="complete"){f=a.COMPLETE;d.sendEvent(g.COMPLETE)}};c.getElementsByTagName("head")[0].appendChild(h);h.src=e}};this.getStatus=function(){return f}}})(jwplayer.utils);(function(a){a.trim=function(b){return b.replace(/^\s*/,"").replace(/\s*$/,"")};a.pad=function(c,d,b){if(!b){b="0"}while(c.length<d){c=b+c}return c};a.seconds=function(d){d=d.replace(",",".");var b=d.split(":");var c=0;if(d.substr(-1)=="s"){c=Number(d.substr(0,d.length-1))}else{if(d.substr(-1)=="m"){c=Number(d.substr(0,d.length-1))*60}else{if(d.substr(-1)=="h"){c=Number(d.substr(0,d.length-1))*3600}else{if(b.length>1){c=Number(b[b.length-1]);c+=Number(b[b.length-2])*60;if(b.length==3){c+=Number(b[b.length-3])*3600}}else{c=Number(d)}}}}return c};a.xmlAttribute=function(b,c){for(var d=0;d<b.attributes.length;d++){if(b.attributes[d].name&&b.attributes[d].name.toLowerCase()==c.toLowerCase()){return b.attributes[d].value.toString()}}return""};a.jsonToString=function(f){var h=h||{};if(h&&h.stringify){return h.stringify(f)}var c=typeof(f);if(c!="object"||f===null){if(c=="string"){f='"'+f.replace(/"/g,'\\"')+'"'}else{return String(f)}}else{var g=[],b=(f&&f.constructor==Array);for(var d in f){var e=f[d];switch(typeof(e)){case"string":e='"'+e.replace(/"/g,'\\"')+'"';break;case"object":if(a.exists(e)){e=a.jsonToString(e)}break}if(b){if(typeof(e)!="function"){g.push(String(e))}}else{if(typeof(e)!="function"){g.push('"'+d+'":'+String(e))}}}if(b){return"["+String(g)+"]"}else{return"{"+String(g)+"}"}}};a.extension=function(b){if(!b){return""}b=b.substring(b.lastIndexOf("/")+1,b.length).split("?")[0];if(b.lastIndexOf(".")>-1){return b.substr(b.lastIndexOf(".")+1,b.length).toLowerCase()}};a.stringToColor=function(b){b=b.replace(/(#|0x)?([0-9A-F]{3,6})$/gi,"$2");if(b.length==3){b=b.charAt(0)+b.charAt(0)+b.charAt(1)+b.charAt(1)+b.charAt(2)+b.charAt(2)}return parseInt(b,16)}})(jwplayer.utils);(function(a){a.events={COMPLETE:"COMPLETE",ERROR:"ERROR",API_READY:"jwplayerAPIReady",JWPLAYER_READY:"jwplayerReady",JWPLAYER_FULLSCREEN:"jwplayerFullscreen",JWPLAYER_RESIZE:"jwplayerResize",JWPLAYER_ERROR:"jwplayerError",JWPLAYER_MEDIA_BEFOREPLAY:"jwplayerMediaBeforePlay",JWPLAYER_MEDIA_BEFORECOMPLETE:"jwplayerMediaBeforeComplete",JWPLAYER_COMPONENT_SHOW:"jwplayerComponentShow",JWPLAYER_COMPONENT_HIDE:"jwplayerComponentHide",JWPLAYER_MEDIA_BUFFER:"jwplayerMediaBuffer",JWPLAYER_MEDIA_BUFFER_FULL:"jwplayerMediaBufferFull",JWPLAYER_MEDIA_ERROR:"jwplayerMediaError",JWPLAYER_MEDIA_LOADED:"jwplayerMediaLoaded",JWPLAYER_MEDIA_COMPLETE:"jwplayerMediaComplete",JWPLAYER_MEDIA_SEEK:"jwplayerMediaSeek",JWPLAYER_MEDIA_TIME:"jwplayerMediaTime",JWPLAYER_MEDIA_VOLUME:"jwplayerMediaVolume",JWPLAYER_MEDIA_META:"jwplayerMediaMeta",JWPLAYER_MEDIA_MUTE:"jwplayerMediaMute",JWPLAYER_PLAYER_STATE:"jwplayerPlayerState",state:{BUFFERING:"BUFFERING",IDLE:"IDLE",PAUSED:"PAUSED",PLAYING:"PLAYING",COMPLETED:"COMPLETED"},JWPLAYER_PLAYLIST_LOADED:"jwplayerPlaylistLoaded",JWPLAYER_PLAYLIST_ITEM:"jwplayerPlaylistItem",JWPLAYER_DISPLAY_CLICK:"jwplayerViewClick",JWPLAYER_INSTREAM_CLICK:"jwplayerInstreamClicked",JWPLAYER_INSTREAM_DESTROYED:"jwplayerInstreamDestroyed"}})(jwplayer);(function(a){var b=jwplayer.utils;a.eventdispatcher=function(h,c){var e=h,g=c,f,d;this.resetEventListeners=function(){f={};d=[]};this.resetEventListeners();this.addEventListener=function(i,l,k){try{if(!b.exists(f[i])){f[i]=[]}if(b.typeOf(l)=="string"){l=(new Function("return "+l))()}f[i].push({listener:l,count:k})}catch(j){b.log("error",j)}return false};this.removeEventListener=function(j,l){if(!f[j]){return}try{for(var i=0;i<f[j].length;i++){if(f[j][i].listener.toString()==l.toString()){f[j].splice(i,1);break}}}catch(k){b.log("error",k)}return false};this.addGlobalListener=function(k,j){try{if(b.typeOf(k)=="string"){k=(new Function("return "+k))()}d.push({listener:k,count:j})}catch(i){b.log("error",i)}return false};this.removeGlobalListener=function(k){if(!k){return}try{for(var i=0;i<d.length;i++){if(d[i].listener.toString()==k.toString()){d.splice(i,1);break}}}catch(j){b.log("error",j)}return false};this.sendEvent=function(k,m){if(!b.exists(m)){m={}}b.extend(m,{id:e,version:jwplayer.version,type:k});if(g){b.log(k,m)}if(b.typeOf(f[k])!="undefined"){for(var j=0;j<f[k].length;j++){try{f[k][j].listener(m)}catch(l){b.log("There was an error while handling a listener: "+l.toString(),f[k][j].listener)}if(f[k][j]){if(f[k][j].count===1){delete f[k][j]}else{if(f[k][j].count>0){f[k][j].count=f[k][j].count-1}}}}}var i;for(i=0;i<d.length;i++){try{d[i].listener(m)}catch(l){b.log("There was an error while handling a listener: "+l.toString(),d[i].listener)}if(d[i]){if(d[i].count===1){delete d[i]}else{if(d[i].count>0){d[i].count=d[i].count-1}}}}}}})(jwplayer.events);(function(a){var c={};var b={};a.plugins=function(){};a.plugins.loadPlugins=function(e,d){b[e]=new a.plugins.pluginloader(new a.plugins.model(c),d);return b[e]};a.plugins.registerPlugin=function(h,f,e){var d=a.utils.getPluginName(h);if(c[d]){c[d].registerPlugin(h,f,e)}else{a.utils.log("A plugin ("+h+") was registered with the player that was not loaded. Please check your configuration.");for(var g in b){b[g].pluginFailed()}}}})(jwplayer);(function(a){a.plugins.model=function(b){this.addPlugin=function(c){var d=a.utils.getPluginName(c);if(!b[d]){b[d]=new a.plugins.plugin(c)}return b[d]}}})(jwplayer);(function(a){a.plugins.pluginmodes={FLASH:"FLASH",JAVASCRIPT:"JAVASCRIPT",HYBRID:"HYBRID"};a.plugins.plugin=function(b){var d="http://plugins.longtailvideo.com";var i=a.utils.loaderstatus.NEW;var j;var h;var k;var c=new a.events.eventdispatcher();a.utils.extend(this,c);function e(){switch(a.utils.getPluginPathType(b)){case a.utils.pluginPathType.ABSOLUTE:return b;case a.utils.pluginPathType.RELATIVE:return a.utils.getAbsolutePath(b,window.location.href);case a.utils.pluginPathType.CDN:var n=a.utils.getPluginName(b);var m=a.utils.getPluginVersion(b);var l=(window.location.href.indexOf("https://")==0)?d.replace("http://","https://secure"):d;return l+"/"+a.version.split(".")[0]+"/"+n+"/"+n+(m!==""?("-"+m):"")+".js"}}function g(l){k=setTimeout(function(){i=a.utils.loaderstatus.COMPLETE;c.sendEvent(a.events.COMPLETE)},1000)}function f(l){i=a.utils.loaderstatus.ERROR;c.sendEvent(a.events.ERROR)}this.load=function(){if(i==a.utils.loaderstatus.NEW){if(b.lastIndexOf(".swf")>0){j=b;i=a.utils.loaderstatus.COMPLETE;c.sendEvent(a.events.COMPLETE);return}i=a.utils.loaderstatus.LOADING;var l=new a.utils.scriptloader(e());l.addEventListener(a.events.COMPLETE,g);l.addEventListener(a.events.ERROR,f);l.load()}};this.registerPlugin=function(n,m,l){if(k){clearTimeout(k);k=undefined}if(m&&l){j=l;h=m}else{if(typeof m=="string"){j=m}else{if(typeof m=="function"){h=m}else{if(!m&&!l){j=n}}}}i=a.utils.loaderstatus.COMPLETE;c.sendEvent(a.events.COMPLETE)};this.getStatus=function(){return i};this.getPluginName=function(){return a.utils.getPluginName(b)};this.getFlashPath=function(){if(j){switch(a.utils.getPluginPathType(j)){case a.utils.pluginPathType.ABSOLUTE:return j;case a.utils.pluginPathType.RELATIVE:if(b.lastIndexOf(".swf")>0){return a.utils.getAbsolutePath(j,window.location.href)}return a.utils.getAbsolutePath(j,e());case a.utils.pluginPathType.CDN:if(j.indexOf("-")>-1){return j+"h"}return j+"-h"}}return null};this.getJS=function(){return h};this.getPluginmode=function(){if(typeof j!="undefined"&&typeof h!="undefined"){return a.plugins.pluginmodes.HYBRID}else{if(typeof j!="undefined"){return a.plugins.pluginmodes.FLASH}else{if(typeof h!="undefined"){return a.plugins.pluginmodes.JAVASCRIPT}}}};this.getNewInstance=function(m,l,n){return new h(m,l,n)};this.getURL=function(){return b}}})(jwplayer);(function(a){a.plugins.pluginloader=function(h,e){var g={};var j=a.utils.loaderstatus.NEW;var d=false;var b=false;var c=new a.events.eventdispatcher();a.utils.extend(this,c);function f(){if(!b){b=true;j=a.utils.loaderstatus.COMPLETE;c.sendEvent(a.events.COMPLETE)}}function i(){if(!b){var l=0;for(plugin in g){var k=g[plugin].getStatus();if(k==a.utils.loaderstatus.LOADING||k==a.utils.loaderstatus.NEW){l++}}if(l==0){f()}}}this.setupPlugins=function(m,k,r){var l={length:0,plugins:{}};var o={length:0,plugins:{}};for(var n in g){var p=g[n].getPluginName();if(g[n].getFlashPath()){l.plugins[g[n].getFlashPath()]=k.plugins[n];l.plugins[g[n].getFlashPath()].pluginmode=g[n].getPluginmode();l.length++}if(g[n].getJS()){var q=document.createElement("div");q.id=m.id+"_"+p;q.style.position="absolute";q.style.zIndex=o.length+10;o.plugins[p]=g[n].getNewInstance(m,k.plugins[n],q);o.length++;if(typeof o.plugins[p].resize!="undefined"){m.onReady(r(o.plugins[p],q,true));m.onResize(r(o.plugins[p],q))}}}m.plugins=o.plugins;return l};this.load=function(){j=a.utils.loaderstatus.LOADING;d=true;for(var k in e){if(a.utils.exists(k)){g[k]=h.addPlugin(k);g[k].addEventListener(a.events.COMPLETE,i);g[k].addEventListener(a.events.ERROR,i)}}for(k in g){g[k].load()}d=false;i()};this.pluginFailed=function(){f()};this.getStatus=function(){return j}}})(jwplayer);(function(a){a.playlist=function(c){var d=[];if(a.utils.typeOf(c)=="array"){for(var b=0;b<c.length;b++){d.push(new a.playlist.item(c[b]))}}else{d.push(new a.playlist.item(c))}return d}})(jwplayer);(function(a){a.item=function(c){var d={description:"",image:"",mediaid:"",title:"",duration:-1,sources:[]};var b=jwplayer.utils.extend({},d,c);if(b.sources.length==0){b.sources[0]=new a.source(b)}return b}})(jwplayer.playlist);(function(a){a.source=function(c){var b={file:"",width:0,label:undefined,type:undefined};for(var d in b){if(jwplayer.utils.exists(c[d])){b[d]=c[d]}}return b}})(jwplayer.playlist);(function(a){var b=a.utils,c=a.events;var d=a.embed=function(h){var g=new d.config(h.config);g.id=h.id;var i=a.plugins.loadPlugins(h.id,g.plugins);function e(l,k){for(var j in k){if(typeof l[j]=="function"){(l[j]).call(l,k[j])}}}function f(){var k=document.getElementById(h.id);if(i.getStatus()==b.loaderstatus.COMPLETE){for(var m=0;m<g.modes.length;m++){if(g.modes[m].type&&d[g.modes[m].type]){var n=g.modes[m].config;var j=b.extend({},n?d.config.addConfig(g,n):g);var l=new d[g.modes[m].type](k,g.modes[m],j,i,h);if(l.supportsConfig()){l.embed();e(h,g.events);return h}}}if(g.fallback){b.log("No suitable players found and fallback enabled");new d.download(k,g)}else{b.log("No suitable players found and fallback disabled")}}}i.addEventListener(c.COMPLETE,f);i.addEventListener(c.ERROR,f);i.load();return h}})(jwplayer);(function(c){var a=c.utils,g=c.embed,e=undefined;var b=g.config=function(i){function l(p,o,n){for(var m=0;m<p.length;m++){var q=p[m].type;p[m].src=n[q]?n[q]:o+"jwplayer."+q+(q=="flash"?".swf":".js")}}var k={fallback:true,height:300,primary:"html5",width:400,base:e},h={html5:{type:"html5"},flash:{type:"flash"}},j=a.extend(k,i);if(!j.base){j.base=a.getScriptPath("jwplayer.js")}if(!j.modes){j.modes=(j.primary=="flash")?[h.flash,h.html5]:[h.html5,h.flash]}l(j.modes,j.base,{html5:j.html5player,flash:j.flashplayer});d(j);return j};b.addConfig=function(h,i){d(i);return a.extend(h,i)};function d(i){if(!i.playlist){var j={};f(i,j,"sources");f(i,j,"image");if(!i.sources){if(i.levels){j.sources=i.levels;delete i.levels}else{var h={};f(i,h,"file");f(i,h,"type");j.sources=[h]}}i.playlist=[j]}}function f(j,h,i){if(a.exists(j[i])){h[i]=j[i];delete j[i]}}})(jwplayer);(function(d){var h=d.embed,b=d.utils,e="pointer",a="none",f="block",g="100%",c="absolute";h.download=function(j,u){var m=b.extend({},u),q,k=m.width?m.width:480,n=m.height?m.height:320,v,o,i=u.logo?u.logo:{prefix:"http://l.longtailvideo.com/download/",file:"logo.png",margin:10};function t(){if(m.playlist&&m.playlist.length){try{v=m.playlist[0].sources[0].file;o=m.playlist[0].image}catch(w){return}}else{return}if(i.prefix){i.prefix+=d.version.split(/\W/).splice(0,2).join("/")+"/"}p();l()}function p(){if(j){q=r("a","display",j);r("div","iconbackground",q);r("div","icon",q);r("div","logo",q);if(v){q.setAttribute("href",b.getAbsolutePath(v))}}}function s(w,y){var z=document.querySelectorAll(w);for(var x=0;x<z.length;x++){for(var A in y){z[x].style[A]=y[A]}}}function l(){var w="#"+j.id+" .jwdownload";s(w+"display",{width:b.styleDimension(k),height:b.styleDimension(n),background:"black center no-repeat "+(o?"url("+o+")":""),backgroundSize:"contain",position:c,border:a,display:f});s(w+"display div",{position:c,width:g,height:g});s(w+"logo",{bottom:i.margin+"px",left:i.margin+"px",background:"bottom left no-repeat url("+i.prefix+i.file+")"});s(w+"icon",{background:"center no-repeat url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAALdJREFUeNrs18ENgjAYhmFouDOCcQJGcARHgE10BDcgTOIosAGwQOuPwaQeuFRi2p/3Sb6EC5L3QCxZBgAAAOCorLW1zMn65TrlkH4NcV7QNcUQt7Gn7KIhxA+qNIR81spOGkL8oFJDyLJRdosqKDDkK+iX5+d7huzwM40xptMQMkjIOeRGo+VkEVvIPfTGIpKASfYIfT9iCHkHrBEzf4gcUQ56aEzuGK/mw0rHpy4AAACAf3kJMACBxjAQNRckhwAAAABJRU5ErkJggg==)"});s(w+"iconbackground",{background:"center no-repeat url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAEpJREFUeNrszwENADAIA7DhX8ENoBMZ5KR10EryckCJiIiIiIiIiIiIiIiIiIiIiIh8GmkRERERERERERERERERERERERGRHSPAAPlXH1phYpYaAAAAAElFTkSuQmCC)"})}function r(w,z,y){var x=document.createElement(w);x.className="jwdownload"+z;if(y){y.appendChild(x)}return x}t()}})(jwplayer);(function(b){var a=b.utils;b.embed.flash=function(h,i,m,g,k){function n(p,o,q){var r=document.createElement("param");r.setAttribute("name",o);r.setAttribute("value",q);p.appendChild(r)}function l(p,q,o){return function(r){if(o){document.getElementById(k.id+"_wrapper").appendChild(q)}var s=document.getElementById(k.id).getPluginConfig("display");p.resize(s.width,s.height);q.style.left=s.x;q.style.top=s.h}}function f(q){if(!q){return{}}var s={};for(var p in q){var o=q[p];for(var r in o){s[p+"."+r]=o[r]}}return s}function j(r,q){if(r[q]){var t=r[q];for(var p in t){var o=t[p];if(typeof o=="string"){if(!r[p]){r[p]=o}}else{for(var s in o){if(!r[p+"."+s]){r[p+"."+s]=o[s]}}}}delete r[q]}}function d(r){if(!r){return{}}var u={},t=[];for(var o in r){var q=a.getPluginName(o);var p=r[o];t.push(o);for(var s in p){u[q+"."+s]=p[s]}}u.plugins=t.join(",");return u}function e(q){var o="";for(var p in q){if(typeof(q[p])=="object"){o+=p+"="+encodeURIComponent("[[JSON]]"+a.jsonToString(q[p]))+"&"}else{o+=p+"="+encodeURIComponent(q[p])+"&"}}return o.substring(0,o.length-1)}this.embed=function(){m.id=k.id;var A;var s=a.extend({},m);if(h.id+"_wrapper"==h.parentNode.id){A=document.getElementById(h.id+"_wrapper")}else{A=document.createElement("div");A.id=h.id+"_wrapper";A.style.position="relative";A.style.width=a.styleDimension(s.width);A.style.height=a.styleDimension(s.height);a.wrap(h,A)}var o=g.setupPlugins(k,s,l);if(o.length>0){a.extend(s,d(o.plugins))}else{delete s.plugins}var t=["height","width","modes","events","primary","base","fallback"];for(var w=0;w<t.length;w++){delete s[t[w]]}var q="opaque";if(s.wmode){q=s.wmode}j(s,"components");j(s,"providers");if(typeof s["dock.position"]!="undefined"){if(s["dock.position"].toString().toLowerCase()=="false"){s.dock=s["dock.position"];delete s["dock.position"]}}var y=a.getCookies();for(var p in y){if(typeof(s[p])=="undefined"){s[p]=y[p]}}var z="#000000",v,r=e(s);if(a.isIE()){var x='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" bgcolor="'+z+'" width="100%" height="100%" id="'+h.id+'" name="'+h.id+'" tabindex=0"">';x+='<param name="movie" value="'+i.src+'">';x+='<param name="allowfullscreen" value="true">';x+='<param name="allowscriptaccess" value="always">';x+='<param name="seamlesstabbing" value="true">';x+='<param name="wmode" value="'+q+'">';x+='<param name="flashvars" value="'+r+'">';x+="</object>";a.setOuterHTML(h,x);v=document.getElementById(h.id)}else{var u=document.createElement("object");u.setAttribute("type","application/x-shockwave-flash");u.setAttribute("data",i.src);u.setAttribute("width","100%");u.setAttribute("height","100%");u.setAttribute("bgcolor","#000000");u.setAttribute("id",h.id);u.setAttribute("name",h.id);u.setAttribute("tabindex",0);n(u,"allowfullscreen","true");n(u,"allowscriptaccess","always");n(u,"seamlesstabbing","true");n(u,"wmode",q);n(u,"flashvars",r);h.parentNode.replaceChild(u,h);v=u}k.container=v;k.setPlayer(v,"flash")};this.supportsConfig=function(){if(a.hasFlash()){if(m){try{var q=m.playlist[0],o=q.sources;if(typeof o=="undefined"){return true}else{for(var p=0;p<o.length;p++){if(o[p].file&&c(o[p].file,o[p].type)){return true}}}}catch(r){return false}}else{return true}}return false};function c(p,q){var o=["mp4","flv","aac","mp3","hls","rtmp","youtube"];if(q&&(o.toString().indexOf(q)<0)){return true}var r=a.extension(p);if(!q){q=r}if(!q){return true}if(a.exists(a.extensionmap[q])){return a.exists(a.extensionmap[q].flash)}return false}}})(jwplayer);(function(c){var a=c.utils,b=a.extensionmap;c.embed.html5=function(e,k,d,f,i){function h(m,n,l){return function(o){var p=document.getElementById(e.id+"_displayarea");if(l){p.appendChild(n)}m.resize(p.clientWidth,p.clientHeight);n.left=p.style.left;n.top=p.style.top}}this.embed=function(){if(c.html5){f.setupPlugins(i,d,h);e.innerHTML="";var l=c.utils.extend({},d);if(l.skin&&l.skin.toLowerCase().indexOf(".zip")>0){l.skin=l.skin.replace(/\.zip/i,".xml")}var m=new c.html5.player(l);i.container=document.getElementById(i.id);i.setPlayer(m,"html5")}else{var n=new a.scriptloader(k.src);n.addEventListener(c.events.COMPLETE,this.embed);n.load()}};this.supportsConfig=function(){if(!!c.vid.canPlayType){try{if(a.typeOf(d.playlist)=="string"){return true}else{var l=d.playlist[0].sources;for(var n=0;n<l.length;n++){var m=l[n].file,o=l[n].type;if(j(m,o)){return true}}}}catch(p){return false}}return false};function j(l,m){if(navigator.userAgent.match(/BlackBerry/i)!==null){return false}var n=b[m?m:a.extension(l)];if(!n){return false}return g(n.html5)}function g(l){var m=c.vid;if(!l){return true}if(m.canPlayType(l)){return true}else{if(l=="audio/mp3"&&navigator.userAgent.match(/safari/i)){return m.canPlayType("audio/mpeg")}else{return false}}}}})(jwplayer);(function(d){var c=[],a=d.utils,e=d.events,b=e.state;var f=d.api=function(u){var y=this,g={},m={},C={},p=[],h=undefined,F=false,q=[],A=undefined,t={},o={};y.container=u;y.id=u.id;y.getBuffer=function(){return x("jwGetBuffer")};y.getContainer=function(){return y.container};function i(I,H){return function(N,J,K,L){if(I.renderingMode=="flash"||I.renderingMode=="html5"){var M;if(J){o[N]=J;M="jwplayer('"+I.id+"').callback('"+N+"')"}else{if(!J&&o[N]){delete o[N]}}h.jwDockSetButton(N,M,K,L)}return H}}y.getPlugin=function(H){var I={};if(H=="dock"){return a.extend(I,{setButton:i(y,I),show:function(){x("jwDockShow");return I},hide:function(){x("jwDockHide");return I},onShow:function(J){D("dock",e.JWPLAYER_COMPONENT_SHOW,J);return I},onHide:function(J){D("dock",e.JWPLAYER_COMPONENT_HIDE,J);return I}})}else{if(H=="controlbar"){return a.extend(I,{show:function(){__callInternal("jwControlbarShow");return I},hide:function(){__callInternal("jwControlbarHide");return I},onShow:function(J){D("controlbar",e.JWPLAYER_COMPONENT_SHOW,J);return I},onHide:function(J){D("controlbar",e.JWPLAYER_COMPONENT_HIDE,J);return I}})}else{if(H=="display"){return a.extend(I,{show:function(){__callInternal("jwDisplayShow");return I},hide:function(){__callInternal("jwDisplayHide");return I},onShow:function(J){D("display",e.JWPLAYER_COMPONENT_SHOW,J);return I},onHide:function(J){D("display",e.JWPLAYER_COMPONENT_HIDE,J);return I}})}else{return y.plugins[H]}}}};y.callback=function(H){if(o[H]){return o[H]()}};y.getDuration=function(){return x("jwGetDuration")};y.getFullscreen=function(){return x("jwGetFullscreen")};y.getStretching=function(){return x("jwGetStretching")};y.getHeight=function(){return x("jwGetHeight")};y.getLockState=function(){return x("jwGetLockState")};y.getMeta=function(){return y.getItemMeta()};y.getMute=function(){return x("jwGetMute")};y.getPlaylist=function(){var I=x("jwGetPlaylist");if(y.renderingMode=="flash"){a.deepReplaceKeyName(I,["__dot__","__spc__","__dsh__"],["."," ","-"])}for(var H=0;H<I.length;H++){if(!a.exists(I[H].index)){I[H].index=H}}return I};y.getPlaylistItem=function(H){if(!a.exists(H)){H=y.getCurrentItem()}return y.getPlaylist()[H]};y.getPosition=function(){return x("jwGetPosition")};y.getRenderingMode=function(){return y.renderingMode};y.getState=function(){return x("jwGetState")};y.getVolume=function(){return x("jwGetVolume")};y.getWidth=function(){return x("jwGetWidth")};y.setFullscreen=function(H){if(!a.exists(H)){x("jwSetFullscreen",!x("jwGetFullscreen"))}else{x("jwSetFullscreen",H)}return y};y.setStretching=function(H){x("jwSetStretching",H);return y};y.setMute=function(H){if(!a.exists(H)){x("jwSetMute",!x("jwGetMute"))}else{x("jwSetMute",H)}return y};y.lock=function(){return y};y.unlock=function(){return y};y.load=function(H){x("jwLoad",H);return y};y.playlistItem=function(H){x("jwPlaylistItem",H);return y};y.playlistPrev=function(){x("jwPlaylistPrev");return y};y.playlistNext=function(){x("jwPlaylistNext");return y};y.resize=function(I,H){if(y.renderingMode=="html5"){h.jwResize(I,H)}else{var J=document.getElementById(y.id+"_wrapper");if(J){J.style.width=a.styleDimension(I);J.style.height=a.styleDimension(H)}}return y};y.play=function(H){if(typeof H=="undefined"){H=y.getState();if(H==b.PLAYING||H==b.BUFFERING){x("jwPause")}else{x("jwPlay")}}else{x("jwPlay",H)}return y};y.pause=function(H){if(typeof H=="undefined"){H=y.getState();if(H==b.PLAYING||H==b.BUFFERING){x("jwPause")}else{x("jwPlay")}}else{x("jwPause",H)}return y};y.stop=function(){x("jwStop");return y};y.seek=function(H){x("jwSeek",H);return y};y.setVolume=function(H){x("jwSetVolume",H);return y};y.loadInstream=function(I,H){A=new f.instream(this,h,I,H);return A};var s={onBufferChange:e.JWPLAYER_MEDIA_BUFFER,onBufferFull:e.JWPLAYER_MEDIA_BUFFER_FULL,onError:e.JWPLAYER_ERROR,onFullscreen:e.JWPLAYER_FULLSCREEN,onMeta:e.JWPLAYER_MEDIA_META,onMute:e.JWPLAYER_MEDIA_MUTE,onPlaylist:e.JWPLAYER_PLAYLIST_LOADED,onPlaylistItem:e.JWPLAYER_PLAYLIST_ITEM,onReady:e.API_READY,onResize:e.JWPLAYER_RESIZE,onComplete:e.JWPLAYER_MEDIA_COMPLETE,onSeek:e.JWPLAYER_MEDIA_SEEK,onTime:e.JWPLAYER_MEDIA_TIME,onVolume:e.JWPLAYER_MEDIA_VOLUME,onBeforePlay:e.JWPLAYER_MEDIA_BEFOREPLAY,onBeforeComplete:e.JWPLAYER_MEDIA_BEFORECOMPLETE,onDisplayClick:e.JWPLAYER_DISPLAY_CLICK};for(var z in s){y[z]=E(s[z],B)}var w={onBuffer:b.BUFFERING,onPause:b.PAUSED,onPlay:b.PLAYING,onIdle:b.IDLE};for(var k in w){y[k]=E(w[k],r)}function E(H,I){return function(J){return I(H,J)}}y.remove=function(){if(!F){throw"Cannot call remove() before player is ready";return}n(this)};function n(H){q=[];f.destroyPlayer(H.id)}y.setup=function(H){if(d.embed){n(y);if(a.clearCss){a.clearCss("#"+y.id)}var I=d(y.id);I.config=H;return new d.embed(I)}return y};y.registerPlugin=function(J,I,H){d.plugins.registerPlugin(J,I,H)};y.setPlayer=function(H,I){h=H;y.renderingMode=I};y.detachMedia=function(){if(y.renderingMode=="html5"){return x("jwDetachMedia")}};y.attachMedia=function(){if(y.renderingMode=="html5"){return x("jwAttachMedia")}};function r(H,I){if(!m[H]){m[H]=[];B(e.JWPLAYER_PLAYER_STATE,G(H))}m[H].push(I);return y}function G(H){return function(J){var I=J.newstate,L=J.oldstate;if(I==H){var K=m[I];if(K){for(var M=0;M<K.length;M++){if(typeof K[M]=="function"){K[M].call(this,{oldstate:L,newstate:I})}}}}}}function D(H,I,J){if(!C[H]){C[H]={}}if(!C[H][I]){C[H][I]=[];B(I,l(H,I))}C[H][I].push(J);return y}function l(H,I){return function(K){if(H==K.component){var J=C[H][I];if(J){for(var L=0;L<J.length;L++){if(typeof J[L]=="function"){J[L].call(this,K)}}}}}}function j(H,I){try{H.jwAddEventListener(I,'function(dat) { jwplayer("'+y.id+'").dispatchEvent("'+I+'", dat); }')}catch(J){a.log("Could not add internal listener")}}function B(H,I){if(!g[H]){g[H]=[];if(h&&F){j(h,H)}}g[H].push(I);return y}y.dispatchEvent=function(J){if(g[J]){var I=a.translateEventResponse(J,arguments[1]);for(var H=0;H<g[J].length;H++){if(typeof g[J][H]=="function"){g[J][H].call(this,I)}}}};y.dispatchInstreamEvent=function(H){if(A){A.dispatchEvent(H,arguments)}};function x(){if(F){var J=arguments[0],H=[];for(var I=1;I<arguments.length;I++){H.push(arguments[I])}if(typeof h!="undefined"&&typeof h[J]=="function"){if(H.length==2){return(h[J])(H[0],H[1])}else{if(H.length==1){return(h[J])(H[0])}else{return(h[J])()}}}return null}else{q.push(arguments)}}y.playerReady=function(I){F=true;if(!h){y.setPlayer(document.getElementById(I.id))}y.container=document.getElementById(y.id);for(var H in g){j(h,H)}B(e.JWPLAYER_PLAYLIST_ITEM,function(J){t={}});B(e.JWPLAYER_MEDIA_META,function(J){a.extend(t,J.metadata)});y.dispatchEvent(e.API_READY);while(q.length>0){x.apply(this,q.shift())}};y.getItemMeta=function(){return t};y.getCurrentItem=function(){return x("jwGetPlaylistIndex")};function v(J,L,K){var H=[];if(!L){L=0}if(!K){K=J.length-1}for(var I=L;I<=K;I++){H.push(J[I])}return H}return y};f.selectPlayer=function(h){var g;if(!a.exists(h)){h=0}if(h.nodeType){g=h}else{if(typeof h=="string"){g=document.getElementById(h)}}if(g){var i=f.playerById(g.id);if(i){return i}else{return f.addPlayer(new f(g))}}else{if(typeof h=="number"){return c[h]}}return null};f.playerById=function(h){for(var g=0;g<c.length;g++){if(c[g].id==h){return c[g]}}return null};f.addPlayer=function(g){for(var h=0;h<c.length;h++){if(c[h]==g){return g}}c.push(g);return g};f.destroyPlayer=function(i){var h=-1;for(var k=0;k<c.length;k++){if(c[k].id==i){h=k;continue}}if(h>=0){var l=c[h].id,g=document.getElementById(l+"_wrapper");if(!g){g=document.getElementById(l)}if(g){var j=document.createElement("div");j.id=l;g.parentNode.replaceChild(j,g)}c.splice(h,1)}return null}})(jwplayer);var _userPlayerReady=(typeof playerReady=="function")?playerReady:undefined;playerReady=function(b){var a=jwplayer.api.playerById(b.id);if(a){a.playerReady(b)}else{jwplayer.api.selectPlayer(b.id).playerReady(b)}if(_userPlayerReady){_userPlayerReady.call(this,b)}};(function(b){var c=b.events,a=c.state;b.api.instream=function(e,k,o,r){var j=e,d=k,i=o,l=r,g={},q={};function h(){j.callInternal("jwLoadInstream",o,r)}function n(s,t){d.jwInstreamAddEventListener(t,'function(dat) { jwplayer("'+j.id+'").dispatchInstreamEvent("'+t+'", dat); }')}function f(s,t){if(!g[s]){g[s]=[];n(d,s)}g[s].push(t);return this}function p(s,t){if(!q[s]){q[s]=[];f(c.JWPLAYER_PLAYER_STATE,m(s))}q[s].push(t);return this}function m(s){return function(u){var t=u.newstate,w=u.oldstate;if(t==s){var v=q[t];if(v){for(var x=0;x<v.length;x++){if(typeof v[x]=="function"){v[x].call(this,{oldstate:w,newstate:t,type:u.type})}}}}}}this.dispatchEvent=function(v,u){if(g[v]){var t=_utils.translateEventResponse(v,u[1]);for(var s=0;s<g[v].length;s++){if(typeof g[v][s]=="function"){g[v][s].call(this,t)}}}};this.onError=function(s){return f(c.JWPLAYER_ERROR,s)};this.onFullscreen=function(s){return f(c.JWPLAYER_FULLSCREEN,s)};this.onMeta=function(s){return f(c.JWPLAYER_MEDIA_META,s)};this.onMute=function(s){return f(c.JWPLAYER_MEDIA_MUTE,s)};this.onComplete=function(s){return f(c.JWPLAYER_MEDIA_COMPLETE,s)};this.onSeek=function(s){return f(c.JWPLAYER_MEDIA_SEEK,s)};this.onTime=function(s){return f(c.JWPLAYER_MEDIA_TIME,s)};this.onVolume=function(s){return f(c.JWPLAYER_MEDIA_VOLUME,s)};this.onBuffer=function(s){return p(a.BUFFERING,s)};this.onPause=function(s){return p(a.PAUSED,s)};this.onPlay=function(s){return p(a.PLAYING,s)};this.onIdle=function(s){return p(a.IDLE,s)};this.onInstreamClick=function(s){return f(c.JWPLAYER_INSTREAM_CLICK,s)};this.onInstreamDestroyed=function(s){return f(c.JWPLAYER_INSTREAM_DESTROYED,s)};this.play=function(s){d.jwInstreamPlay(s)};this.pause=function(s){d.jwInstreamPause(s)};this.seek=function(s){d.jwInstreamSeek(s)};this.destroy=function(){d.jwInstreamDestroy()};this.getState=function(){return d.jwInstreamGetState()};this.getDuration=function(){return d.jwInstreamGetDuration()};this.getPosition=function(){return d.jwInstreamGetPosition()};h()}})(jwplayer)};1 if(typeof jwplayer=="undefined"){jwplayer=function(a){if(jwplayer.api){return jwplayer.api.selectPlayer(a)}};var $jw=jwplayer;jwplayer.version="6.0.2217";jwplayer.vid=document.createElement("video");jwplayer.audio=document.createElement("audio");jwplayer.source=document.createElement("source");(function(d){var j=document,g=window,b=navigator,h="undefined",f="string",c="object";var k=d.utils=function(){};k.exists=function(l){switch(typeof(l)){case f:return(l.length>0);break;case c:return(l!==null);case h:return false}return true};k.styleDimension=function(l){return l+(l.toString().indexOf("%")>0?"":"px")};k.getAbsolutePath=function(r,q){if(!k.exists(q)){q=j.location.href}if(!k.exists(r)){return undefined}if(a(r)){return r}var s=q.substring(0,q.indexOf("://")+3);var p=q.substring(s.length,q.indexOf("/",s.length+1));var m;if(r.indexOf("/")===0){m=r.split("/")}else{var n=q.split("?")[0];n=n.substring(s.length+p.length+1,n.lastIndexOf("/"));m=n.split("/").concat(r.split("/"))}var l=[];for(var o=0;o<m.length;o++){if(!m[o]||!k.exists(m[o])||m[o]=="."){continue}else{if(m[o]==".."){l.pop()}else{l.push(m[o])}}}return s+p+"/"+l.join("/")};function a(m){if(!k.exists(m)){return}var n=m.indexOf("://");var l=m.indexOf("?");return(n>0&&(l<0||(l>n)))}k.extend=function(){var l=k.extend["arguments"];if(l.length>1){for(var n=1;n<l.length;n++){for(var m in l[n]){if(k.exists(l[n][m])){l[0][m]=l[n][m]}}}return l[0]}return null};k.log=function(m,l){if(typeof console!=h&&typeof console.log!=h){if(l){console.log(m,l)}else{console.log(m)}}};var e=k.userAgentMatch=function(m){var l=b.userAgent.toLowerCase();return(l.match(m)!==null)};k.isIE=function(){return e(/msie/i)};k.isMobile=function(){return e(/(iP(hone|ad|od))|android/i)};k.isIOS=function(){return e(/iP(hone|ad|od)/i)};k.isIPod=function(){return e(/iP(hone|od)/i)};k.isIPad=function(){return e(/iPad/i)};k.saveCookie=function(l,m){j.cookie="jwplayer."+l+"="+m+"; path=/"};k.getCookies=function(){var o={};var n=j.cookie.split("; ");for(var m=0;m<n.length;m++){var l=n[m].split("=");if(l[0].indexOf("jwplayer.")==0){o[l[0].substring(9,l[0].length)]=l[1]}}return o};k.typeOf=function(m){var l=typeof m;if(l==="object"){if(!m){return"null"}return(m instanceof Array)?"array":l}else{return l}};k.translateEventResponse=function(n,l){var p=k.extend({},l);if(n==d.events.JWPLAYER_FULLSCREEN&&!p.fullscreen){p.fullscreen=p.message=="true"?true:false;delete p.message}else{if(typeof p.data==c){p=k.extend(p,p.data);delete p.data}else{if(typeof p.metadata==c){k.deepReplaceKeyName(p.metadata,["__dot__","__spc__","__dsh__"],["."," ","-"])}}}var m=["position","duration","offset"];for(var o in m){if(p[m[o]]){p[m[o]]=Math.round(p[m[o]]*1000)/1000}}return p};k.flashVersion=function(){var l=b.plugins,m;if(l!=h){m=l["Shockwave Flash"];if(m){return parseInt(m.description.replace(/\D+(\d+)\..*/,"$1"))}}if(typeof g.ActiveXObject!=h){try{m=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");if(m){return parseInt(m.GetVariable("$version").split(" ")[1].split(",")[0])}}catch(n){}}return 0};k.getScriptPath=function(n){var l=j.getElementsByTagName("script");for(var m=0;m<l.length;m++){var o=l[m].src;if(o&&o.indexOf(n)>=0){return o.substr(0,o.indexOf(n))}}return""};k.deepReplaceKeyName=function(s,n,l){switch(d.utils.typeOf(s)){case"array":for(var p=0;p<s.length;p++){s[p]=d.utils.deepReplaceKeyName(s[p],n,l)}break;case c:for(var o in s){var r,q;if(n instanceof Array&&l instanceof Array){if(n.length!=l.length){continue}else{r=n;q=l}}else{r=[n];q=[l]}var m=o;for(var p=0;p<r.length;p++){m=m.replace(new RegExp(n[p],"g"),l[p])}s[m]=d.utils.deepReplaceKeyName(s[o],n,l);if(o!=m){delete s[o]}}break}return s};var i=k.pluginPathType={ABSOLUTE:0,RELATIVE:1,CDN:2};k.getPluginPathType=function(m){if(typeof m!=f){return}m=m.split("?")[0];var n=m.indexOf("://");if(n>0){return i.ABSOLUTE}var l=m.indexOf("/");var o=k.extension(m);if(n<0&&l<0&&(!o||!isNaN(o))){return i.CDN}return i.RELATIVE};k.getPluginName=function(l){return l.replace(/^.*\/([^-]*)-?.*\.(swf|js)$/,"$1")};k.getPluginVersion=function(l){return l.replace(/[^-]*-?([^\.]*).*$/,"$1")};k.isYouTube=function(l){return(l.indexOf("youtube.com")>-1||l.indexOf("youtu.be")>-1)}})(jwplayer);(function(i){var b="video/",g="audio/",e="image",h="mp4",f={f4a:g+h,f4v:b+h,mov:b+h,m4a:g+h,m4v:b+h,mp4:b+h,aac:g+"aac",mp3:g+"mp3",ogg:g+"ogg",oga:g+"ogg",ogv:b+"ogg",webm:b+"webm",m3u8:"application/vnd.apple.mpegurl"},b="video",d={flv:b,f4v:b,mov:b,m4a:b,m4v:b,mp4:b,aac:b,mp3:"sound",smil:"rtmp",m3u8:"hls"};var a=i.extensionmap={};for(var c in f){a[c]={html5:f[c]}}for(c in d){if(!a[c]){a[c]={}}a[c].flash=d[c]}})(jwplayer.utils);(function(b){var a=b.loaderstatus={NEW:0,LOADING:1,ERROR:2,COMPLETE:3},c=document;b.scriptloader=function(e){var f=a.NEW,g=jwplayer.events,d=new g.eventdispatcher();b.extend(this,d);this.load=function(){if(f==a.NEW){f=a.LOADING;var h=c.createElement("script");h.onload=function(i){f=a.COMPLETE;d.sendEvent(g.COMPLETE)};h.onerror=function(i){f=a.ERROR;d.sendEvent(g.ERROR)};h.onreadystatechange=function(){if(h.readyState=="loaded"||h.readyState=="complete"){f=a.COMPLETE;d.sendEvent(g.COMPLETE)}};c.getElementsByTagName("head")[0].appendChild(h);h.src=e}};this.getStatus=function(){return f}}})(jwplayer.utils);(function(a){a.trim=function(b){return b.replace(/^\s*/,"").replace(/\s*$/,"")};a.pad=function(c,d,b){if(!b){b="0"}while(c.length<d){c=b+c}return c};a.seconds=function(d){d=d.replace(",",".");var b=d.split(":");var c=0;if(d.substr(-1)=="s"){c=Number(d.substr(0,d.length-1))}else{if(d.substr(-1)=="m"){c=Number(d.substr(0,d.length-1))*60}else{if(d.substr(-1)=="h"){c=Number(d.substr(0,d.length-1))*3600}else{if(b.length>1){c=Number(b[b.length-1]);c+=Number(b[b.length-2])*60;if(b.length==3){c+=Number(b[b.length-3])*3600}}else{c=Number(d)}}}}return c};a.xmlAttribute=function(b,c){for(var d=0;d<b.attributes.length;d++){if(b.attributes[d].name&&b.attributes[d].name.toLowerCase()==c.toLowerCase()){return b.attributes[d].value.toString()}}return""};a.jsonToString=function(f){var h=h||{};if(h&&h.stringify){return h.stringify(f)}var c=typeof(f);if(c!="object"||f===null){if(c=="string"){f='"'+f.replace(/"/g,'\\"')+'"'}else{return String(f)}}else{var g=[],b=(f&&f.constructor==Array);for(var d in f){var e=f[d];switch(typeof(e)){case"string":e='"'+e.replace(/"/g,'\\"')+'"';break;case"object":if(a.exists(e)){e=a.jsonToString(e)}break}if(b){if(typeof(e)!="function"){g.push(String(e))}}else{if(typeof(e)!="function"){g.push('"'+d+'":'+String(e))}}}if(b){return"["+String(g)+"]"}else{return"{"+String(g)+"}"}}};a.extension=function(b){if(!b){return""}b=b.substring(b.lastIndexOf("/")+1,b.length).split("?")[0];if(b.lastIndexOf(".")>-1){return b.substr(b.lastIndexOf(".")+1,b.length).toLowerCase()}};a.stringToColor=function(b){b=b.replace(/(#|0x)?([0-9A-F]{3,6})$/gi,"$2");if(b.length==3){b=b.charAt(0)+b.charAt(0)+b.charAt(1)+b.charAt(1)+b.charAt(2)+b.charAt(2)}return parseInt(b,16)}})(jwplayer.utils);(function(a){a.events={COMPLETE:"COMPLETE",ERROR:"ERROR",API_READY:"jwplayerAPIReady",JWPLAYER_READY:"jwplayerReady",JWPLAYER_FULLSCREEN:"jwplayerFullscreen",JWPLAYER_RESIZE:"jwplayerResize",JWPLAYER_ERROR:"jwplayerError",JWPLAYER_MEDIA_BEFOREPLAY:"jwplayerMediaBeforePlay",JWPLAYER_MEDIA_BEFORECOMPLETE:"jwplayerMediaBeforeComplete",JWPLAYER_COMPONENT_SHOW:"jwplayerComponentShow",JWPLAYER_COMPONENT_HIDE:"jwplayerComponentHide",JWPLAYER_MEDIA_BUFFER:"jwplayerMediaBuffer",JWPLAYER_MEDIA_BUFFER_FULL:"jwplayerMediaBufferFull",JWPLAYER_MEDIA_ERROR:"jwplayerMediaError",JWPLAYER_MEDIA_LOADED:"jwplayerMediaLoaded",JWPLAYER_MEDIA_COMPLETE:"jwplayerMediaComplete",JWPLAYER_MEDIA_SEEK:"jwplayerMediaSeek",JWPLAYER_MEDIA_TIME:"jwplayerMediaTime",JWPLAYER_MEDIA_VOLUME:"jwplayerMediaVolume",JWPLAYER_MEDIA_META:"jwplayerMediaMeta",JWPLAYER_MEDIA_MUTE:"jwplayerMediaMute",JWPLAYER_MEDIA_LEVELS:"jwplayerMediaLevels",JWPLAYER_MEDIA_LEVEL_CHANGED:"jwplayerMediaLevelChanged",JWPLAYER_PLAYER_STATE:"jwplayerPlayerState",state:{BUFFERING:"BUFFERING",IDLE:"IDLE",PAUSED:"PAUSED",PLAYING:"PLAYING",COMPLETED:"COMPLETED"},JWPLAYER_PLAYLIST_LOADED:"jwplayerPlaylistLoaded",JWPLAYER_PLAYLIST_ITEM:"jwplayerPlaylistItem",JWPLAYER_DISPLAY_CLICK:"jwplayerViewClick",JWPLAYER_INSTREAM_CLICK:"jwplayerInstreamClicked",JWPLAYER_INSTREAM_DESTROYED:"jwplayerInstreamDestroyed"}})(jwplayer);(function(a){var b=jwplayer.utils;a.eventdispatcher=function(h,c){var e=h,g=c,f,d;this.resetEventListeners=function(){f={};d=[]};this.resetEventListeners();this.addEventListener=function(i,l,k){try{if(!b.exists(f[i])){f[i]=[]}if(b.typeOf(l)=="string"){l=(new Function("return "+l))()}f[i].push({listener:l,count:k})}catch(j){b.log("error",j)}return false};this.removeEventListener=function(j,l){if(!f[j]){return}try{for(var i=0;i<f[j].length;i++){if(f[j][i].listener.toString()==l.toString()){f[j].splice(i,1);break}}}catch(k){b.log("error",k)}return false};this.addGlobalListener=function(k,j){try{if(b.typeOf(k)=="string"){k=(new Function("return "+k))()}d.push({listener:k,count:j})}catch(i){b.log("error",i)}return false};this.removeGlobalListener=function(k){if(!k){return}try{for(var i=0;i<d.length;i++){if(d[i].listener.toString()==k.toString()){d.splice(i,1);break}}}catch(j){b.log("error",j)}return false};this.sendEvent=function(k,m){if(!b.exists(m)){m={}}b.extend(m,{id:e,version:jwplayer.version,type:k});if(g){b.log(k,m)}if(b.typeOf(f[k])!="undefined"){for(var j=0;j<f[k].length;j++){try{f[k][j].listener(m)}catch(l){b.log("There was an error while handling a listener: "+l.toString(),f[k][j].listener)}if(f[k][j]){if(f[k][j].count===1){delete f[k][j]}else{if(f[k][j].count>0){f[k][j].count=f[k][j].count-1}}}}}var i;for(i=0;i<d.length;i++){try{d[i].listener(m)}catch(l){b.log("There was an error while handling a listener: "+l.toString(),d[i].listener)}if(d[i]){if(d[i].count===1){delete d[i]}else{if(d[i].count>0){d[i].count=d[i].count-1}}}}}}})(jwplayer.events);(function(a){var c={};var b={};a.plugins=function(){};a.plugins.loadPlugins=function(e,d){b[e]=new a.plugins.pluginloader(new a.plugins.model(c),d);return b[e]};a.plugins.registerPlugin=function(h,f,e){var d=a.utils.getPluginName(h);if(c[d]){c[d].registerPlugin(h,f,e)}else{a.utils.log("A plugin ("+h+") was registered with the player that was not loaded. Please check your configuration.");for(var g in b){b[g].pluginFailed()}}}})(jwplayer);(function(a){a.plugins.model=function(b){this.addPlugin=function(c){var d=a.utils.getPluginName(c);if(!b[d]){b[d]=new a.plugins.plugin(c)}return b[d]}}})(jwplayer);(function(b){var a=jwplayer.utils,c=jwplayer.events,d="undefined";b.pluginmodes={FLASH:0,JAVASCRIPT:1,HYBRID:2};b.plugin=function(e){var g="http://plugins.longtailvideo.com",l=a.loaderstatus.NEW,m,k,n;var f=new c.eventdispatcher();a.extend(this,f);function h(){switch(a.getPluginPathType(e)){case a.pluginPathType.ABSOLUTE:return e;case a.pluginPathType.RELATIVE:return a.getAbsolutePath(e,window.location.href);case a.pluginPathType.CDN:var q=a.getPluginName(e);var p=a.getPluginVersion(e);var o=(window.location.href.indexOf("https://")==0)?g.replace("http://","https://secure"):g;return o+"/"+jwplayer.version.split(".")[0]+"/"+q+"/"+q+(p!==""?("-"+p):"")+".js"}}function j(o){n=setTimeout(function(){l=a.loaderstatus.COMPLETE;f.sendEvent(c.COMPLETE)},1000)}function i(o){l=a.loaderstatus.ERROR;f.sendEvent(c.ERROR)}this.load=function(){if(l==a.loaderstatus.NEW){if(e.lastIndexOf(".swf")>0){m=e;l=a.loaderstatus.COMPLETE;f.sendEvent(c.COMPLETE);return}l=a.loaderstatus.LOADING;var o=new a.scriptloader(h());o.addEventListener(c.COMPLETE,j);o.addEventListener(c.ERROR,i);o.load()}};this.registerPlugin=function(q,p,o){if(n){clearTimeout(n);n=undefined}if(p&&o){m=o;k=p}else{if(typeof p=="string"){m=p}else{if(typeof p=="function"){k=p}else{if(!p&&!o){m=q}}}}l=a.loaderstatus.COMPLETE;f.sendEvent(c.COMPLETE)};this.getStatus=function(){return l};this.getPluginName=function(){return a.getPluginName(e)};this.getFlashPath=function(){if(m){switch(a.getPluginPathType(m)){case a.pluginPathType.ABSOLUTE:return m;case a.pluginPathType.RELATIVE:if(e.lastIndexOf(".swf")>0){return a.getAbsolutePath(m,window.location.href)}return a.getAbsolutePath(m,h());case a.pluginPathType.CDN:if(m.indexOf("-")>-1){return m+"h"}return m+"-h"}}return null};this.getJS=function(){return k};this.getPluginmode=function(){if(typeof m!=d&&typeof k!=d){return b.pluginmodes.HYBRID}else{if(typeof m!=d){return b.pluginmodes.FLASH}else{if(typeof k!=d){return b.pluginmodes.JAVASCRIPT}}}};this.getNewInstance=function(p,o,q){return new k(p,o,q)};this.getURL=function(){return e}}})(jwplayer.plugins);(function(b){var a=b.utils,c=b.events;b.plugins.pluginloader=function(j,h){var i={},n=a.loaderstatus.NEW,g=false,d=false,l=false,e=new c.eventdispatcher();a.extend(this,e);function f(){if(l){e.sendEvent(c.ERROR)}else{if(!d){d=true;n=a.loaderstatus.COMPLETE;e.sendEvent(c.COMPLETE)}}}function m(){if(!d){var p=0;for(plugin in i){var o=i[plugin].getStatus();if(o==a.loaderstatus.LOADING||o==a.loaderstatus.NEW){p++}}if(p==0){f()}}}this.setupPlugins=function(q,o,v){var p={length:0,plugins:{}};var s={length:0,plugins:{}};for(var r in i){var t=i[r].getPluginName();if(i[r].getFlashPath()){p.plugins[i[r].getFlashPath()]=o.plugins[r];p.plugins[i[r].getFlashPath()].pluginmode=i[r].getPluginmode();p.length++}if(i[r].getJS()){var u=document.createElement("div");u.id=q.id+"_"+t;u.style.position="absolute";u.style.zIndex=s.length+10;s.plugins[t]=i[r].getNewInstance(q,o.plugins[r],u);s.length++;q.onReady(v(s.plugins[t],u,true));q.onResize(v(s.plugins[t],u))}}q.plugins=s.plugins;return p};this.load=function(){if(a.typeOf(h)!="object"){m();return}n=a.loaderstatus.LOADING;g=true;for(var o in h){if(a.exists(o)){i[o]=j.addPlugin(o);i[o].addEventListener(c.COMPLETE,m);i[o].addEventListener(c.ERROR,k)}}for(o in i){i[o].load()}g=false;m()};var k=this.pluginFailed=function(){if(!l){l=true;f()}};this.getStatus=function(){return n}}})(jwplayer);(function(a){a.playlist=function(c){var d=[];if(a.utils.typeOf(c)=="array"){for(var b=0;b<c.length;b++){d.push(new a.playlist.item(c[b]))}}else{d.push(new a.playlist.item(c))}return d}})(jwplayer);(function(a){a.item=function(c){var d={description:"",image:"",mediaid:"",title:"",duration:-1,sources:[]},b=jwplayer.utils.extend({},d,c);if(b.sources.length==0){b.sources[0]=new a.source(b)}return b}})(jwplayer.playlist);(function(d){var b=undefined,a=jwplayer.utils,c={file:b,width:b,label:b,bitrate:b,type:b};d.source=function(f){var e=a.extend({},c);for(var g in c){if(a.exists(f[g])){e[g]=f[g];delete f[g]}}return e}})(jwplayer.playlist);(function(b){var a=b.utils,c=b.events;var d=b.embed=function(o){var l=new d.config(o.config),h,j="Error loading player: ",g=b.plugins.loadPlugins(o.id,l.plugins);l.id=o.id;h=document.getElementById(o.id);function i(r,q){for(var p in q){if(typeof r[p]=="function"){(r[p]).call(r,q[p])}}}function e(){if(a.typeOf(l.playlist)=="array"&&l.playlist.length<2){if(l.playlist.length==0||!l.playlist[0].sources||l.playlist[0].sources.length==0){m();return}}if(g.getStatus()==a.loaderstatus.COMPLETE){for(var r=0;r<l.modes.length;r++){if(l.modes[r].type&&d[l.modes[r].type]){var s=l.modes[r].config;var p=a.extend({},s?d.config.addConfig(l,s):l);var q=new d[l.modes[r].type](h,l.modes[r],p,g,o);if(q.supportsConfig()){q.addEventListener(c.ERROR,f);q.embed();i(o,p.events);return o}}}if(l.fallback){a.log("No suitable players found and fallback enabled");new d.download(h,l,m)}else{a.log("No suitable players found and fallback disabled")}}}function f(p){n(h,j+p.message)}function k(p){n(h,j+"Could not load plugins")}function m(){n(h,j+"No media sources found")}function n(p,r){var q=p.style;q.backgroundColor="#000";q.color="#FFF";q.width=a.styleDimension(l.width);q.height=a.styleDimension(l.height);q.display="table";q.padding="50px";var s=document.createElement("p");s.style.verticalAlign="middle";s.style.textAlign="center";s.style.display="table-cell";s.innerHTML=r;p.innerHTML="";p.appendChild(s)}b.embed.errorScreen=n;g.addEventListener(c.COMPLETE,e);g.addEventListener(c.ERROR,k);g.load();return o}})(jwplayer);(function(c){var a=c.utils,g=c.embed,e=undefined;var b=g.config=function(i){function l(p,o,n){for(var m=0;m<p.length;m++){var q=p[m].type;if(!p[m].src){p[m].src=n[q]?n[q]:o+"jwplayer."+q+(q=="flash"?".swf":".js")}}}var k={fallback:true,height:300,primary:"html5",width:400,base:e},h={html5:{type:"html5"},flash:{type:"flash"}},j=a.extend(k,i);if(!j.base){j.base=a.getScriptPath("jwplayer.js")}if(!j.modes){j.modes=(j.primary=="flash")?[h.flash,h.html5]:[h.html5,h.flash]}l(j.modes,j.base,{html5:j.html5player,flash:j.flashplayer});d(j);return j};b.addConfig=function(h,i){d(i);return a.extend(h,i)};function d(j){if(!j.playlist){var l={};f(j,l,"sources");f(j,l,"image");if(!j.sources){if(j.levels){l.sources=j.levels;delete j.levels}else{var h={};f(j,h,"file");f(j,h,"type");l.sources=h.file?[h]:[]}}j.playlist=[l]}else{for(var k=0;k<j.playlist.length;k++){j.playlist[k]=new c.playlist.item(j.playlist[k])}}}function f(j,h,i){if(a.exists(j[i])){h[i]=j[i];delete j[i]}}})(jwplayer);(function(d){var h=d.embed,b=d.utils,e="pointer",a="none",f="block",g="100%",c="absolute";h.download=function(k,v,j){var n=b.extend({},v),r,l=n.width?n.width:480,o=n.height?n.height:320,w,p,i=v.logo?v.logo:{prefix:"http://l.longtailvideo.com/download/",file:"logo.png",margin:10};function u(){if(n.playlist&&n.playlist.length){var z,B,y;for(var x=0;x<n.playlist[0].sources.length;x++){var A=n.playlist[0].sources[x];if(A.file){if(("mp4,mp4,flv,webm,aac,mp3,vorbis").split().indexOf(A.type)>-1){z=A.file;B=A.image;continue}else{if(b.isYouTube(A.file)){y=A.file}}}}}else{return}if(z){w=z;p=B;if(i.prefix){i.prefix+=d.version.split(/\W/).splice(0,2).join("/")+"/"}q();m()}else{if(y){alert("Youtube goes here: "+y)}else{j()}}}function q(){if(k){r=s("a","display",k);s("div","iconbackground",r);s("div","icon",r);s("div","logo",r);if(w){r.setAttribute("href",b.getAbsolutePath(w))}}}function t(x,z){var A=document.querySelectorAll(x);for(var y=0;y<A.length;y++){for(var B in z){A[y].style[B]=z[B]}}}function m(){var x="#"+k.id+" .jwdownload";t(x+"display",{width:b.styleDimension(l),height:b.styleDimension(o),background:"black center no-repeat "+(p?"url("+p+")":""),backgroundSize:"contain",position:c,border:a,display:f});t(x+"display div",{position:c,width:g,height:g});t(x+"logo",{bottom:i.margin+"px",left:i.margin+"px",background:"bottom left no-repeat url("+i.prefix+i.file+")"});t(x+"icon",{background:"center no-repeat url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAALdJREFUeNrs18ENgjAYhmFouDOCcQJGcARHgE10BDcgTOIosAGwQOuPwaQeuFRi2p/3Sb6EC5L3QCxZBgAAAOCorLW1zMn65TrlkH4NcV7QNcUQt7Gn7KIhxA+qNIR81spOGkL8oFJDyLJRdosqKDDkK+iX5+d7huzwM40xptMQMkjIOeRGo+VkEVvIPfTGIpKASfYIfT9iCHkHrBEzf4gcUQ56aEzuGK/mw0rHpy4AAACAf3kJMACBxjAQNRckhwAAAABJRU5ErkJggg==)"});t(x+"iconbackground",{background:"center no-repeat url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAEpJREFUeNrszwENADAIA7DhX8ENoBMZ5KR10EryckCJiIiIiIiIiIiIiIiIiIiIiIh8GmkRERERERERERERERERERERERGRHSPAAPlXH1phYpYaAAAAAElFTkSuQmCC)"})}function s(x,A,z){var y=document.createElement(x);y.className="jwdownload"+A;if(z){z.appendChild(y)}return y}u()}})(jwplayer);(function(b){var a=b.utils,c=b.events;b.embed.flash=function(k,l,p,j,n){var f=new b.events.eventdispatcher(),g=a.flashVersion();a.extend(this,f);function q(s,r,t){var u=document.createElement("param");u.setAttribute("name",r);u.setAttribute("value",t);s.appendChild(u)}function o(s,t,r){return function(u){if(r){document.getElementById(n.id+"_wrapper").appendChild(t)}var v=document.getElementById(n.id).getPluginConfig("display");if(typeof s.resize=="function"){s.resize(v.width,v.height)}t.style.left=v.x;t.style.top=v.h}}function i(t){if(!t){return{}}var v={};for(var s in t){var r=t[s];for(var u in r){v[s+"."+u]=r[u]}}return v}function m(u,t){if(u[t]){var w=u[t];for(var s in w){var r=w[s];if(typeof r=="string"){if(!u[s]){u[s]=r}}else{for(var v in r){if(!u[s+"."+v]){u[s+"."+v]=r[v]}}}}delete u[t]}}function e(u){if(!u){return{}}var x={},w=[];for(var r in u){var t=a.getPluginName(r);var s=u[r];w.push(r);for(var v in s){x[t+"."+v]=s[v]}}x.plugins=w.join(",");return x}function h(t){var r="";for(var s in t){if(typeof(t[s])=="object"){r+=s+"="+encodeURIComponent("[[JSON]]"+a.jsonToString(t[s]))+"&"}else{r+=s+"="+encodeURIComponent(t[s])+"&"}}return r.substring(0,r.length-1)}this.embed=function(){p.id=n.id;if(g<10){f.sendEvent(c.ERROR,{message:"Flash version must be 10.0 or greater"});return false}var D;var v=a.extend({},p);if(k.id+"_wrapper"==k.parentNode.id){D=document.getElementById(k.id+"_wrapper")}else{D=document.createElement("div");D.id=k.id+"_wrapper";D.style.position="relative";D.style.width=a.styleDimension(v.width);D.style.height=a.styleDimension(v.height);k.parentNode.replaceChild(D,k);D.appendChild(k)}var r=j.setupPlugins(n,v,o);if(r.length>0){a.extend(v,e(r.plugins))}else{delete v.plugins}var w=["height","width","modes","events","primary","base","fallback"];for(var z=0;z<w.length;z++){delete v[w[z]]}var t="opaque";if(v.wmode){t=v.wmode}m(v,"components");m(v,"providers");if(typeof v["dock.position"]!="undefined"){if(v["dock.position"].toString().toLowerCase()=="false"){v.dock=v["dock.position"];delete v["dock.position"]}}var B=a.getCookies();for(var s in B){if(typeof(v[s])=="undefined"){v[s]=B[s]}}var C="#000000",y,u=h(v);if(a.isIE()){var A='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" bgcolor="'+C+'" width="100%" height="100%" id="'+k.id+'" name="'+k.id+'" tabindex=0"">';A+='<param name="movie" value="'+l.src+'">';A+='<param name="allowfullscreen" value="true">';A+='<param name="allowscriptaccess" value="always">';A+='<param name="seamlesstabbing" value="true">';A+='<param name="wmode" value="'+t+'">';A+='<param name="flashvars" value="'+u+'">';A+="</object>";k.outerHTML=A;y=document.getElementById(k.id)}else{var x=document.createElement("object");x.setAttribute("type","application/x-shockwave-flash");x.setAttribute("data",l.src);x.setAttribute("width","100%");x.setAttribute("height","100%");x.setAttribute("bgcolor","#000000");x.setAttribute("id",k.id);x.setAttribute("name",k.id);x.setAttribute("tabindex",0);q(x,"allowfullscreen","true");q(x,"allowscriptaccess","always");q(x,"seamlesstabbing","true");q(x,"wmode",t);q(x,"flashvars",u);x.onerror=function(){alert("does this work?")};k.parentNode.replaceChild(x,k);y=x}n.container=y;n.setPlayer(y,"flash")};this.supportsConfig=function(){if(g){if(p){try{var t=p.playlist[0],r=t.sources;if(typeof r=="undefined"){return true}else{for(var s=0;s<r.length;s++){if(r[s].file&&d(r[s].file,r[s].type)){return true}}}}catch(u){return false}}else{return true}}return false};function d(s,t){var r=["mp4","flv","aac","mp3","hls","rtmp","youtube"];if(t&&(r.toString().indexOf(t)<0)){return true}var u=a.extension(s);if(!t){t=u}if(!t){return true}if(a.exists(a.extensionmap[t])){return a.exists(a.extensionmap[t].flash)}return false}}})(jwplayer);(function(c){var a=c.utils,b=a.extensionmap,d=c.events;c.embed.html5=function(g,h,o,f,k){var j=this,e=new d.eventdispatcher();a.extend(j,e);function l(q,r,p){return function(s){var t=document.getElementById(g.id+"_displayarea");if(p){t.appendChild(r)}if(typeof q.resize=="function"){q.resize(t.clientWidth,t.clientHeight)}r.left=t.style.left;r.top=t.style.top}}j.embed=function(){if(c.html5){f.setupPlugins(k,o,l);g.innerHTML="";var p=c.utils.extend({},o);if(p.skin&&p.skin.toLowerCase().indexOf(".zip")>0){p.skin=p.skin.replace(/\.zip/i,".xml")}var q=new c.html5.player(p);k.container=document.getElementById(k.id);k.setPlayer(q,"html5")}else{var r=new a.scriptloader(h.src);r.addEventListener(d.ERROR,i);r.addEventListener(d.COMPLETE,j.embed);r.load()}};function i(p){j.sendEvent(p.type,{message:"HTML5 player not found"})}j.supportsConfig=function(){if(!!c.vid.canPlayType){try{if(a.typeOf(o.playlist)=="string"){return true}else{var p=o.playlist[0].sources;for(var r=0;r<p.length;r++){var q=p[r].file,s=p[r].type;if(n(q,s)){return true}}}}catch(t){return false}}return false};function n(p,q){if(navigator.userAgent.match(/BlackBerry/i)!==null){return false}var r=b[q?q:a.extension(p)];if(!r){return false}return m(r.html5)}function m(p){var q=c.vid;if(!p){return true}if(q.canPlayType(p)){return true}else{if(p=="audio/mp3"&&navigator.userAgent.match(/safari/i)){return q.canPlayType("audio/mpeg")}else{return false}}}}})(jwplayer);(function(d){var c=[],a=d.utils,e=d.events,b=e.state;var f=d.api=function(u){var y=this,g={},m={},C={},p=[],h=undefined,F=false,q=[],A=undefined,t={},o={};y.container=u;y.id=u.id;y.getBuffer=function(){return x("jwGetBuffer")};y.getContainer=function(){return y.container};function i(I,H){return function(N,J,K,L){if(I.renderingMode=="flash"||I.renderingMode=="html5"){var M;if(J){o[N]=J;M="jwplayer('"+I.id+"').callback('"+N+"')"}else{if(!J&&o[N]){delete o[N]}}h.jwDockSetButton(N,M,K,L)}return H}}y.getPlugin=function(H){var I={};if(H=="dock"){return a.extend(I,{setButton:i(y,I),show:function(){x("jwDockShow");return I},hide:function(){x("jwDockHide");return I},onShow:function(J){D("dock",e.JWPLAYER_COMPONENT_SHOW,J);return I},onHide:function(J){D("dock",e.JWPLAYER_COMPONENT_HIDE,J);return I}})}else{if(H=="controlbar"){return a.extend(I,{show:function(){__callInternal("jwControlbarShow");return I},hide:function(){__callInternal("jwControlbarHide");return I},onShow:function(J){D("controlbar",e.JWPLAYER_COMPONENT_SHOW,J);return I},onHide:function(J){D("controlbar",e.JWPLAYER_COMPONENT_HIDE,J);return I}})}else{if(H=="display"){return a.extend(I,{show:function(){__callInternal("jwDisplayShow");return I},hide:function(){__callInternal("jwDisplayHide");return I},onShow:function(J){D("display",e.JWPLAYER_COMPONENT_SHOW,J);return I},onHide:function(J){D("display",e.JWPLAYER_COMPONENT_HIDE,J);return I}})}else{return y.plugins[H]}}}};y.callback=function(H){if(o[H]){return o[H]()}};y.getDuration=function(){return x("jwGetDuration")};y.getFullscreen=function(){return x("jwGetFullscreen")};y.getStretching=function(){return x("jwGetStretching")};y.getHeight=function(){return x("jwGetHeight")};y.getLockState=function(){return x("jwGetLockState")};y.getMeta=function(){return y.getItemMeta()};y.getMute=function(){return x("jwGetMute")};y.getPlaylist=function(){var I=x("jwGetPlaylist");if(y.renderingMode=="flash"){a.deepReplaceKeyName(I,["__dot__","__spc__","__dsh__"],["."," ","-"])}for(var H=0;H<I.length;H++){if(!a.exists(I[H].index)){I[H].index=H}}return I};y.getPlaylistItem=function(H){if(!a.exists(H)){H=y.getCurrentItem()}return y.getPlaylist()[H]};y.getPosition=function(){return x("jwGetPosition")};y.getRenderingMode=function(){return y.renderingMode};y.getState=function(){return x("jwGetState")};y.getVolume=function(){return x("jwGetVolume")};y.getWidth=function(){return x("jwGetWidth")};y.setFullscreen=function(H){if(!a.exists(H)){x("jwSetFullscreen",!x("jwGetFullscreen"))}else{x("jwSetFullscreen",H)}return y};y.setStretching=function(H){x("jwSetStretching",H);return y};y.setMute=function(H){if(!a.exists(H)){x("jwSetMute",!x("jwGetMute"))}else{x("jwSetMute",H)}return y};y.lock=function(){return y};y.unlock=function(){return y};y.load=function(H){x("jwLoad",H);return y};y.playlistItem=function(H){x("jwPlaylistItem",H);return y};y.playlistPrev=function(){x("jwPlaylistPrev");return y};y.playlistNext=function(){x("jwPlaylistNext");return y};y.resize=function(I,H){if(y.renderingMode=="html5"){h.jwResize(I,H)}else{var J=document.getElementById(y.id+"_wrapper");if(J){J.style.width=a.styleDimension(I);J.style.height=a.styleDimension(H)}}return y};y.play=function(H){if(typeof H=="undefined"){H=y.getState();if(H==b.PLAYING||H==b.BUFFERING){x("jwPause")}else{x("jwPlay")}}else{x("jwPlay",H)}return y};y.pause=function(H){if(typeof H=="undefined"){H=y.getState();if(H==b.PLAYING||H==b.BUFFERING){x("jwPause")}else{x("jwPlay")}}else{x("jwPause",H)}return y};y.stop=function(){x("jwStop");return y};y.seek=function(H){x("jwSeek",H);return y};y.setVolume=function(H){x("jwSetVolume",H);return y};y.loadInstream=function(I,H){A=new f.instream(this,h,I,H);return A};y.getQualityLevels=function(){return x("jwGetQualityLevels")};y.getCurrentQuality=function(){return x("jwGetCurrentQuality")};y.setCurrentQuality=function(H){x("jwSetCurrentQuality",H)};var s={onBufferChange:e.JWPLAYER_MEDIA_BUFFER,onBufferFull:e.JWPLAYER_MEDIA_BUFFER_FULL,onError:e.JWPLAYER_ERROR,onFullscreen:e.JWPLAYER_FULLSCREEN,onMeta:e.JWPLAYER_MEDIA_META,onMute:e.JWPLAYER_MEDIA_MUTE,onPlaylist:e.JWPLAYER_PLAYLIST_LOADED,onPlaylistItem:e.JWPLAYER_PLAYLIST_ITEM,onReady:e.API_READY,onResize:e.JWPLAYER_RESIZE,onComplete:e.JWPLAYER_MEDIA_COMPLETE,onSeek:e.JWPLAYER_MEDIA_SEEK,onTime:e.JWPLAYER_MEDIA_TIME,onVolume:e.JWPLAYER_MEDIA_VOLUME,onBeforePlay:e.JWPLAYER_MEDIA_BEFOREPLAY,onBeforeComplete:e.JWPLAYER_MEDIA_BEFORECOMPLETE,onDisplayClick:e.JWPLAYER_DISPLAY_CLICK,onQualityLevels:e.JWPLAYER_MEDIA_LEVELS,onQualityChange:e.JWPLAYER_MEDIA_LEVEL_CHANGED};for(var z in s){y[z]=E(s[z],B)}var w={onBuffer:b.BUFFERING,onPause:b.PAUSED,onPlay:b.PLAYING,onIdle:b.IDLE};for(var k in w){y[k]=E(w[k],r)}function E(H,I){return function(J){return I(H,J)}}y.remove=function(){if(!F){throw"Cannot call remove() before player is ready";return}n(this)};function n(H){q=[];f.destroyPlayer(H.id)}y.setup=function(H){if(d.embed){n(y);if(a.clearCss){a.clearCss("#"+y.id)}var I=d(y.id);I.config=H;return new d.embed(I)}return y};y.registerPlugin=function(J,I,H){d.plugins.registerPlugin(J,I,H)};y.setPlayer=function(H,I){h=H;y.renderingMode=I};y.detachMedia=function(){if(y.renderingMode=="html5"){return x("jwDetachMedia")}};y.attachMedia=function(){if(y.renderingMode=="html5"){return x("jwAttachMedia")}};function r(H,I){if(!m[H]){m[H]=[];B(e.JWPLAYER_PLAYER_STATE,G(H))}m[H].push(I);return y}function G(H){return function(J){var I=J.newstate,L=J.oldstate;if(I==H){var K=m[I];if(K){for(var M=0;M<K.length;M++){if(typeof K[M]=="function"){K[M].call(this,{oldstate:L,newstate:I})}}}}}}function D(H,I,J){if(!C[H]){C[H]={}}if(!C[H][I]){C[H][I]=[];B(I,l(H,I))}C[H][I].push(J);return y}function l(H,I){return function(K){if(H==K.component){var J=C[H][I];if(J){for(var L=0;L<J.length;L++){if(typeof J[L]=="function"){J[L].call(this,K)}}}}}}function j(H,I){try{H.jwAddEventListener(I,'function(dat) { jwplayer("'+y.id+'").dispatchEvent("'+I+'", dat); }')}catch(J){a.log("Could not add internal listener")}}function B(H,I){if(!g[H]){g[H]=[];if(h&&F){j(h,H)}}g[H].push(I);return y}y.dispatchEvent=function(J){if(g[J]){var I=a.translateEventResponse(J,arguments[1]);for(var H=0;H<g[J].length;H++){if(typeof g[J][H]=="function"){g[J][H].call(this,I)}}}};y.dispatchInstreamEvent=function(H){if(A){A.dispatchEvent(H,arguments)}};function x(){if(F){var J=arguments[0],H=[];for(var I=1;I<arguments.length;I++){H.push(arguments[I])}if(typeof h!="undefined"&&typeof h[J]=="function"){if(H.length==2){return(h[J])(H[0],H[1])}else{if(H.length==1){return(h[J])(H[0])}else{return(h[J])()}}}return null}else{q.push(arguments)}}y.playerReady=function(I){F=true;if(!h){y.setPlayer(document.getElementById(I.id))}y.container=document.getElementById(y.id);for(var H in g){j(h,H)}B(e.JWPLAYER_PLAYLIST_ITEM,function(J){t={}});B(e.JWPLAYER_MEDIA_META,function(J){a.extend(t,J.metadata)});y.dispatchEvent(e.API_READY);while(q.length>0){x.apply(this,q.shift())}};y.getItemMeta=function(){return t};y.getCurrentItem=function(){return x("jwGetPlaylistIndex")};function v(J,L,K){var H=[];if(!L){L=0}if(!K){K=J.length-1}for(var I=L;I<=K;I++){H.push(J[I])}return H}return y};f.selectPlayer=function(h){var g;if(!a.exists(h)){h=0}if(h.nodeType){g=h}else{if(typeof h=="string"){g=document.getElementById(h)}}if(g){var i=f.playerById(g.id);if(i){return i}else{return f.addPlayer(new f(g))}}else{if(typeof h=="number"){return c[h]}}return null};f.playerById=function(h){for(var g=0;g<c.length;g++){if(c[g].id==h){return c[g]}}return null};f.addPlayer=function(g){for(var h=0;h<c.length;h++){if(c[h]==g){return g}}c.push(g);return g};f.destroyPlayer=function(i){var h=-1;for(var k=0;k<c.length;k++){if(c[k].id==i){h=k;continue}}if(h>=0){var l=c[h].id,g=document.getElementById(l+"_wrapper");if(!g){g=document.getElementById(l)}if(g){var j=document.createElement("div");j.id=l;g.parentNode.replaceChild(j,g)}c.splice(h,1)}return null}})(jwplayer);var _userPlayerReady=(typeof playerReady=="function")?playerReady:undefined;playerReady=function(b){var a=jwplayer.api.playerById(b.id);if(a){a.playerReady(b)}else{jwplayer.api.selectPlayer(b.id).playerReady(b)}if(_userPlayerReady){_userPlayerReady.call(this,b)}};(function(b){var c=b.events,a=c.state;b.api.instream=function(e,k,o,r){var j=e,d=k,i=o,l=r,g={},q={};function h(){j.callInternal("jwLoadInstream",o,r)}function n(s,t){d.jwInstreamAddEventListener(t,'function(dat) { jwplayer("'+j.id+'").dispatchInstreamEvent("'+t+'", dat); }')}function f(s,t){if(!g[s]){g[s]=[];n(d,s)}g[s].push(t);return this}function p(s,t){if(!q[s]){q[s]=[];f(c.JWPLAYER_PLAYER_STATE,m(s))}q[s].push(t);return this}function m(s){return function(u){var t=u.newstate,w=u.oldstate;if(t==s){var v=q[t];if(v){for(var x=0;x<v.length;x++){if(typeof v[x]=="function"){v[x].call(this,{oldstate:w,newstate:t,type:u.type})}}}}}}this.dispatchEvent=function(v,u){if(g[v]){var t=_utils.translateEventResponse(v,u[1]);for(var s=0;s<g[v].length;s++){if(typeof g[v][s]=="function"){g[v][s].call(this,t)}}}};this.onError=function(s){return f(c.JWPLAYER_ERROR,s)};this.onFullscreen=function(s){return f(c.JWPLAYER_FULLSCREEN,s)};this.onMeta=function(s){return f(c.JWPLAYER_MEDIA_META,s)};this.onMute=function(s){return f(c.JWPLAYER_MEDIA_MUTE,s)};this.onComplete=function(s){return f(c.JWPLAYER_MEDIA_COMPLETE,s)};this.onSeek=function(s){return f(c.JWPLAYER_MEDIA_SEEK,s)};this.onTime=function(s){return f(c.JWPLAYER_MEDIA_TIME,s)};this.onVolume=function(s){return f(c.JWPLAYER_MEDIA_VOLUME,s)};this.onBuffer=function(s){return p(a.BUFFERING,s)};this.onPause=function(s){return p(a.PAUSED,s)};this.onPlay=function(s){return p(a.PLAYING,s)};this.onIdle=function(s){return p(a.IDLE,s)};this.onInstreamClick=function(s){return f(c.JWPLAYER_INSTREAM_CLICK,s)};this.onInstreamDestroyed=function(s){return f(c.JWPLAYER_INSTREAM_DESTROYED,s)};this.play=function(s){d.jwInstreamPlay(s)};this.pause=function(s){d.jwInstreamPause(s)};this.seek=function(s){d.jwInstreamSeek(s)};this.destroy=function(){d.jwInstreamDestroy()};this.getState=function(){return d.jwInstreamGetState()};this.getDuration=function(){return d.jwInstreamGetDuration()};this.getPosition=function(){return d.jwInstreamGetPosition()};h()}})(jwplayer)}; -
branches/jw6/src/flash/com/longtailvideo/jwplayer/controller/Controller.as
r2192 r2217 93 93 94 94 95 /** A list with legacy CDN classes that are now redirected to buit-in ones. **/96 protected var cdns:Object = {97 bitgravity:{'http.startparam':'starttime', provider:'http'},98 edgecast:{'http.startparam':'ec_seek', provider:'http'},99 flvseek:{'http.startparam':'fs', provider:'http'},100 highwinds:{'rtmp.loadbalance':true, provider:'rtmp'},101 lighttpd:{'http.startparam':'start', provider:'http'},102 vdox:{'rtmp.loadbalance':true, provider:'rtmp'}103 };104 105 95 /** Reference to a PlaylistItem which has triggered an external MediaProvider load **/ 106 96 protected var _delayedItem:PlaylistItem; … … 199 189 _playlistReady = true; 200 190 201 if (_model.config.shuffle) { 202 shuffleItem(); 203 } else { 204 if (_model.config.item >= _model.playlist.length) { 205 _model.config.item = _model.playlist.length - 1; 206 } 207 _model.playlist.currentIndex = _model.config.item; 208 } 191 if (_model.config.item >= _model.playlist.length) { 192 _model.config.item = _model.playlist.length - 1; 193 } 194 _model.playlist.currentIndex = _model.config.item; 209 195 210 196 if(_model.config.autostart) { … … 218 204 219 205 220 protected function shuffleItem():void {221 _model.playlist.currentIndex = Math.floor(Math.random() * _model.playlist.length);222 }223 224 225 206 protected function playlistItemHandler(evt:PlaylistEvent):void { 226 207 _model.config.item = _model.playlist.currentIndex; … … 253 234 break; 254 235 case RepeatOptions.ALWAYS: 255 if (_model.playlist.currentIndex == _model.playlist.length - 1 && !_model.config.shuffle) {236 if (_model.playlist.currentIndex == _model.playlist.length - 1) { 256 237 _model.playlist.currentIndex = 0; 257 238 play(); … … 261 242 break; 262 243 case RepeatOptions.LIST: 263 if (_model.playlist.currentIndex == _model.playlist.length - 1 && !_model.config.shuffle) {244 if (_model.playlist.currentIndex == _model.playlist.length - 1) { 264 245 _lockingResume = false; 265 246 _model.playlist.currentIndex = 0; … … 479 460 _lockingResume = true; 480 461 stop(); 481 if (_model.config.shuffle) { 482 shuffleItem(); 483 } else if (_model.playlist.currentIndex == _model.playlist.length - 1) { 462 if (_model.playlist.currentIndex == _model.playlist.length - 1) { 484 463 _player.playlist.currentIndex = 0; 485 464 } else { … … 500 479 _lockingResume = true; 501 480 stop(); 502 if (_model.config.shuffle) { 503 shuffleItem(); 504 } else if (_model.playlist.currentIndex <= 0) { 481 if (_model.playlist.currentIndex <= 0) { 505 482 _model.playlist.currentIndex = _model.playlist.length - 1; 506 483 } else { … … 652 629 if (provider) { 653 630 654 // Backwards compatibility for CDNs in the 'type' flashvar.655 if (cdns.hasOwnProperty(provider)) {656 _model.config.setConfig(cdns[provider]);657 provider = cdns[provider]['provider'];658 }659 660 631 // If the model doesn't have an instance of the provider, load & instantiate it 661 632 if (!_model.hasMediaProvider(provider)) { -
branches/jw6/src/flash/com/longtailvideo/jwplayer/controller/MediaProviderLoader.as
r2192 r2217 1 1 package com.longtailvideo.jwplayer.controller { 2 import com.longtailvideo.jwplayer.media. MediaProvider;2 import com.longtailvideo.jwplayer.media.IMediaProvider; 3 3 import com.longtailvideo.jwplayer.utils.AssetLoader; 4 4 … … 28 28 private var repository:String = "http://providers.longtailvideo.com/5/"; 29 29 30 public var loadedSource: MediaProvider;30 public var loadedSource:IMediaProvider; 31 31 32 32 /** 33 * Loads a SWF file whose document class extends MediaProvider.33 * Loads a SWF file whose document class implements MediaProvider. 34 34 */ 35 35 public function loadSource(url:String):void { … … 47 47 var loader:AssetLoader = evt.target as AssetLoader; 48 48 try { 49 loadedSource = loader.loadedObject as MediaProvider;49 loadedSource = loader.loadedObject as IMediaProvider; 50 50 if (loadedSource) { 51 51 dispatchEvent(new Event(Event.COMPLETE)); -
branches/jw6/src/flash/com/longtailvideo/jwplayer/controller/PlayerSetup.as
r2199 r2217 124 124 } 125 125 126 protected function loadSkin( evt:ErrorEvent=null):void {126 protected function loadSkin():void { 127 127 var skin:ISkin; 128 if (confHash && confHash['skin'] && evt == null) {128 if (confHash && confHash['skin']) { 129 129 if (Strings.extension(confHash['skin']) == "zip") { 130 130 skin = new ZIPSkin(); … … 132 132 skin = new PNGSkin(); 133 133 } else { 134 Logger.log("Could not load skin " + confHash['skin']);134 tasker.failure(new ErrorEvent(ErrorEvent.ERROR, false, false, "Skin could not be loaded: Invalid file type")); 135 135 } 136 } 137 if (skin) { 138 // If this step fails, load the default skin instead 139 skin.addEventListener(ErrorEvent.ERROR, loadSkin); 140 } else { 141 if (evt) { 142 Logger.log("Error loading skin: " + evt.text); 143 (evt.target as EventDispatcher).removeEventListener(ErrorEvent.ERROR, loadSkin); 144 } 136 } else { 145 137 skin = new DefaultSkin(); 146 skin.addEventListener(ErrorEvent.ERROR, tasker.failure);147 }138 } 139 skin.addEventListener(ErrorEvent.ERROR, tasker.failure); 148 140 skin.addEventListener(Event.COMPLETE, tasker.success); 149 141 skin.load(confHash['skin']); -
branches/jw6/src/flash/com/longtailvideo/jwplayer/controller/PluginLoader.as
r2192 r2217 9 9 import flash.events.EventDispatcher; 10 10 import flash.utils.Dictionary; 11 12 import mx.core.IFlexDisplayObject; 11 13 12 14 /** … … 35 37 36 38 private var loaders:Dictionary; 39 40 // So plugins can embed assets 41 private var flexDisplay:IFlexDisplayObject; 37 42 38 43 protected function get pluginRepository():String { … … 67 72 var loader:AssetLoader = new AssetLoader(); 68 73 loader.addEventListener(Event.COMPLETE, loadSuccess); 69 loader.addEventListener(ErrorEvent.ERROR, loadLocalFailed);74 loader.addEventListener(ErrorEvent.ERROR, pluginLoadFailed); 70 75 loaders[loader] = plugin; 71 76 loader.load(plugin); … … 75 80 } 76 81 77 private function loadLocalFailed(evt:ErrorEvent):void {78 var loader:AssetLoader = evt.target as AssetLoader;79 var plugin:String = loaders[loader];80 loader.removeEventListener(ErrorEvent.ERROR, loadLocalFailed);81 delete loaders[loader];82 checkComplete();83 }84 85 82 private function loadV5Plugin(plugin:String):void { 86 83 var loader:AssetLoader = new AssetLoader(); 87 84 loader.addEventListener(Event.COMPLETE, loadSuccess); 88 loader.addEventListener(ErrorEvent.ERROR, loadV5Failed);85 loader.addEventListener(ErrorEvent.ERROR, pluginLoadFailed); 89 86 90 87 var split:Array = plugin.substr(plugin.lastIndexOf("/")+1).replace(/(.*)\.swf$/i, "$1").split("-"); … … 97 94 } 98 95 99 private function loadV5Failed(evt:ErrorEvent):void { 100 var loader:AssetLoader = evt.target as AssetLoader; 101 var url:String = loaders[loader] as String; 102 loader.removeEventListener(ErrorEvent.ERROR, loadV5Failed); 103 delete loaders[loader]; 104 loadV4Plugin(url); 96 private function pluginLoadFailed(evt:ErrorEvent):void { 97 dispatchEvent(new ErrorEvent(ErrorEvent.ERROR, false, false, "Error loading plugin: Plugin file not found")); 105 98 } 106 99 107 private function loadV4Plugin(plugin:String):void {108 var loader:AssetLoader = new AssetLoader();109 loader.addEventListener(Event.COMPLETE, loadSuccess);110 loader.addEventListener(ErrorEvent.ERROR, loadV4Failed);111 loaders[loader] = plugin;112 113 if (Strings.extension(plugin) == "swf") { plugin = plugin.substring(0, plugin.length-4); }114 loader.load(pluginRepository + '4/' + plugin + ".swf");115 }116 117 private function loadV4Failed(evt:ErrorEvent):void {118 var loader:AssetLoader = evt.target as AssetLoader;119 delete loaders[loader];120 checkComplete();121 }122 123 100 private function loadSuccess(evt:Event):void { 124 101 var loader:AssetLoader = evt.target as AssetLoader; -
branches/jw6/src/flash/com/longtailvideo/jwplayer/events/MediaEvent.as
r2192 r2217 192 192 public static var JWPLAYER_MEDIA_BEFORECOMPLETE:String = "jwplayerMediaBeforeComplete"; 193 193 /** 194 * The <code>MediaEvent.JWPLAYER_MEDIA_MUTE</code> constant defines the value of the195 * <code>type</code> property of the event object for a <code>jwplayerMediaMute</code> event.196 *197 * <p>The properties of the event object have the following values:</p> 198 * <table class="innertable">199 * <tr><th>Property</th><th>Value</th></tr>200 * <tr><td><code>id</code></td><td>ID of the player in the HTML DOM. Used by javascript to reference the player.</td></tr>201 * <tr><td><code>client</code></td><td>A string representing the client the player runs in (e.g. FLASH WIN 9,0,115,0).</td></tr>202 * <tr><td><code>version</code></td><td>A string representing the major version, minor version and revision number of the player (e.g. 5.0.395).</td></tr>203 * <tr><td><code>duration</code></td><td>The current playback volume, between 0 and 100.</td></tr>204 * </table>205 *206 * @eventType jwplayerMediaMute194 * The <code>MediaEvent.JWPLAYER_MEDIA_MUTE</code> constant defines the value of the 195 * <code>type</code> property of the event object for a <code>jwplayerMediaMute</code> event. 196 * 197 * <p>The properties of the event object have the following values:</p> 198 * <table class="innertable"> 199 * <tr><th>Property</th><th>Value</th></tr> 200 * <tr><td><code>id</code></td><td>ID of the player in the HTML DOM. Used by javascript to reference the player.</td></tr> 201 * <tr><td><code>client</code></td><td>A string representing the client the player runs in (e.g. FLASH WIN 9,0,115,0).</td></tr> 202 * <tr><td><code>version</code></td><td>A string representing the major version, minor version and revision number of the player (e.g. 5.0.395).</td></tr> 203 * <tr><td><code>duration</code></td><td>The current playback volume, between 0 and 100.</td></tr> 204 * </table> 205 * 206 * @eventType jwplayerMediaMute 207 207 */ 208 208 public static var JWPLAYER_MEDIA_MUTE:String = "jwplayerMediaMute"; 209 /** 210 * The <code>MediaEvent.JWPLAYER_MEDIA_LEVELS</code> constant defines the value of the 211 * <code>type</code> property of the event object for a <code>jwplayerMediaLevels</code> event. 212 * 213 * <p>The properties of the event object have the following values:</p> 214 * <table class="innertable"> 215 * <tr><th>Property</th><th>Value</th></tr> 216 * <tr><td><code>id</code></td><td>ID of the player in the HTML DOM. Used by javascript to reference the player.</td></tr> 217 * <tr><td><code>client</code></td><td>A string representing the client the player runs in (e.g. FLASH WIN 9,0,115,0).</td></tr> 218 * <tr><td><code>version</code></td><td>A string representing the major version, minor version and revision number of the player (e.g. 5.0.395).</td></tr> 219 * <tr><td><code>levels</code></td><td>An array of quality levels</td></tr> 220 * <tr><td><code>currentQuality</code></td><td>The current level; A value of -1 means the level is automatically selected</td></tr> 221 * </table> 222 * 223 * @eventType jwplayerMediaMute 224 */ 225 public static var JWPLAYER_MEDIA_LEVELS:String = "jwplayerMediaLevels"; 226 /** 227 * The <code>MediaEvent.JWPLAYER_MEDIA_LEVEL_CHANGED</code> constant defines the value of the 228 * <code>type</code> property of the event object for a <code>jwplayerMediaLevelChanged</code> event. 229 * 230 * <p>The properties of the event object have the following values:</p> 231 * <table class="innertable"> 232 * <tr><th>Property</th><th>Value</th></tr> 233 * <tr><td><code>id</code></td><td>ID of the player in the HTML DOM. Used by javascript to reference the player.</td></tr> 234 * <tr><td><code>client</code></td><td>A string representing the client the player runs in (e.g. FLASH WIN 9,0,115,0).</td></tr> 235 * <tr><td><code>version</code></td><td>A string representing the major version, minor version and revision number of the player (e.g. 5.0.395).</td></tr> 236 * <tr><td><code>levels</code></td><td>An array of quality levels</td></tr> 237 * <tr><td><code>currentQuality</code></td><td>The current level; A value of -1 means the level is automatically selected</td></tr> 238 * </table> 239 * 240 * @eventType jwplayerMediaMute 241 */ 242 public static var JWPLAYER_MEDIA_LEVEL_CHANGED:String = "jwplayerMediaLevelChanged"; 209 243 210 244 public var bufferPercent:Number = -1; … … 215 249 public var volume:Number = -1; 216 250 public var mute:Boolean = false; 251 public var levels:Array = null; 252 public var currentQuality:Number = -1; 217 253 218 254 public function MediaEvent(type:String) { … … 229 265 evt.volume = this.volume; 230 266 evt.mute = this.mute; 267 evt.levels = this.levels; 268 evt.currentQuality = this.currentQuality; 231 269 return evt; 232 270 } … … 246 284 if (volume != defaults.volume) retString += ' volume="' + volume + '"'; 247 285 if (mute != defaults.mute) retString += ' mute="' + mute + '"'; 286 if (levels != defaults.levels) retString += ' levels="' + levels + '"'; 287 if (currentQuality != defaults.currentQuality) retString += ' currentQuality="' + currentQuality + '"'; 248 288 if (message != defaults.message) retString += ' message="' + message + '"'; 249 289 -
branches/jw6/src/flash/com/longtailvideo/jwplayer/media/HTTPMediaProvider.as
r2192 r2217 124 124 _bandwidthSwitch = false; 125 125 _bandwidthChecked = false; 126 if (item.currentLevel != item.getLevel(config.bandwidth, config.width)) {126 if (item.currentLevel != getLevel(item, config.bandwidth, config.width)) { 127 127 load(item); 128 128 return; … … 227 227 _bufferingComplete = false; 228 228 229 if (item.levels.length > 0) { item.setLevel( item.getLevel(config.bandwidth, config.width)); }229 if (item.levels.length > 0) { item.setLevel(getLevel(item, config.bandwidth, config.width)); } 230 230 231 231 _stream.play(getURL()); … … 359 359 override public function resize(width:Number, height:Number):void { 360 360 super.resize(width, height); 361 if (state != PlayerState.IDLE && item.levels.length > 0 && item.getLevel(config.bandwidth, config.width) != item.currentLevel) {361 if (state != PlayerState.IDLE && item.levels.length > 0 && getLevel(item, config.bandwidth, config.width) != item.currentLevel) { 362 362 _byteoffset = getOffset(position); 363 363 _timeoffset = _position = getOffset(position,true); -
branches/jw6/src/flash/com/longtailvideo/jwplayer/media/MediaProvider.as
r2192 r2217 6 6 import com.longtailvideo.jwplayer.model.PlayerConfig; 7 7 import com.longtailvideo.jwplayer.model.PlaylistItem; 8 import com.longtailvideo.jwplayer.model.PlaylistItemLevel; 8 9 import com.longtailvideo.jwplayer.player.PlayerState; 9 10 import com.longtailvideo.jwplayer.utils.Stretcher; … … 58 59 [Event(name="jwplayerMediaComplete", type="com.longtailvideo.jwplayer.events.MediaEvent")] 59 60 /** 61 * Fired when the currently playing media exposes different quality levels 62 * 63 * @eventType com.longtailvideo.jwplayer.events.MediaEvent.JWPLAYER_MEDIA_LEVELS 64 */ 65 [Event(name="jwplayerMediaLevels", type="com.longtailvideo.jwplayer.events.MediaEvent")] 66 /** 67 * Fired when the currently quality level has changed 68 * 69 * @eventType com.longtailvideo.jwplayer.events.MediaEvent.JWPLAYER_MEDIA_LEVEL_CHANGED 70 */ 71 [Event(name="jwplayerMediaLevelChanged", type="com.longtailvideo.jwplayer.events.MediaEvent")] 72 /** 60 73 * Sent when the playback state has changed. 61 74 * … … 64 77 [Event(name="jwplayerPlayerState", type="com.longtailvideo.jwplayer.events.PlayerStateEvent")] 65 78 66 public class MediaProvider extends Sprite implements I GlobalEventDispatcher {79 public class MediaProvider extends Sprite implements IMediaProvider { 67 80 /** Reference to the player configuration. **/ 68 81 private var _config:PlayerConfig; … … 87 100 /** Queue buffer full event if it occurs while the player is paused. **/ 88 101 private var _queuedBufferFull:Boolean; 89 102 /** Current quality level **/ 103 protected var _currentQuality:Number = -1; 90 104 91 105 protected var _width:Number; … … 364 378 } 365 379 380 381 /** 382 * Current quality level getter 383 **/ 384 public function get currentQuality():Number { 385 return _currentQuality; 386 } 387 388 /** 389 * Current quality level setter 390 **/ 391 public function set currentQuality(quality:Number):void { 392 _currentQuality = quality; 393 } 394 395 /** Quality levels (must be overridden by inheritors **/ 396 public function get qualityLevels():Array { 397 return null; 398 } 399 400 private function qualityLabel(level:PlaylistItemLevel):String { 401 if (level.label) return level.label; 402 else if (level.height) return level.height + "p"; 403 else if (level.width) return (level.width * 9 / 16) + "p"; 404 else if (level.bitrate) return level.bitrate + "kbps"; 405 else return ""; 406 } 407 408 protected function sendQualityEvent(type, levels:Array, quality:Number):void { 409 var qualityEvent:MediaEvent = new MediaEvent(type); 410 qualityEvent.levels = []; 411 for (var i:Number=0; i<levels.length; i++) { 412 var translatedLevel:Object = { 413 label: qualityLabel(levels[i]) ? qualityLabel(levels[i]) : i 414 }; 415 if (levels[i].width) translatedLevel.width = levels[i].width; 416 if (levels[i].height) translatedLevel.height = levels[i].height; 417 if (levels[i].bitrate) translatedLevel.bitrate = levels[i].bitrate; 418 qualityEvent.levels.push(translatedLevel); 419 } 420 qualityEvent.currentQuality = quality; 421 dispatchEvent(qualityEvent); 422 } 423 424 protected function getLevel(item:PlaylistItem, bitrate:Number, width:Number):Number { 425 for (var i:Number=0; i < item.levels.length; i++) { 426 var level:PlaylistItemLevel = item.levels[i] as PlaylistItemLevel; 427 if ((isNaN(level.bitrate) || bitrate >= level.bitrate * 1.5) && (isNaN(level.width) || width >= level.width * 0.67) && !level.blacklisted) { 428 return i; 429 } 430 } 431 return item.levels.length - 1; 432 } 433 434 435 436 366 437 /////////////////////////////////////////// 367 438 /// IGlobalEventDispatcher implementation -
branches/jw6/src/flash/com/longtailvideo/jwplayer/media/RTMPMediaProvider.as
r2192 r2217 228 228 drf = Math.round((_streamInfo[len-1].drf - _streamInfo[len-3].drf)*5)/10; 229 229 } 230 if(item.levels.length > 0 && item.getLevel(bwd,config.width) != item.currentLevel) {230 if(item.levels.length > 0 && getLevel(item, bwd,config.width) != item.currentLevel) { 231 231 Logger.log("swapping to another level b/c of bandwidth",bwd.toString()); 232 swap( item.getLevel(bwd, config.width));232 swap(getLevel(item, bwd, config.width)); 233 233 } 234 234 if(item.levels.length > 0 && drf > 10 && item.currentLevel < item.levels.length-1) { … … 238 238 sendMediaEvent(MediaEvent.JWPLAYER_MEDIA_META, {metadata: {type:'blacklist',level:lvl,state:true}}); 239 239 Logger.log("swapping to another level b/c of framedrops",drf.toString()); 240 swap( item.getLevel(bwd, config.width));240 swap(getLevel(item, bwd, config.width)); 241 241 } 242 242 sendMediaEvent(MediaEvent.JWPLAYER_MEDIA_META, {metadata: {bandwidth:bwd,droppedFrames:drf}}); … … 285 285 } 286 286 287 if (item.levels.length > 0) { item.setLevel( item.getLevel(config.bandwidth, config.width)); }287 if (item.levels.length > 0) { item.setLevel(getLevel(item, config.bandwidth, config.width)); } 288 288 289 289 clearInterval(_positionInterval); … … 350 350 item.clearLevels() 351 351 for(var i:Number=0; i<arr.length; i++) { item.addLevel(arr[i]); } 352 item.setLevel( item.getLevel(config.bandwidth, config.width));352 item.setLevel(getLevel(item, config.bandwidth, config.width)); 353 353 } else if (item.levels.length > 0) { 354 354 var level:PlaylistItemLevel = item.levels[(item.smil as Array).indexOf(smilLocation)] as PlaylistItemLevel; … … 473 473 super.resize(width, height); 474 474 if (state == PlayerState.PLAYING) { 475 if (item.levels.length > 0 && item.currentLevel != item.getLevel(config.bandwidth, config.width)) {475 if (item.levels.length > 0 && item.currentLevel != getLevel(item, config.bandwidth, config.width)) { 476 476 if (_dynamic) { 477 477 Logger.log("swapping to another level b/c of size: "+config.width); 478 swap( item.getLevel(config.bandwidth, config.width));478 swap(getLevel(item, config.bandwidth, config.width)); 479 479 } else { 480 480 seek(position); … … 493 493 _timeoffset = pos; 494 494 clearInterval(_positionInterval); 495 if (item.levels.length > 0 && item.getLevel(config.bandwidth, config.width) != item.currentLevel) {496 item.setLevel( item.getLevel(config.bandwidth, config.width));495 if (item.levels.length > 0 && getLevel(item, config.bandwidth, config.width) != item.currentLevel) { 496 item.setLevel(getLevel(item, config.bandwidth, config.width)); 497 497 if (_loadbalanceOnSwitch) { 498 498 load(item); -
branches/jw6/src/flash/com/longtailvideo/jwplayer/media/VideoMediaProvider.as
r2203 r2217 3 3 import com.longtailvideo.jwplayer.model.PlayerConfig; 4 4 import com.longtailvideo.jwplayer.model.PlaylistItem; 5 import com.longtailvideo.jwplayer.model.PlaylistItemLevel; 5 6 import com.longtailvideo.jwplayer.player.PlayerState; 6 7 import com.longtailvideo.jwplayer.utils.Configger; … … 40 41 /** Bandwidth check interval **/ 41 42 private var _bandwidthTimeout:Number = 2000; 43 /** Whether the quality levels have been sent out **/ 44 private var _qualitySent:Boolean = false; 42 45 43 46 /** Constructor; sets up the connection and display. **/ … … 76 79 _bufferingComplete = false; 77 80 if (itm.levels.length > 0) { 78 itm.setLevel(itm.getLevel(config.bandwidth, config.width)); 79 _bandwidthChecked = false; 81 if (currentQuality < 0) { 82 itm.setLevel(getLevel(itm, config.bandwidth, config.width)); 83 _bandwidthChecked = false; 84 } 80 85 } else { 81 86 _bandwidthChecked = true; 87 } 88 if (itm.levels.length > 0) { 89 if (!_qualitySent) { 90 _qualitySent = true; 91 sendQualityEvent(MediaEvent.JWPLAYER_MEDIA_LEVELS, itm.levels, _currentQuality); 92 } 82 93 } 83 94 … … 222 233 if (_bandwidthSwitch) { 223 234 _bandwidthSwitch = false; 224 if (item.currentLevel != item.getLevel(config.bandwidth, config.width)) {235 if (item.currentLevel != getLevel(item, config.bandwidth, config.width)) { 225 236 load(item); 226 237 return; … … 257 268 break; 258 269 case "NetStream.Play.StreamNotFound": 259 error(' Video not found or access denied: ' + item.file);270 error('Error loading media: File not found'); 260 271 break; 261 272 } … … 274 285 clearInterval(_positionInterval); 275 286 _positionInterval = undefined; 287 _qualitySent = false; 276 288 super.stop(); 277 289 } … … 291 303 } 292 304 } 305 306 307 308 override public function set currentQuality(quality:Number):void { 309 if (quality == _currentQuality) return; 310 if (!_item) return; 311 312 if (quality >= 0) { 313 if (_item.levels.length > quality && _item.currentLevel != quality) { 314 _item.setLevel(quality); 315 _currentQuality = quality; 316 sendQualityEvent(MediaEvent.JWPLAYER_MEDIA_LEVEL_CHANGED, _item.levels, _currentQuality); 317 load(_item); 318 } 319 } else { 320 var autoLevel:Number = getLevel(_item, config.bandwidth, config.width); 321 if (autoLevel != _item.currentLevel) { 322 _item.setLevel(autoLevel); 323 load(_item); 324 } 325 } 326 } 327 328 override public function get qualityLevels():Array { 329 if (_item) { 330 return _item.levels; 331 } else return null; 332 } 333 293 334 } 294 335 } -
branches/jw6/src/flash/com/longtailvideo/jwplayer/model/Model.as
r2196 r2217 5 5 import com.longtailvideo.jwplayer.events.PlayerStateEvent; 6 6 import com.longtailvideo.jwplayer.media.HTTPMediaProvider; 7 import com.longtailvideo.jwplayer.media.IMediaProvider; 7 8 import com.longtailvideo.jwplayer.media.MediaProvider; 8 9 import com.longtailvideo.jwplayer.media.RTMPMediaProvider; … … 90 91 protected var _fullscreen:Boolean = false; 91 92 92 protected var _currentMedia: MediaProvider;93 protected var _currentMedia:IMediaProvider; 93 94 94 95 protected var _mediaSources:Object; … … 113 114 114 115 /** The currently loaded MediaProvider **/ 115 public function get media(): MediaProvider {116 public function get media():IMediaProvider { 116 117 return _currentMedia; 117 118 } … … 176 177 */ 177 178 public function hasMediaProvider(type:String):Boolean { 178 return (_mediaSources[url2type(type)] is MediaProvider);179 return (_mediaSources[url2type(type)] is IMediaProvider); 179 180 } 180 181 … … 182 183 * Add a MediaProvider to the list of available sources. 183 184 */ 184 public function setMediaProvider(type:String, provider: MediaProvider):void {185 public function setMediaProvider(type:String, provider:IMediaProvider):void { 185 186 if (!hasMediaProvider(type)) { 186 187 _mediaSources[url2type(type)] = provider; … … 193 194 type = "video"; 194 195 195 var newMedia: MediaProvider = _mediaSources[url2type(type)] asMediaProvider;196 var newMedia:IMediaProvider = _mediaSources[url2type(type)] as IMediaProvider; 196 197 197 198 if (_currentMedia != newMedia) { -
branches/jw6/src/flash/com/longtailvideo/jwplayer/model/PlayerConfig.as
r2199 r2217 75 75 for (var i:Number = 0; i < (config[item] as Array).length; i++) { 76 76 var level:Object = config[item][i]; 77 _singleItem.addLevel(new PlaylistItemLevel(level.file, level. bitrate, level.width, level.streamer));77 _singleItem.addLevel(new PlaylistItemLevel(level.file, level.type, level.bitrate, level.width, level.streamer)); 78 78 } 79 79 } -
branches/jw6/src/flash/com/longtailvideo/jwplayer/model/Playlist.as
r2192 r2217 131 131 load(playlistItems); 132 132 } else { 133 playlistError(" XML could not be parsed or playlist was empty");134 } 135 } else { 136 playlistError("Playlist file did not contain a valid playlist");133 playlistError("Loaded playlist is empty"); 134 } 135 } else { 136 playlistError("Playlist is not a valid RSS feed"); 137 137 } 138 138 } -
branches/jw6/src/flash/com/longtailvideo/jwplayer/model/PlaylistItem.as
r2203 r2217 24 24 protected var _streamer:String = ""; 25 25 26 protected var _currentLevel:Number = -1; 26 protected var _type:String = null; 27 protected var _currentLevel:Number = 0; 27 28 protected var _levels:Array = []; 28 29 … … 58 59 for each (var level:Object in levels) { 59 60 if (level['file']) { 60 var newLevel:PlaylistItemLevel = new PlaylistItemLevel(level['file'], 61 var newLevel:PlaylistItemLevel = new PlaylistItemLevel(level['file'], 62 level['type'], 61 63 Number(level['bitrate']), 62 64 Number(level['width']), … … 65 67 switch(otherProp) { 66 68 case "file": 69 case "type": 67 70 case "bitrate": 68 71 case "width": … … 125 128 public function addLevel(newLevel:PlaylistItemLevel):void { 126 129 if (validExtension(newLevel)) { 127 if (_currentLevel < 0) _currentLevel = 0; 130 // Removing playlist level sorting 131 /* if (_currentLevel < 0) _currentLevel = 0; 128 132 for (var i:Number = 0; i < _levels.length; i++) { 129 133 var level:PlaylistItemLevel = _levels[i] as PlaylistItemLevel; … … 136 140 } 137 141 } 142 */ 138 143 _levels.push(newLevel); 139 144 } … … 160 165 **/ 161 166 protected function validExtension(level:Object):Boolean { 162 return levelType(level); 167 if (_type) { 168 return (typeMap(levelType(level)) == typeMap(_type)); 169 } else { 170 var lType = levelType(level); 171 if (lType) { 172 if (typeMap(lType)) { 173 _type = lType; 174 return true; 175 } 176 } else { 177 // No valid extension, but if provider is set manually, try to play using that provider. 178 if (_provider) return true; 179 } 180 } 181 return false; 163 182 } 164 183 165 184 public function get currentLevel():Number { 166 185 return _currentLevel; 167 }168 169 public function getLevel(bitrate:Number, width:Number):Number {170 for (var i:Number=0; i < _levels.length; i++) {171 var level:PlaylistItemLevel = _levels[i] as PlaylistItemLevel;172 if ((isNaN(level.bitrate) || bitrate >= level.bitrate * 1.5) && (isNaN(level.width) || width >= level.width * 0.67) && !level.blacklisted) {173 return i;174 }175 }176 return _levels.length - 1;177 186 } 178 187 … … 215 224 private function levelType(level:Object):String { 216 225 if (level) { 217 var type:String = level.type ? level.type : Strings.extension(level.file); 218 switch (type) { 219 case "flv": 220 case "f4v": 221 case "mov": 222 case "m4a": 223 case "m4v": 224 case "mp4": 225 case "aac": 226 return "video"; 227 break; 228 case "mp3": 229 return "sound"; 230 break; 231 case "smil": 232 return "rtmp"; 233 break; 234 case "m3u8": 235 return "hls"; 236 break; 226 if (level.type) return level.type; 227 else { 228 if (level.streamer) return "rtmp"; 229 else if (level.file) { 230 if (Strings.isYouTube(level.file)) return "youtube"; 231 else { 232 return extensionMap(Strings.extension(level.file)); 233 } 234 } 237 235 } 236 } 237 return null; 238 } 239 240 private function extensionMap(extension:String):String { 241 switch (extension) { 242 case "flv": 243 return "flv"; 244 case "f4v": 245 case "m4v": 246 case "mp4": 247 return "mp4"; 248 case "m4a": 249 case "aac": 250 case "f4a": 251 return "aac"; 252 break; 253 case "mp3": 254 return "mp3"; 255 break; 256 case "smil": 257 return "rtmp"; 258 break; 259 case "m3u8": 260 return "hls"; 261 break; 262 case "webm": 263 return "webm"; 264 break; 265 case "ogg": 266 case "oga": 267 return "vorbis"; 268 break; 269 } 270 return null; 271 } 272 273 private function typeMap(type:String):String { 274 switch (type) { 275 case "flv": 276 case "mp4": 277 case "aac": 278 case "video": 279 return "video"; 280 break; 281 case "mp3": 282 case "sound": 283 return "sound"; 284 break; 285 case "rtmp": 286 return "rtmp"; 287 break; 288 case "hls": 289 return "hls"; 290 break; 238 291 } 239 292 return null; … … 244 297 return _provider; 245 298 } else if (_levels.length > 0) { 246 return levelType(_levels[_currentLevel]);299 return typeMap(levelType(_levels[_currentLevel])); 247 300 } 248 301 return null; … … 253 306 254 307 public function get type():String { 255 if (_levels.length > 0) { 256 var level:Object = _levels[_currentLevel]; 257 return level.type ? level.type : Strings.extension(level.file); 258 } else return null; 308 return _type; 259 309 } 260 310 -
branches/jw6/src/flash/com/longtailvideo/jwplayer/model/PlaylistItemLevel.as
r2192 r2217 4 4 5 5 public var file:String = ""; 6 public var type:String = ""; 6 7 public var bitrate:Number = 0; 7 8 public var width:Number = 0; 9 public var height:Number = 0; 8 10 public var streamer:String = ""; 9 11 public var blacklisted:Boolean = false; … … 11 13 /** 12 14 * @param file - The location of the file to play 15 * @param type - The type of file 13 16 * @param bitrate - The bitrate of the file 14 17 * @param width - The width of the file 15 18 * @param streamer - Item's RTMP stream location 16 19 */ 17 public function PlaylistItemLevel(file:String, bitrate:Number, width:Number, streamer:String="") {20 public function PlaylistItemLevel(file:String, type:String, bitrate:Number, width:Number, streamer:String="") { 18 21 this.file = file; 22 this.type = type; 19 23 this.streamer = streamer; 20 24 this.bitrate = bitrate; -
branches/jw6/src/flash/com/longtailvideo/jwplayer/parsers/JWParser.as
r2192 r2217 68 68 if (item['type']) { 69 69 return item['type']; 70 } else if ( isYouTube(item['file'])) {70 } else if (Strings.isYouTube(item['file'])) { 71 71 return "youtube"; 72 72 } else if (item['streamer'] && item['streamer'].indexOf('rtmp') == 0) { … … 83 83 } 84 84 85 private static function isYouTube(file:String):Boolean {86 if (!file)87 return false;88 else if (file.indexOf('youtube.com/w') > -1)89 return true;90 else if (file.indexOf('youtube.com/v') > -1)91 return true;92 else if (file.indexOf('youtu.be') > -1)93 return true;94 else95 return false;96 }97 98 85 } 99 86 -
branches/jw6/src/flash/com/longtailvideo/jwplayer/parsers/LoadbalanceParser.as
r2192 r2217 19 19 var level:PlaylistItemLevel = new PlaylistItemLevel( 20 20 Strings.xmlAttribute(i, 'src'), 21 '', 21 22 Number(Strings.xmlAttribute(i,'system-bitrate'))/1000, 22 23 Number(Strings.xmlAttribute(i,'width')), -
branches/jw6/src/flash/com/longtailvideo/jwplayer/parsers/ParserFactory.as
r2192 r2217 7 7 try { 8 8 switch(list.localName().toString().toLowerCase()) { 9 case 'asx':10 return new ASXParser();11 break;12 case 'feed':13 return new ATOMParser();14 break;15 case 'playlist':16 return new XSPFParser();17 break;9 // case 'asx': 10 // return new ASXParser(); 11 // break; 12 // case 'feed': 13 // return new ATOMParser(); 14 // break; 15 // case 'playlist': 16 // return new XSPFParser(); 17 // break; 18 18 case 'rss': 19 19 return new RSSParser(); 20 20 break; 21 case 'smil':22 return new SMILParser();23 break;21 // case 'smil': 22 // return new SMILParser(); 23 // break; 24 24 } 25 25 } catch (e:Error) { -
branches/jw6/src/flash/com/longtailvideo/jwplayer/player/IPlayer.as
r2192 r2217 76 76 function overrideComponent(plugin:IPlayerComponent):void; 77 77 function loadInstream(target:IPlugin, item:PlaylistItem, options:IInstreamOptions=null):IInstreamPlayer; 78 function getQualityLevels():Array; 79 function getCurrentQuality():Number; 80 function setCurrentQuality(index:Number):void; 81 78 82 } 79 83 } -
branches/jw6/src/flash/com/longtailvideo/jwplayer/player/InstreamPlayer.as
r2196 r2217 504 504 throw new Error("Unsupported IPlayer method in InstreamPlayer"); 505 505 return null; 506 } 506 } 507 508 public function getQualityLevels():Array { 509 throw new Error("Unsupported IPlayer method in InstreamPlayer"); 510 return null; 511 } 512 513 public function getCurrentQuality():Number { 514 throw new Error("Unsupported IPlayer method in InstreamPlayer"); 515 return null; 516 } 517 518 public function setCurrentQuality(index:Number):void { 519 throw new Error("Unsupported IPlayer method in InstreamPlayer"); 520 } 507 521 508 522 } -
branches/jw6/src/flash/com/longtailvideo/jwplayer/player/JavascriptAPI.as
r2199 r2217 167 167 ExternalInterface.addCallback("jwDestroyAPI", js_destroyAPI); 168 168 169 // Quality API 170 ExternalInterface.addCallback("jwGetQualityLevels", js_getQualityLevels); 171 ExternalInterface.addCallback("jwGetCurrentQuality", js_getCurrentQuality); 172 ExternalInterface.addCallback("jwSetCurrentQuality", js_setCurrentQuality); 173 169 174 // UNIMPLEMENTED 170 175 //ExternalInterface.addCallback("jwGetBandwidth", js_getBandwidth); … … 271 276 if (evt.offset > 0) returnObj.offset = evt.offset; 272 277 if (evt.position >= 0) returnObj.position = evt.position; 278 if (evt.currentQuality >= 0) returnObj.currentQuality = evt.currentQuality; 279 if (evt.levels) returnObj.levels = JavascriptSerialization.stripDots(evt.levels); 273 280 274 281 if (evt.type == MediaEvent.JWPLAYER_MEDIA_MUTE) … … 549 556 _destroyed = true; 550 557 } 551 558 559 protected function js_getQualityLevels():Array { 560 return _player.getQualityLevels(); 561 } 562 563 protected function js_getCurrentQuality():Number { 564 return _player.getCurrentQuality(); 565 } 566 567 protected function js_setCurrentQuality(index:Number):void { 568 _player.setCurrentQuality(index); 569 } 570 552 571 protected function callJS(functionName:String, args:*):void { 553 572 if (!_destroyed) { -
branches/jw6/src/flash/com/longtailvideo/jwplayer/player/Player.as
r2196 r2217 4 4 import com.longtailvideo.jwplayer.events.IGlobalEventDispatcher; 5 5 import com.longtailvideo.jwplayer.events.PlayerEvent; 6 import com.longtailvideo.jwplayer.media.IMediaProvider; 7 import com.longtailvideo.jwplayer.media.MediaProvider; 8 import com.longtailvideo.jwplayer.media.VideoMediaProvider; 6 9 import com.longtailvideo.jwplayer.model.IInstreamOptions; 7 10 import com.longtailvideo.jwplayer.model.IPlaylist; … … 292 295 } 293 296 297 298 public function getQualityLevels():Array { 299 return model.media ? model.media.qualityLevels : null; 300 } 301 302 public function getCurrentQuality():Number { 303 return model.media ? model.media.currentQuality : NaN; 304 } 305 306 public function setCurrentQuality(index:Number):void { 307 if (model.media) model.media.currentQuality = index; 308 } 309 310 311 312 /////////////////////////////////////////// 313 /// Disallowed Sprite methods // 314 /////////////////////////////////////////// 315 294 316 /** The player should not accept any calls referencing its display stack **/ 295 317 public override function addChild(child:DisplayObject):DisplayObject { -
branches/jw6/src/flash/com/longtailvideo/jwplayer/player/PlayerState.as
r2192 r2217 16 16 /** Playback is paused. **/ 17 17 public static var PAUSED:String = "PAUSED"; 18 /** Playlist has completed playing. **/ 19 public static var COMPLETED:String = "COMPLETED"; 18 20 } 19 21 } -
branches/jw6/src/flash/com/longtailvideo/jwplayer/player/PlayerVersion.as
r2203 r2217 3 3 4 4 public class PlayerVersion { 5 protected static var _version:String = '6.0.22 03';5 protected static var _version:String = '6.0.2217'; 6 6 7 7 public static function get version():String { -
branches/jw6/src/flash/com/longtailvideo/jwplayer/utils/AssetLoader.as
r2192 r2217 9 9 import flash.events.SecurityErrorEvent; 10 10 import flash.net.URLLoader; 11 import flash.net.URLLoaderDataFormat; 11 12 import flash.net.URLRequest; 12 13 import flash.system.ApplicationDomain; … … 90 91 switch (evt.status) { 91 92 case 400: 92 loadError(new ErrorEvent(ErrorEvent.ERROR, false, false, " HTTP Status 400;Bad request."));93 loadError(new ErrorEvent(ErrorEvent.ERROR, false, false, "Bad request.")); 93 94 break; 94 95 case 401: 95 loadError(new ErrorEvent(ErrorEvent.ERROR, false, false, " HTTP Status 401; Unauthorized."));96 loadError(new ErrorEvent(ErrorEvent.ERROR, false, false, "Request not authorize.")); 96 97 break; 97 98 case 403: 98 loadError(new ErrorEvent(ErrorEvent.ERROR, false, false, " HTTP Status 403; Forbidden."));99 loadError(new ErrorEvent(ErrorEvent.ERROR, false, false, "File could not be loaded due to server permissions.")); 99 100 break; 100 101 case 404: 101 loadError(new ErrorEvent(ErrorEvent.ERROR, false, false, " HTTP Status 404; Not Found."));102 loadError(new ErrorEvent(ErrorEvent.ERROR, false, false, "File not found.")); 102 103 break; 103 104 case 500: 104 loadError(new ErrorEvent(ErrorEvent.ERROR, false, false, " HTTP Status 500; Internal Server Error."));105 loadError(new ErrorEvent(ErrorEvent.ERROR, false, false, "Internal server error.")); 105 106 break; 106 107 case 503: 107 loadError(new ErrorEvent(ErrorEvent.ERROR, false, false, " HTTP Status 503; Service Unavailable."));108 loadError(new ErrorEvent(ErrorEvent.ERROR, false, false, "Service unavailable.")); 108 109 break; 109 110 } … … 111 112 112 113 protected function loadError(evt:ErrorEvent):void { 113 dispatchEvent(new ErrorEvent(ErrorEvent.ERROR, false, false, evt.text)); 114 if (evt is SecurityErrorEvent) { 115 dispatchEvent(new ErrorEvent(ErrorEvent.ERROR, false, false, "Crossdomain loading denied.")); 116 } else { 117 dispatchEvent(evt.clone()); 118 } 114 119 _errorState = true; 115 120 } … … 149 154 if (!_urlLoader) { 150 155 _urlLoader = new URLLoader(); 156 _urlLoader.dataFormat = URLLoaderDataFormat.BINARY; 151 157 _urlLoader.addEventListener(Event.COMPLETE, urlLoadComplete); 152 158 _urlLoader.addEventListener(IOErrorEvent.IO_ERROR, loadError); -
branches/jw6/src/flash/com/longtailvideo/jwplayer/utils/JavascriptSerialization.as
r2192 r2217 23 23 var obj:Object = { 24 24 'author': item.author, 25 'date': item.date,26 'description': item.description,27 'duration': item.duration,28 'file': item.file,29 'image': item.image,30 'link': item.link,31 'mediaid': item.mediaid,32 'provider': item.provider,33 'start': item.start,34 'streamer': item.streamer,35 'tags': item.tags,36 'title': item.title,37 'type': item.provider25 'date': item.date, 26 'description': item.description, 27 'duration': item.duration, 28 'file': item.file, 29 'image': item.image, 30 'link': item.link, 31 'mediaid': item.mediaid, 32 'provider': item.provider, 33 'start': item.start, 34 'streamer': item.streamer, 35 'tags': item.tags, 36 'title': item.title, 37 'type': item.provider 38 38 }; 39 39 -
branches/jw6/src/flash/com/longtailvideo/jwplayer/utils/Strings.as
r2192 r2217 228 228 /** Removes potentially harmful string headers from a link **/ 229 229 public static function cleanLink(link:String):String { 230 return link.replace(/(javascript|asfunction|vbscript)\:/gi, ""); 230 // Can't use a regex variable; matching tests will incorrectly return false 231 while(/(javascript|asfunction|vbscript):/gi.test(link)) { 232 link = link.replace(/(javascript|asfunction|vbscript):/gi, ""); 233 } 234 return link; 235 } 236 237 public static function isYouTube(file:String):Boolean { 238 if (!file) 239 return false; 240 else if (file.indexOf('youtube.com/w') > -1) 241 return true; 242 else if (file.indexOf('youtube.com/v') > -1) 243 return true; 244 else if (file.indexOf('youtu.be') > -1) 245 return true; 246 else 247 return false; 231 248 } 232 249 233 250 234 235 251 236 252 } -
branches/jw6/src/flash/com/longtailvideo/jwplayer/view/View.as
r2203 r2217 385 385 _components.playlist.hide(); 386 386 return; 387 } else { 388 _components.controlbar.force(false); 387 389 } 388 390 -
branches/jw6/src/flash/com/longtailvideo/jwplayer/view/components/ControlbarComponent.as
r2203 r2217 811 811 public function force(state:Boolean):void { 812 812 _forcing = state; 813 redraw(); 813 stateHandler(); 814 moveTimeout(); 814 815 } 815 816 -
branches/jw6/src/flash/com/longtailvideo/jwplayer/view/skins/PNGSkin.as
r2192 r2217 54 54 55 55 protected function loadError(evt:ErrorEvent):void { 56 sendError( evt.text);56 sendError("Error loading skin: " + evt.text); 57 57 } 58 58 -
branches/jw6/src/flash/com/longtailvideo/jwplayer/view/skins/ZIPSkin.as
r2196 r2217 27 27 _urlPrefix = url.substring(url.lastIndexOf('/') + 1, url.lastIndexOf('.')); 28 28 29 var assetLoader:AssetLoader = new AssetLoader(); 30 assetLoader.addEventListener(ErrorEvent.ERROR, loadError); 31 assetLoader.addEventListener(Event.COMPLETE, loadComplete); 32 assetLoader.load(url); 33 return; 34 29 35 var urlStream:URLLoader = new URLLoader(); 30 36 urlStream.dataFormat = URLLoaderDataFormat.BINARY; … … 41 47 protected override function loadComplete(evt:Event):void { 42 48 try { 43 var data:ByteArray = (evt.target as URLLoader).dataas ByteArray;49 var data:ByteArray = (evt.target as AssetLoader).loadedObject as ByteArray; 44 50 buildSkin(data); 45 51 } catch (e:Error) { -
branches/jw6/src/js/api/jwplayer.api.js
r2203 r2217 254 254 return _instream; 255 255 }; 256 _this.getQualityLevels = function() { 257 return _callInternal("jwGetQualityLevels"); 258 }; 259 _this.getCurrentQuality = function() { 260 return _callInternal("jwGetCurrentQuality"); 261 }; 262 _this.setCurrentQuality = function(level) { 263 _callInternal("jwSetCurrentQuality", level); 264 }; 256 265 257 266 var _eventMapping = { … … 272 281 onBeforePlay: events.JWPLAYER_MEDIA_BEFOREPLAY, 273 282 onBeforeComplete: events.JWPLAYER_MEDIA_BEFORECOMPLETE, 274 onDisplayClick: events.JWPLAYER_DISPLAY_CLICK 283 onDisplayClick: events.JWPLAYER_DISPLAY_CLICK, 284 onQualityLevels: events.JWPLAYER_MEDIA_LEVELS, 285 onQualityChange: events.JWPLAYER_MEDIA_LEVEL_CHANGED 275 286 }; 276 287 -
branches/jw6/src/js/embed/jwplayer.embed.config.js
r2197 r2217 15 15 for (var i=0; i<modes.length; i++) { 16 16 var mode = modes[i].type; 17 modes[i].src = players[mode] ? players[mode] : base + "jwplayer." + mode + (mode == "flash" ? ".swf" : ".js"); 17 if (!modes[i].src) { 18 modes[i].src = players[mode] ? players[mode] : base + "jwplayer." + mode + (mode == "flash" ? ".swf" : ".js"); 19 } 18 20 } 19 21 } … … 68 70 _moveProperty(config, singleSource, "file"); 69 71 _moveProperty(config, singleSource, "type"); 70 singleItem.sources = [singleSource];72 singleItem.sources = singleSource.file ? [singleSource] : []; 71 73 } 72 74 } 73 75 74 76 config.playlist = [singleItem]; 77 } else { 78 // Use JW Player playlist items to normalize sources of existing playlist items 79 for (var i=0; i<config.playlist.length; i++) { 80 config.playlist[i] = new jwplayer.playlist.item(config.playlist[i]); 81 } 75 82 } 76 83 } -
branches/jw6/src/js/embed/jwplayer.embed.download.js
r2199 r2217 14 14 JW_CSS_ABSOLUTE = "absolute"; 15 15 16 embed.download = function(_container, _options ) {16 embed.download = function(_container, _options, _errorCallback) { 17 17 var params = utils.extend({}, _options), 18 18 _display, … … 30 30 function _embed() { 31 31 if (params.playlist && params.playlist.length) { 32 try { 33 _file = params.playlist[0].sources[0].file; 34 _image = params.playlist[0].image; 35 } catch(e) { 36 return; 32 // TODO: make sure source can be downloaded (mp4, flv, webm, aac, mp3 or vorbis) 33 // If no downlaodable files, and youtube, display youtube 34 // If nothing, show error message 35 var file, image, youtube; 36 for (var i=0; i<params.playlist[0].sources.length; i++) { 37 var source = params.playlist[0].sources[i]; 38 if (source.file) { 39 if (("mp4,mp4,flv,webm,aac,mp3,vorbis").split().indexOf(source.type) > -1) { 40 file = source.file; 41 image = source.image; 42 continue; 43 } else if (utils.isYouTube(source.file)){ 44 youtube = source.file; 45 } 46 } 37 47 } 38 48 } else { … … 40 50 } 41 51 42 if (_logo.prefix) { 43 _logo.prefix += jwplayer.version.split(/\W/).splice(0, 2).join("/") + "/"; 52 if (file) { 53 _file = file; 54 _image = image; 55 if (_logo.prefix) { 56 _logo.prefix += jwplayer.version.split(/\W/).splice(0, 2).join("/") + "/"; 57 } 58 _buildElements(); 59 _styleElements(); 60 } else if (youtube) { 61 alert("Youtube goes here: " + youtube); 62 } else { 63 _errorCallback(); 44 64 } 45 46 _buildElements();47 _styleElements();48 65 } 49 66 -
branches/jw6/src/js/embed/jwplayer.embed.flash.js
r2202 r2217 6 6 */ 7 7 (function(jwplayer) { 8 var utils = jwplayer.utils ;8 var utils = jwplayer.utils, events = jwplayer.events; 9 9 10 10 jwplayer.embed.flash = function(_container, _player, _options, _loader, _api) { 11 var _eventDispatcher = new jwplayer.events.eventdispatcher(), 12 _flashVersion = utils.flashVersion(); 13 utils.extend(this, _eventDispatcher); 14 15 11 16 function appendAttribute(object, name, value) { 12 17 var param = document.createElement('param'); … … 22 27 } 23 28 var display = document.getElementById(_api.id).getPluginConfig("display"); 24 plugin.resize(display.width, display.height); 29 if (typeof plugin.resize == "function") { 30 plugin.resize(display.width, display.height); 31 } 25 32 div.style.left = display.x; 26 33 div.style.top = displ
