Changeset 2193


Ignore:
Timestamp:
05/11/12 08:17:41 (13 months ago)
Author:
pablo
Message:

Load the HTML5 javascript dynamically

Location:
branches/jw6
Files:
1 added
1 deleted
19 edited

Legend:

Unmodified
Added
Removed
  • branches/jw6/bin-debug/jwplayer.html5.js

    r2192 r2193  
    2525        }; 
    2626         
    27         animations.transform = function(domelement, value) { 
    28                 domelement.style.webkitTransform = value; 
    29                 domelement.style.MozTransform = value; 
    30                 domelement.style.OTransform = value; 
    31                 domelement.style.msTransform = value; 
     27 
     28        animations.rotate = function(domelement, deg) { 
     29                utils.transform(domelement, "rotate(" + deg + "deg)"); 
    3230        }; 
    3331         
    34         animations.transformOrigin = function(domelement, value) { 
    35                 domelement.style.webkitTransformOrigin = value; 
    36                 domelement.style.MozTransformOrigin = value; 
    37                 domelement.style.OTransformOrigin = value; 
    38                 domelement.style.msTransformOrigin = value; 
    39         }; 
    40          
    41         animations.rotate = function(domelement, deg) { 
    42                 animations.transform(domelement, "rotate(" + deg + "deg)"); 
    43         }; 
    44          
    45 })(jwplayer.html5.utils); 
     32})(jwplayer.utils); 
    4633/** 
    4734 * Parsers namespace declaration 
     
    14651452                _events = jwplayer.events, 
    14661453                _states = _events.state, 
    1467                 _rotate = html5.utils.animations.rotate, 
     1454                _rotate = _utils.animations.rotate, 
    14681455                 
    14691456 
  • branches/jw6/bin-debug/jwplayer.js

    r2192 r2193  
    479479        } 
    480480 
    481 })(jwplayer); 
    482 /** 
     481        /** 
     482         * Recursively traverses nested object, replacing key names containing a 
     483         * search string with a replacement string. 
     484         *  
     485         * @param searchString 
     486         *            The string to search for in the object's key names 
     487         * @param replaceString 
     488         *            The string to replace in the object's key names 
     489         * @returns The modified object. 
     490         */ 
     491        jwplayer.utils.deepReplaceKeyName = function(obj, searchString, replaceString) { 
     492                switch (jwplayer.utils.typeOf(obj)) { 
     493                case "array": 
     494                        for ( var i = 0; i < obj.length; i++) { 
     495                                obj[i] = jwplayer.utils.deepReplaceKeyName(obj[i], 
     496                                                searchString, replaceString); 
     497                        } 
     498                        break; 
     499                case "object": 
     500                        for ( var key in obj) { 
     501                                var searches, replacements; 
     502                                if (searchString instanceof Array && replaceString instanceof Array) { 
     503                                        if (searchString.length != replaceString.length) 
     504                                                continue; 
     505                                        else { 
     506                                                searches = searchString; 
     507                                                replacements = replaceString; 
     508                                        } 
     509                                } else { 
     510                                        searches = [searchString]; 
     511                                        replacements = [replaceString]; 
     512                                } 
     513                                var newkey = key; 
     514                                for (var i=0; i < searches.length; i++) { 
     515                                        newkey = newkey.replace(new RegExp(searchString[i], "g"), replaceString[i]); 
     516                                } 
     517                                obj[newkey] = jwplayer.utils.deepReplaceKeyName(obj[key], searchString, replaceString); 
     518                                if (key != newkey) { 
     519                                        delete obj[key]; 
     520                                } 
     521                        } 
     522                        break; 
     523                } 
     524                return obj; 
     525        } 
     526 
     527})(jwplayer);/** 
    483528 * JW Player Media Extension to Mime Type mapping 
    484529 * 
    485530 * @author zach 
    486  * @version 5.4 
     531 * @modified pablo 
     532 * @version 6.0 
    487533 */ 
    488534(function(utils) { 
    489         utils.extensionmap = { 
    490                 "3gp": { 
    491                         html5: "video/3gpp", 
    492                         flash: "video" 
    493                 }, 
    494                 "3gpp": { 
    495                         html5: "video/3gpp" 
    496                 }, 
    497                 "3g2": { 
    498                         html5: "video/3gpp2", 
    499                         flash: "video" 
    500                 }, 
    501                 "3gpp2": { 
    502                         html5: "video/3gpp2" 
    503                 }, 
    504                 "flv": { 
    505                         flash: "video" 
    506                 }, 
    507                 "f4a": { 
    508                         html5: "audio/mp4" 
    509                 }, 
    510                 "f4b": { 
    511                         html5: "audio/mp4", 
    512                         flash: "video" 
    513                 }, 
    514                 "f4v": { 
    515                         html5: "video/mp4", 
    516                         flash: "video" 
    517                 }, 
    518                 "mov": { 
    519                         html5: "video/quicktime", 
    520                         flash: "video" 
    521                 }, 
    522                 "m4a": { 
    523                         html5: "audio/mp4", 
    524                         flash: "video" 
    525                 }, 
    526                 "m4b": { 
    527                         html5: "audio/mp4" 
    528                 }, 
    529                 "m4p": { 
    530                         html5: "audio/mp4" 
    531                 }, 
    532                 "m4v": { 
    533                         html5: "video/mp4", 
    534                         flash: "video" 
    535                 }, 
    536                 "mp4": { 
    537                         html5: "video/mp4", 
    538                         flash: "video" 
    539                 }, 
    540                 "rbs":{ 
    541                         flash: "sound" 
    542                 }, 
    543                 "aac": { 
    544                         html5: "audio/aac", 
    545                         flash: "video" 
    546                 }, 
    547                 "mp3": { 
    548                         html5: "audio/mp3", 
    549                         flash: "sound" 
    550                 }, 
    551                 "ogg": { 
    552                         html5: "audio/ogg" 
    553                 }, 
    554                 "oga": { 
    555                         html5: "audio/ogg" 
    556                 }, 
    557                 "ogv": { 
    558                         html5: "video/ogg" 
    559                 }, 
    560                 "webm": { 
    561                         html5: "video/webm" 
    562                 }, 
    563                 "m3u8": { 
    564                         html5: "audio/x-mpegurl" 
    565                 }, 
    566                 "gif": { 
    567                         flash: "image" 
    568                 }, 
    569                 "jpeg": { 
    570                         flash: "image" 
    571                 }, 
    572                 "jpg": { 
    573                         flash: "image" 
    574                 }, 
    575                 "swf":{ 
    576                         flash: "image" 
    577                 }, 
    578                 "png":{ 
    579                         flash: "image" 
    580                 }, 
    581                 "wav":{ 
    582                         html5: "audio/x-wav" 
     535        var video = "video/",  
     536                audio = "audio/", 
     537                image = "image", 
     538                mp4 = "mp4", 
     539                 
     540                html5Extensions = { 
     541                        "f4a": audio+mp4, 
     542                        "f4b": audio+mp4, 
     543                        "f4v": video+mp4, 
     544                        "mov": video+"quicktime", 
     545                        "m4a": audio+mp4, 
     546                        "m4b": audio+mp4, 
     547                        "m4p": audio+mp4, 
     548                        "m4v": video+mp4, 
     549                        "mp4": video+mp4, 
     550                        "aac": audio+"aac", 
     551                        "mp3": audio+"mp3", 
     552                        "ogg": audio+"ogg", 
     553                        "oga": audio+"ogg", 
     554                        "ogv": video+"ogg", 
     555                        "webm": video+"webm", 
     556                        "m3u8": audio+"x-mpegurl", 
     557                        "wav": audio+"x-wav" 
    583558                },  
    584                 "rtmp":{ 
    585                         flash: "rtmp" 
    586                 }, 
    587                 "hls":{ 
    588                         flash: "hls" 
    589                 } 
    590         }; 
     559                video = "video",  
     560                flashExtensions = { 
     561                        "flv": video, 
     562                        "f4b": video, 
     563                        "f4v": video, 
     564                        "mov": video, 
     565                        "m4a": video, 
     566                        "m4v": video, 
     567                        "mp4": video, 
     568                        "aac": video, 
     569                        "mp3": "sound", 
     570                        "gif": image, 
     571                        "jpeg": image, 
     572                        "jpg": image, 
     573                        "swf": image, 
     574                        "png": image, 
     575                        "rtmp": "rtmp", 
     576                        "hls": "hls" 
     577                }; 
     578         
     579        var _extensionmap = utils.extensionmap = {}; 
     580        for (var ext in html5Extensions) { 
     581                _extensionmap[ext] = { html5: html5Extensions[ext] }; 
     582        } 
     583        for (ext in flashExtensions) { 
     584                if (!_extensionmap[ext]) _extensionmap[ext] = {}; 
     585                _extensionmap[ext].flash = flashExtensions[ext]; 
     586        } 
     587 
    591588})(jwplayer.utils); 
    592589/** 
     
    604601                        COMPLETE: 3 
    605602                }, 
    606                 _events = jwplayer.events, 
    607603                DOCUMENT = document; 
    608604         
    609605         
    610606        utils.scriptloader = function(url) { 
    611                 var _status = _loaderstatus.NEW; 
    612                 var _eventDispatcher = new _events.eventdispatcher(); 
     607                var _status = _loaderstatus.NEW, 
     608                        _events = jwplayer.events, 
     609                        _eventDispatcher = new _events.eventdispatcher(); 
     610                 
    613611                utils.extend(this, _eventDispatcher); 
    614612                 
     
    651649 * @version 6.0 
    652650 */ 
    653 (function(jwplayer) { 
    654         var DOCUMENT = document; 
    655         var WINDOW = window; 
    656          
    657         //Declare namespace 
    658         var utils = jwplayer.utils = function() { 
    659         }; 
    660  
    661         /** 
    662          * Returns true if the value of the object is null, undefined or the empty 
    663          * string 
    664          *  
    665          * @param a The variable to inspect 
    666          */ 
    667         utils.exists = function(item) { 
    668                 switch (typeof (item)) { 
    669                 case "string": 
    670                         return (item.length > 0); 
    671                         break; 
    672                 case "object": 
    673                         return (item !== null); 
    674                 case "undefined": 
    675                         return false; 
    676                 } 
    677                 return true; 
    678         } 
    679  
    680         var _styleSheets={}, 
    681                 _styleSheet, 
    682                 _rules = {}; 
    683  
    684         function _createStylesheet() { 
    685                 var styleSheet = DOCUMENT.createElement("style"); 
    686                 styleSheet.type = "text/css"; 
    687                 DOCUMENT.getElementsByTagName('head')[0].appendChild(styleSheet); 
    688                 return styleSheet; 
    689         } 
    690          
    691         utils.css = function(selector, styles, important) { 
    692                 if (!utils.exists(important)) important = false; 
    693                  
    694                 if (utils.isIE()) { 
    695                         if (!_styleSheet) { 
    696                                 _styleSheet = _createStylesheet(); 
    697                         } 
    698                 } else if (!_styleSheets[selector]) { 
    699                         _styleSheets[selector] = _createStylesheet(); 
    700                 } 
    701  
    702                 if (!_rules[selector]) { 
    703                         _rules[selector] = {}; 
    704                 } 
    705  
    706                 for (var style in styles) { 
    707                         var val = _styleValue(style, styles[style], important); 
    708                         if (utils.exists(_rules[selector][style]) && !utils.exists(val)) { 
    709                                 delete _rules[selector][style]; 
    710                         } else { 
    711                                 _rules[selector][style] = val; 
    712                         } 
    713                 } 
    714  
    715                 // IE9 limits the number of style tags in the head, so we need to update the entire stylesheet each time 
    716                 if (utils.isIE()) { 
    717                         _updateAllStyles(); 
     651(function(utils) { 
     652        var exists = utils.exists; 
     653         
     654        utils.scale = function(domelement, xscale, yscale, xoffset, yoffset) { 
     655                var value; 
     656                 
     657                // Set defaults 
     658                if (!exists(xscale)) xscale = 1; 
     659                if (!exists(yscale)) yscale = 1; 
     660                if (!exists(xoffset)) xoffset = 0; 
     661                if (!exists(yoffset)) yoffset = 0; 
     662                 
     663                if (xscale == 1 && yscale == 1 && xoffset == 0 && yoffset == 0) { 
     664                        value = ""; 
    718665                } else { 
    719                         _updateStylesheet(selector, _styleSheets[selector]); 
    720                 } 
    721         } 
    722          
    723         function _styleValue(style, value, important) { 
    724                 if (typeof value === "undefined") { 
    725                         return undefined; 
    726                 }  
    727                  
    728                 var importantString = important ? " !important" : ""; 
    729  
    730                 if (typeof value == "number") { 
    731                         if (isNaN(value)) { 
    732                                 return undefined; 
    733                         } 
    734                         switch (style) { 
    735                         case "z-index": 
    736                         case "opacity": 
    737                                 return value + importantString; 
    738                                 break; 
    739                         default: 
    740                                 if (style.match(/color/i)) { 
    741                                         return "#" + utils.pad(value.toString(16), 6); 
    742                                 } else { 
    743                                         return Math.ceil(value) + "px" + importantString; 
    744                                 } 
    745                                 break; 
    746                         } 
    747                 } else { 
    748                         return value + importantString; 
    749                 } 
    750         } 
    751  
    752         function _updateAllStyles() { 
    753                 var ruleText = "\n"; 
    754                 for (var rule in _rules) { 
    755                         ruleText += _getRuleText(rule); 
    756                 } 
    757                 _styleSheet.innerHTML = ruleText; 
    758         } 
    759          
    760         function _updateStylesheet(selector, sheet) { 
    761                 if (sheet) { 
    762                         sheet.innerHTML = _getRuleText(selector); 
    763                 } 
    764         } 
    765          
    766         function _getRuleText(selector) { 
    767                 var ruleText = selector + "{\n"; 
    768                 var styles = _rules[selector]; 
    769                 for (var style in styles) { 
    770                         ruleText += "  "+style + ": " + styles[style] + ";\n"; 
    771                 } 
    772                 ruleText += "}\n"; 
    773                 return ruleText; 
    774         } 
    775          
    776          
    777         /** 
    778          * Removes all css elements which match a particular style 
    779          */ 
    780         utils.clearCss = function(filter) { 
    781                 for (var rule in _rules) { 
    782                         if (rule.indexOf(filter) >= 0) { 
    783                                 delete _rules[rule]; 
    784                         } 
    785                 } 
    786                 for (var selector in _styleSheets) { 
    787                         if (selector.indexOf(filter) >= 0) { 
    788                                 _styleSheets[selector].innerHTML = ''; 
    789                         } 
    790                 } 
    791         } 
    792          
    793         /** Gets an absolute file path based on a relative filepath * */ 
    794         utils.getAbsolutePath = function(path, base) { 
    795                 if (!utils.exists(base)) { 
    796                         base = DOCUMENT.location.href; 
    797                 } 
    798                 if (!utils.exists(path)) { 
    799                         return undefined; 
    800                 } 
    801                 if (isAbsolutePath(path)) { 
    802                         return path; 
    803                 } 
    804                 var protocol = base.substring(0, base.indexOf("://") + 3); 
    805                 var domain = base.substring(protocol.length, base.indexOf('/', protocol.length + 1)); 
    806                 var patharray; 
    807                 if (path.indexOf("/") === 0) { 
    808                         patharray = path.split("/"); 
    809                 } else { 
    810                         var basepath = base.split("?")[0]; 
    811                         basepath = basepath.substring(protocol.length + domain.length + 1, basepath.lastIndexOf('/')); 
    812                         patharray = basepath.split("/").concat(path.split("/")); 
    813                 } 
    814                 var result = []; 
    815                 for ( var i = 0; i < patharray.length; i++) { 
    816                         if (!patharray[i] || !utils.exists(patharray[i]) || patharray[i] == ".") { 
    817                                 continue; 
    818                         } else if (patharray[i] == "..") { 
    819                                 result.pop(); 
    820                         } else { 
    821                                 result.push(patharray[i]); 
    822                         } 
    823                 } 
    824                 return protocol + domain + "/" + result.join("/"); 
    825         }; 
    826  
    827         function isAbsolutePath(path) { 
    828                 if (!utils.exists(path)) { 
    829                         return; 
    830                 } 
    831                 var protocol = path.indexOf("://"); 
    832                 var queryparams = path.indexOf("?"); 
    833                 return (protocol > 0 && (queryparams < 0 || (queryparams > protocol))); 
    834         } 
    835  
    836         /** Merges a list of objects **/ 
    837         utils.extend = function() { 
    838                 var args = utils.extend['arguments']; 
    839                 if (args.length > 1) { 
    840                         for ( var i = 1; i < args.length; i++) { 
    841                                 for ( var element in args[i]) { 
    842                                         args[0][element] = args[i][element]; 
    843                                 } 
    844                         } 
    845                         return args[0]; 
    846                 } 
    847                 return null; 
    848         }; 
    849  
    850         /** 
    851          * Cleans up a css dimension (e.g. '420px') and returns an integer. 
    852          */ 
    853         utils.parseDimension = function(dimension) { 
    854                 if (typeof dimension == "string") { 
    855                         if (dimension === "") { 
    856                                 return 0; 
    857                         } else if (dimension.lastIndexOf("%") > -1) { 
    858                                 return dimension; 
    859                         } else { 
    860                                 return parseInt(dimension.replace("px", ""), 10); 
    861                         } 
    862                 } 
    863                 return dimension; 
    864         } 
    865  
    866         /** Format the elapsed / remaining text. **/ 
    867         utils.timeFormat = function(sec) { 
    868                 if (sec > 0) { 
    869                         var str = Math.floor(sec / 60) < 10 ? "0" + Math.floor(sec / 60) + ":" : Math.floor(sec / 60) + ":"; 
    870                         str += Math.floor(sec % 60) < 10 ? "0" + Math.floor(sec % 60) : Math.floor(sec % 60); 
    871                         return str; 
    872                 } else { 
    873                         return "00:00"; 
    874                 } 
    875         } 
    876  
    877         /** Logger * */ 
    878         utils.log = function(msg, obj) { 
    879                 if (typeof console != "undefined" && typeof console.log != "undefined") { 
    880                         if (obj) { 
    881                                 console.log(msg, obj); 
    882                         } else { 
    883                                 console.log(msg); 
    884                         } 
    885                 } 
    886         }; 
    887  
    888         /** Replacement for getBoundingClientRect, which isn't supported in iOS 3.1.2 **/ 
    889         utils.getBoundingClientRect = function(element) { 
    890                 if (typeof element.getBoundingClientRect == "function") { 
    891                         return element.getBoundingClientRect(); 
    892                 } else { 
    893                         return {  
    894                                 left: element.offsetLeft + DOCUMENT.body.scrollLeft,  
    895                                 top: element.offsetTop + DOCUMENT.body.scrollTop,  
    896                                 width: element.offsetWidth,  
    897                                 height: element.offsetHeight 
    898                         }; 
    899                 } 
    900         } 
    901          
    902         var _userAgentMatch = utils.userAgentMatch = function(regex) { 
    903                 var agent = navigator.userAgent.toLowerCase(); 
    904                 return (agent.match(regex) !== null); 
    905         }; 
    906  
    907         utils.isIE = function() { 
    908                 return _userAgentMatch(/msie/i); 
    909         }; 
    910          
    911         /** Matches iOS and Android devices **/  
    912         utils.isMobile = function() { 
    913                 return _userAgentMatch(/(iP(hone|ad|od))|android/i); 
    914         } 
    915  
    916         /** 
    917          * Detects whether the current browser is mobile Safari. 
    918          */ 
    919         jwplayer.utils.isIOS = function() { 
    920                 return _userAgentMatch(/iP(hone|ad|od)/i); 
    921         }; 
    922          
    923         utils.isIPod = function() { 
    924                 return _userAgentMatch(/iP(hone|od)/i); 
    925         }; 
    926  
    927         utils.isIPad = function() { 
    928                 return _userAgentMatch(/iPad/i); 
    929         }; 
    930  
    931         /** Save a setting **/ 
    932         utils.saveCookie = function(name, value) { 
    933                 DOCUMENT.cookie = "jwplayer." + name + "=" + value + "; path=/"; 
    934         } 
    935  
    936         /** Retrieve saved  player settings **/ 
    937         utils.getCookies = function() { 
    938                 var jwCookies = {}; 
    939                 var cookies = DOCUMENT.cookie.split('; '); 
    940                 for (var i=0; i<cookies.length; i++) { 
    941                         var split = cookies[i].split('='); 
    942                         if (split[0].indexOf("jwplayer.") == 0) { 
    943                                 jwCookies[split[0].substring(9, split[0].length)] = utils.serialize(split[1]); 
    944                         } 
    945                 } 
    946                 return jwCookies; 
    947         } 
    948          
    949         /** Loads an XML file into a DOM object * */ 
    950         utils.ajax = function(xmldocpath, completecallback, errorcallback) { 
    951                 var xmlhttp; 
    952                 if (_isCrossdomain(xmldocpath) && utils.exists(WINDOW.XDomainRequest)) { 
    953                         // IE9 
    954                         xmlhttp = new XDomainRequest(); 
    955                         xmlhttp.onload = _ajaxComplete(xmlhttp, xmldocpath, completecallback, errorcallback); 
    956                         xmlhttp.onerror = _ajaxError(errorcallback, xmldocpath, xmlhttp); 
    957                 } else if (utils.exists(WINDOW.XMLHttpRequest)) { 
    958                         // Firefox, Chrome, Opera, Safari 
    959                         xmlhttp = new XMLHttpRequest(); 
    960                         xmlhttp.onreadystatechange = _readyStateChangeHandler(xmlhttp, xmldocpath, completecallback, errorcallback); 
    961                         xmlhttp.onerror = _ajaxError(errorcallback, xmldocpath); 
    962                 } else { 
    963                         if (errorcallback) errorcallback(); 
    964                 } 
    965                   
    966                 try { 
    967                         xmlhttp.open("GET", xmldocpath, true); 
    968                         xmlhttp.send(null); 
    969                 } catch (error) { 
    970                         if (errorcallback) errorcallback(xmldocpath); 
    971                 } 
    972                 return xmlhttp; 
    973         }; 
    974          
    975         function _isCrossdomain(path) { 
    976                 if (path && path.indexOf("://") >= 0) { 
    977                         if (path.split("/")[2] != window.location.href.split("/")[2]) 
    978                                 return true 
    979                 }  
    980                 return false;    
    981         } 
    982          
    983         function _ajaxError(errorcallback, xmldocpath, xmlhttp) { 
    984                 return function() { 
    985                         errorcallback(xmldocpath); 
    986                 } 
    987         } 
    988          
    989         function _readyStateChangeHandler(xmlhttp, xmldocpath, completecallback, errorcallback) { 
    990                 return function() { 
    991                         if (xmlhttp.readyState === 4) { 
    992                                 if (xmlhttp.status == 200) { 
    993                                         _ajaxComplete(xmlhttp, xmldocpath, completecallback, errorcallback)(); 
    994                                 } else if (errorcallback) { 
    995                                         errorcallback(xmldocpath); 
    996                                 } 
    997                         } 
    998                 } 
    999         } 
    1000          
    1001         function _ajaxComplete(xmlhttp, xmldocpath, completecallback, errorcallback) { 
    1002                 return function() { 
    1003                         // Handle the case where an XML document was returned with an incorrect MIME type. 
    1004                         if (!utils.exists(xmlhttp.responseXML)) { 
    1005                                 try { 
    1006                                         var parsedXML; 
    1007                                         // Parse XML in FF/Chrome/Safari/Opera 
    1008                                         if (WINDOW.DOMParser) { 
    1009                                                 parsedXML = (new DOMParser()).parseFromString(xmlhttp.responseText,"text/xml"); 
    1010                                         } else {  
    1011                                                 // Internet Explorer 
    1012                                                 parsedXML = new ActiveXObject("Microsoft.XMLDOM"); 
    1013                                                 parsedXML.async="false"; 
    1014                                                 parsedXML.loadXML(xmlhttp.responseText); 
    1015                                         } 
    1016                                         if (parsedXML) { 
    1017                                                 xmlhttp = utils.extend({}, xmlhttp, {responseXML:parsedXML}); 
    1018                                         } 
    1019                                 } catch(e) { 
    1020                                         if (errorcallback) errorcallback(xmldocpath); 
    1021                                         return; 
    1022                                 } 
    1023                         } 
    1024                         completecallback(xmlhttp); 
    1025                 } 
    1026         } 
    1027  
    1028         /** Returns the true type of an object * */ 
    1029         utils.typeOf = function(value) { 
    1030                 var typeofString = typeof value; 
    1031                 if (typeofString === 'object') { 
    1032                         if (!value) return "null"; 
    1033                         return (value instanceof Array) ? 'array' : typeofString; 
    1034                 } else { 
    1035                         return typeofString; 
    1036                 } 
    1037         }; 
    1038  
    1039         /* Normalizes differences between Flash and HTML5 internal players' event responses. */ 
    1040         utils.translateEventResponse = function(type, eventProperties) { 
    1041                 var translated = jwplayer.utils.extend({}, eventProperties); 
    1042                 if (type == jwplayer.api.events.JWPLAYER_FULLSCREEN && !translated.fullscreen) { 
    1043                         translated.fullscreen = translated.message == "true" ? true : false; 
    1044                         delete translated.message; 
    1045                 } else if (typeof translated.data == "object") { 
    1046                         // Takes ViewEvent "data" block and moves it up a level 
    1047                         translated = jwplayer.utils.extend(translated, translated.data); 
    1048                         delete translated.data; 
    1049                 } else if (typeof translated.metadata == "object") { 
    1050                         jwplayer.utils.deepReplaceKeyName(translated.metadata, ["__dot__","__spc__","__dsh__"], ["."," ","-"]); 
    1051                 } 
    1052                  
    1053                 var rounders = ["position", "duration", "offset"]; 
    1054                 for (var rounder in rounders) { 
    1055                         if (translated[rounders[rounder]]) { 
    1056                                 translated[rounders[rounder]] = Math.round(translated[rounders[rounder]] * 1000) / 1000; 
    1057                         } 
    1058                 } 
    1059                  
    1060                 return translated; 
    1061         } 
    1062  
    1063  
    1064         utils.transform = function(domelement, xscale, yscale, xoffset, yoffset) { 
    1065                 // Set defaults 
    1066                 if (!jwplayer.utils.exists(xscale)) xscale = 1; 
    1067                 if (!jwplayer.utils.exists(yscale)) yscale = 1; 
    1068                 if (!jwplayer.utils.exists(xoffset)) xoffset = 0; 
    1069                 if (!jwplayer.utils.exists(yoffset)) yoffset = 0; 
    1070                  
    1071                 if (xscale == 1 && yscale == 1 && xoffset == 0 && yoffset == 0) { 
    1072                         domelement.style.webkitTransform = ""; 
    1073                         domelement.style.MozTransform = ""; 
    1074                         domelement.style.msTransform = ""; 
    1075                         domelement.style.OTransform = ""; 
    1076                 } else { 
    1077                         var value = "scale("+xscale+","+yscale+") translate("+xoffset+"px,"+yoffset+"px)"; 
    1078                         domelement.style.webkitTransform = value; 
    1079                         domelement.style.MozTransform = value; 
    1080                         domelement.style.msTransform = value; 
    1081                         domelement.style.OTransform = value; 
    1082                 } 
    1083         }; 
     666                        value = "scale("+xscale+","+yscale+") translate("+xoffset+"px,"+yoffset+"px)"; 
     667                } 
     668                 
     669        }; 
     670         
     671        utils.transform = function(element, value) { 
     672                var style = element.style; 
     673                if (exists(value)) { 
     674                        style.webkitTransform = value; 
     675                        style.MozTransform = value; 
     676                        style.msTransform = value; 
     677                        style.OTransform = value; 
     678                } 
     679        } 
    1084680         
    1085681        /** 
     
    1111707                        style = {}, 
    1112708                        video = (domelement.tagName.toLowerCase() == "video"), 
    1113                         transform = false, 
     709                        scale = false, 
    1114710                        stretchClass; 
    1115711                 
     
    1132728                        xscale = yscale = 1; 
    1133729                case _stretching.EXACTFIT: 
    1134                 transform = true; 
     730                        scale = true; 
    1135731                        break; 
    1136732                case _stretching.UNIFORM: 
     
    1139735                                elementHeight = elementHeight * yscale; 
    1140736                                if (elementWidth / parentWidth > 0.95) { 
    1141                                         transform = true; 
     737                                        scale = true; 
    1142738                                        stretchClass = "jwexactfit"; 
    1143739                                        xscale = Math.ceil(100 * parentWidth / elementWidth) / 100; 
     
    1148744                                elementHeight = elementHeight * xscale; 
    1149745                                if (elementHeight / parentHeight > 0.95) { 
    1150                                         transform = true; 
     746                                        scale = true; 
    1151747                                        stretchClass = "jwexactfit"; 
    1152748                                        yscale = Math.ceil(100 * parentHeight / elementHeight) / 100; 
     
    1161757 
    1162758                if (video) { 
    1163                         if (transform) { 
     759                        if (scale) { 
    1164760                                domelement.style.width = elementWidth + "px"; 
    1165761                                domelement.style.height = elementHeight + "px";  
    1166762                                xoff = ((parentWidth - elementWidth) / 2) / xscale; 
    1167763                                yoff = ((parentHeight - elementHeight) / 2) / yscale; 
    1168                                 utils.transform(domelement, xscale, yscale, xoff, yoff); 
     764                                utils.scale(domelement, xscale, yscale, xoff, yoff); 
    1169765                        } else { 
    1170766                                domelement.style.width = ""; 
     
    1185781        }; 
    1186782 
    1187 })(jwplayer); 
     783})(jwplayer.utils); 
    1188784/** 
    1189785 * String utilities for the JW Player. 
     
    21191715                                fallback: true, 
    21201716                                height: 300, 
    2121                                 primary: "flash", 
     1717                                primary: "html5", 
    21221718                                width: 400, 
    21231719                                base: undefined 
     
    21311727                if (!parsedConfig.modes) { 
    21321728                        parsedConfig.modes = _playerDefaults( 
    2133                                         parsedConfig.primarh, 
     1729                                        parsedConfig.primary, 
    21341730                                        parsedConfig.base,  
    21351731                                        parsedConfig.html5player,  
     
    23561952 * Flash mode embedder the JW Player 
    23571953 * @author Zach 
    2358  * @version 5.5 
     1954 * @modified Pablo 
     1955 * @version 6.0 
    23591956 */ 
    23601957(function(jwplayer) { 
     
    25212118                        } 
    25222119                         
    2523                         var bgcolor = "#000000"; 
    2524                          
    2525                         var flashPlayer; 
    2526                          
    2527                         console.log(params); 
    2528                         var flashvars = jsonToFlashvars(params); 
    2529                         console.log(flashvars); 
     2120                        var bgcolor = "#000000", 
     2121                                flashPlayer, 
     2122                                flashvars = jsonToFlashvars(params); 
    25302123                         
    25312124                        if (utils.isIE()) { 
     
    26742267                                _api.setPlayer(html5player, "html5"); 
    26752268                        } else { 
    2676                                 return null; 
     2269                                var scriptLoader = new utils.scriptloader(_player.src); 
     2270                                scriptLoader.addEventListener(jwplayer.events.COMPLETE, this.embed); 
     2271                                scriptLoader.load(); 
    26772272                        } 
    26782273                } 
  • branches/jw6/jwplayer.html5.js

    r2192 r2193  
    1 (function(a){a.html5={}})(jwplayer);(function(a){a.utils={}})(jwplayer.html5);(function(a){var b=a.animations=function(){};b.transform=function(c,d){c.style.webkitTransform=d;c.style.MozTransform=d;c.style.OTransform=d;c.style.msTransform=d};b.transformOrigin=function(c,d){c.style.webkitTransformOrigin=d;c.style.MozTransformOrigin=d;c.style.OTransformOrigin=d;c.style.msTransformOrigin=d};b.rotate=function(c,d){b.transform(c,"rotate("+d+"deg)")}})(jwplayer.html5.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(m){var v=m.html5,h=m.utils,j=m.events,q=m.events.state,p=h.css,b="button",o="text",e="divider",r="slider",f="relative",g="absolute",a="none",n="block",t="inline",l="inline-block",c="left",w="right",k="100%",s="width .25s linear, left .25s linear, opacity .25s, background .25s",u=".jwcontrolbar",d=document;v.controlbar=function(D,ar){var B,W,C={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:o}]},center:{position:"center",elements:[{name:"time",type:r}]},right:{position:"right",elements:[{name:"duration",type:o},{name:"blank",type:b},{name:"divider",type:e},{name:"mute",type:b},{name:"volume",type:r},{name:"divider",type:e},{name:"fullscreen",type:b}]}}},U,aB,am,az,ap,aJ,K,N,aj=false,at=0,Z={play:"pause",mute:"unmute",fullscreen:"normalscreen"},aA={play:false,mute:false,fullscreen:false},A={play:ae,mute:O,fullscreen:ab,next:z,prev:ah},E={time:Y,volume:aE};function aD(){am={};B=D;ap=B.id+"_controlbar";aJ=K=0;az=P();az.id=ap;az.className="jwcontrolbar";window.addEventListener("mousemove",aI,false);window.addEventListener("mouseup",aI,false);W=B.skin;U=h.extend({},C,W.getComponentSettings("controlbar"),ar);aB=W.getComponentLayout("controlbar");if(!aB){aB=C.layout}X();av();x();Q();F();aF()}function x(){B.jwAddEventListener(m.events.JWPLAYER_MEDIA_TIME,aK);B.jwAddEventListener(m.events.JWPLAYER_PLAYER_STATE,H);B.jwAddEventListener(m.events.JWPLAYER_MEDIA_MUTE,aF);B.jwAddEventListener(m.events.JWPLAYER_MEDIA_VOLUME,F);B.jwAddEventListener(m.events.JWPLAYER_MEDIA_BUFFER,L);B.jwAddEventListener(m.events.JWPLAYER_FULLSCREEN,G);B.jwAddEventListener(m.events.JWPLAYER_PLAYLIST_LOADED,Q)}function aK(aM){var aL=false,aN;if(am.elapsed){aN=h.timeFormat(aM.position);am.elapsed.innerHTML=aN;aL=(aN.length!=h.timeFormat(K).length)}if(am.duration){aN=h.timeFormat(aM.duration);am.duration.innerHTML=aN;aL=(aL||(aN.length!=h.timeFormat(aJ).length))}if(aM.duration>0){ay(aM.position/aM.duration)}else{ay(0)}aJ=aM.duration;K=aM.position;if(aL){ai()}}function H(aL){switch(aL.newstate){case q.BUFFERING:case q.PLAYING:p(au(".jwtimeSliderThumb"),{opacity:1});T("play",true);break;case q.PAUSED:if(!aj){T("play",false)}break;case q.IDLE:T("play",false);p(au(".jwtimeSliderThumb"),{opacity:0});if(am.timeRail){am.timeRail.className="jwrail";setTimeout(function(){am.timeRail.className+=" jwsmooth"},100)}aC(0);aK({position:0,duration:0});break;case q.COMPLETED:p(au(),{opacity:0});break}}function aF(){var aL=B.jwGetMute();T("mute",aL);y(aL?0:N)}function F(){N=B.jwGetVolume()/100;y(N)}function L(aL){aC(aL.bufferPercent/100)}function G(aL){T("fullscreen",aL.fullscreen)}function Q(aL){if(B.jwGetPlaylist().length<2){p(au(".jwnext"),{display:"none"});p(au(".jwprev"),{display:"none"})}else{p(au(".jwnext"),{display:undefined});p(au(".jwprev"),{display:undefined})}ai()}function X(){h.clearCss("#"+ap);p("#"+ap,{height:ad("background").height,bottom:U.margin?U.margin:0,left:U.margin?U.margin:0,right:U.margin?U.margin:0});p(au(".jwtext"),{font:U.fontsize+"px/"+ad("background").height+"px "+U.font,color:U.fontcolor,"font-weight":U.fontweight,"font-style":U.fontstyle,"text-align":"center",padding:"0 5px"})}function au(aL){return"#"+ap+(aL?" "+aL:"")}function P(){return d.createElement("span")}function av(){var aN=an("capLeft");var aM=an("capRight");var aL=an("background",{position:g,left:ad("capLeft").width,right:ad("capRight").width,"background-repeat":"repeat-x"},true);if(aL){az.appendChild(aL)}if(aN){az.appendChild(aN)}aw();if(aM){az.appendChild(aM)}}function R(aL){switch(aL.type){case e:return ag(aL);break;case o:return ao(aL.name);break;case b:if(aL.name!="blank"){return af(aL.name)}break;case r:return S(aL.name);break}}function an(aN,aQ,aM,aS){var aP=P();aP.className="jw"+aN;var aL=aS?" left center":" center";var aO=ad(aN);aP.innerHTML="&nbsp;";if(!aO||aO.src==""){return}var aR;if(aM){aR={background:"url('"+aO.src+"') repeat-x "+aL}}else{aR={background:"url('"+aO.src+"') no-repeat"+aL,width:aO.width}}p(au(".jw"+aN),h.extend(aR,aQ));am[aN]=aP;return aP}function af(aN){if(!ad(aN+"Button").src){return null}var aO=d.createElement("button");aO.className="jw"+aN;aO.addEventListener("click",ak(aN),false);var aP=ad(aN+"Button");var aM=ad(aN+"ButtonOver");aO.innerHTML="&nbsp;";V(au(".jw"+aN),aP,aM);var aL=Z[aN];if(aL){V(au(".jw"+aN+".jwtoggle"),ad(aL+"Button"),ad(aL+"ButtonOver"))}am[aN]=aO;return aO}function V(aL,aM,aN){if(!aM.src){return}p(aL,{width:aM.width,background:"url("+aM.src+") center no-repeat"});if(aN.src){p(aL+":hover",{background:"url("+aN.src+") center no-repeat"})}}function ak(aL){return function(){if(A[aL]){A[aL]()}}}function ae(){if(aA.play){B.jwPause()}else{B.jwPlay()}}function O(){B.jwSetMute();aF({mute:aA.mute})}function aE(aL){if(aL<0.1){aL=0}if(aL>0.9){aL=1}B.jwSetVolume(aL*100);y(aL)}function Y(aL){B.jwSeek(aL*aJ)}function ab(){B.jwSetFullscreen()}function z(){B.jwPlaylistNext()}function ah(){B.jwPlaylistNext()}function T(aL,aM){if(!h.exists(aM)){aM=!aA[aL]}if(am[aL]){am[aL].className="jw"+aL+(aM?" jwtoggle jwtoggling":" jwtoggling");setTimeout(function(){am[aL].className=am[aL].className.replace(" jwtoggling","")},100)}aA[aL]=aM}function M(aL){return ap+"_"+aL}function ao(aL,aP){var aN=P();aN.id=M(aL);aN.className="jwtext jw"+aL;var aM={};var aO=ad(aL+"Background");if(aO.src){aM.background="url("+aO.src+") no-repeat center";aM["background-size"]="100% "+ad("background").height+"px"}p(au(".jw"+aL),aM);aN.innerHTML="00:00";am[aL]=aN;return aN}function ag(aM){if(aM.width){var aL=P();aL.className="jwblankDivider";p(aL,{width:parseInt(aM.width)});return aL}else{if(aM.element){return an(aM.element)}else{return an(aM.name)}}}function S(aL){var aO=P();aO.className="jwslider jw"+aL;var aN=an(aL+"SliderCapLeft");var aM=an(aL+"SliderCapRight");if(aM){aM.className+=" jwcapRight"}var aP=aq(aL);if(aN){aO.appendChild(aN)}aO.appendChild(aP);if(aN){aO.appendChild(aM)}p(au(".jw"+aL+" .jwrail"),{left:ad(aL+"SliderCapLeft").width,right:ad(aL+"SliderCapRight").width,});am[aL]=aO;if(aL=="time"){aH(aO);ay(0);aC(0)}else{if(aL=="volume"){ax(aO)}}return aO}function aq(aN){var aQ=P();aQ.className="jwrail jwsmooth";var aL=["Rail","Buffer","Progress"];for(var aP=0;aP<aL.length;aP++){var aO=an(aN+"Slider"+aL[aP],null,true,(aN=="volume"));if(aO){aO.className+=" jwstretch";aQ.appendChild(aO)}}var aM=an(aN+"SliderThumb");if(aM){p(au("."+aM.className),{opacity:0});aM.className+=" jwthumb";aQ.appendChild(aM)}aQ.addEventListener("mousedown",I(aN),false);am[aN+"Rail"]=aQ;return aQ}function J(){var aL=B.jwGetState();return(aL==q.IDLE||aL==q.COMPLETED)}function I(aL){return(function(aM){if(aM.button!=0){return}am[aL+"Rail"].className="jwrail";if(aL=="time"){if(!J()){B.jwSeekDrag(true);aj=aL}}else{aj=aL}})}function aI(aL){if(!aj||aL.button!=0){return}var aP=am[aj].getElementsByClassName("jwrail")[0],aQ=h.getBoundingClientRect(aP),aO=(aL.clientX-aQ.left)/aQ.width;if(aL.type=="mouseup"){var aM=aj;if(aM=="time"){B.jwSeekDrag(false)}am[aM+"Rail"].className="jwrail jwsmooth";aj=null;E[aM](aO)}else{if(aj=="time"){ay(aO)}else{y(aO)}var aN=(new Date()).getTime();if(aN-at>500){at=aN;E[aj](aO)}}}function aH(aL){if(am.timeSliderThumb){p(au(".jwtimeSliderThumb"),{"margin-left":(ad("timeSliderThumb").width/-2)})}aC(0);ay(0)}function ax(aN){var aM=ad("volumeSliderCapLeft").width,aL=ad("volumeSliderCapRight").width,aO=ad("volumeSliderRail").width;p(au(".jwvolume"),{width:(aM+aO+aL)})}var aa={};function aw(){aG("left");aG("center");aG("right");az.appendChild(aa.left);az.appendChild(aa.center);az.appendChild(aa.right);p(au(".jwright"),{right:ad("capRight").width})}function aG(aM){var aL=P();aL.className="jwgroup jw"+aM;aa[aM]=aL;if(aB[aM]){ac(aB[aM],aa[aM])}}function ac(aO,aL){if(aO&&aO.elements.length>0){for(var aN=0;aN<aO.elements.length;aN++){var aM=R(aO.elements[aN]);if(aM){aL.appendChild(aM)}}}}var ai=this.resize=function(aM,aL){p(au(".jwgroup.jwcenter"),{left:Math.round(h.parseDimension(aa.left.offsetWidth)+ad("capLeft").width),right:Math.round(h.parseDimension(aa.right.offsetWidth)+ad("capRight").width)})};this.getDisplayElement=function(){return az};function aC(aL){aL=Math.min(Math.max(0,aL),1);if(am.timeSliderBuffer){am.timeSliderBuffer.style.width=aL*100+"%"}}function al(aL,aN,aO){var aM=100*Math.min(Math.max(0,aN),1)+"%";if(am[aL+"SliderProgress"]){am[aL+"SliderProgress"].style.width=aM}if(am[aL+"SliderThumb"]){am[aL+"SliderThumb"].style.left=aM}}function y(aL){al("volume",aL,true)}function ay(aL){al("time",aL)}function ad(aL){var aM=W.getSkinElement("controlbar",aL);if(aM){return aM}else{return{width:0,height:0,src:"",image:undefined,ready:false}}}this.show=function(){p(au(),{opacity:1})};this.hide=function(){p(au(),{opacity:0})};aD()};p(u,{position:g,overflow:"hidden",opacity:0,"-webkit-transition":s,"-moz-transition":s,"-o-transition":s});p(u+" span",{height:k,"-webkit-user-select":a,"-webkit-user-drag":a,"user-select":a,"user-drag":a});p(u+" .jwgroup",{display:t});p(u+" span, "+u+" .jwgroup button,"+u+" .jwleft",{position:f,"float":c});p(u+" .jwright",{position:g});p(u+" .jwcenter",{position:g});p(u+" button",{display:l,height:k,border:a,cursor:"pointer","-webkit-transition":s,"-moz-transition":s,"-o-transition":s});p(u+" .jwcapRight",{right:0,position:g});p(u+" .jwtime,"+u+" .jwgroup span.jwstretch",{position:g,height:k,width:k,left:0});p(u+" .jwrail,"+u+" .jwthumb",{position:g,height:k,cursor:"pointer"});p(u+" .jwtime .jwsmooth span",{"-webkit-transition":s,"-moz-transition":s,"-o-transition":s});p(u+" .jwdivider+.jwdivider",{display:a});p(u+" .jwtext",{padding:"0 5px","text-align":"center"});p(u+" .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);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="20"/><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="blank"/><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,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAIAAABvFaqvAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAElJREFUOI3t1LERACAMQlFgGvcfxNIhHMK4gsUvUviOmgtNsiAZkBSEKxKEnCYkkQrJn/YwbUNiSDDYRZaQRDaShv+oX9GBZEIuK+8hXVLs+/YAAAAASUVORK5CYII="/><element name="blankButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAYCAYAAAAyJzegAAAAFElEQVQYV2P8//8/AzpgHBUc7oIAGZdH0RjKN8EAAAAASUVORK5CYII="/><element name="capLeft" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAYCAYAAAA7zJfaAAAAQElEQVQIWz3LsRGAMADDQJ0XB5bMINABZ9GENGrszxhjT2WLSqxEJG2JQrTMdV2q5LpOAvyRaVmsi7WdeZ/7+AAaOTq7BVrfOQAAAABJRU5ErkJggg=="/><element name="capRight" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAYCAYAAAA7zJfaAAAAQElEQVQIWz3LsRGAMADDQJ0XB5bMINABZ9GENGrszxhjT2WLSqxEJG2JQrTMdV2q5LpOAvyRaVmsi7WdeZ/7+AAaOTq7BVrfOQAAAABJRU5ErkJggg=="/><element name="divider" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAYCAIAAAC0rgCNAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADhJREFUCB0FwcENgEAAw7Aq+893g8APUILNOQcbFRktVGqUVFRkWNz3xTa2sUaLNUosKlRUvvf5AdbWOTtzmzyWAAAAAElFTkSuQmCC"/><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,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAYCAYAAAA/OUfnAAAAO0lEQVQYlWP4//8/Awwz0JgDBP/BeN6Cxf/hnI2btiI4u/fsQ3AOHjqK4Jw4eQbBOX/hEoKDYjSd/AMA4cS4mfLsorgAAAAASUVORK5CYII="/><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"><elements><element name="background" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyAQMAAAAk8RryAAAABlBMVEUAAAAAAAClZ7nPAAAAAnRSTlOZpuml+rYAAAASSURBVBhXY2AYJuA/GBwY6jQAyDyoK8QcL4QAAAAASUVORK5CYII="/><element name="playIcon" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAiUlEQVR42u3XSw2AMBREURwgAQlIQAISKgUpSEFKJeCg5b0E0kWBTVcD9ySTsL0Jn9IBAAAA+K2UUrBlW/Rr5ZDoIeeuoFkxJD9ss03aIXXQqB9SttoG7ZA6qNcOKdttiwcJh9RB+iFl4SshkRBuLR72+9cvH0SOKI2HRo7x/Fi1/uoCAAAAwLsD8ki99IlO2dQAAAAASUVORK5CYII="/><element name="muteIcon" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAVUlEQVR42u3WMQrAIAxAUW/g/SdvGmvpoOBeSHgPsjj5QTANAACARCJilIhYM0tEvJM+Ik3Id9E957kQIb+F3OdCPC0hPkQriqWx9hp/x/QGAABQyAPLB22VGrpLDgAAAABJRU5ErkJggg=="/><element name="errorIcon" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAA/0lEQVR42u2U0QmEMBAF7cASLMESUoIlpARLSCkpwRJSgiWkhOvAXD4WsgRkyaG5DbyB+Yvg8KITAAAAAAAYk+u61mwk15EjPtlEfihmqIiZR1Qx80ghjgdUuiHXGHSVsoag0x6x8DUoyjD5KovmEJ9NTDMRPIT0mtdIUkjlonuNohO+Ha99DTmkuGgKCTcvebAzx82ZoCWC3/3aIMWSRucaxcjORSFY4xpFdjYJGp1rFGcyCYZ/RVh6AUnfcNZ2zih3/mGj1jVCdiNDwyrq1rA/xMdeEXvDVdnYc1vDc3uPkDObXrlaxbNHSOohQhr/WOeLEWfWTgAAAAAAADzNF9sHJ7PJ57MlAAAAAElFTkSuQmCC"/><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,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyAQMAAAAk8RryAAAABlBMVEUAAAAAAAClZ7nPAAAAAnRSTlOZpuml+rYAAAASSURBVBhXY2AYJuA/GBwY6jQAyDyoK8QcL4QAAAAASUVORK5CYII="/></elements></component><component name="playlist"><settings><setting name="backgroundcolor" value="0xe8e8e8"/></settings><elements><element name="item" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAIAAAC1nk4lAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHBJREFUaN7t2MENwCAMBEEe9N8wSKYC/D8YV7CyJoRkVtVImxkZPQInMxoP0XiIxkM0HsGbjjSNBx544IEHHnjggUe/6UQeey0PIh7XTftGxKPj4eXCtLsHHh+ZxkO0Iw8PR55Ni8ZD9Hu/EAoP0dc5RRg9qeRjVF8AAAAASUVORK5CYII="/><element name="sliderCapTop" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAHCAYAAADnCQYGAAAAFUlEQVQokWP8//8/A7UB46ihI9hQAKt6FPPXhVGHAAAAAElFTkSuQmCC"/><element name="sliderRail" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAUCAYAAABiS3YzAAAAKElEQVQ4y2P4//8/Az68bNmy/+iYkB6GUUNHDR01dNTQUUNHDaXcUABUDOKhcxnsSwAAAABJRU5ErkJggg=="/><element name="sliderThumb" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAUCAYAAABiS3YzAAAAJUlEQVQ4T2P4//8/Ay4MBP9xYbz6Rg0dNXTU0FFDRw0dNZRyQwHH4NBa7GJsXAAAAABJRU5ErkJggg=="/><element name="sliderCapBottom" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAHCAYAAADnCQYGAAAAFUlEQVQokWP8//8/A7UB46ihI9hQAKt6FPPXhVGHAAAAAElFTkSuQmCC"/></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(g){var n=jwplayer.utils,k=n.css,d=jwplayer.events,e=d.state,m=g.utils.animations.rotate,l=document,a=".jwdisplay",j=".jwpreview",b="absolute",c="none",h="100%",f="opacity .25s";g.display=function(F,T){var M=F,B=F.skin,u,o,s,y,N,R,E={},p,D,P,I,z=n.extend({backgroundcolor:"#000",showicons:true},B.getComponentSettings("display"),T);_bufferRotation=!n.exists(z.bufferrotation)?15:parseInt(z.bufferrotation,10),_bufferInterval=!n.exists(z.bufferinterval)?100:parseInt(z.bufferinterval,10);function C(){u=l.createElement("div");u.id=M.id+"_display";u.className="jwdisplay";o=l.createElement("div");o.className="jwpreview";u.appendChild(o);M.jwAddEventListener(d.JWPLAYER_PLAYER_STATE,A);M.jwAddEventListener(d.JWPLAYER_PLAYLIST_ITEM,L);u.addEventListener("click",O,false);r();A({newstate:e.IDLE})}function O(V){switch(M.jwGetState()){case e.PLAYING:case e.BUFFERING:M.jwPause();break;default:M.jwPlay();break}}function r(){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=l.createElement("div"),W=G("background"),ab=G("backgroundOver");button=l.createElement("button");if(aa){button.className="jw"+ac;Z.className="jwicon";button.appendChild(Z);w("#"+u.id+" ."+button.className,W,ab);w("#"+u.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 w(V,W,X){if(!(W&&W.src)){return}k(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){k(V+".jwhover",{background:"url("+X.src+") center no-repeat"})}}function U(V){if(!z.showicons){return}if(D){u.removeChild(D)}D=E[V];if(D){u.appendChild(D)}if(V=="buffer"){P=0;I=setInterval(function(){P+=_bufferRotation;m(D.childNodes[0],P%360)},_bufferInterval)}}function L(){var V=M.jwGetPlaylist()[M.jwGetPlaylistIndex()];var W=V?V.image:"";if(s!=W){s=W;Q(j,false);v()}}var J;function A(V){clearTimeout(J);J=setTimeout(function(){q(V.newstate)},100)}function q(V){clearInterval(I);switch(V){case e.COMPLETED:case e.IDLE:U("play");Q(j,true);break;case e.BUFFERING:U("buffer");break;case e.PLAYING:U();Q(j,false);break;case e.PAUSED:U("play");break}}this.getDisplayElement=function(){return u};function t(V){return"#"+u.id+" "+V}function v(){if(s){var V=new Image();V.addEventListener("load",S,false);V.src=s}else{Q(j,false);y=N=0}}function S(){y=this.width;N=this.height;x();k(t(j),{"background-image":s?("url("+s+")"):"",})}function G(V){var W=B.getSkinElement("display",V);if(W){return W}return null}function x(){n.stretch(M.jwGetStretching(),o,u.clientWidth,u.clientHeight,y,N)}this.resize=x;function Q(V,W){k(t(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()};k(a,{position:b,cursor:"pointer",width:h,height:h,overflow:"hidden",opacity:0});k(a+" .jwpreview",{position:b,width:h,height:h,"background-repeat":"no-repeat","background-position":"center",overflow:"hidden"});k(a+", "+a+" *",{"-webkit-transition":f,"-moz-transition":f,"-o-transition":f});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.resize()}if(u){u.resize()}}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,controls:true,debug:d,height:320,icons:true,item:0,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=a.extend({},_defaults,p,l(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)}this.jwPlay=g.play;this.jwPause=g.pause;this.jwStop=g.stop;this.jwSeek=g.seek;this.jwSetVolume=g.setVolume;this.jwSetMute=g.setMute;this.jwLoad=g.load;this.jwPlaylistNext=g.next;this.jwPlaylistPrev=g.prev;this.jwPlaylistItem=g.item;this.jwSetFullscreen=g.setFullscreen;this.jwResize=f.resize;this.jwSeekDrag=j.seekDrag;this.jwSetStretching=g.setStretching;function e(m){return function(){return j[m]}}this.jwGetPlaylistIndex=e("item");this.jwGetPosition=e("position");this.jwGetDuration=e("duration");this.jwGetBuffer=e("buffer");this.jwGetWidth=e("width");this.jwGetHeight=e("height");this.jwGetFullscreen=e("fullscreen");this.jwGetVolume=e("volume");this.jwGetMute=e("mute");this.jwGetState=e("state");this.jwGetStretching=e("stretching");this.jwGetPlaylist=e("playlist");this.jwDetachMedia=g.detachMedia;this.jwAttachMedia=g.attachMedia;var b;this.jwLoadInstream=function(n,m){if(!b){b=new a.instream(l,j,f,g)}setTimeout(function(){b.load(n,m)},10)};this.jwInstreamDestroy=function(){if(b){b.jwInstreamDestroy()}};this.jwAddEventListener=g.addEventListener;this.jwRemoveEventListener=g.removeEventListener;k()}})(jwplayer.html5);(function(e){var c={size:180,itemheight:60,thumbs:true,fontcolor:"#000000",overcolor:"",activecolor:"",backgroundcolor:"#f8f8f8",font:"_sans",fontsize:"",fontstyle:"",fontweight:""},j={_sans:"Arial, Helvetica, sans-serif",_serif:"Times, Times New Roman, serif",_typewriter:"Courier New, Courier, monospace"},l=jwplayer.utils,g=l.css,d=jwplayer.events,k=".jwplaylist",h=document,a="absolute",b="none",f="100%";e.playlistcomponent=function(A,M){var G=A,v=G.skin,n=l.extend({},c,G.skin.getComponentSettings("playlist"),M),H,u,N,m,p,o,t=-1,q={background:undefined,item:undefined,itemOver:undefined,itemImage:undefined,itemActive:undefined};this.getDisplayElement=function(){return H};this.resize=function(P,O){u=P;N=O};this.show=function(){_show(H)};this.hide=function(){_hide(H)};function r(){H=K("div","jwplaylist");H.id=G.id+"_jwplayer_playlistcomponent";J();if(q.item){n.itemheight=q.item.height}x();G.jwAddEventListener(jwplayer.events.JWPLAYER_PLAYLIST_LOADED,B);G.jwAddEventListener(jwplayer.events.JWPLAYER_PLAYLIST_ITEM,E)}function s(O){return"#"+H.id+(O?" ."+O:"")}function x(){var S=0,R=0,O=0,Q=n.itemheight,U=n.fontsize;l.clearCss(s());g(s("jwlist"),{"background-color":n.backgroundcolor,"background-image":q.background?"url("+q.background.src+")":"",color:n.fontcolor,"font-family":j[n.font]?j[n.font]:j._sans,"font-size":(U?U:11)+"px","font-style":n.fontstyle,"font-weight":n.fontweight});if(q.itemImage){S=(Q-q.itemImage.height)/2;R=q.itemImage.width;O=q.itemImage.height}else{R=Q*4/3;O=Q}g(s("jwplaylistimg"),{height:O,width:R,margin:S});g(s("jwlist li"),{"background-image":q.item?"url("+q.item.src+")":"",height:Q,"background-size":f+" "+Q+"px",cursor:"pointer"});var P={overflow:"hidden"};if(n.activecolor!==""){P.color=n.activecolor}if(q.itemActive){P["background-image"]="url("+q.itemActive.src+")"}g(s("jwlist li.active"),P);var T={overflow:"hidden"};if(n.overcolor!==""){T.color=n.overcolor}if(q.itemOver){T["background-image"]="url("+q.itemOver.src+")"}g(s("jwlist li:hover"),T);g(s("jwtextwrapper"),{padding:"5px 5px 0 "+(S?0:"5px"),height:Q-5,position:"relative"});g(s("jwtitle"),{height:U?U+10:20,"line-height":U?U+10:20,overflow:"hidden",display:"inline-block",width:f,"font-size":U?U:13,"font-weight":n.fontweight?n.fontweight:"bold"});g(s("jwdescription"),{display:"block","line-height":U?U+4:16,overflow:"hidden",height:Q,position:"relative"});g(s("jwduration"),{position:"absolute",right:5})}function y(){var O=K("ul","jwlist");O.id=H.id+"_ul"+Math.round(Math.random()*10000000);return O}function z(R){var W=m[R],V=K("li","jwitem");V.id=o.id+"_item_"+R;var S=K("div","jwplaylistimg jwfill");if(F()&&(W.image||W["playlist.image"]||q.itemImage)){var T;if(W["playlist.image"]){T=W["playlist.image"]}else{if(W.image){T=W.image}else{if(q.itemImage){T=q.itemImage.src}}}g("#"+V.id+" .jwplaylistimg",{"background-image":T?"url("+T+")":null});L(V,S)}var O=K("div","jwtextwrapper");var U=K("span","jwtitle");U.innerHTML=W?W.title:"";L(O,U);if(W.description){var Q=K("span","jwdescription");Q.innerHTML=W.description;L(O,Q)}if(W.duration>0){var P=K("span","jwduration");P.innerHTML=l.timeFormat(W.duration);L(U,P)}L(V,O);return V}function K(P,O){var Q=h.createElement(P);if(O){Q.className=O}return Q}function L(O,P){O.appendChild(P)}function B(P){H.innerHTML="";m=C();if(!m){return}items=[];o=y();for(var Q=0;Q<m.length;Q++){var O=z(Q);O.onclick=I(Q);L(o,O);items.push(O)}t=G.jwGetPlaylistIndex();L(H,o);if(l.isIOS()&&window.iScroll){o.style.height=n.itemheight*m.length+"px";var R=new iScroll(H.id)}}function C(){var P=G.jwGetPlaylist();var Q=[];for(var O=0;O<P.length;O++){if(!P[O]["ova.hidden"]){Q.push(P[O])}}return Q}function I(O){return function(){G.jwPlaylistItem(O);G.jwPlay(true)}}function w(){o.scrollTop=G.jwGetPlaylistIndex()*n.itemheight}function F(){return n.thumbs.toString().toLowerCase()=="true"}function E(O){if(t>=0){h.getElementById(o.id+"_item_"+t).className="jwitem";t=O.index}h.getElementById(o.id+"_item_"+O.index).className="jwitem active";w()}function J(){for(var O in q){q[O]=D(O)}}function D(O){return v.getSkinElement("playlist",O)}r();return this};g(k,{overflow:"hidden",position:"absolute",width:f,height:f});g(k+" .jwplaylistimg",{position:"relative",width:f,"float":"left",margin:"0 5px 0 0",background:"black",overflow:"hidden"});g(k+" .jwlist",{width:f,height:f,"list-style":"none",margin:0,padding:0,"overflow-y":"auto"});g(k+" .jwlist li",{width:f});g(k+" .jwtextwrapper",{overflow:"hidden"})})(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(z){var F=z.getElementsByTagName("component");if(F.length===0){return}for(var I=0;I<F.length;I++){var D=F[I].getAttribute("name");var C={settings:{},elements:{},layout:{}};p[D]=C;var H=F[I].getElementsByTagName("elements")[0].getElementsByTagName("element");for(var G=0;G<H.length;G++){c(H[G],D)}var A=F[I].getElementsByTagName("settings")[0];if(A&&A.childNodes.length>0){var L=A.getElementsByTagName("setting");for(var Q=0;Q<L.length;Q++){var R=L[Q].getAttribute("name");var J=L[Q].getAttribute("value");var y=/color$/.test(R)?"color":null;p[D].settings[R]=b.typechecker(J,y)}}var M=F[I].getElementsByTagName("layout")[0];if(M&&M.childNodes.length>0){var N=M.getElementsByTagName("group");for(var x=0;x<N.length;x++){var B=N[x];p[D].layout[B.getAttribute("position")]={elements:[]};for(var P=0;P<B.attributes.length;P++){var E=B.attributes[P];p[D].layout[B.getAttribute("position")][E.name]=E.value}var O=B.getElementsByTagName("*");for(var w=0;w<O.length;w++){var u=O[w];p[D].layout[B.getAttribute("position")].elements.push({type:u.tagName});for(var v=0;v<u.attributes.length;v++){var K=u.attributes[v];p[D].layout[B.getAttribute("position")].elements[w][K.name]=K.value}if(!b.exists(p[D].layout[B.getAttribute("position")].elements[w].name)){p[D].layout[B.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(O){var I={abort:v,canplay:o,canplaythrough:v,durationchange:z,emptied:v,ended:v,error:k,loadeddata:v,loadedmetadata:o,loadstart:v,pause:N,play:N,playing:N,progress:v,ratechange:v,readystatechange:v,seeked:v,seeking:v,stalled:v,suspend:v,timeupdate:P,volumechange:j,waiting:r},u=a.extensionmap,A,x,s,T,m,L,S,D,J,B,e=b.IDLE,E,l=-1,C=-1,G=new d.eventdispatcher(),q=false;a.extend(this,G);function Q(U){s=U;K();s.controls=true;s.controls=false;q=true}function K(){for(var U in I){s.addEventListener(U,I[U],false)}}function p(U,V){if(q){G.sendEvent(U,V)}}function v(U){}function z(U){if(!q){return}if(T<0){T=s.duration}P()}function P(U){if(!q){return}if(e==b.PLAYING&&!B){m=s.currentTime;p(d.JWPLAYER_MEDIA_TIME,{position:m,duration:T});if(m>=T&&T>0){M()}}}function o(U){if(!q){return}if(!S){S=true;n();if(J>0){y(J)}}}function n(){if(!D){D=true;p(d.JWPLAYER_MEDIA_BUFFER_FULL)}}function N(U){if(!q||B){return}if(s.paused){g()}else{t(b.PLAYING)}}function r(U){if(!q){return}t(b.BUFFERING)}function k(U){if(!q){return}a.log("Error: %o",s.error);t(b.IDLE)}function f(U){var V=u[a.extension(U)];return(!!V&&!!V.html5&&s.canPlayType(V.html5))}function F(W){var U=W.sources;if(U&&U.length>0){for(var V=0;V<U.length;V++){if(f(U[V].file)){return U[V].file}}}else{if(W.file&&f(W.file)){return W.file}}return null}this.load=function(U){if(!q){return}A=U;S=false;D=false;J=0;T=U.duration?U.duration:-1;m=0;x=F(A);if(!x){a.log("Could not find a file to play.");return}t(b.BUFFERING);s.src=x;s.load();l=setInterval(h,100);if(a.isMobile()){s.controls=true}if(a.isIPod()){n()}};var w=this.stop=function(){if(!q){return}s.removeAttribute("src");s.load();clearInterval(l);t(b.IDLE)};this.play=function(){if(a.isIPad()){s.controls=true}if(q){s.play()}};var g=this.pause=function(){if(q){if(a.isIPad()){s.controls=false}s.pause();t(b.PAUSED)}};this.seekDrag=function(U){if(!q){return}B=U;if(U){s.pause()}else{s.play()}};var y=this.seek=function(U){if(!q){return}if(s.readyState>=s.HAVE_FUTURE_DATA){J=0;if(!B){p(d.JWPLAYER_MEDIA_SEEK,{position:m,offset:U})}s.currentTime=U}else{J=U}};var R=this.volume=function(U){s.volume=U/100};function j(U){p(d.JWPLAYER_MEDIA_VOLUME,{volume:Math.round(s.volume*100)});p(d.JWPLAYER_MEDIA_MUTE,{mute:s.muted})}this.mute=function(U){if(!a.exists(U)){U=!s.mute}if(U){if(!s.muted){E=s.volume*100;s.muted=true;R(0)}}else{if(s.muted){R(E);s.muted=false}}};function t(U){if(U==b.PAUSED&&e==b.IDLE){return}if(B){return}if(e!=U){var V=e;e=U;p(d.JWPLAYER_PLAYER_STATE,{oldstate:V,newstate:U})}}function h(){if(!q){return}var U=H();if(U!=C){C=U;p(d.JWPLAYER_MEDIA_BUFFER,{bufferPercent:Math.round(C*100)})}if(U>=1){clearInterval(l)}}function H(){if(s.buffered.length==0||s.duration==0){return 0}else{return s.buffered.end(s.buffered.length-1)/s.duration}}function M(){t(b.IDLE);p(d.JWPLAYER_MEDIA_BEFORECOMPLETE);p(d.JWPLAYER_MEDIA_COMPLETE)}this.detachMedia=function(){q=false;return s};this.attachMedia=function(){q=true};this.getTag=function(){return s};Q(O)}})(jwplayer);(function(g){var b=jwplayer,h=b.utils,n=h.css,j=jwplayer.events,o=j.state,d=document,l="jwplayer",a="."+l+".jwfullscreen",m="jwmain",s="jwinstream",r="jwvideo",c="jwcontrols",e="jwplaylist";g.view=function(B,x){var A=B,y=x,Q,J,G,T,u=0,Z=2000,w,af,E,Y,ag,ab;this.setup=function(ak){A.skin=ak;Q=aa("div",l);Q.id=A.id;var aj=document.getElementById(A.id);aj.parentNode.replaceChild(Q,aj);J=aa("span",m);af=aa("span",r);w=y.getVideo().getTag();af.appendChild(w);G=aa("span",c);E=aa("span",s);T=aa("span",e);t();J.appendChild(af);J.appendChild(G);J.appendChild(E);Q.appendChild(J);Q.appendChild(T);d.addEventListener("webkitfullscreenchange",ac,false);d.addEventListener("mozfullscreenchange",ac,false);d.addEventListener("keydown",V,false);A.jwAddEventListener(j.JWPLAYER_PLAYER_STATE,C);C({newstate:o.IDLE});G.addEventListener("mouseout",U,false);G.addEventListener("mousemove",ah,false);if(Y){Y.getDisplayElement().addEventListener("mousemove",P,false);Y.getDisplayElement().addEventListener("mouseout",ae,false)}};function aa(ak,aj){var al=d.createElement(ak);if(aj){al.className=aj}return al}function ah(){clearTimeout(u);if(A.jwGetState()==o.PLAYING||A.jwGetState()==o.PAUSED){I();if(!X){u=setTimeout(U,Z)}}}var X=false;function P(){clearTimeout(u);X=true}function ae(){X=false}function U(){if(A.jwGetState()==o.PLAYING||A.jwGetState()==o.PAUSED){D()}clearTimeout(u);u=0}function t(){var ak=y.width,aj=y.height,al=y.componentConfig("controlbar");displaySettings=y.componentConfig("display");if(aj>40||aj.indexOf("%")){ag=new g.display(A,displaySettings);G.appendChild(ag.getDisplayElement());displaySettings.backgroundcolor=ag.getBGColor()}else{displaySettings.backgroundcolor="transparent";al.margin=0}n(S(),{"background-color":displaySettings.backgroundcolor});if(y.playlistsize>0&&y.playlistposition&&y.playlistposition!="none"){ab=new g.playlistcomponent(A,{});T.appendChild(ab.getDisplayElement())}N(ak,aj);if(!h.isMobile()){Y=new g.controlbar(A,al);G.appendChild(Y.getDisplayElement())}}var L=this.fullscreen=function(aj){if(!h.exists(aj)){aj=!y.fullscreen}if(aj){if(!y.fullscreen){O(true);if(Q.requestFullScreen){Q.requestFullScreen()}else{if(Q.mozRequestFullScreen){Q.mozRequestFullScreen()}else{if(Q.webkitRequestFullScreen){Q.webkitRequestFullScreen()}}}y.setFullscreen(true)}}else{O(false);if(y.fullscreen){if(d.cancelFullScreen){d.cancelFullScreen()}else{if(d.mozCancelFullScreen){d.mozCancelFullScreen()}else{if(d.webkitCancelFullScreen){d.webkitCancelFullScreen()}}}y.setFullscreen(false)}}};function N(al,aj){if(h.exists(al)&&h.exists(aj)){n(S(),{width:al,height:aj});y.width=al;y.height=aj}if(ag){ag.resize(al,aj)}if(Y){Y.resize(al,aj)}var an=y.playlistsize,ao=y.playlistposition;if(ab&&an>0&&ao){ab.resize(al,aj);var ak={display:"block"},am={};ak[ao]=0;am[ao]=an;if(ao=="left"||ao=="right"){ak.width=an}else{ak.height=an}n(S(e),ak);n(S(m),am)}z();return}function z(){h.stretch(y.stretching,w,af.clientWidth,af.clientHeight,w.videoWidth,w.videoHeight)}this.resize=N;this.resizeMedia=z;this.completeSetup=function(){n(S(),{opacity:1})};function V(aj){switch(aj.keyCode){case 27:if(y.fullscreen){L(false)}break;case 32:A.jwPlay();break}}function O(aj){if(aj){Q.className+=" jwfullscreen"}else{Q.className=Q.className.replace(/\s+jwfullscreen/,"")}}function ai(){var aj=[d.mozFullScreenElement,d.webkitCurrentFullScreenElement];for(var ak=0;ak<aj.length;ak++){if(aj[ak]&&aj[ak].id==A.id){return true}}return false}function ac(aj){y.setFullscreen(ai());L(y.fullscreen)}function I(){if(Y&&y.controls){Y.show()}}function D(){if(Y){Y.hide()}}function v(){if(ag){ag.show()}}function H(){if(ag){ag.hide()}}function F(){D();H()}function W(){I();v()}var K;function C(aj){clearTimeout(K);K=setTimeout(function(){ad(aj.newstate)},100)}function ad(ak){var aj={};switch(ak){case o.PLAYING:if(h.isIPod()){aj.display="block"}aj.opacity=1;n(S(r),aj);z();ah();break;case o.COMPLETED:case o.IDLE:if(h.isIPod()){aj.display="none"}aj.opacity=0;n(S(r),aj);D();v();break;case o.BUFFERING:case o.PAUSED:W();break}}function S(aj){return"#"+A.id+(aj?" ."+aj:"")}this.setupInstream=function(aj,ak){R(S(s),true);R(S(c),false);E.appendChild(aj);_instreamVideo=ak;C({newstate:o.PLAYING});_instreamMode=true};var M=this.destroyInstream=function(){R(S(s),false);R(S(c),true);E.innerHTML="";_instreamVideo=null;_instreamMode=false;N(y.width,y.height)};function R(aj,ak){n(aj,{display:ak?"block":"none"})}};var q="opacity .5s ease",k="100%",f="absolute",p=" !important";n("."+l,{position:"relative",overflow:"hidden",opacity:0,"-webkit-transition":q,"-moz-transition":q,"-o-transition":q});n("."+m,{position:f,left:0,right:0,top:0,bottom:0,"-webkit-transition":q,"-moz-transition":q,"-o-transition":q});n("."+r+" ,."+c,{position:f,height:k,width:k,"-webkit-transition":q,"-moz-transition":q,"-o-transition":q});n("."+r+" video",{background:"transparent",width:k,height:k});n("."+e,{position:f,height:k,width:k,display:"none"});n("."+s,{overflow:"hidden",position:f,top:0,left:0,bottom:0,right:0,display:"none"});n(a,{width:k,height:k,left:0,right:0,top:0,bottom:0,"z-index":1000,position:"fixed"},true);n(a+" ."+m,{left:0,right:0,top:0,bottom:0},true);n(a+" ."+e,{display:"none"},true);n("."+l+" .jwuniform",{"background-size":"contain"+p});n("."+l+" .jwfill",{"background-size":"cover"+p});n("."+l+" .jwexactfit",{"background-size":k+" "+k+p});n("."+l+" .jwnone",{"background-size":null})})(jwplayer.html5); 
     1(function(a){a.html5={}})(jwplayer);(function(a){a.utils={}})(jwplayer.html5);(function(a){var b=a.animations=function(){};b.rotate=function(c,d){a.transform(c,"rotate("+d+"deg)")}})(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(m){var v=m.html5,h=m.utils,j=m.events,q=m.events.state,p=h.css,b="button",o="text",e="divider",r="slider",f="relative",g="absolute",a="none",n="block",t="inline",l="inline-block",c="left",w="right",k="100%",s="width .25s linear, left .25s linear, opacity .25s, background .25s",u=".jwcontrolbar",d=document;v.controlbar=function(D,ar){var B,W,C={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:o}]},center:{position:"center",elements:[{name:"time",type:r}]},right:{position:"right",elements:[{name:"duration",type:o},{name:"blank",type:b},{name:"divider",type:e},{name:"mute",type:b},{name:"volume",type:r},{name:"divider",type:e},{name:"fullscreen",type:b}]}}},U,aB,am,az,ap,aJ,K,N,aj=false,at=0,Z={play:"pause",mute:"unmute",fullscreen:"normalscreen"},aA={play:false,mute:false,fullscreen:false},A={play:ae,mute:O,fullscreen:ab,next:z,prev:ah},E={time:Y,volume:aE};function aD(){am={};B=D;ap=B.id+"_controlbar";aJ=K=0;az=P();az.id=ap;az.className="jwcontrolbar";window.addEventListener("mousemove",aI,false);window.addEventListener("mouseup",aI,false);W=B.skin;U=h.extend({},C,W.getComponentSettings("controlbar"),ar);aB=W.getComponentLayout("controlbar");if(!aB){aB=C.layout}X();av();x();Q();F();aF()}function x(){B.jwAddEventListener(m.events.JWPLAYER_MEDIA_TIME,aK);B.jwAddEventListener(m.events.JWPLAYER_PLAYER_STATE,H);B.jwAddEventListener(m.events.JWPLAYER_MEDIA_MUTE,aF);B.jwAddEventListener(m.events.JWPLAYER_MEDIA_VOLUME,F);B.jwAddEventListener(m.events.JWPLAYER_MEDIA_BUFFER,L);B.jwAddEventListener(m.events.JWPLAYER_FULLSCREEN,G);B.jwAddEventListener(m.events.JWPLAYER_PLAYLIST_LOADED,Q)}function aK(aM){var aL=false,aN;if(am.elapsed){aN=h.timeFormat(aM.position);am.elapsed.innerHTML=aN;aL=(aN.length!=h.timeFormat(K).length)}if(am.duration){aN=h.timeFormat(aM.duration);am.duration.innerHTML=aN;aL=(aL||(aN.length!=h.timeFormat(aJ).length))}if(aM.duration>0){ay(aM.position/aM.duration)}else{ay(0)}aJ=aM.duration;K=aM.position;if(aL){ai()}}function H(aL){switch(aL.newstate){case q.BUFFERING:case q.PLAYING:p(au(".jwtimeSliderThumb"),{opacity:1});T("play",true);break;case q.PAUSED:if(!aj){T("play",false)}break;case q.IDLE:T("play",false);p(au(".jwtimeSliderThumb"),{opacity:0});if(am.timeRail){am.timeRail.className="jwrail";setTimeout(function(){am.timeRail.className+=" jwsmooth"},100)}aC(0);aK({position:0,duration:0});break;case q.COMPLETED:p(au(),{opacity:0});break}}function aF(){var aL=B.jwGetMute();T("mute",aL);y(aL?0:N)}function F(){N=B.jwGetVolume()/100;y(N)}function L(aL){aC(aL.bufferPercent/100)}function G(aL){T("fullscreen",aL.fullscreen)}function Q(aL){if(B.jwGetPlaylist().length<2){p(au(".jwnext"),{display:"none"});p(au(".jwprev"),{display:"none"})}else{p(au(".jwnext"),{display:undefined});p(au(".jwprev"),{display:undefined})}ai()}function X(){h.clearCss("#"+ap);p("#"+ap,{height:ad("background").height,bottom:U.margin?U.margin:0,left:U.margin?U.margin:0,right:U.margin?U.margin:0});p(au(".jwtext"),{font:U.fontsize+"px/"+ad("background").height+"px "+U.font,color:U.fontcolor,"font-weight":U.fontweight,"font-style":U.fontstyle,"text-align":"center",padding:"0 5px"})}function au(aL){return"#"+ap+(aL?" "+aL:"")}function P(){return d.createElement("span")}function av(){var aN=an("capLeft");var aM=an("capRight");var aL=an("background",{position:g,left:ad("capLeft").width,right:ad("capRight").width,"background-repeat":"repeat-x"},true);if(aL){az.appendChild(aL)}if(aN){az.appendChild(aN)}aw();if(aM){az.appendChild(aM)}}function R(aL){switch(aL.type){case e:return ag(aL);break;case o:return ao(aL.name);break;case b:if(aL.name!="blank"){return af(aL.name)}break;case r:return S(aL.name);break}}function an(aN,aQ,aM,aS){var aP=P();aP.className="jw"+aN;var aL=aS?" left center":" center";var aO=ad(aN);aP.innerHTML="&nbsp;";if(!aO||aO.src==""){return}var aR;if(aM){aR={background:"url('"+aO.src+"') repeat-x "+aL}}else{aR={background:"url('"+aO.src+"') no-repeat"+aL,width:aO.width}}p(au(".jw"+aN),h.extend(aR,aQ));am[aN]=aP;return aP}function af(aN){if(!ad(aN+"Button").src){return null}var aO=d.createElement("button");aO.className="jw"+aN;aO.addEventListener("click",ak(aN),false);var aP=ad(aN+"Button");var aM=ad(aN+"ButtonOver");aO.innerHTML="&nbsp;";V(au(".jw"+aN),aP,aM);var aL=Z[aN];if(aL){V(au(".jw"+aN+".jwtoggle"),ad(aL+"Button"),ad(aL+"ButtonOver"))}am[aN]=aO;return aO}function V(aL,aM,aN){if(!aM.src){return}p(aL,{width:aM.width,background:"url("+aM.src+") center no-repeat"});if(aN.src){p(aL+":hover",{background:"url("+aN.src+") center no-repeat"})}}function ak(aL){return function(){if(A[aL]){A[aL]()}}}function ae(){if(aA.play){B.jwPause()}else{B.jwPlay()}}function O(){B.jwSetMute();aF({mute:aA.mute})}function aE(aL){if(aL<0.1){aL=0}if(aL>0.9){aL=1}B.jwSetVolume(aL*100);y(aL)}function Y(aL){B.jwSeek(aL*aJ)}function ab(){B.jwSetFullscreen()}function z(){B.jwPlaylistNext()}function ah(){B.jwPlaylistNext()}function T(aL,aM){if(!h.exists(aM)){aM=!aA[aL]}if(am[aL]){am[aL].className="jw"+aL+(aM?" jwtoggle jwtoggling":" jwtoggling");setTimeout(function(){am[aL].className=am[aL].className.replace(" jwtoggling","")},100)}aA[aL]=aM}function M(aL){return ap+"_"+aL}function ao(aL,aP){var aN=P();aN.id=M(aL);aN.className="jwtext jw"+aL;var aM={};var aO=ad(aL+"Background");if(aO.src){aM.background="url("+aO.src+") no-repeat center";aM["background-size"]="100% "+ad("background").height+"px"}p(au(".jw"+aL),aM);aN.innerHTML="00:00";am[aL]=aN;return aN}function ag(aM){if(aM.width){var aL=P();aL.className="jwblankDivider";p(aL,{width:parseInt(aM.width)});return aL}else{if(aM.element){return an(aM.element)}else{return an(aM.name)}}}function S(aL){var aO=P();aO.className="jwslider jw"+aL;var aN=an(aL+"SliderCapLeft");var aM=an(aL+"SliderCapRight");if(aM){aM.className+=" jwcapRight"}var aP=aq(aL);if(aN){aO.appendChild(aN)}aO.appendChild(aP);if(aN){aO.appendChild(aM)}p(au(".jw"+aL+" .jwrail"),{left:ad(aL+"SliderCapLeft").width,right:ad(aL+"SliderCapRight").width,});am[aL]=aO;if(aL=="time"){aH(aO);ay(0);aC(0)}else{if(aL=="volume"){ax(aO)}}return aO}function aq(aN){var aQ=P();aQ.className="jwrail jwsmooth";var aL=["Rail","Buffer","Progress"];for(var aP=0;aP<aL.length;aP++){var aO=an(aN+"Slider"+aL[aP],null,true,(aN=="volume"));if(aO){aO.className+=" jwstretch";aQ.appendChild(aO)}}var aM=an(aN+"SliderThumb");if(aM){p(au("."+aM.className),{opacity:0});aM.className+=" jwthumb";aQ.appendChild(aM)}aQ.addEventListener("mousedown",I(aN),false);am[aN+"Rail"]=aQ;return aQ}function J(){var aL=B.jwGetState();return(aL==q.IDLE||aL==q.COMPLETED)}function I(aL){return(function(aM){if(aM.button!=0){return}am[aL+"Rail"].className="jwrail";if(aL=="time"){if(!J()){B.jwSeekDrag(true);aj=aL}}else{aj=aL}})}function aI(aL){if(!aj||aL.button!=0){return}var aP=am[aj].getElementsByClassName("jwrail")[0],aQ=h.getBoundingClientRect(aP),aO=(aL.clientX-aQ.left)/aQ.width;if(aL.type=="mouseup"){var aM=aj;if(aM=="time"){B.jwSeekDrag(false)}am[aM+"Rail"].className="jwrail jwsmooth";aj=null;E[aM](aO)}else{if(aj=="time"){ay(aO)}else{y(aO)}var aN=(new Date()).getTime();if(aN-at>500){at=aN;E[aj](aO)}}}function aH(aL){if(am.timeSliderThumb){p(au(".jwtimeSliderThumb"),{"margin-left":(ad("timeSliderThumb").width/-2)})}aC(0);ay(0)}function ax(aN){var aM=ad("volumeSliderCapLeft").width,aL=ad("volumeSliderCapRight").width,aO=ad("volumeSliderRail").width;p(au(".jwvolume"),{width:(aM+aO+aL)})}var aa={};function aw(){aG("left");aG("center");aG("right");az.appendChild(aa.left);az.appendChild(aa.center);az.appendChild(aa.right);p(au(".jwright"),{right:ad("capRight").width})}function aG(aM){var aL=P();aL.className="jwgroup jw"+aM;aa[aM]=aL;if(aB[aM]){ac(aB[aM],aa[aM])}}function ac(aO,aL){if(aO&&aO.elements.length>0){for(var aN=0;aN<aO.elements.length;aN++){var aM=R(aO.elements[aN]);if(aM){aL.appendChild(aM)}}}}var ai=this.resize=function(aM,aL){p(au(".jwgroup.jwcenter"),{left:Math.round(h.parseDimension(aa.left.offsetWidth)+ad("capLeft").width),right:Math.round(h.parseDimension(aa.right.offsetWidth)+ad("capRight").width)})};this.getDisplayElement=function(){return az};function aC(aL){aL=Math.min(Math.max(0,aL),1);if(am.timeSliderBuffer){am.timeSliderBuffer.style.width=aL*100+"%"}}function al(aL,aN,aO){var aM=100*Math.min(Math.max(0,aN),1)+"%";if(am[aL+"SliderProgress"]){am[aL+"SliderProgress"].style.width=aM}if(am[aL+"SliderThumb"]){am[aL+"SliderThumb"].style.left=aM}}function y(aL){al("volume",aL,true)}function ay(aL){al("time",aL)}function ad(aL){var aM=W.getSkinElement("controlbar",aL);if(aM){return aM}else{return{width:0,height:0,src:"",image:undefined,ready:false}}}this.show=function(){p(au(),{opacity:1})};this.hide=function(){p(au(),{opacity:0})};aD()};p(u,{position:g,overflow:"hidden",opacity:0,"-webkit-transition":s,"-moz-transition":s,"-o-transition":s});p(u+" span",{height:k,"-webkit-user-select":a,"-webkit-user-drag":a,"user-select":a,"user-drag":a});p(u+" .jwgroup",{display:t});p(u+" span, "+u+" .jwgroup button,"+u+" .jwleft",{position:f,"float":c});p(u+" .jwright",{position:g});p(u+" .jwcenter",{position:g});p(u+" button",{display:l,height:k,border:a,cursor:"pointer","-webkit-transition":s,"-moz-transition":s,"-o-transition":s});p(u+" .jwcapRight",{right:0,position:g});p(u+" .jwtime,"+u+" .jwgroup span.jwstretch",{position:g,height:k,width:k,left:0});p(u+" .jwrail,"+u+" .jwthumb",{position:g,height:k,cursor:"pointer"});p(u+" .jwtime .jwsmooth span",{"-webkit-transition":s,"-moz-transition":s,"-o-transition":s});p(u+" .jwdivider+.jwdivider",{display:a});p(u+" .jwtext",{padding:"0 5px","text-align":"center"});p(u+" .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);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="20"/><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="blank"/><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,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAIAAABvFaqvAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAElJREFUOI3t1LERACAMQlFgGvcfxNIhHMK4gsUvUviOmgtNsiAZkBSEKxKEnCYkkQrJn/YwbUNiSDDYRZaQRDaShv+oX9GBZEIuK+8hXVLs+/YAAAAASUVORK5CYII="/><element name="blankButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAYCAYAAAAyJzegAAAAFElEQVQYV2P8//8/AzpgHBUc7oIAGZdH0RjKN8EAAAAASUVORK5CYII="/><element name="capLeft" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAYCAYAAAA7zJfaAAAAQElEQVQIWz3LsRGAMADDQJ0XB5bMINABZ9GENGrszxhjT2WLSqxEJG2JQrTMdV2q5LpOAvyRaVmsi7WdeZ/7+AAaOTq7BVrfOQAAAABJRU5ErkJggg=="/><element name="capRight" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAYCAYAAAA7zJfaAAAAQElEQVQIWz3LsRGAMADDQJ0XB5bMINABZ9GENGrszxhjT2WLSqxEJG2JQrTMdV2q5LpOAvyRaVmsi7WdeZ/7+AAaOTq7BVrfOQAAAABJRU5ErkJggg=="/><element name="divider" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAYCAIAAAC0rgCNAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADhJREFUCB0FwcENgEAAw7Aq+893g8APUILNOQcbFRktVGqUVFRkWNz3xTa2sUaLNUosKlRUvvf5AdbWOTtzmzyWAAAAAElFTkSuQmCC"/><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,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAYCAYAAAA/OUfnAAAAO0lEQVQYlWP4//8/Awwz0JgDBP/BeN6Cxf/hnI2btiI4u/fsQ3AOHjqK4Jw4eQbBOX/hEoKDYjSd/AMA4cS4mfLsorgAAAAASUVORK5CYII="/><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"><elements><element name="background" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyAQMAAAAk8RryAAAABlBMVEUAAAAAAAClZ7nPAAAAAnRSTlOZpuml+rYAAAASSURBVBhXY2AYJuA/GBwY6jQAyDyoK8QcL4QAAAAASUVORK5CYII="/><element name="playIcon" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAiUlEQVR42u3XSw2AMBREURwgAQlIQAISKgUpSEFKJeCg5b0E0kWBTVcD9ySTsL0Jn9IBAAAA+K2UUrBlW/Rr5ZDoIeeuoFkxJD9ss03aIXXQqB9SttoG7ZA6qNcOKdttiwcJh9RB+iFl4SshkRBuLR72+9cvH0SOKI2HRo7x/Fi1/uoCAAAAwLsD8ki99IlO2dQAAAAASUVORK5CYII="/><element name="muteIcon" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAVUlEQVR42u3WMQrAIAxAUW/g/SdvGmvpoOBeSHgPsjj5QTANAACARCJilIhYM0tEvJM+Ik3Id9E957kQIb+F3OdCPC0hPkQriqWx9hp/x/QGAABQyAPLB22VGrpLDgAAAABJRU5ErkJggg=="/><element name="errorIcon" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAA/0lEQVR42u2U0QmEMBAF7cASLMESUoIlpARLSCkpwRJSgiWkhOvAXD4WsgRkyaG5DbyB+Yvg8KITAAAAAAAYk+u61mwk15EjPtlEfihmqIiZR1Qx80ghjgdUuiHXGHSVsoag0x6x8DUoyjD5KovmEJ9NTDMRPIT0mtdIUkjlonuNohO+Ha99DTmkuGgKCTcvebAzx82ZoCWC3/3aIMWSRucaxcjORSFY4xpFdjYJGp1rFGcyCYZ/RVh6AUnfcNZ2zih3/mGj1jVCdiNDwyrq1rA/xMdeEXvDVdnYc1vDc3uPkDObXrlaxbNHSOohQhr/WOeLEWfWTgAAAAAAADzNF9sHJ7PJ57MlAAAAAElFTkSuQmCC"/><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,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyAQMAAAAk8RryAAAABlBMVEUAAAAAAAClZ7nPAAAAAnRSTlOZpuml+rYAAAASSURBVBhXY2AYJuA/GBwY6jQAyDyoK8QcL4QAAAAASUVORK5CYII="/></elements></component><component name="playlist"><settings><setting name="backgroundcolor" value="0xe8e8e8"/></settings><elements><element name="item" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAIAAAC1nk4lAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHBJREFUaN7t2MENwCAMBEEe9N8wSKYC/D8YV7CyJoRkVtVImxkZPQInMxoP0XiIxkM0HsGbjjSNBx544IEHHnjggUe/6UQeey0PIh7XTftGxKPj4eXCtLsHHh+ZxkO0Iw8PR55Ni8ZD9Hu/EAoP0dc5RRg9qeRjVF8AAAAASUVORK5CYII="/><element name="sliderCapTop" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAHCAYAAADnCQYGAAAAFUlEQVQokWP8//8/A7UB46ihI9hQAKt6FPPXhVGHAAAAAElFTkSuQmCC"/><element name="sliderRail" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAUCAYAAABiS3YzAAAAKElEQVQ4y2P4//8/Az68bNmy/+iYkB6GUUNHDR01dNTQUUNHDaXcUABUDOKhcxnsSwAAAABJRU5ErkJggg=="/><element name="sliderThumb" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAUCAYAAABiS3YzAAAAJUlEQVQ4T2P4//8/Ay4MBP9xYbz6Rg0dNXTU0FFDRw0dNZRyQwHH4NBa7GJsXAAAAABJRU5ErkJggg=="/><element name="sliderCapBottom" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAHCAYAAADnCQYGAAAAFUlEQVQokWP8//8/A7UB46ihI9hQAKt6FPPXhVGHAAAAAElFTkSuQmCC"/></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(g){var n=jwplayer.utils,k=n.css,d=jwplayer.events,e=d.state,m=n.animations.rotate,l=document,a=".jwdisplay",j=".jwpreview",b="absolute",c="none",h="100%",f="opacity .25s";g.display=function(F,T){var M=F,B=F.skin,u,o,s,y,N,R,E={},p,D,P,I,z=n.extend({backgroundcolor:"#000",showicons:true},B.getComponentSettings("display"),T);_bufferRotation=!n.exists(z.bufferrotation)?15:parseInt(z.bufferrotation,10),_bufferInterval=!n.exists(z.bufferinterval)?100:parseInt(z.bufferinterval,10);function C(){u=l.createElement("div");u.id=M.id+"_display";u.className="jwdisplay";o=l.createElement("div");o.className="jwpreview";u.appendChild(o);M.jwAddEventListener(d.JWPLAYER_PLAYER_STATE,A);M.jwAddEventListener(d.JWPLAYER_PLAYLIST_ITEM,L);u.addEventListener("click",O,false);r();A({newstate:e.IDLE})}function O(V){switch(M.jwGetState()){case e.PLAYING:case e.BUFFERING:M.jwPause();break;default:M.jwPlay();break}}function r(){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=l.createElement("div"),W=G("background"),ab=G("backgroundOver");button=l.createElement("button");if(aa){button.className="jw"+ac;Z.className="jwicon";button.appendChild(Z);w("#"+u.id+" ."+button.className,W,ab);w("#"+u.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 w(V,W,X){if(!(W&&W.src)){return}k(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){k(V+".jwhover",{background:"url("+X.src+") center no-repeat"})}}function U(V){if(!z.showicons){return}if(D){u.removeChild(D)}D=E[V];if(D){u.appendChild(D)}if(V=="buffer"){P=0;I=setInterval(function(){P+=_bufferRotation;m(D.childNodes[0],P%360)},_bufferInterval)}}function L(){var V=M.jwGetPlaylist()[M.jwGetPlaylistIndex()];var W=V?V.image:"";if(s!=W){s=W;Q(j,false);v()}}var J;function A(V){clearTimeout(J);J=setTimeout(function(){q(V.newstate)},100)}function q(V){clearInterval(I);switch(V){case e.COMPLETED:case e.IDLE:U("play");Q(j,true);break;case e.BUFFERING:U("buffer");break;case e.PLAYING:U();Q(j,false);break;case e.PAUSED:U("play");break}}this.getDisplayElement=function(){return u};function t(V){return"#"+u.id+" "+V}function v(){if(s){var V=new Image();V.addEventListener("load",S,false);V.src=s}else{Q(j,false);y=N=0}}function S(){y=this.width;N=this.height;x();k(t(j),{"background-image":s?("url("+s+")"):"",})}function G(V){var W=B.getSkinElement("display",V);if(W){return W}return null}function x(){n.stretch(M.jwGetStretching(),o,u.clientWidth,u.clientHeight,y,N)}this.resize=x;function Q(V,W){k(t(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()};k(a,{position:b,cursor:"pointer",width:h,height:h,overflow:"hidden",opacity:0});k(a+" .jwpreview",{position:b,width:h,height:h,"background-repeat":"no-repeat","background-position":"center",overflow:"hidden"});k(a+", "+a+" *",{"-webkit-transition":f,"-moz-transition":f,"-o-transition":f});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.resize()}if(u){u.resize()}}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,controls:true,debug:d,height:320,icons:true,item:0,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=a.extend({},_defaults,p,l(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)}this.jwPlay=g.play;this.jwPause=g.pause;this.jwStop=g.stop;this.jwSeek=g.seek;this.jwSetVolume=g.setVolume;this.jwSetMute=g.setMute;this.jwLoad=g.load;this.jwPlaylistNext=g.next;this.jwPlaylistPrev=g.prev;this.jwPlaylistItem=g.item;this.jwSetFullscreen=g.setFullscreen;this.jwResize=f.resize;this.jwSeekDrag=j.seekDrag;this.jwSetStretching=g.setStretching;function e(m){return function(){return j[m]}}this.jwGetPlaylistIndex=e("item");this.jwGetPosition=e("position");this.jwGetDuration=e("duration");this.jwGetBuffer=e("buffer");this.jwGetWidth=e("width");this.jwGetHeight=e("height");this.jwGetFullscreen=e("fullscreen");this.jwGetVolume=e("volume");this.jwGetMute=e("mute");this.jwGetState=e("state");this.jwGetStretching=e("stretching");this.jwGetPlaylist=e("playlist");this.jwDetachMedia=g.detachMedia;this.jwAttachMedia=g.attachMedia;var b;this.jwLoadInstream=function(n,m){if(!b){b=new a.instream(l,j,f,g)}setTimeout(function(){b.load(n,m)},10)};this.jwInstreamDestroy=function(){if(b){b.jwInstreamDestroy()}};this.jwAddEventListener=g.addEventListener;this.jwRemoveEventListener=g.removeEventListener;k()}})(jwplayer.html5);(function(e){var c={size:180,itemheight:60,thumbs:true,fontcolor:"#000000",overcolor:"",activecolor:"",backgroundcolor:"#f8f8f8",font:"_sans",fontsize:"",fontstyle:"",fontweight:""},j={_sans:"Arial, Helvetica, sans-serif",_serif:"Times, Times New Roman, serif",_typewriter:"Courier New, Courier, monospace"},l=jwplayer.utils,g=l.css,d=jwplayer.events,k=".jwplaylist",h=document,a="absolute",b="none",f="100%";e.playlistcomponent=function(A,M){var G=A,v=G.skin,n=l.extend({},c,G.skin.getComponentSettings("playlist"),M),H,u,N,m,p,o,t=-1,q={background:undefined,item:undefined,itemOver:undefined,itemImage:undefined,itemActive:undefined};this.getDisplayElement=function(){return H};this.resize=function(P,O){u=P;N=O};this.show=function(){_show(H)};this.hide=function(){_hide(H)};function r(){H=K("div","jwplaylist");H.id=G.id+"_jwplayer_playlistcomponent";J();if(q.item){n.itemheight=q.item.height}x();G.jwAddEventListener(jwplayer.events.JWPLAYER_PLAYLIST_LOADED,B);G.jwAddEventListener(jwplayer.events.JWPLAYER_PLAYLIST_ITEM,E)}function s(O){return"#"+H.id+(O?" ."+O:"")}function x(){var S=0,R=0,O=0,Q=n.itemheight,U=n.fontsize;l.clearCss(s());g(s("jwlist"),{"background-color":n.backgroundcolor,"background-image":q.background?"url("+q.background.src+")":"",color:n.fontcolor,"font-family":j[n.font]?j[n.font]:j._sans,"font-size":(U?U:11)+"px","font-style":n.fontstyle,"font-weight":n.fontweight});if(q.itemImage){S=(Q-q.itemImage.height)/2;R=q.itemImage.width;O=q.itemImage.height}else{R=Q*4/3;O=Q}g(s("jwplaylistimg"),{height:O,width:R,margin:S});g(s("jwlist li"),{"background-image":q.item?"url("+q.item.src+")":"",height:Q,"background-size":f+" "+Q+"px",cursor:"pointer"});var P={overflow:"hidden"};if(n.activecolor!==""){P.color=n.activecolor}if(q.itemActive){P["background-image"]="url("+q.itemActive.src+")"}g(s("jwlist li.active"),P);var T={overflow:"hidden"};if(n.overcolor!==""){T.color=n.overcolor}if(q.itemOver){T["background-image"]="url("+q.itemOver.src+")"}g(s("jwlist li:hover"),T);g(s("jwtextwrapper"),{padding:"5px 5px 0 "+(S?0:"5px"),height:Q-5,position:"relative"});g(s("jwtitle"),{height:U?U+10:20,"line-height":U?U+10:20,overflow:"hidden",display:"inline-block",width:f,"font-size":U?U:13,"font-weight":n.fontweight?n.fontweight:"bold"});g(s("jwdescription"),{display:"block","line-height":U?U+4:16,overflow:"hidden",height:Q,position:"relative"});g(s("jwduration"),{position:"absolute",right:5})}function y(){var O=K("ul","jwlist");O.id=H.id+"_ul"+Math.round(Math.random()*10000000);return O}function z(R){var W=m[R],V=K("li","jwitem");V.id=o.id+"_item_"+R;var S=K("div","jwplaylistimg jwfill");if(F()&&(W.image||W["playlist.image"]||q.itemImage)){var T;if(W["playlist.image"]){T=W["playlist.image"]}else{if(W.image){T=W.image}else{if(q.itemImage){T=q.itemImage.src}}}g("#"+V.id+" .jwplaylistimg",{"background-image":T?"url("+T+")":null});L(V,S)}var O=K("div","jwtextwrapper");var U=K("span","jwtitle");U.innerHTML=W?W.title:"";L(O,U);if(W.description){var Q=K("span","jwdescription");Q.innerHTML=W.description;L(O,Q)}if(W.duration>0){var P=K("span","jwduration");P.innerHTML=l.timeFormat(W.duration);L(U,P)}L(V,O);return V}function K(P,O){var Q=h.createElement(P);if(O){Q.className=O}return Q}function L(O,P){O.appendChild(P)}function B(P){H.innerHTML="";m=C();if(!m){return}items=[];o=y();for(var Q=0;Q<m.length;Q++){var O=z(Q);O.onclick=I(Q);L(o,O);items.push(O)}t=G.jwGetPlaylistIndex();L(H,o);if(l.isIOS()&&window.iScroll){o.style.height=n.itemheight*m.length+"px";var R=new iScroll(H.id)}}function C(){var P=G.jwGetPlaylist();var Q=[];for(var O=0;O<P.length;O++){if(!P[O]["ova.hidden"]){Q.push(P[O])}}return Q}function I(O){return function(){G.jwPlaylistItem(O);G.jwPlay(true)}}function w(){o.scrollTop=G.jwGetPlaylistIndex()*n.itemheight}function F(){return n.thumbs.toString().toLowerCase()=="true"}function E(O){if(t>=0){h.getElementById(o.id+"_item_"+t).className="jwitem";t=O.index}h.getElementById(o.id+"_item_"+O.index).className="jwitem active";w()}function J(){for(var O in q){q[O]=D(O)}}function D(O){return v.getSkinElement("playlist",O)}r();return this};g(k,{overflow:"hidden",position:"absolute",width:f,height:f});g(k+" .jwplaylistimg",{position:"relative",width:f,"float":"left",margin:"0 5px 0 0",background:"black",overflow:"hidden"});g(k+" .jwlist",{width:f,height:f,"list-style":"none",margin:0,padding:0,"overflow-y":"auto"});g(k+" .jwlist li",{width:f});g(k+" .jwtextwrapper",{overflow:"hidden"})})(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(z){var F=z.getElementsByTagName("component");if(F.length===0){return}for(var I=0;I<F.length;I++){var D=F[I].getAttribute("name");var C={settings:{},elements:{},layout:{}};p[D]=C;var H=F[I].getElementsByTagName("elements")[0].getElementsByTagName("element");for(var G=0;G<H.length;G++){c(H[G],D)}var A=F[I].getElementsByTagName("settings")[0];if(A&&A.childNodes.length>0){var L=A.getElementsByTagName("setting");for(var Q=0;Q<L.length;Q++){var R=L[Q].getAttribute("name");var J=L[Q].getAttribute("value");var y=/color$/.test(R)?"color":null;p[D].settings[R]=b.typechecker(J,y)}}var M=F[I].getElementsByTagName("layout")[0];if(M&&M.childNodes.length>0){var N=M.getElementsByTagName("group");for(var x=0;x<N.length;x++){var B=N[x];p[D].layout[B.getAttribute("position")]={elements:[]};for(var P=0;P<B.attributes.length;P++){var E=B.attributes[P];p[D].layout[B.getAttribute("position")][E.name]=E.value}var O=B.getElementsByTagName("*");for(var w=0;w<O.length;w++){var u=O[w];p[D].layout[B.getAttribute("position")].elements.push({type:u.tagName});for(var v=0;v<u.attributes.length;v++){var K=u.attributes[v];p[D].layout[B.getAttribute("position")].elements[w][K.name]=K.value}if(!b.exists(p[D].layout[B.getAttribute("position")].elements[w].name)){p[D].layout[B.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(O){var I={abort:v,canplay:o,canplaythrough:v,durationchange:z,emptied:v,ended:v,error:k,loadeddata:v,loadedmetadata:o,loadstart:v,pause:N,play:N,playing:N,progress:v,ratechange:v,readystatechange:v,seeked:v,seeking:v,stalled:v,suspend:v,timeupdate:P,volumechange:j,waiting:r},u=a.extensionmap,A,x,s,T,m,L,S,D,J,B,e=b.IDLE,E,l=-1,C=-1,G=new d.eventdispatcher(),q=false;a.extend(this,G);function Q(U){s=U;K();s.controls=true;s.controls=false;q=true}function K(){for(var U in I){s.addEventListener(U,I[U],false)}}function p(U,V){if(q){G.sendEvent(U,V)}}function v(U){}function z(U){if(!q){return}if(T<0){T=s.duration}P()}function P(U){if(!q){return}if(e==b.PLAYING&&!B){m=s.currentTime;p(d.JWPLAYER_MEDIA_TIME,{position:m,duration:T});if(m>=T&&T>0){M()}}}function o(U){if(!q){return}if(!S){S=true;n();if(J>0){y(J)}}}function n(){if(!D){D=true;p(d.JWPLAYER_MEDIA_BUFFER_FULL)}}function N(U){if(!q||B){return}if(s.paused){g()}else{t(b.PLAYING)}}function r(U){if(!q){return}t(b.BUFFERING)}function k(U){if(!q){return}a.log("Error: %o",s.error);t(b.IDLE)}function f(U){var V=u[a.extension(U)];return(!!V&&!!V.html5&&s.canPlayType(V.html5))}function F(W){var U=W.sources;if(U&&U.length>0){for(var V=0;V<U.length;V++){if(f(U[V].file)){return U[V].file}}}else{if(W.file&&f(W.file)){return W.file}}return null}this.load=function(U){if(!q){return}A=U;S=false;D=false;J=0;T=U.duration?U.duration:-1;m=0;x=F(A);if(!x){a.log("Could not find a file to play.");return}t(b.BUFFERING);s.src=x;s.load();l=setInterval(h,100);if(a.isMobile()){s.controls=true}if(a.isIPod()){n()}};var w=this.stop=function(){if(!q){return}s.removeAttribute("src");s.load();clearInterval(l);t(b.IDLE)};this.play=function(){if(a.isIPad()){s.controls=true}if(q){s.play()}};var g=this.pause=function(){if(q){if(a.isIPad()){s.controls=false}s.pause();t(b.PAUSED)}};this.seekDrag=function(U){if(!q){return}B=U;if(U){s.pause()}else{s.play()}};var y=this.seek=function(U){if(!q){return}if(s.readyState>=s.HAVE_FUTURE_DATA){J=0;if(!B){p(d.JWPLAYER_MEDIA_SEEK,{position:m,offset:U})}s.currentTime=U}else{J=U}};var R=this.volume=function(U){s.volume=U/100};function j(U){p(d.JWPLAYER_MEDIA_VOLUME,{volume:Math.round(s.volume*100)});p(d.JWPLAYER_MEDIA_MUTE,{mute:s.muted})}this.mute=function(U){if(!a.exists(U)){U=!s.mute}if(U){if(!s.muted){E=s.volume*100;s.muted=true;R(0)}}else{if(s.muted){R(E);s.muted=false}}};function t(U){if(U==b.PAUSED&&e==b.IDLE){return}if(B){return}if(e!=U){var V=e;e=U;p(d.JWPLAYER_PLAYER_STATE,{oldstate:V,newstate:U})}}function h(){if(!q){return}var U=H();if(U!=C){C=U;p(d.JWPLAYER_MEDIA_BUFFER,{bufferPercent:Math.round(C*100)})}if(U>=1){clearInterval(l)}}function H(){if(s.buffered.length==0||s.duration==0){return 0}else{return s.buffered.end(s.buffered.length-1)/s.duration}}function M(){t(b.IDLE);p(d.JWPLAYER_MEDIA_BEFORECOMPLETE);p(d.JWPLAYER_MEDIA_COMPLETE)}this.detachMedia=function(){q=false;return s};this.attachMedia=function(){q=true};this.getTag=function(){return s};Q(O)}})(jwplayer);(function(g){var b=jwplayer,h=b.utils,n=h.css,j=jwplayer.events,o=j.state,d=document,l="jwplayer",a="."+l+".jwfullscreen",m="jwmain",s="jwinstream",r="jwvideo",c="jwcontrols",e="jwplaylist";g.view=function(B,x){var A=B,y=x,Q,J,G,T,u=0,Z=2000,w,af,E,Y,ag,ab;this.setup=function(ak){A.skin=ak;Q=aa("div",l);Q.id=A.id;var aj=document.getElementById(A.id);aj.parentNode.replaceChild(Q,aj);J=aa("span",m);af=aa("span",r);w=y.getVideo().getTag();af.appendChild(w);G=aa("span",c);E=aa("span",s);T=aa("span",e);t();J.appendChild(af);J.appendChild(G);J.appendChild(E);Q.appendChild(J);Q.appendChild(T);d.addEventListener("webkitfullscreenchange",ac,false);d.addEventListener("mozfullscreenchange",ac,false);d.addEventListener("keydown",V,false);A.jwAddEventListener(j.JWPLAYER_PLAYER_STATE,C);C({newstate:o.IDLE});G.addEventListener("mouseout",U,false);G.addEventListener("mousemove",ah,false);if(Y){Y.getDisplayElement().addEventListener("mousemove",P,false);Y.getDisplayElement().addEventListener("mouseout",ae,false)}};function aa(ak,aj){var al=d.createElement(ak);if(aj){al.className=aj}return al}function ah(){clearTimeout(u);if(A.jwGetState()==o.PLAYING||A.jwGetState()==o.PAUSED){I();if(!X){u=setTimeout(U,Z)}}}var X=false;function P(){clearTimeout(u);X=true}function ae(){X=false}function U(){if(A.jwGetState()==o.PLAYING||A.jwGetState()==o.PAUSED){D()}clearTimeout(u);u=0}function t(){var ak=y.width,aj=y.height,al=y.componentConfig("controlbar");displaySettings=y.componentConfig("display");if(aj>40||aj.indexOf("%")){ag=new g.display(A,displaySettings);G.appendChild(ag.getDisplayElement());displaySettings.backgroundcolor=ag.getBGColor()}else{displaySettings.backgroundcolor="transparent";al.margin=0}n(S(),{"background-color":displaySettings.backgroundcolor});if(y.playlistsize>0&&y.playlistposition&&y.playlistposition!="none"){ab=new g.playlistcomponent(A,{});T.appendChild(ab.getDisplayElement())}N(ak,aj);if(!h.isMobile()){Y=new g.controlbar(A,al);G.appendChild(Y.getDisplayElement())}}var L=this.fullscreen=function(aj){if(!h.exists(aj)){aj=!y.fullscreen}if(aj){if(!y.fullscreen){O(true);if(Q.requestFullScreen){Q.requestFullScreen()}else{if(Q.mozRequestFullScreen){Q.mozRequestFullScreen()}else{if(Q.webkitRequestFullScreen){Q.webkitRequestFullScreen()}}}y.setFullscreen(true)}}else{O(false);if(y.fullscreen){if(d.cancelFullScreen){d.cancelFullScreen()}else{if(d.mozCancelFullScreen){d.mozCancelFullScreen()}else{if(d.webkitCancelFullScreen){d.webkitCancelFullScreen()}}}y.setFullscreen(false)}}};function N(al,aj){if(h.exists(al)&&h.exists(aj)){n(S(),{width:al,height:aj});y.width=al;y.height=aj}if(ag){ag.resize(al,aj)}if(Y){Y.resize(al,aj)}var an=y.playlistsize,ao=y.playlistposition;if(ab&&an>0&&ao){ab.resize(al,aj);var ak={display:"block"},am={};ak[ao]=0;am[ao]=an;if(ao=="left"||ao=="right"){ak.width=an}else{ak.height=an}n(S(e),ak);n(S(m),am)}z();return}function z(){h.stretch(y.stretching,w,af.clientWidth,af.clientHeight,w.videoWidth,w.videoHeight)}this.resize=N;this.resizeMedia=z;this.completeSetup=function(){n(S(),{opacity:1})};function V(aj){switch(aj.keyCode){case 27:if(y.fullscreen){L(false)}break;case 32:A.jwPlay();break}}function O(aj){if(aj){Q.className+=" jwfullscreen"}else{Q.className=Q.className.replace(/\s+jwfullscreen/,"")}}function ai(){var aj=[d.mozFullScreenElement,d.webkitCurrentFullScreenElement];for(var ak=0;ak<aj.length;ak++){if(aj[ak]&&aj[ak].id==A.id){return true}}return false}function ac(aj){y.setFullscreen(ai());L(y.fullscreen)}function I(){if(Y&&y.controls){Y.show()}}function D(){if(Y){Y.hide()}}function v(){if(ag){ag.show()}}function H(){if(ag){ag.hide()}}function F(){D();H()}function W(){I();v()}var K;function C(aj){clearTimeout(K);K=setTimeout(function(){ad(aj.newstate)},100)}function ad(ak){var aj={};switch(ak){case o.PLAYING:if(h.isIPod()){aj.display="block"}aj.opacity=1;n(S(r),aj);z();ah();break;case o.COMPLETED:case o.IDLE:if(h.isIPod()){aj.display="none"}aj.opacity=0;n(S(r),aj);D();v();break;case o.BUFFERING:case o.PAUSED:W();break}}function S(aj){return"#"+A.id+(aj?" ."+aj:"")}this.setupInstream=function(aj,ak){R(S(s),true);R(S(c),false);E.appendChild(aj);_instreamVideo=ak;C({newstate:o.PLAYING});_instreamMode=true};var M=this.destroyInstream=function(){R(S(s),false);R(S(c),true);E.innerHTML="";_instreamVideo=null;_instreamMode=false;N(y.width,y.height)};function R(aj,ak){n(aj,{display:ak?"block":"none"})}};var q="opacity .5s ease",k="100%",f="absolute",p=" !important";n("."+l,{position:"relative",overflow:"hidden",opacity:0,"-webkit-transition":q,"-moz-transition":q,"-o-transition":q});n("."+m,{position:f,left:0,right:0,top:0,bottom:0,"-webkit-transition":q,"-moz-transition":q,"-o-transition":q});n("."+r+" ,."+c,{position:f,height:k,width:k,"-webkit-transition":q,"-moz-transition":q,"-o-transition":q});n("."+r+" video",{background:"transparent",width:k,height:k});n("."+e,{position:f,height:k,width:k,display:"none"});n("."+s,{overflow:"hidden",position:f,top:0,left:0,bottom:0,right:0,display:"none"});n(a,{width:k,height:k,left:0,right:0,top:0,bottom:0,"z-index":1000,position:"fixed"},true);n(a+" ."+m,{left:0,right:0,top:0,bottom:0},true);n(a+" ."+e,{display:"none"},true);n("."+l+" .jwuniform",{"background-size":"contain"+p});n("."+l+" .jwfill",{"background-size":"cover"+p});n("."+l+" .jwexactfit",{"background-size":k+" "+k+p});n("."+l+" .jwnone",{"background-size":null})})(jwplayer.html5); 
  • branches/jw6/jwplayer.js

    r2192 r2193  
    1 if(typeof jwplayer=="undefined"){jwplayer=function(a){if(jwplayer.api){return jwplayer.api.selectPlayer(a)}};var $jw=jwplayer;jwplayer.version="6.0.2192";jwplayer.vid=document.createElement("video");jwplayer.audio=document.createElement("audio");jwplayer.source=document.createElement("source");(function(h){var d=document;var o=window;var n=h.utils=function(){};n.exists=function(s){switch(typeof(s)){case"string":return(s.length>0);break;case"object":return(s!==null);case"undefined":return false}return true};var b={},q,a={};function p(){var s=d.createElement("style");s.type="text/css";d.getElementsByTagName("head")[0].appendChild(s);return s}n.css=function(s,v,t){if(!n.exists(t)){t=false}if(n.isIE()){if(!q){q=p()}}else{if(!b[s]){b[s]=p()}}if(!a[s]){a[s]={}}for(var u in v){var w=g(u,v[u],t);if(n.exists(a[s][u])&&!n.exists(w)){delete a[s][u]}else{a[s][u]=w}}if(n.isIE()){i()}else{e(s,b[s])}};function g(u,v,s){if(typeof v==="undefined"){return undefined}var t=s?" !important":"";if(typeof v=="number"){if(isNaN(v)){return undefined}switch(u){case"z-index":case"opacity":return v+t;break;default:if(u.match(/color/i)){return"#"+n.pad(v.toString(16),6)}else{return Math.ceil(v)+"px"+t}break}}else{return v+t}}function i(){var s="\n";for(var t in a){s+=r(t)}q.innerHTML=s}function e(s,t){if(t){t.innerHTML=r(s)}}function r(s){var t=s+"{\n";var v=a[s];for(var u in v){t+="  "+u+": "+v[u]+";\n"}t+="}\n";return t}n.clearCss=function(t){for(var u in a){if(u.indexOf(t)>=0){delete a[u]}}for(var s in b){if(s.indexOf(t)>=0){b[s].innerHTML=""}}};n.getAbsolutePath=function(y,x){if(!n.exists(x)){x=d.location.href}if(!n.exists(y)){return undefined}if(j(y)){return y}var z=x.substring(0,x.indexOf("://")+3);var w=x.substring(z.length,x.indexOf("/",z.length+1));var t;if(y.indexOf("/")===0){t=y.split("/")}else{var u=x.split("?")[0];u=u.substring(z.length+w.length+1,u.lastIndexOf("/"));t=u.split("/").concat(y.split("/"))}var s=[];for(var v=0;v<t.length;v++){if(!t[v]||!n.exists(t[v])||t[v]=="."){continue}else{if(t[v]==".."){s.pop()}else{s.push(t[v])}}}return z+w+"/"+s.join("/")};function j(t){if(!n.exists(t)){return}var u=t.indexOf("://");var s=t.indexOf("?");return(u>0&&(s<0||(s>u)))}n.extend=function(){var s=n.extend["arguments"];if(s.length>1){for(var u=1;u<s.length;u++){for(var t in s[u]){s[0][t]=s[u][t]}}return s[0]}return null};n.parseDimension=function(s){if(typeof s=="string"){if(s===""){return 0}else{if(s.lastIndexOf("%")>-1){return s}else{return parseInt(s.replace("px",""),10)}}}return s};n.timeFormat=function(s){if(s>0){var t=Math.floor(s/60)<10?"0"+Math.floor(s/60)+":":Math.floor(s/60)+":";t+=Math.floor(s%60)<10?"0"+Math.floor(s%60):Math.floor(s%60);return t}else{return"00:00"}};n.log=function(t,s){if(typeof console!="undefined"&&typeof console.log!="undefined"){if(s){console.log(t,s)}else{console.log(t)}}};n.getBoundingClientRect=function(s){if(typeof s.getBoundingClientRect=="function"){return s.getBoundingClientRect()}else{return{left:s.offsetLeft+d.body.scrollLeft,top:s.offsetTop+d.body.scrollTop,width:s.offsetWidth,height:s.offsetHeight}}};var k=n.userAgentMatch=function(t){var s=navigator.userAgent.toLowerCase();return(s.match(t)!==null)};n.isIE=function(){return k(/msie/i)};n.isMobile=function(){return k(/(iP(hone|ad|od))|android/i)};n.isIOS=function(){return k(/iP(hone|ad|od)/i)};n.isIPod=function(){return k(/iP(hone|od)/i)};n.isIPad=function(){return k(/iPad/i)};n.saveCookie=function(s,t){d.cookie="jwplayer."+s+"="+t+"; path=/"};n.getCookies=function(){var v={};var u=d.cookie.split("; ");for(var t=0;t<u.length;t++){var s=u[t].split("=");if(s[0].indexOf("jwplayer.")==0){v[s[0].substring(9,s[0].length)]=n.serialize(s[1])}}return v};n.ajax=function(w,v,s){var u;if(l(w)&&n.exists(o.XDomainRequest)){u=new XDomainRequest();u.onload=m(u,w,v,s);u.onerror=f(s,w,u)}else{if(n.exists(o.XMLHttpRequest)){u=new XMLHttpRequest();u.onreadystatechange=c(u,w,v,s);u.onerror=f(s,w)}else{if(s){s()}}}try{u.open("GET",w,true);u.send(null)}catch(t){if(s){s(w)}}return u};function l(s){if(s&&s.indexOf("://")>=0){if(s.split("/")[2]!=o.location.href.split("/")[2]){return true}}return false}function f(s,u,t){return function(){s(u)}}function c(t,v,u,s){return function(){if(t.readyState===4){if(t.status==200){m(t,v,u,s)()}else{if(s){s(v)}}}}}function m(t,v,u,s){return function(){if(!n.exists(t.responseXML)){try{var w;if(o.DOMParser){w=(new DOMParser()).parseFromString(t.responseText,"text/xml")}else{w=new ActiveXObject("Microsoft.XMLDOM");w.async="false";w.loadXML(t.responseText)}if(w){t=n.extend({},t,{responseXML:w})}}catch(x){if(s){s(v)}return}}u(t)}}n.typeOf=function(t){var s=typeof t;if(s==="object"){if(!t){return"null"}return(t instanceof Array)?"array":s}else{return s}};n.translateEventResponse=function(u,s){var w=n.extend({},s);if(u==h.events.JWPLAYER_FULLSCREEN&&!w.fullscreen){w.fullscreen=w.message=="true"?true:false;delete w.message}else{if(typeof w.data=="object"){w=n.extend(w,w.data);delete w.data}else{if(typeof w.metadata=="object"){n.deepReplaceKeyName(w.metadata,["__dot__","__spc__","__dsh__"],["."," ","-"])}}}var t=["position","duration","offset"];for(var v in t){if(w[t[v]]){w[t[v]]=Math.round(w[t[v]]*1000)/1000}}return w};n.hasFlash=function(){if(typeof navigator.plugins!="undefined"&&typeof navigator.plugins["Shockwave Flash"]!="undefined"){return true}if(typeof o.ActiveXObject!="undefined"){try{new ActiveXObject("ShockwaveFlash.ShockwaveFlash");return true}catch(s){}}return false};n.wrap=function(s,t){if(s.parentNode){s.parentNode.replaceChild(t,s)}t.appendChild(s)};n.getScriptPath=function(u){var s=d.getElementsByTagName("script");for(var t=0;t<s.length;t++){var v=s[t].src;if(v&&v.indexOf(u)>=0){return v.substr(0,v.indexOf(u))}}return""}})(jwplayer);(function(a){a.extensionmap={"3gp":{html5:"video/3gpp",flash:"video"},"3gpp":{html5:"video/3gpp"},"3g2":{html5:"video/3gpp2",flash:"video"},"3gpp2":{html5:"video/3gpp2"},flv:{flash:"video"},f4a:{html5:"audio/mp4"},f4b:{html5:"audio/mp4",flash:"video"},f4v:{html5:"video/mp4",flash:"video"},mov:{html5:"video/quicktime",flash:"video"},m4a:{html5:"audio/mp4",flash:"video"},m4b:{html5:"audio/mp4"},m4p:{html5:"audio/mp4"},m4v:{html5:"video/mp4",flash:"video"},mp4:{html5:"video/mp4",flash:"video"},rbs:{flash:"sound"},aac:{html5:"audio/aac",flash:"video"},mp3:{html5:"audio/mp3",flash:"sound"},ogg:{html5:"audio/ogg"},oga:{html5:"audio/ogg"},ogv:{html5:"video/ogg"},webm:{html5:"video/webm"},m3u8:{html5:"audio/x-mpegurl"},gif:{flash:"image"},jpeg:{flash:"image"},jpg:{flash:"image"},swf:{flash:"image"},png:{flash:"image"},wav:{html5:"audio/x-wav"},rtmp:{flash:"rtmp"},hls:{flash:"hls"}}})(jwplayer.utils);(function(b){var a=b.loaderstatus={NEW:0,LOADING:1,ERROR:2,COMPLETE:3},d=jwplayer.events,c=document;b.scriptloader=function(f){var g=a.NEW;var e=new d.eventdispatcher();b.extend(this,e);this.load=function(){if(g==a.NEW){g=a.LOADING;var h=c.createElement("script");h.onload=function(i){g=a.COMPLETE;e.sendEvent(d.COMPLETE)};h.onerror=function(i){g=a.ERROR;e.sendEvent(d.ERROR)};h.onreadystatechange=function(){if(h.readyState=="loaded"||h.readyState=="complete"){g=a.COMPLETE;e.sendEvent(d.COMPLETE)}};c.getElementsByTagName("head")[0].appendChild(h);h.src=f}};this.getStatus=function(){return g}}})(jwplayer.utils);(function(a){var c=document;var b=window;a.transform=function(g,f,e,i,j){if(!a.exists(f)){f=1}if(!a.exists(e)){e=1}if(!a.exists(i)){i=0}if(!a.exists(j)){j=0}if(f==1&&e==1&&i==0&&j==0){g.style.webkitTransform="";g.style.MozTransform="";g.style.msTransform="";g.style.OTransform=""}else{var h="scale("+f+","+e+") translate("+i+"px,"+j+"px)";g.style.webkitTransform=h;g.style.MozTransform=h;g.style.msTransform=h;g.style.OTransform=h}};a.stretch=function(m,r,q,j,o,k){if(!r){return}if(!q||!j||!o||!k){return}var f=q/o,i=j/k,p=0,l=0,e={},g=(r.tagName.toLowerCase()=="video"),h=false,n;if(g){a.transform(r)}n="jw"+m.toLowerCase();switch(m.toLowerCase()){case d.FILL:if(f>i){o=o*f;k=k*f}else{o=o*i;k=k*i}case d.NONE:f=i=1;case d.EXACTFIT:h=true;break;case d.UNIFORM:if(f>i){o=o*i;k=k*i;if(o/q>0.95){h=true;n="jwexactfit";f=Math.ceil(100*q/o)/100;i=1}}else{o=o*f;k=k*f;if(k/j>0.95){h=true;n="jwexactfit";i=Math.ceil(100*j/k)/100;f=1}}break;default:return;break}if(g){if(h){r.style.width=o+"px";r.style.height=k+"px";p=((q-o)/2)/f;l=((j-k)/2)/i;a.transform(r,f,i,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 d=a.stretching={NONE:"none",FILL:"fill",UNIFORM:"uniform",EXACTFIT:"exactfit"}})(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.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)}}}}};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()}}})(jwplayer.utils);(function(b){var d=new RegExp(/^(#|0x)[0-9a-fA-F]{3,6}/);b.typechecker=function(g,f){f=!b.exists(f)?c(g):f;return e(g,f)};function c(f){var g=["true","false","t","f"];if(g.toString().indexOf(f.toLowerCase().replace(" ",""))>=0){return"boolean"}else{if(d.test(f)){return"color"}else{if(!isNaN(parseInt(f,10))&&parseInt(f,10).toString().length==f.length){return"integer"}else{if(!isNaN(parseFloat(f))&&parseFloat(f).toString().length==f.length){return"float"}}}}return"string"}function e(g,f){if(!b.exists(f)){return g}switch(f){case"color":if(g.length>0){return a(g)}return null;case"integer":return parseInt(g,10);case"float":return parseFloat(g);case"boolean":if(g.toLowerCase()=="true"){return true}else{if(g=="1"){return true}}return false}return g}function a(f){f=f.replace(/(#|0x)?([0-9A-F]{3,6})$/gi,"$2");if(f.length==3){f=f.charAt(0)+f.charAt(0)+f.charAt(1)+f.charAt(1)+f.charAt(2)+f.charAt(2)}return parseInt(f,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_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 n=0;n<g.modes.length;n++){if(g.modes[n].type&&d[g.modes[n].type]){var p=g.modes[n].config;var t=g;if(p){t=b.extend(b.clone(g),p);var s=["file","levels","playlist"];for(var m=0;m<s.length;m++){var q=s[m];if(b.exists(p[q])){for(var l=0;l<s.length;l++){if(l!=m){var o=s[l];if(b.exists(t[o])&&!b.exists(p[o])){delete t[o]}}}}}}var r=new d[g.modes[n].type](k,g.modes[n],t,i,h);if(r.supportsConfig()){r.embed();e(h,g.events);return h}}}if(g.fallback){new d.download(k,g)}b.log("No suitable players found")}}i.addEventListener(c.COMPLETE,f);i.addEventListener(c.ERROR,f);i.load();return h}})(jwplayer);(function(b){var a=b.utils;function c(d,g,e,h){var f={html5:{type:"html5",src:e?e:g+"jwplayer.html5.js"},flash:{type:"flash",src:h?h:g+"jwplayer.flash.swf"}};if(d=="html5"){return[f.html5,f.flash]}else{return[f.flash,f.html5]}}b.embed.config=function(d){var e={fallback:true,height:300,primary:"flash",width:400,base:undefined},f=a.extend(e,d);if(!f.base){f.base=a.getScriptPath("jwplayer.js")}if(!f.modes){f.modes=c(f.primarh,f.base,f.html5player,f.flashplayer)}return f}})(jwplayer);(function(d){var f=d.embed,i=d.utils,g=i.css,h="pointer",c="none",a="block",e="100%",b="absolute";f.download=function(k,u){var n=i.extend({},u),r,l=n.width?n.width:480,o=n.height?n.height:320,v,p,j=u.logo?u.logo:{prefix:"http://l.longtailvideo.com/download/",file:"logo.png",margin:10};function t(){if(n.playlist&&n.playlist.length){try{v=n.playlist[0].sources[0].file;p=n.playlist[0].image}catch(w){return}}else{return}if(j.prefix){j.prefix+=d.version.split(/\W/).splice(0,2).join("/")+"/"}m();q()}function q(){if(k){r=s("a","display",k);s("div","iconbackground",r);s("div","icon",r);s("div","logo",r);if(v){r.setAttribute("href",i.getAbsolutePath(v))}}}function m(){var w="#"+k.id+" .jwdownload";g(w+"display",{width:l,height:o,background:"black center no-repeat "+(p?"url("+p+")":""),"background-size":"contain",position:b,border:c,display:a});g(w+"display div",{position:b,width:e,height:e});g(w+"logo",{bottom:j.margin,left:j.margin,background:"bottom left no-repeat url("+j.prefix+j.file+")"});g(w+"icon",{background:"center no-repeat url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAALdJREFUeNrs18ENgjAYhmFouDOCcQJGcARHgE10BDcgTOIosAGwQOuPwaQeuFRi2p/3Sb6EC5L3QCxZBgAAAOCorLW1zMn65TrlkH4NcV7QNcUQt7Gn7KIhxA+qNIR81spOGkL8oFJDyLJRdosqKDDkK+iX5+d7huzwM40xptMQMkjIOeRGo+VkEVvIPfTGIpKASfYIfT9iCHkHrBEzf4gcUQ56aEzuGK/mw0rHpy4AAACAf3kJMACBxjAQNRckhwAAAABJRU5ErkJggg==)"});g(w+"iconbackground",{background:"center no-repeat url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAEpJREFUeNrszwENADAIA7DhX8ENoBMZ5KR10EryckCJiIiIiIiIiIiIiIiIiIiIiIh8GmkRERERERERERERERERERERERGRHSPAAPlXH1phYpYaAAAAAElFTkSuQmCC)"})}function s(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 t=document.getElementById(k.id).getPluginConfig("display");p.resize(t.width,t.height);var s={left:t.x,top:t.y};a.css(q,s)}}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=encodeURIComponent(window.location.href.split("#")[0])+"&";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 B;var s=a.extend({},m);var p=s.width;var z=s.height;if(h.id+"_wrapper"==h.parentNode.id){B=document.getElementById(h.id+"_wrapper")}else{B=document.createElement("div");B.id=h.id+"_wrapper";a.wrap(h,B);a.css(B,{position:"relative",width:p,height:z})}var q=g.setupPlugins(k,s,l);if(q.length>0){a.extend(s,d(q.plugins))}else{delete s.plugins}var t=["height","width","modes","events"];for(var w=0;w<t.length;w++){delete s[t[w]]}var r="opaque";if(s.wmode){r=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 o in y){if(typeof(s[o])=="undefined"){s[o]=y[o]}}var A="#000000";var v;if(a.isIE()){var x='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" bgcolor="'+A+'" 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="'+r+'">';x+='<param name="flashvars" value="'+e(s)+'">';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",r);n(u,"flashvars",e(s));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,q.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(!r){return true}if(a.exists(a.extensionmap[r])&&!a.exists(a.extensionmap[r].flash)){return false}return true}}})(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{return null}};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=a.extension(l);m=m?m:n;if((!m)||!b[m]){return true}return g(b[m].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(h){this.container=h;this.id=h.id;var p={};var v={};var r={};var g=[];var k=undefined;var n=false;var l=[];var t=undefined;var u={};var m={};this.getBuffer=function(){return this.callInternal("jwGetBuffer")};this.getContainer=function(){return this.container};function i(x,w){return function(C,y,z,A){if(x.renderingMode=="flash"||x.renderingMode=="html5"){var B;if(y){m[C]=y;B="jwplayer('"+x.id+"').callback('"+C+"')"}else{if(!y&&m[C]){delete m[C]}}k.jwDockSetButton(C,B,z,A)}return w}}this.getPlugin=function(w){var y=this;var x={};if(w=="dock"){return a.extend(x,{setButton:i(y,x),show:function(){y.callInternal("jwDockShow");return x},hide:function(){y.callInternal("jwDockHide");return x},onShow:function(z){y.componentListener("dock",e.JWPLAYER_COMPONENT_SHOW,z);return x},onHide:function(z){y.componentListener("dock",e.JWPLAYER_COMPONENT_HIDE,z);return x}})}else{if(w=="controlbar"){return a.extend(x,{show:function(){y.callInternal("jwControlbarShow");return x},hide:function(){y.callInternal("jwControlbarHide");return x},onShow:function(z){y.componentListener("controlbar",e.JWPLAYER_COMPONENT_SHOW,z);return x},onHide:function(z){y.componentListener("controlbar",e.JWPLAYER_COMPONENT_HIDE,z);return x}})}else{if(w=="display"){return a.extend(x,{show:function(){y.callInternal("jwDisplayShow");return x},hide:function(){y.callInternal("jwDisplayHide");return x},onShow:function(z){y.componentListener("display",e.JWPLAYER_COMPONENT_SHOW,z);return x},onHide:function(z){y.componentListener("display",e.JWPLAYER_COMPONENT_HIDE,z);return x}})}else{return this.plugins[w]}}}};this.callback=function(w){if(m[w]){return m[w]()}};this.getDuration=function(){return this.callInternal("jwGetDuration")};this.getFullscreen=function(){return this.callInternal("jwGetFullscreen")};this.getHeight=function(){return this.callInternal("jwGetHeight")};this.getLockState=function(){return this.callInternal("jwGetLockState")};this.getMeta=function(){return this.getItemMeta()};this.getMute=function(){return this.callInternal("jwGetMute")};this.getPlaylist=function(){var x=this.callInternal("jwGetPlaylist");if(this.renderingMode=="flash"){a.deepReplaceKeyName(x,["__dot__","__spc__","__dsh__"],["."," ","-"])}for(var w=0;w<x.length;w++){if(!a.exists(x[w].index)){x[w].index=w}}return x};this.getPlaylistItem=function(w){if(!a.exists(w)){w=this.getCurrentItem()}return this.getPlaylist()[w]};this.getPosition=function(){return this.callInternal("jwGetPosition")};this.getRenderingMode=function(){return this.renderingMode};this.getState=function(){return this.callInternal("jwGetState")};this.getVolume=function(){return this.callInternal("jwGetVolume")};this.getWidth=function(){return this.callInternal("jwGetWidth")};this.setFullscreen=function(w){if(!a.exists(w)){this.callInternal("jwSetFullscreen",!this.callInternal("jwGetFullscreen"))}else{this.callInternal("jwSetFullscreen",w)}return this};this.setMute=function(w){if(!a.exists(w)){this.callInternal("jwSetMute",!this.callInternal("jwGetMute"))}else{this.callInternal("jwSetMute",w)}return this};this.lock=function(){return this};this.unlock=function(){return this};this.load=function(w){this.callInternal("jwLoad",w);return this};this.playlistItem=function(w){this.callInternal("jwPlaylistItem",w);return this};this.playlistPrev=function(){this.callInternal("jwPlaylistPrev");return this};this.playlistNext=function(){this.callInternal("jwPlaylistNext");return this};this.resize=function(x,w){if(this.renderingMode=="html5"){k.jwResize(x,w)}else{this.container.width=x;this.container.height=w;var y=document.getElementById(this.id+"_wrapper");if(y){y.style.width=x+"px";y.style.height=w+"px"}}return this};this.play=function(w){if(typeof w=="undefined"){w=this.getState();if(w==b.PLAYING||w==b.BUFFERING){this.callInternal("jwPause")}else{this.callInternal("jwPlay")}}else{this.callInternal("jwPlay",w)}return this};this.pause=function(w){if(typeof w=="undefined"){w=this.getState();if(w==b.PLAYING||w==b.BUFFERING){this.callInternal("jwPause")}else{this.callInternal("jwPlay")}}else{this.callInternal("jwPause",w)}return this};this.stop=function(){this.callInternal("jwStop");return this};this.seek=function(w){this.callInternal("jwSeek",w);return this};this.setVolume=function(w){this.callInternal("jwSetVolume",w);return this};this.loadInstream=function(x,w){t=new f.instream(this,k,x,w);return t};this.onBufferChange=function(w){return this.eventListener(e.JWPLAYER_MEDIA_BUFFER,w)};this.onBufferFull=function(w){return this.eventListener(e.JWPLAYER_MEDIA_BUFFER_FULL,w)};this.onError=function(w){return this.eventListener(e.JWPLAYER_ERROR,w)};this.onFullscreen=function(w){return this.eventListener(e.JWPLAYER_FULLSCREEN,w)};this.onMeta=function(w){return this.eventListener(e.JWPLAYER_MEDIA_META,w)};this.onMute=function(w){return this.eventListener(e.JWPLAYER_MEDIA_MUTE,w)};this.onPlaylist=function(w){return this.eventListener(e.JWPLAYER_PLAYLIST_LOADED,w)};this.onPlaylistItem=function(w){return this.eventListener(e.JWPLAYER_PLAYLIST_ITEM,w)};this.onReady=function(w){return this.eventListener(e.API_READY,w)};this.onResize=function(w){return this.eventListener(e.JWPLAYER_RESIZE,w)};this.onComplete=function(w){return this.eventListener(e.JWPLAYER_MEDIA_COMPLETE,w)};this.onSeek=function(w){return this.eventListener(e.JWPLAYER_MEDIA_SEEK,w)};this.onTime=function(w){return this.eventListener(e.JWPLAYER_MEDIA_TIME,w)};this.onVolume=function(w){return this.eventListener(e.JWPLAYER_MEDIA_VOLUME,w)};this.onBeforePlay=function(w){return this.eventListener(e.JWPLAYER_MEDIA_BEFOREPLAY,w)};this.onBeforeComplete=function(w){return this.eventListener(e.JWPLAYER_MEDIA_BEFORECOMPLETE,w)};this.onBuffer=function(w){return this.stateListener(b.BUFFERING,w)};this.onPause=function(w){return this.stateListener(b.PAUSED,w)};this.onPlay=function(w){return this.stateListener(b.PLAYING,w)};this.onIdle=function(w){return this.stateListener(b.IDLE,w)};this.remove=function(){if(!n){throw"Cannot call remove() before player is ready";return}s(this)};function s(w){l=[];f.destroyPlayer(w.id)}this.setup=function(x){if(d.embed){var w=this.id;s(this);var y=d(w);y.config=x;return new d.embed(y)}return this};this.registerPlugin=function(y,x,w){d.plugins.registerPlugin(y,x,w)};this.setPlayer=function(w,x){k=w;this.renderingMode=x};this.stateListener=function(w,x){if(!v[w]){v[w]=[];this.eventListener(e.JWPLAYER_PLAYER_STATE,j(w))}v[w].push(x);return this};this.detachMedia=function(){if(this.renderingMode=="html5"){return this.callInternal("jwDetachMedia")}};this.attachMedia=function(){if(this.renderingMode=="html5"){return this.callInternal("jwAttachMedia")}};function j(w){return function(y){var x=y.newstate,A=y.oldstate;if(x==w){var z=v[x];if(z){for(var B=0;B<z.length;B++){if(typeof z[B]=="function"){z[B].call(this,{oldstate:A,newstate:x})}}}}}}this.componentListener=function(w,x,y){if(!r[w]){r[w]={}}if(!r[w][x]){r[w][x]=[];this.eventListener(x,o(w,x))}r[w][x].push(y);return this};function o(w,x){return function(z){if(w==z.component){var y=r[w][x];if(y){for(var A=0;A<y.length;A++){if(typeof y[A]=="function"){y[A].call(this,z)}}}}}}this.addInternalListener=function(w,x){try{w.jwAddEventListener(x,'function(dat) { jwplayer("'+this.id+'").dispatchEvent("'+x+'", dat); }')}catch(y){a.log("Could not add internal listener")}};this.eventListener=function(w,x){if(!p[w]){p[w]=[];if(k&&n){this.addInternalListener(k,w)}}p[w].push(x);return this};this.dispatchEvent=function(y){if(p[y]){var x=a.translateEventResponse(y,arguments[1]);for(var w=0;w<p[y].length;w++){if(typeof p[y][w]=="function"){p[y][w].call(this,x)}}}};this.dispatchInstreamEvent=function(w){if(t){t.dispatchEvent(w,arguments)}};this.callInternal=function(){if(n){var y=arguments[0],w=[];for(var x=1;x<arguments.length;x++){w.push(arguments[x])}if(typeof k!="undefined"&&typeof k[y]=="function"){if(w.length==2){return(k[y])(w[0],w[1])}else{if(w.length==1){return(k[y])(w[0])}else{return(k[y])()}}}return null}else{l.push(arguments)}};this.playerReady=function(x){n=true;if(!k){this.setPlayer(document.getElementById(x.id))}this.container=document.getElementById(this.id);for(var w in p){this.addInternalListener(k,w)}this.eventListener(e.JWPLAYER_PLAYLIST_ITEM,function(y){u={}});this.eventListener(e.JWPLAYER_MEDIA_META,function(y){a.extend(u,y.metadata)});this.dispatchEvent(e.API_READY);while(l.length>0){this.callInternal.apply(this,l.shift())}};this.getItemMeta=function(){return u};this.getCurrentItem=function(){return this.callInternal("jwGetPlaylistIndex")};function q(y,A,z){var w=[];if(!A){A=0}if(!z){z=y.length-1}for(var x=A;x<=z;x++){w.push(y[x])}return w}return this};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(j){var i=-1;for(var l=0;l<c.length;l++){if(c[l].id==j){i=l;continue}}if(i>=0){var g=document.getElementById(c[i].id);if(document.getElementById(c[i].id+"_wrapper")){g=document.getElementById(c[i].id+"_wrapper")}if(g){var k=document.createElement("div");var h=g.id;if(g.id.indexOf("_wrapper")==g.id.length-8){newID=g.id.substring(0,g.id.length-8)}k.setAttribute("id",h);g.parentNode.replaceChild(k,g)}c.splice(i,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)}; 
     1if(typeof jwplayer=="undefined"){jwplayer=function(a){if(jwplayer.api){return jwplayer.api.selectPlayer(a)}};var $jw=jwplayer;jwplayer.version="6.0.2192";jwplayer.vid=document.createElement("video");jwplayer.audio=document.createElement("audio");jwplayer.source=document.createElement("source");(function(h){var d=document;var o=window;var n=h.utils=function(){};n.exists=function(s){switch(typeof(s)){case"string":return(s.length>0);break;case"object":return(s!==null);case"undefined":return false}return true};var b={},q,a={};function p(){var s=d.createElement("style");s.type="text/css";d.getElementsByTagName("head")[0].appendChild(s);return s}n.css=function(s,v,t){if(!n.exists(t)){t=false}if(n.isIE()){if(!q){q=p()}}else{if(!b[s]){b[s]=p()}}if(!a[s]){a[s]={}}for(var u in v){var w=g(u,v[u],t);if(n.exists(a[s][u])&&!n.exists(w)){delete a[s][u]}else{a[s][u]=w}}if(n.isIE()){i()}else{e(s,b[s])}};function g(u,v,s){if(typeof v==="undefined"){return undefined}var t=s?" !important":"";if(typeof v=="number"){if(isNaN(v)){return undefined}switch(u){case"z-index":case"opacity":return v+t;break;default:if(u.match(/color/i)){return"#"+n.pad(v.toString(16),6)}else{return Math.ceil(v)+"px"+t}break}}else{return v+t}}function i(){var s="\n";for(var t in a){s+=r(t)}q.innerHTML=s}function e(s,t){if(t){t.innerHTML=r(s)}}function r(s){var t=s+"{\n";var v=a[s];for(var u in v){t+="  "+u+": "+v[u]+";\n"}t+="}\n";return t}n.clearCss=function(t){for(var u in a){if(u.indexOf(t)>=0){delete a[u]}}for(var s in b){if(s.indexOf(t)>=0){b[s].innerHTML=""}}};n.getAbsolutePath=function(y,x){if(!n.exists(x)){x=d.location.href}if(!n.exists(y)){return undefined}if(j(y)){return y}var z=x.substring(0,x.indexOf("://")+3);var w=x.substring(z.length,x.indexOf("/",z.length+1));var t;if(y.indexOf("/")===0){t=y.split("/")}else{var u=x.split("?")[0];u=u.substring(z.length+w.length+1,u.lastIndexOf("/"));t=u.split("/").concat(y.split("/"))}var s=[];for(var v=0;v<t.length;v++){if(!t[v]||!n.exists(t[v])||t[v]=="."){continue}else{if(t[v]==".."){s.pop()}else{s.push(t[v])}}}return z+w+"/"+s.join("/")};function j(t){if(!n.exists(t)){return}var u=t.indexOf("://");var s=t.indexOf("?");return(u>0&&(s<0||(s>u)))}n.extend=function(){var s=n.extend["arguments"];if(s.length>1){for(var u=1;u<s.length;u++){for(var t in s[u]){s[0][t]=s[u][t]}}return s[0]}return null};n.parseDimension=function(s){if(typeof s=="string"){if(s===""){return 0}else{if(s.lastIndexOf("%")>-1){return s}else{return parseInt(s.replace("px",""),10)}}}return s};n.timeFormat=function(s){if(s>0){var t=Math.floor(s/60)<10?"0"+Math.floor(s/60)+":":Math.floor(s/60)+":";t+=Math.floor(s%60)<10?"0"+Math.floor(s%60):Math.floor(s%60);return t}else{return"00:00"}};n.log=function(t,s){if(typeof console!="undefined"&&typeof console.log!="undefined"){if(s){console.log(t,s)}else{console.log(t)}}};n.getBoundingClientRect=function(s){if(typeof s.getBoundingClientRect=="function"){return s.getBoundingClientRect()}else{return{left:s.offsetLeft+d.body.scrollLeft,top:s.offsetTop+d.body.scrollTop,width:s.offsetWidth,height:s.offsetHeight}}};var k=n.userAgentMatch=function(t){var s=navigator.userAgent.toLowerCase();return(s.match(t)!==null)};n.isIE=function(){return k(/msie/i)};n.isMobile=function(){return k(/(iP(hone|ad|od))|android/i)};n.isIOS=function(){return k(/iP(hone|ad|od)/i)};n.isIPod=function(){return k(/iP(hone|od)/i)};n.isIPad=function(){return k(/iPad/i)};n.saveCookie=function(s,t){d.cookie="jwplayer."+s+"="+t+"; path=/"};n.getCookies=function(){var v={};var u=d.cookie.split("; ");for(var t=0;t<u.length;t++){var s=u[t].split("=");if(s[0].indexOf("jwplayer.")==0){v[s[0].substring(9,s[0].length)]=n.serialize(s[1])}}return v};n.ajax=function(w,v,s){var u;if(l(w)&&n.exists(o.XDomainRequest)){u=new XDomainRequest();u.onload=m(u,w,v,s);u.onerror=f(s,w,u)}else{if(n.exists(o.XMLHttpRequest)){u=new XMLHttpRequest();u.onreadystatechange=c(u,w,v,s);u.onerror=f(s,w)}else{if(s){s()}}}try{u.open("GET",w,true);u.send(null)}catch(t){if(s){s(w)}}return u};function l(s){if(s&&s.indexOf("://")>=0){if(s.split("/")[2]!=o.location.href.split("/")[2]){return true}}return false}function f(s,u,t){return function(){s(u)}}function c(t,v,u,s){return function(){if(t.readyState===4){if(t.status==200){m(t,v,u,s)()}else{if(s){s(v)}}}}}function m(t,v,u,s){return function(){if(!n.exists(t.responseXML)){try{var w;if(o.DOMParser){w=(new DOMParser()).parseFromString(t.responseText,"text/xml")}else{w=new ActiveXObject("Microsoft.XMLDOM");w.async="false";w.loadXML(t.responseText)}if(w){t=n.extend({},t,{responseXML:w})}}catch(x){if(s){s(v)}return}}u(t)}}n.typeOf=function(t){var s=typeof t;if(s==="object"){if(!t){return"null"}return(t instanceof Array)?"array":s}else{return s}};n.translateEventResponse=function(u,s){var w=n.extend({},s);if(u==h.events.JWPLAYER_FULLSCREEN&&!w.fullscreen){w.fullscreen=w.message=="true"?true:false;delete w.message}else{if(typeof w.data=="object"){w=n.extend(w,w.data);delete w.data}else{if(typeof w.metadata=="object"){n.deepReplaceKeyName(w.metadata,["__dot__","__spc__","__dsh__"],["."," ","-"])}}}var t=["position","duration","offset"];for(var v in t){if(w[t[v]]){w[t[v]]=Math.round(w[t[v]]*1000)/1000}}return w};n.hasFlash=function(){if(typeof navigator.plugins!="undefined"&&typeof navigator.plugins["Shockwave Flash"]!="undefined"){return true}if(typeof o.ActiveXObject!="undefined"){try{new ActiveXObject("ShockwaveFlash.ShockwaveFlash");return true}catch(s){}}return false};n.wrap=function(s,t){if(s.parentNode){s.parentNode.replaceChild(t,s)}t.appendChild(s)};n.getScriptPath=function(u){var s=d.getElementsByTagName("script");for(var t=0;t<s.length;t++){var v=s[t].src;if(v&&v.indexOf(u)>=0){return v.substr(0,v.indexOf(u))}}return""};h.utils.deepReplaceKeyName=function(z,u,s){switch(h.utils.typeOf(z)){case"array":for(var w=0;w<z.length;w++){z[w]=h.utils.deepReplaceKeyName(z[w],u,s)}break;case"object":for(var v in z){var y,x;if(u instanceof Array&&s instanceof Array){if(u.length!=s.length){continue}else{y=u;x=s}}else{y=[u];x=[s]}var t=v;for(var w=0;w<y.length;w++){t=t.replace(new RegExp(u[w],"g"),s[w])}z[t]=h.utils.deepReplaceKeyName(z[v],u,s);if(v!=t){delete z[v]}}break}return z}})(jwplayer);(function(i){var b="video/",g="audio/",e="image",h="mp4",f={f4a:g+h,f4b:g+h,f4v:b+h,mov:b+"quicktime",m4a:g+h,m4b:g+h,m4p: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:g+"x-mpegurl",wav:g+"x-wav"},b="video",d={flv:b,f4b:b,f4v:b,mov:b,m4a:b,m4v:b,mp4:b,aac:b,mp3:"sound",gif:e,jpeg:e,jpg:e,swf:e,png:e,rtmp:"rtmp",hls:"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){var b=a.exists;a.scale=function(f,e,d,h,i){var g;if(!b(e)){e=1}if(!b(d)){d=1}if(!b(h)){h=0}if(!b(i)){i=0}if(e==1&&d==1&&h==0&&i==0){g=""}else{g="scale("+e+","+d+") translate("+h+"px,"+i+"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(l,q,p,i,n,j){if(!q){return}if(!p||!i||!n||!j){return}var e=p/n,h=i/j,o=0,k=0,d={},f=(q.tagName.toLowerCase()=="video"),g=false,m;if(f){a.transform(q)}m="jw"+l.toLowerCase();switch(l.toLowerCase()){case c.FILL:if(e>h){n=n*e;j=j*e}else{n=n*h;j=j*h}case c.NONE:e=h=1;case c.EXACTFIT:g=true;break;case c.UNIFORM:if(e>h){n=n*h;j=j*h;if(n/p>0.95){g=true;m="jwexactfit";e=Math.ceil(100*p/n)/100;h=1}}else{n=n*e;j=j*e;if(j/i>0.95){g=true;m="jwexactfit";h=Math.ceil(100*i/j)/100;e=1}}break;default:return;break}if(f){if(g){q.style.width=n+"px";q.style.height=j+"px";o=((p-n)/2)/e;k=((i-j)/2)/h;a.scale(q,e,h,o,k)}else{q.style.width="";q.style.height=""}}else{q.className=q.className.replace(/\s*jw(none|exactfit|uniform|fill)/g,"");q.className+=" "+m}};var c=a.stretching={NONE:"none",FILL:"fill",UNIFORM:"uniform",EXACTFIT:"exactfit"}})(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.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)}}}}};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()}}})(jwplayer.utils);(function(b){var d=new RegExp(/^(#|0x)[0-9a-fA-F]{3,6}/);b.typechecker=function(g,f){f=!b.exists(f)?c(g):f;return e(g,f)};function c(f){var g=["true","false","t","f"];if(g.toString().indexOf(f.toLowerCase().replace(" ",""))>=0){return"boolean"}else{if(d.test(f)){return"color"}else{if(!isNaN(parseInt(f,10))&&parseInt(f,10).toString().length==f.length){return"integer"}else{if(!isNaN(parseFloat(f))&&parseFloat(f).toString().length==f.length){return"float"}}}}return"string"}function e(g,f){if(!b.exists(f)){return g}switch(f){case"color":if(g.length>0){return a(g)}return null;case"integer":return parseInt(g,10);case"float":return parseFloat(g);case"boolean":if(g.toLowerCase()=="true"){return true}else{if(g=="1"){return true}}return false}return g}function a(f){f=f.replace(/(#|0x)?([0-9A-F]{3,6})$/gi,"$2");if(f.length==3){f=f.charAt(0)+f.charAt(0)+f.charAt(1)+f.charAt(1)+f.charAt(2)+f.charAt(2)}return parseInt(f,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_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 n=0;n<g.modes.length;n++){if(g.modes[n].type&&d[g.modes[n].type]){var p=g.modes[n].config;var t=g;if(p){t=b.extend(b.clone(g),p);var s=["file","levels","playlist"];for(var m=0;m<s.length;m++){var q=s[m];if(b.exists(p[q])){for(var l=0;l<s.length;l++){if(l!=m){var o=s[l];if(b.exists(t[o])&&!b.exists(p[o])){delete t[o]}}}}}}var r=new d[g.modes[n].type](k,g.modes[n],t,i,h);if(r.supportsConfig()){r.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(b){var a=b.utils;function c(d,g,e,h){var f={html5:{type:"html5",src:e?e:g+"jwplayer.html5.js"},flash:{type:"flash",src:h?h:g+"jwplayer.flash.swf"}};if(d=="html5"){return[f.html5,f.flash]}else{return[f.flash,f.html5]}}b.embed.config=function(d){var e={fallback:true,height:300,primary:"html5",width:400,base:undefined},f=a.extend(e,d);if(!f.base){f.base=a.getScriptPath("jwplayer.js")}if(!f.modes){f.modes=c(f.primary,f.base,f.html5player,f.flashplayer)}return f}})(jwplayer);(function(d){var f=d.embed,i=d.utils,g=i.css,h="pointer",c="none",a="block",e="100%",b="absolute";f.download=function(k,u){var n=i.extend({},u),r,l=n.width?n.width:480,o=n.height?n.height:320,v,p,j=u.logo?u.logo:{prefix:"http://l.longtailvideo.com/download/",file:"logo.png",margin:10};function t(){if(n.playlist&&n.playlist.length){try{v=n.playlist[0].sources[0].file;p=n.playlist[0].image}catch(w){return}}else{return}if(j.prefix){j.prefix+=d.version.split(/\W/).splice(0,2).join("/")+"/"}m();q()}function q(){if(k){r=s("a","display",k);s("div","iconbackground",r);s("div","icon",r);s("div","logo",r);if(v){r.setAttribute("href",i.getAbsolutePath(v))}}}function m(){var w="#"+k.id+" .jwdownload";g(w+"display",{width:l,height:o,background:"black center no-repeat "+(p?"url("+p+")":""),"background-size":"contain",position:b,border:c,display:a});g(w+"display div",{position:b,width:e,height:e});g(w+"logo",{bottom:j.margin,left:j.margin,background:"bottom left no-repeat url("+j.prefix+j.file+")"});g(w+"icon",{background:"center no-repeat url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAALdJREFUeNrs18ENgjAYhmFouDOCcQJGcARHgE10BDcgTOIosAGwQOuPwaQeuFRi2p/3Sb6EC5L3QCxZBgAAAOCorLW1zMn65TrlkH4NcV7QNcUQt7Gn7KIhxA+qNIR81spOGkL8oFJDyLJRdosqKDDkK+iX5+d7huzwM40xptMQMkjIOeRGo+VkEVvIPfTGIpKASfYIfT9iCHkHrBEzf4gcUQ56aEzuGK/mw0rHpy4AAACAf3kJMACBxjAQNRckhwAAAABJRU5ErkJggg==)"});g(w+"iconbackground",{background:"center no-repeat url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAEpJREFUeNrszwENADAIA7DhX8ENoBMZ5KR10EryckCJiIiIiIiIiIiIiIiIiIiIiIh8GmkRERERERERERERERERERERERGRHSPAAPlXH1phYpYaAAAAAElFTkSuQmCC)"})}function s(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 t=document.getElementById(k.id).getPluginConfig("display");p.resize(t.width,t.height);var s={left:t.x,top:t.y};a.css(q,s)}}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 C;var t=a.extend({},m);var p=t.width;var A=t.height;if(h.id+"_wrapper"==h.parentNode.id){C=document.getElementById(h.id+"_wrapper")}else{C=document.createElement("div");C.id=h.id+"_wrapper";a.wrap(h,C);a.css("#"+C.id,{position:"relative",width:p,height:A})}var q=g.setupPlugins(k,t,l);if(q.length>0){a.extend(t,d(q.plugins))}else{delete t.plugins}var u=["height","width","modes","events","primary","base","fallback"];for(var x=0;x<u.length;x++){delete t[u[x]]}var r="opaque";if(t.wmode){r=t.wmode}j(t,"components");j(t,"providers");if(typeof t["dock.position"]!="undefined"){if(t["dock.position"].toString().toLowerCase()=="false"){t.dock=t["dock.position"];delete t["dock.position"]}}var z=a.getCookies();for(var o in z){if(typeof(t[o])=="undefined"){t[o]=z[o]}}var B="#000000",w,s=e(t);if(a.isIE()){var y='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" bgcolor="'+B+'" width="100%" height="100%" id="'+h.id+'" name="'+h.id+'" tabindex=0"">';y+='<param name="movie" value="'+i.src+'">';y+='<param name="allowfullscreen" value="true">';y+='<param name="allowscriptaccess" value="always">';y+='<param name="seamlesstabbing" value="true">';y+='<param name="wmode" value="'+r+'">';y+='<param name="flashvars" value="'+s+'">';y+="</object>";a.setOuterHTML(h,y);w=document.getElementById(h.id)}else{var v=document.createElement("object");v.setAttribute("type","application/x-shockwave-flash");v.setAttribute("data",i.src);v.setAttribute("width","100%");v.setAttribute("height","100%");v.setAttribute("bgcolor","#000000");v.setAttribute("id",h.id);v.setAttribute("name",h.id);v.setAttribute("tabindex",0);n(v,"allowfullscreen","true");n(v,"allowscriptaccess","always");n(v,"seamlesstabbing","true");n(v,"wmode",r);n(v,"flashvars",s);h.parentNode.replaceChild(v,h);w=v}k.container=w;k.setPlayer(w,"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,q.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(!r){return true}if(a.exists(a.extensionmap[r])&&!a.exists(a.extensionmap[r].flash)){return false}return true}}})(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=a.extension(l);m=m?m:n;if((!m)||!b[m]){return true}return g(b[m].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(h){this.container=h;this.id=h.id;var p={};var v={};var r={};var g=[];var k=undefined;var n=false;var l=[];var t=undefined;var u={};var m={};this.getBuffer=function(){return this.callInternal("jwGetBuffer")};this.getContainer=function(){return this.container};function i(x,w){return function(C,y,z,A){if(x.renderingMode=="flash"||x.renderingMode=="html5"){var B;if(y){m[C]=y;B="jwplayer('"+x.id+"').callback('"+C+"')"}else{if(!y&&m[C]){delete m[C]}}k.jwDockSetButton(C,B,z,A)}return w}}this.getPlugin=function(w){var y=this;var x={};if(w=="dock"){return a.extend(x,{setButton:i(y,x),show:function(){y.callInternal("jwDockShow");return x},hide:function(){y.callInternal("jwDockHide");return x},onShow:function(z){y.componentListener("dock",e.JWPLAYER_COMPONENT_SHOW,z);return x},onHide:function(z){y.componentListener("dock",e.JWPLAYER_COMPONENT_HIDE,z);return x}})}else{if(w=="controlbar"){return a.extend(x,{show:function(){y.callInternal("jwControlbarShow");return x},hide:function(){y.callInternal("jwControlbarHide");return x},onShow:function(z){y.componentListener("controlbar",e.JWPLAYER_COMPONENT_SHOW,z);return x},onHide:function(z){y.componentListener("controlbar",e.JWPLAYER_COMPONENT_HIDE,z);return x}})}else{if(w=="display"){return a.extend(x,{show:function(){y.callInternal("jwDisplayShow");return x},hide:function(){y.callInternal("jwDisplayHide");return x},onShow:function(z){y.componentListener("display",e.JWPLAYER_COMPONENT_SHOW,z);return x},onHide:function(z){y.componentListener("display",e.JWPLAYER_COMPONENT_HIDE,z);return x}})}else{return this.plugins[w]}}}};this.callback=function(w){if(m[w]){return m[w]()}};this.getDuration=function(){return this.callInternal("jwGetDuration")};this.getFullscreen=function(){return this.callInternal("jwGetFullscreen")};this.getHeight=function(){return this.callInternal("jwGetHeight")};this.getLockState=function(){return this.callInternal("jwGetLockState")};this.getMeta=function(){return this.getItemMeta()};this.getMute=function(){return this.callInternal("jwGetMute")};this.getPlaylist=function(){var x=this.callInternal("jwGetPlaylist");if(this.renderingMode=="flash"){a.deepReplaceKeyName(x,["__dot__","__spc__","__dsh__"],["."," ","-"])}for(var w=0;w<x.length;w++){if(!a.exists(x[w].index)){x[w].index=w}}return x};this.getPlaylistItem=function(w){if(!a.exists(w)){w=this.getCurrentItem()}return this.getPlaylist()[w]};this.getPosition=function(){return this.callInternal("jwGetPosition")};this.getRenderingMode=function(){return this.renderingMode};this.getState=function(){return this.callInternal("jwGetState")};this.getVolume=function(){return this.callInternal("jwGetVolume")};this.getWidth=function(){return this.callInternal("jwGetWidth")};this.setFullscreen=function(w){if(!a.exists(w)){this.callInternal("jwSetFullscreen",!this.callInternal("jwGetFullscreen"))}else{this.callInternal("jwSetFullscreen",w)}return this};this.setMute=function(w){if(!a.exists(w)){this.callInternal("jwSetMute",!this.callInternal("jwGetMute"))}else{this.callInternal("jwSetMute",w)}return this};this.lock=function(){return this};this.unlock=function(){return this};this.load=function(w){this.callInternal("jwLoad",w);return this};this.playlistItem=function(w){this.callInternal("jwPlaylistItem",w);return this};this.playlistPrev=function(){this.callInternal("jwPlaylistPrev");return this};this.playlistNext=function(){this.callInternal("jwPlaylistNext");return this};this.resize=function(x,w){if(this.renderingMode=="html5"){k.jwResize(x,w)}else{this.container.width=x;this.container.height=w;var y=document.getElementById(this.id+"_wrapper");if(y){y.style.width=x+"px";y.style.height=w+"px"}}return this};this.play=function(w){if(typeof w=="undefined"){w=this.getState();if(w==b.PLAYING||w==b.BUFFERING){this.callInternal("jwPause")}else{this.callInternal("jwPlay")}}else{this.callInternal("jwPlay",w)}return this};this.pause=function(w){if(typeof w=="undefined"){w=this.getState();if(w==b.PLAYING||w==b.BUFFERING){this.callInternal("jwPause")}else{this.callInternal("jwPlay")}}else{this.callInternal("jwPause",w)}return this};this.stop=function(){this.callInternal("jwStop");return this};this.seek=function(w){this.callInternal("jwSeek",w);return this};this.setVolume=function(w){this.callInternal("jwSetVolume",w);return this};this.loadInstream=function(x,w){t=new f.instream(this,k,x,w);return t};this.onBufferChange=function(w){return this.eventListener(e.JWPLAYER_MEDIA_BUFFER,w)};this.onBufferFull=function(w){return this.eventListener(e.JWPLAYER_MEDIA_BUFFER_FULL,w)};this.onError=function(w){return this.eventListener(e.JWPLAYER_ERROR,w)};this.onFullscreen=function(w){return this.eventListener(e.JWPLAYER_FULLSCREEN,w)};this.onMeta=function(w){return this.eventListener(e.JWPLAYER_MEDIA_META,w)};this.onMute=function(w){return this.eventListener(e.JWPLAYER_MEDIA_MUTE,w)};this.onPlaylist=function(w){return this.eventListener(e.JWPLAYER_PLAYLIST_LOADED,w)};this.onPlaylistItem=function(w){return this.eventListener(e.JWPLAYER_PLAYLIST_ITEM,w)};this.onReady=function(w){return this.eventListener(e.API_READY,w)};this.onResize=function(w){return this.eventListener(e.JWPLAYER_RESIZE,w)};this.onComplete=function(w){return this.eventListener(e.JWPLAYER_MEDIA_COMPLETE,w)};this.onSeek=function(w){return this.eventListener(e.JWPLAYER_MEDIA_SEEK,w)};this.onTime=function(w){return this.eventListener(e.JWPLAYER_MEDIA_TIME,w)};this.onVolume=function(w){return this.eventListener(e.JWPLAYER_MEDIA_VOLUME,w)};this.onBeforePlay=function(w){return this.eventListener(e.JWPLAYER_MEDIA_BEFOREPLAY,w)};this.onBeforeComplete=function(w){return this.eventListener(e.JWPLAYER_MEDIA_BEFORECOMPLETE,w)};this.onBuffer=function(w){return this.stateListener(b.BUFFERING,w)};this.onPause=function(w){return this.stateListener(b.PAUSED,w)};this.onPlay=function(w){return this.stateListener(b.PLAYING,w)};this.onIdle=function(w){return this.stateListener(b.IDLE,w)};this.remove=function(){if(!n){throw"Cannot call remove() before player is ready";return}s(this)};function s(w){l=[];f.destroyPlayer(w.id)}this.setup=function(x){if(d.embed){var w=this.id;s(this);var y=d(w);y.config=x;return new d.embed(y)}return this};this.registerPlugin=function(y,x,w){d.plugins.registerPlugin(y,x,w)};this.setPlayer=function(w,x){k=w;this.renderingMode=x};this.stateListener=function(w,x){if(!v[w]){v[w]=[];this.eventListener(e.JWPLAYER_PLAYER_STATE,j(w))}v[w].push(x);return this};this.detachMedia=function(){if(this.renderingMode=="html5"){return this.callInternal("jwDetachMedia")}};this.attachMedia=function(){if(this.renderingMode=="html5"){return this.callInternal("jwAttachMedia")}};function j(w){return function(y){var x=y.newstate,A=y.oldstate;if(x==w){var z=v[x];if(z){for(var B=0;B<z.length;B++){if(typeof z[B]=="function"){z[B].call(this,{oldstate:A,newstate:x})}}}}}}this.componentListener=function(w,x,y){if(!r[w]){r[w]={}}if(!r[w][x]){r[w][x]=[];this.eventListener(x,o(w,x))}r[w][x].push(y);return this};function o(w,x){return function(z){if(w==z.component){var y=r[w][x];if(y){for(var A=0;A<y.length;A++){if(typeof y[A]=="function"){y[A].call(this,z)}}}}}}this.addInternalListener=function(w,x){try{w.jwAddEventListener(x,'function(dat) { jwplayer("'+this.id+'").dispatchEvent("'+x+'", dat); }')}catch(y){a.log("Could not add internal listener")}};this.eventListener=function(w,x){if(!p[w]){p[w]=[];if(k&&n){this.addInternalListener(k,w)}}p[w].push(x);return this};this.dispatchEvent=function(y){if(p[y]){var x=a.translateEventResponse(y,arguments[1]);for(var w=0;w<p[y].length;w++){if(typeof p[y][w]=="function"){p[y][w].call(this,x)}}}};this.dispatchInstreamEvent=function(w){if(t){t.dispatchEvent(w,arguments)}};this.callInternal=function(){if(n){var y=arguments[0],w=[];for(var x=1;x<arguments.length;x++){w.push(arguments[x])}if(typeof k!="undefined"&&typeof k[y]=="function"){if(w.length==2){return(k[y])(w[0],w[1])}else{if(w.length==1){return(k[y])(w[0])}else{return(k[y])()}}}return null}else{l.push(arguments)}};this.playerReady=function(x){n=true;if(!k){this.setPlayer(document.getElementById(x.id))}this.container=document.getElementById(this.id);for(var w in p){this.addInternalListener(k,w)}this.eventListener(e.JWPLAYER_PLAYLIST_ITEM,function(y){u={}});this.eventListener(e.JWPLAYER_MEDIA_META,function(y){a.extend(u,y.metadata)});this.dispatchEvent(e.API_READY);while(l.length>0){this.callInternal.apply(this,l.shift())}};this.getItemMeta=function(){return u};this.getCurrentItem=function(){return this.callInternal("jwGetPlaylistIndex")};function q(y,A,z){var w=[];if(!A){A=0}if(!z){z=y.length-1}for(var x=A;x<=z;x++){w.push(y[x])}return w}return this};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(j){var i=-1;for(var l=0;l<c.length;l++){if(c[l].id==j){i=l;continue}}if(i>=0){var g=document.getElementById(c[i].id);if(document.getElementById(c[i].id+"_wrapper")){g=document.getElementById(c[i].id+"_wrapper")}if(g){var k=document.createElement("div");var h=g.id;if(g.id.indexOf("_wrapper")==g.id.length-8){newID=g.id.substring(0,g.id.length-8)}k.setAttribute("id",h);g.parentNode.replaceChild(k,g)}c.splice(i,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/model/PlaylistItem.as

    r2192 r2193  
    2929                 
    3030                public function PlaylistItem(obj:Object = null) { 
     31                        if (obj && obj.sources is Array) { 
     32                                obj.levels = obj.sources; 
     33                                delete obj.sources; 
     34                        } 
     35                         
    3136                        for (var itm:String in obj) { 
    3237                                if (itm == "levels") { 
  • branches/jw6/src/flash/com/longtailvideo/jwplayer/view/Logo.as

    r2192 r2193  
    2828                /** Configuration defaults **/ 
    2929                protected var defaults:Object = { 
    30                         prefix: "http://l.longtailvideo.com/",  
     30                        prefix: "http://l.longtailvideo.com/flash/",  
    3131                        file: "logo.png",  
    3232                        link: "http://www.longtailvideo.com/players/jw-flv-player/", 
  • branches/jw6/src/flash/com/longtailvideo/jwplayer/view/View.as

    r2192 r2193  
    597597                                        Draw.smooth(_image.content as Bitmap); 
    598598                                } catch (e:Error) { 
    599                                         Logger.log('Could not smooth preview image: ' + e.message); 
     599                                        //Could not smooth preview image 
    600600                                } 
    601601                                if (_model.state != PlayerState.PLAYING && _model.state != PlayerState.PAUSED) {  
  • branches/jw6/src/flash/com/longtailvideo/jwplayer/view/components/PlaylistComponent.as

    r2192 r2193  
    684684                                                Draw.smooth(ldr.content as Bitmap); 
    685685                                        } catch (e:Error) { 
    686                                                 Logger.log('Could not smooth thumbnail image: ' + e.message); 
     686                                                //Could not smooth thumbnail image 
    687687                                        } 
    688688                                        Stretcher.stretch(ldr, image[0], image[1], Stretcher.FILL); 
  • branches/jw6/src/js/embed/jwplayer.embed.config.js

    r2192 r2193  
    3030                                fallback: true, 
    3131                                height: 300, 
    32                                 primary: "flash", 
     32                                primary: "html5", 
    3333                                width: 400, 
    3434                                base: undefined 
     
    4242                if (!parsedConfig.modes) { 
    4343                        parsedConfig.modes = _playerDefaults( 
    44                                         parsedConfig.primarh, 
     44                                        parsedConfig.primary, 
    4545                                        parsedConfig.base,  
    4646                                        parsedConfig.html5player,  
  • branches/jw6/src/js/embed/jwplayer.embed.flash.js

    r2192 r2193  
    22 * Flash mode embedder the JW Player 
    33 * @author Zach 
    4  * @version 5.5 
     4 * @modified Pablo 
     5 * @version 6.0 
    56 */ 
    67(function(jwplayer) { 
     
    167168                        } 
    168169                         
    169                         var bgcolor = "#000000"; 
    170                          
    171                         var flashPlayer; 
    172                          
    173                         console.log(params); 
    174                         var flashvars = jsonToFlashvars(params); 
    175                         console.log(flashvars); 
     170                        var bgcolor = "#000000", 
     171                                flashPlayer, 
     172                                flashvars = jsonToFlashvars(params); 
    176173                         
    177174                        if (utils.isIE()) { 
  • branches/jw6/src/js/embed/jwplayer.embed.html5.js

    r2192 r2193  
    4040                                _api.setPlayer(html5player, "html5"); 
    4141                        } else { 
    42                                 return null; 
     42                                var scriptLoader = new utils.scriptloader(_player.src); 
     43                                scriptLoader.addEventListener(jwplayer.events.COMPLETE, this.embed); 
     44                                scriptLoader.load(); 
    4345                        } 
    4446                } 
  • branches/jw6/src/js/html5/jwplayer.html5.display.js

    r2192 r2193  
    1010                _events = jwplayer.events, 
    1111                _states = _events.state, 
    12                 _rotate = html5.utils.animations.rotate, 
     12                _rotate = _utils.animations.rotate, 
    1313                 
    1414 
  • branches/jw6/src/js/html5/utils/jwplayer.html5.utils.animations.js

    r2179 r2193  
    99        }; 
    1010         
    11         animations.transform = function(domelement, value) { 
    12                 domelement.style.webkitTransform = value; 
    13                 domelement.style.MozTransform = value; 
    14                 domelement.style.OTransform = value; 
    15                 domelement.style.msTransform = value; 
     11 
     12        animations.rotate = function(domelement, deg) { 
     13                utils.transform(domelement, "rotate(" + deg + "deg)"); 
    1614        }; 
    1715         
    18         animations.transformOrigin = function(domelement, value) { 
    19                 domelement.style.webkitTransformOrigin = value; 
    20                 domelement.style.MozTransformOrigin = value; 
    21                 domelement.style.OTransformOrigin = value; 
    22                 domelement.style.msTransformOrigin = value; 
    23         }; 
    24          
    25         animations.rotate = function(domelement, deg) { 
    26                 animations.transform(domelement, "rotate(" + deg + "deg)"); 
    27         }; 
    28          
    29 })(jwplayer.html5.utils); 
     16})(jwplayer.utils); 
  • branches/jw6/src/js/utils/jwplayer.utils.extensionmap.js

    r2192 r2193  
    33 * 
    44 * @author zach 
    5  * @version 5.4 
     5 * @modified pablo 
     6 * @version 6.0 
    67 */ 
    78(function(utils) { 
    8         utils.extensionmap = { 
    9                 "3gp": { 
    10                         html5: "video/3gpp", 
    11                         flash: "video" 
    12                 }, 
    13                 "3gpp": { 
    14                         html5: "video/3gpp" 
    15                 }, 
    16                 "3g2": { 
    17                         html5: "video/3gpp2", 
    18                         flash: "video" 
    19                 }, 
    20                 "3gpp2": { 
    21                         html5: "video/3gpp2" 
    22                 }, 
    23                 "flv": { 
    24                         flash: "video" 
    25                 }, 
    26                 "f4a": { 
    27                         html5: "audio/mp4" 
    28                 }, 
    29                 "f4b": { 
    30                         html5: "audio/mp4", 
    31                         flash: "video" 
    32                 }, 
    33                 "f4v": { 
    34                         html5: "video/mp4", 
    35                         flash: "video" 
    36                 }, 
    37                 "mov": { 
    38                         html5: "video/quicktime", 
    39                         flash: "video" 
    40                 }, 
    41                 "m4a": { 
    42                         html5: "audio/mp4", 
    43                         flash: "video" 
    44                 }, 
    45                 "m4b": { 
    46                         html5: "audio/mp4" 
    47                 }, 
    48                 "m4p": { 
    49                         html5: "audio/mp4" 
    50                 }, 
    51                 "m4v": { 
    52                         html5: "video/mp4", 
    53                         flash: "video" 
    54                 }, 
    55                 "mp4": { 
    56                         html5: "video/mp4", 
    57                         flash: "video" 
    58                 }, 
    59                 "rbs":{ 
    60                         flash: "sound" 
    61                 }, 
    62                 "aac": { 
    63                         html5: "audio/aac", 
    64                         flash: "video" 
    65                 }, 
    66                 "mp3": { 
    67                         html5: "audio/mp3", 
    68                         flash: "sound" 
    69                 }, 
    70                 "ogg": { 
    71                         html5: "audio/ogg" 
    72                 }, 
    73                 "oga": { 
    74                         html5: "audio/ogg" 
    75                 }, 
    76                 "ogv": { 
    77                         html5: "video/ogg" 
    78                 }, 
    79                 "webm": { 
    80                         html5: "video/webm" 
    81                 }, 
    82                 "m3u8": { 
    83                         html5: "audio/x-mpegurl" 
    84                 }, 
    85                 "gif": { 
    86                         flash: "image" 
    87                 }, 
    88                 "jpeg": { 
    89                         flash: "image" 
    90                 }, 
    91                 "jpg": { 
    92                         flash: "image" 
    93                 }, 
    94                 "swf":{ 
    95                         flash: "image" 
    96                 }, 
    97                 "png":{ 
    98                         flash: "image" 
    99                 }, 
    100                 "wav":{ 
    101                         html5: "audio/x-wav" 
     9        var video = "video/",  
     10                audio = "audio/", 
     11                image = "image", 
     12                mp4 = "mp4", 
     13                 
     14                html5Extensions = { 
     15                        "f4a": audio+mp4, 
     16                        "f4b": audio+mp4, 
     17                        "f4v": video+mp4, 
     18                        "mov": video+"quicktime", 
     19                        "m4a": audio+mp4, 
     20                        "m4b": audio+mp4, 
     21                        "m4p": audio+mp4, 
     22                        "m4v": video+mp4, 
     23                        "mp4": video+mp4, 
     24                        "aac": audio+"aac", 
     25                        "mp3": audio+"mp3", 
     26                        "ogg": audio+"ogg", 
     27                        "oga": audio+"ogg", 
     28                        "ogv": video+"ogg", 
     29                        "webm": video+"webm", 
     30                        "m3u8": audio+"x-mpegurl", 
     31                        "wav": audio+"x-wav" 
    10232                },  
    103                 "rtmp":{ 
    104                         flash: "rtmp" 
    105                 }, 
    106                 "hls":{ 
    107                         flash: "hls" 
    108                 } 
    109         }; 
     33                video = "video",  
     34                flashExtensions = { 
     35                        "flv": video, 
     36                        "f4b": video, 
     37                        "f4v": video, 
     38                        "mov": video, 
     39                        "m4a": video, 
     40                        "m4v": video, 
     41                        "mp4": video, 
     42                        "aac": video, 
     43                        "mp3": "sound", 
     44                        "gif": image, 
     45                        "jpeg": image, 
     46                        "jpg": image, 
     47                        "swf": image, 
     48                        "png": image, 
     49                        "rtmp": "rtmp", 
     50                        "hls": "hls" 
     51                }; 
     52         
     53        var _extensionmap = utils.extensionmap = {}; 
     54        for (var ext in html5Extensions) { 
     55                _extensionmap[ext] = { html5: html5Extensions[ext] }; 
     56        } 
     57        for (ext in flashExtensions) { 
     58                if (!_extensionmap[ext]) _extensionmap[ext] = {}; 
     59                _extensionmap[ext].flash = flashExtensions[ext]; 
     60        } 
     61 
    11062})(jwplayer.utils); 
  • branches/jw6/src/js/utils/jwplayer.utils.js

    r2192 r2193  
    454454        } 
    455455 
     456        /** 
     457         * Recursively traverses nested object, replacing key names containing a 
     458         * search string with a replacement string. 
     459         *  
     460         * @param searchString 
     461         *            The string to search for in the object's key names 
     462         * @param replaceString 
     463         *            The string to replace in the object's key names 
     464         * @returns The modified object. 
     465         */ 
     466        jwplayer.utils.deepReplaceKeyName = function(obj, searchString, replaceString) { 
     467                switch (jwplayer.utils.typeOf(obj)) { 
     468                case "array": 
     469                        for ( var i = 0; i < obj.length; i++) { 
     470                                obj[i] = jwplayer.utils.deepReplaceKeyName(obj[i], 
     471                                                searchString, replaceString); 
     472                        } 
     473                        break; 
     474                case "object": 
     475                        for ( var key in obj) { 
     476                                var searches, replacements; 
     477                                if (searchString instanceof Array && replaceString instanceof Array) { 
     478                                        if (searchString.length != replaceString.length) 
     479                                                continue; 
     480                                        else { 
     481                                                searches = searchString; 
     482                                                replacements = replaceString; 
     483                                        } 
     484                                } else { 
     485                                        searches = [searchString]; 
     486                                        replacements = [replaceString]; 
     487                                } 
     488                                var newkey = key; 
     489                                for (var i=0; i < searches.length; i++) { 
     490                                        newkey = newkey.replace(new RegExp(searchString[i], "g"), replaceString[i]); 
     491                                } 
     492                                obj[newkey] = jwplayer.utils.deepReplaceKeyName(obj[key], searchString, replaceString); 
     493                                if (key != newkey) { 
     494                                        delete obj[key]; 
     495                                } 
     496                        } 
     497                        break; 
     498                } 
     499                return obj; 
     500        } 
     501 
    456502})(jwplayer); 
  • branches/jw6/src/js/utils/jwplayer.utils.scriptloader.js

    r2192 r2193  
    1313                        COMPLETE: 3 
    1414                }, 
    15                 _events = jwplayer.events, 
    1615                DOCUMENT = document; 
    1716         
    1817         
    1918        utils.scriptloader = function(url) { 
    20                 var _status = _loaderstatus.NEW; 
    21                 var _eventDispatcher = new _events.eventdispatcher(); 
     19                var _status = _loaderstatus.NEW, 
     20                        _events = jwplayer.events, 
     21                        _eventDispatcher = new _events.eventdispatcher(); 
     22                 
    2223                utils.extend(this, _eventDispatcher); 
    2324                 
  • branches/jw6/src/js/utils/jwplayer.utils.stretching.js

    r2192 r2193  
    55 * @version 6.0 
    66 */ 
    7 (function(jwplayer) { 
    8         var DOCUMENT = document; 
    9         var WINDOW = window; 
     7(function(utils) { 
     8        var exists = utils.exists; 
    109         
    11         //Declare namespace 
    12         var utils = jwplayer.utils = function() { 
     10        utils.scale = function(domelement, xscale, yscale, xoffset, yoffset) { 
     11                var value; 
     12                 
     13                // Set defaults 
     14                if (!exists(xscale)) xscale = 1; 
     15                if (!exists(yscale)) yscale = 1; 
     16                if (!exists(xoffset)) xoffset = 0; 
     17                if (!exists(yoffset)) yoffset = 0; 
     18                 
     19                if (xscale == 1 && yscale == 1 && xoffset == 0 && yoffset == 0) { 
     20                        value = ""; 
     21                } else { 
     22                        value = "scale("+xscale+","+yscale+") translate("+xoffset+"px,"+yoffset+"px)"; 
     23                } 
     24                 
    1325        }; 
    14  
    15         /** 
    16          * Returns true if the value of the object is null, undefined or the empty 
    17          * string 
    18          *  
    19          * @param a The variable to inspect 
    20          */ 
    21         utils.exists = function(item) { 
    22                 switch (typeof (item)) { 
    23                 case "string": 
    24                         return (item.length > 0); 
    25                         break; 
    26                 case "object": 
    27                         return (item !== null); 
    28                 case "undefined": 
    29                         return false; 
    30                 } 
    31                 return true; 
    32         } 
    33  
    34         var _styleSheets={}, 
    35                 _styleSheet, 
    36                 _rules = {}; 
    37  
    38         function _createStylesheet() { 
    39                 var styleSheet = DOCUMENT.createElement("style"); 
    40                 styleSheet.type = "text/css"; 
    41                 DOCUMENT.getElementsByTagName('head')[0].appendChild(styleSheet); 
    42                 return styleSheet; 
    43         } 
    4426         
    45         utils.css = function(selector, styles, important) { 
    46                 if (!utils.exists(important)) important = false; 
    47                  
    48                 if (utils.isIE()) { 
    49                         if (!_styleSheet) { 
    50                                 _styleSheet = _createStylesheet(); 
    51                         } 
    52                 } else if (!_styleSheets[selector]) { 
    53                         _styleSheets[selector] = _createStylesheet(); 
    54                 } 
    55  
    56                 if (!_rules[selector]) { 
    57                         _rules[selector] = {}; 
    58                 } 
    59  
    60                 for (var style in styles) { 
    61                         var val = _styleValue(style, styles[style], important); 
    62                         if (utils.exists(_rules[selector][style]) && !utils.exists(val)) { 
    63                                 delete _rules[selector][style]; 
    64                         } else { 
    65                                 _rules[selector][style] = val; 
    66                         } 
    67                 } 
    68  
    69                 // IE9 limits the number of style tags in the head, so we need to update the entire stylesheet each time 
    70                 if (utils.isIE()) { 
    71                         _updateAllStyles(); 
    72                 } else { 
    73                         _updateStylesheet(selector, _styleSheets[selector]); 
     27        utils.transform = function(element, value) { 
     28                var style = element.style; 
     29                if (exists(value)) { 
     30                        style.webkitTransform = value; 
     31                        style.MozTransform = value; 
     32                        style.msTransform = value; 
     33                        style.OTransform = value; 
    7434                } 
    7535        } 
    76          
    77         function _styleValue(style, value, important) { 
    78                 if (typeof value === "undefined") { 
    79                         return undefined; 
    80                 }  
    81                  
    82                 var importantString = important ? " !important" : ""; 
    83  
    84                 if (typeof value == "number") { 
    85                         if (isNaN(value)) { 
    86                                 return undefined; 
    87                         } 
    88                         switch (style) { 
    89                         case "z-index": 
    90                         case "opacity": 
    91                                 return value + importantString; 
    92                                 break; 
    93                         default: 
    94                                 if (style.match(/color/i)) { 
    95                                         return "#" + utils.pad(value.toString(16), 6); 
    96                                 } else { 
    97                                         return Math.ceil(value) + "px" + importantString; 
    98                                 } 
    99                                 break; 
    100                         } 
    101                 } else { 
    102                         return value + importantString; 
    103                 } 
    104         } 
    105  
    106         function _updateAllStyles() { 
    107                 var ruleText = "\n"; 
    108                 for (var rule in _rules) { 
    109                         ruleText += _getRuleText(rule); 
    110                 } 
    111                 _styleSheet.innerHTML = ruleText; 
    112         } 
    113          
    114         function _updateStylesheet(selector, sheet) { 
    115                 if (sheet) { 
    116                         sheet.innerHTML = _getRuleText(selector); 
    117                 } 
    118         } 
    119          
    120         function _getRuleText(selector) { 
    121                 var ruleText = selector + "{\n"; 
    122                 var styles = _rules[selector]; 
    123                 for (var style in styles) { 
    124                         ruleText += "  "+style + ": " + styles[style] + ";\n"; 
    125                 } 
    126                 ruleText += "}\n"; 
    127                 return ruleText; 
    128         } 
    129          
    130          
    131         /** 
    132          * Removes all css elements which match a particular style 
    133          */ 
    134         utils.clearCss = function(filter) { 
    135                 for (var rule in _rules) { 
    136                         if (rule.indexOf(filter) >= 0) { 
    137                                 delete _rules[rule]; 
    138                         } 
    139                 } 
    140                 for (var selector in _styleSheets) { 
    141                         if (selector.indexOf(filter) >= 0) { 
    142                                 _styleSheets[selector].innerHTML = ''; 
    143                         } 
    144                 } 
    145         } 
    146          
    147         /** Gets an absolute file path based on a relative filepath * */ 
    148         utils.getAbsolutePath = function(path, base) { 
    149                 if (!utils.exists(base)) { 
    150                         base = DOCUMENT.location.href; 
    151                 } 
    152                 if (!utils.exists(path)) { 
    153                         return undefined; 
    154                 } 
    155                 if (isAbsolutePath(path)) { 
    156                         return path; 
    157                 } 
    158                 var protocol = base.substring(0, base.indexOf("://") + 3); 
    159                 var domain = base.substring(protocol.length, base.indexOf('/', protocol.length + 1)); 
    160                 var patharray; 
    161                 if (path.indexOf("/") === 0) { 
    162                         patharray = path.split("/"); 
    163                 } else { 
    164                         var basepath = base.split("?")[0]; 
    165                         basepath = basepath.substring(protocol.length + domain.length + 1, basepath.lastIndexOf('/')); 
    166                         patharray = basepath.split("/").concat(path.split("/")); 
    167                 } 
    168                 var result = []; 
    169                 for ( var i = 0; i < patharray.length; i++) { 
    170                         if (!patharray[i] || !utils.exists(patharray[i]) || patharray[i] == ".") { 
    171                                 continue; 
    172                         } else if (patharray[i] == "..") { 
    173                                 result.pop(); 
    174                         } else { 
    175                                 result.push(patharray[i]); 
    176                         } 
    177                 } 
    178                 return protocol + domain + "/" + result.join("/"); 
    179         }; 
    180  
    181         function isAbsolutePath(path) { 
    182                 if (!utils.exists(path)) { 
    183                         return; 
    184                 } 
    185                 var protocol = path.indexOf("://"); 
    186                 var queryparams = path.indexOf("?"); 
    187                 return (protocol > 0 && (queryparams < 0 || (queryparams > protocol))); 
    188         } 
    189  
    190         /** Merges a list of objects **/ 
    191         utils.extend = function() { 
    192                 var args = utils.extend['arguments']; 
    193                 if (args.length > 1) { 
    194                         for ( var i = 1; i < args.length; i++) { 
    195                                 for ( var element in args[i]) { 
    196                                         args[0][element] = args[i][element]; 
    197                                 } 
    198                         } 
    199                         return args[0]; 
    200                 } 
    201                 return null; 
    202         }; 
    203  
    204         /** 
    205          * Cleans up a css dimension (e.g. '420px') and returns an integer. 
    206          */ 
    207         utils.parseDimension = function(dimension) { 
    208                 if (typeof dimension == "string") { 
    209                         if (dimension === "") { 
    210                                 return 0; 
    211                         } else if (dimension.lastIndexOf("%") > -1) { 
    212                                 return dimension; 
    213                         } else { 
    214                                 return parseInt(dimension.replace("px", ""), 10); 
    215                         } 
    216                 } 
    217                 return dimension; 
    218         } 
    219  
    220         /** Format the elapsed / remaining text. **/ 
    221         utils.timeFormat = function(sec) { 
    222                 if (sec > 0) { 
    223                         var str = Math.floor(sec / 60) < 10 ? "0" + Math.floor(sec / 60) + ":" : Math.floor(sec / 60) + ":"; 
    224                         str += Math.floor(sec % 60) < 10 ? "0" + Math.floor(sec % 60) : Math.floor(sec % 60); 
    225                         return str; 
    226                 } else { 
    227                         return "00:00"; 
    228                 } 
    229         } 
    230  
    231         /** Logger * */ 
    232         utils.log = function(msg, obj) { 
    233                 if (typeof console != "undefined" && typeof console.log != "undefined") { 
    234                         if (obj) { 
    235                                 console.log(msg, obj); 
    236                         } else { 
    237                                 console.log(msg); 
    238                         } 
    239                 } 
    240         }; 
    241  
    242         /** Replacement for getBoundingClientRect, which isn't supported in iOS 3.1.2 **/ 
    243         utils.getBoundingClientRect = function(element) { 
    244                 if (typeof element.getBoundingClientRect == "function") { 
    245                         return element.getBoundingClientRect(); 
    246                 } else { 
    247                         return {  
    248                                 left: element.offsetLeft + DOCUMENT.body.scrollLeft,  
    249                                 top: element.offsetTop + DOCUMENT.body.scrollTop,  
    250                                 width: element.offsetWidth,  
    251                                 height: element.offsetHeight 
    252                         }; 
    253                 } 
    254         } 
    255          
    256         var _userAgentMatch = utils.userAgentMatch = function(regex) { 
    257                 var agent = navigator.userAgent.toLowerCase(); 
    258                 return (agent.match(regex) !== null); 
    259         }; 
    260  
    261         utils.isIE = function() { 
    262                 return _userAgentMatch(/msie/i); 
    263         }; 
    264          
    265         /** Matches iOS and Android devices **/  
    266         utils.isMobile = function() { 
    267                 return _userAgentMatch(/(iP(hone|ad|od))|android/i); 
    268         } 
    269  
    270         /** 
    271          * Detects whether the current browser is mobile Safari. 
    272          */ 
    273         jwplayer.utils.isIOS = function() { 
    274                 return _userAgentMatch(/iP(hone|ad|od)/i); 
    275         }; 
    276          
    277         utils.isIPod = function() { 
    278                 return _userAgentMatch(/iP(hone|od)/i); 
    279         }; 
    280  
    281         utils.isIPad = function() { 
    282                 return _userAgentMatch(/iPad/i); 
    283         }; 
    284  
    285         /** Save a setting **/ 
    286         utils.saveCookie = function(name, value) { 
    287                 DOCUMENT.cookie = "jwplayer." + name + "=" + value + "; path=/"; 
    288         } 
    289  
    290         /** Retrieve saved  player settings **/ 
    291         utils.getCookies = function() { 
    292                 var jwCookies = {}; 
    293                 var cookies = DOCUMENT.cookie.split('; '); 
    294                 for (var i=0; i<cookies.length; i++) { 
    295                         var split = cookies[i].split('='); 
    296                         if (split[0].indexOf("jwplayer.") == 0) { 
    297                                 jwCookies[split[0].substring(9, split[0].length)] = utils.serialize(split[1]); 
    298                         } 
    299                 } 
    300                 return jwCookies; 
    301         } 
    302          
    303         /** Loads an XML file into a DOM object * */ 
    304         utils.ajax = function(xmldocpath, completecallback, errorcallback) { 
    305                 var xmlhttp; 
    306                 if (_isCrossdomain(xmldocpath) && utils.exists(WINDOW.XDomainRequest)) { 
    307                         // IE9 
    308                         xmlhttp = new XDomainRequest(); 
    309                         xmlhttp.onload = _ajaxComplete(xmlhttp, xmldocpath, completecallback, errorcallback); 
    310                         xmlhttp.onerror = _ajaxError(errorcallback, xmldocpath, xmlhttp); 
    311                 } else if (utils.exists(WINDOW.XMLHttpRequest)) { 
    312                         // Firefox, Chrome, Opera, Safari 
    313                         xmlhttp = new XMLHttpRequest(); 
    314                         xmlhttp.onreadystatechange = _readyStateChangeHandler(xmlhttp, xmldocpath, completecallback, errorcallback); 
    315                         xmlhttp.onerror = _ajaxError(errorcallback, xmldocpath); 
    316                 } else { 
    317                         if (errorcallback) errorcallback(); 
    318                 } 
    319                   
    320                 try { 
    321                         xmlhttp.open("GET", xmldocpath, true); 
    322                         xmlhttp.send(null); 
    323                 } catch (error) { 
    324                         if (errorcallback) errorcallback(xmldocpath); 
    325                 } 
    326                 return xmlhttp; 
    327         }; 
    328          
    329         function _isCrossdomain(path) { 
    330                 if (path && path.indexOf("://") >= 0) { 
    331                         if (path.split("/")[2] != window.location.href.split("/")[2]) 
    332                                 return true 
    333                 }  
    334                 return false;    
    335         } 
    336          
    337         function _ajaxError(errorcallback, xmldocpath, xmlhttp) { 
    338                 return function() { 
    339                         errorcallback(xmldocpath); 
    340                 } 
    341         } 
    342          
    343         function _readyStateChangeHandler(xmlhttp, xmldocpath, completecallback, errorcallback) { 
    344                 return function() { 
    345                         if (xmlhttp.readyState === 4) { 
    346                                 if (xmlhttp.status == 200) { 
    347                                         _ajaxComplete(xmlhttp, xmldocpath, completecallback, errorcallback)(); 
    348                                 } else if (errorcallback) { 
    349                                         errorcallback(xmldocpath); 
    350                                 } 
    351                         } 
    352                 } 
    353         } 
    354          
    355         function _ajaxComplete(xmlhttp, xmldocpath, completecallback, errorcallback) { 
    356                 return function() { 
    357                         // Handle the case where an XML document was returned with an incorrect MIME type. 
    358                         if (!utils.exists(xmlhttp.responseXML)) { 
    359                                 try { 
    360                                         var parsedXML; 
    361                                         // Parse XML in FF/Chrome/Safari/Opera 
    362                                         if (WINDOW.DOMParser) { 
    363                                                 parsedXML = (new DOMParser()).parseFromString(xmlhttp.responseText,"text/xml"); 
    364                                         } else {  
    365                                                 // Internet Explorer 
    366                                                 parsedXML = new ActiveXObject("Microsoft.XMLDOM"); 
    367                                                 parsedXML.async="false"; 
    368                                                 parsedXML.loadXML(xmlhttp.responseText); 
    369                                         } 
    370                                         if (parsedXML) { 
    371                                                 xmlhttp = utils.extend({}, xmlhttp, {responseXML:parsedXML}); 
    372                                         } 
    373                                 } catch(e) { 
    374                                         if (errorcallback) errorcallback(xmldocpath); 
    375                                         return; 
    376                                 } 
    377                         } 
    378                         completecallback(xmlhttp); 
    379                 } 
    380         } 
    381  
    382         /** Returns the true type of an object * */ 
    383         utils.typeOf = function(value) { 
    384                 var typeofString = typeof value; 
    385                 if (typeofString === 'object') { 
    386                         if (!value) return "null"; 
    387                         return (value instanceof Array) ? 'array' : typeofString; 
    388                 } else { 
    389                         return typeofString; 
    390                 } 
    391         }; 
    392  
    393         /* Normalizes differences between Flash and HTML5 internal players' event responses. */ 
    394         utils.translateEventResponse = function(type, eventProperties) { 
    395                 var translated = jwplayer.utils.extend({}, eventProperties); 
    396                 if (type == jwplayer.api.events.JWPLAYER_FULLSCREEN && !translated.fullscreen) { 
    397                         translated.fullscreen = translated.message == "true" ? true : false; 
    398                         delete translated.message; 
    399                 } else if (typeof translated.data == "object") { 
    400                         // Takes ViewEvent "data" block and moves it up a level 
    401                         translated = jwplayer.utils.extend(translated, translated.data); 
    402                         delete translated.data; 
    403                 } else if (typeof translated.metadata == "object") { 
    404                         jwplayer.utils.deepReplaceKeyName(translated.metadata, ["__dot__","__spc__","__dsh__"], ["."," ","-"]); 
    405                 } 
    406                  
    407                 var rounders = ["position", "duration", "offset"]; 
    408                 for (var rounder in rounders) { 
    409                         if (translated[rounders[rounder]]) { 
    410                                 translated[rounders[rounder]] = Math.round(translated[rounders[rounder]] * 1000) / 1000; 
    411                         } 
    412                 } 
    413                  
    414                 return translated; 
    415         } 
    416  
    417  
    418         utils.transform = function(domelement, xscale, yscale, xoffset, yoffset) { 
    419                 // Set defaults 
    420                 if (!jwplayer.utils.exists(xscale)) xscale = 1; 
    421                 if (!jwplayer.utils.exists(yscale)) yscale = 1; 
    422                 if (!jwplayer.utils.exists(xoffset)) xoffset = 0; 
    423                 if (!jwplayer.utils.exists(yoffset)) yoffset = 0; 
    424                  
    425                 if (xscale == 1 && yscale == 1 && xoffset == 0 && yoffset == 0) { 
    426                         domelement.style.webkitTransform = ""; 
    427                         domelement.style.MozTransform = ""; 
    428                         domelement.style.msTransform = ""; 
    429                         domelement.style.OTransform = ""; 
    430                 } else { 
    431                         var value = "scale("+xscale+","+yscale+") translate("+xoffset+"px,"+yoffset+"px)"; 
    432                         domelement.style.webkitTransform = value; 
    433                         domelement.style.MozTransform = value; 
    434                         domelement.style.msTransform = value; 
    435                         domelement.style.OTransform = value; 
    436                 } 
    437         }; 
    43836         
    43937        /** 
     
    46563                        style = {}, 
    46664                        video = (domelement.tagName.toLowerCase() == "video"), 
    467                         transform = false, 
     65                        scale = false, 
    46866                        stretchClass; 
    46967                 
     
    48684                        xscale = yscale = 1; 
    48785                case _stretching.EXACTFIT: 
    488                 transform = true; 
     86                        scale = true; 
    48987                        break; 
    49088                case _stretching.UNIFORM: 
     
    49391                                elementHeight = elementHeight * yscale; 
    49492                                if (elementWidth / parentWidth > 0.95) { 
    495                                         transform = true; 
     93                                        scale = true; 
    49694                                        stretchClass = "jwexactfit"; 
    49795                                        xscale = Math.ceil(100 * parentWidth / elementWidth) / 100; 
     
    502100                                elementHeight = elementHeight * xscale; 
    503101                                if (elementHeight / parentHeight > 0.95) { 
    504                                         transform = true; 
     102                                        scale = true; 
    505103                                        stretchClass = "jwexactfit"; 
    506104                                        yscale = Math.ceil(100 * parentHeight / elementHeight) / 100; 
     
    515113 
    516114                if (video) { 
    517                         if (transform) { 
     115                        if (scale) { 
    518116                                domelement.style.width = elementWidth + "px"; 
    519117                                domelement.style.height = elementHeight + "px";  
    520118                                xoff = ((parentWidth - elementWidth) / 2) / xscale; 
    521119                                yoff = ((parentHeight - elementHeight) / 2) / yscale; 
    522                                 utils.transform(domelement, xscale, yscale, xoff, yoff); 
     120                                utils.scale(domelement, xscale, yscale, xoff, yoff); 
    523121                        } else { 
    524122                                domelement.style.width = ""; 
     
    539137        }; 
    540138 
    541 })(jwplayer); 
     139})(jwplayer.utils); 
  • branches/jw6/test/embedder.html

    r2192 r2193  
    44          <title>Embedder test</title> 
    55          <script src="../bin-debug/jwplayer.js"></script> 
    6           <script src="../bin-debug/jwplayer.html5.js"></script> 
    76 
    87          <style type="text/css"> 
     
    2322                      playlist: [{ 
    2423                              sources:[ 
    25                                              { file: 'http://content.bitsontherun.com/videos/nPripu9l-1ahmry41.mp4' }                     
     24                                             { file: 'http://content.bitsontherun.com/videos/nPripu9l-1ahmry41.mp4' }, 
    2625                                             { file: 'http://content.bitsontherun.com/videos/nPripu9l-1Lq5Mnwq.webm' }            
    2726                                          ], 
Note: See TracChangeset for help on using the changeset viewer.