Changeset 2184


Ignore:
Timestamp:
05/07/12 08:04:46 (13 months ago)
Author:
pablo
Message:
  • Controlbar deals with case where duration or position string length changes (i.e. 99:99 -> 100:00)
  • Adds beforeplay event
  • Adds inStream API
  • Playlist positioning
Location:
branches/jw6
Files:
20 added
11 edited

Legend:

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

    r2181 r2184  
    6868        } 
    6969         
    70         utils.css = function(selector, styles) { 
     70        utils.css = function(selector, styles, important) { 
     71                if (!utils.exists(important)) important = false; 
     72                 
    7173                if (utils.isIE()) { 
    7274                        if (!_styleSheet) { 
     
    8284 
    8385                for (var style in styles) { 
    84                         var val = _styleValue(style, styles[style]); 
     86                        var val = _styleValue(style, styles[style], important); 
    8587                        if (utils.exists(_rules[selector][style]) && !utils.exists(val)) { 
    8688                                delete _rules[selector][style]; 
     
    98100        } 
    99101         
    100         function _styleValue(style, value) { 
     102        function _styleValue(style, value, important) { 
    101103                if (typeof value === "undefined") { 
    102104                        return undefined; 
    103105                }  
     106                 
     107                var importantString = important ? " !important" : ""; 
    104108 
    105109                if (typeof value == "number") { 
     
    110114                        case "z-index": 
    111115                        case "opacity": 
    112                                 return value; 
     116                                return value + importantString; 
    113117                                break; 
    114118                        default: 
     
    116120                                        return "#" + utils.strings.pad(value.toString(16), 6); 
    117121                                } else { 
    118                                         return Math.ceil(value) + "px"; 
     122                                        return Math.ceil(value) + "px" + importantString; 
    119123                                } 
    120124                                break; 
    121125                        } 
    122126                } else { 
    123                         return value; 
     127                        return value + importantString; 
    124128                } 
    125129        } 
     
    458462                } 
    459463 
    460                 domelement.className = domelement.className.replace(/jw(none|exactfit|uniform|fill)/g, ""); 
     464                domelement.className = domelement.className.replace(/\s*jw(none|exactfit|uniform|fill)/g, ""); 
    461465                domelement.className += " " + stretchClass; 
    462466        }; 
     
    13261330                        _id, 
    13271331                        _duration, 
     1332                        _position, 
    13281333                        _currentVolume, 
    13291334                        _dragging = false, 
     
    13611366 
    13621367                        _id = _api.id + "_controlbar"; 
    1363                         _duration = 0; 
     1368                        _duration = _position = 0; 
    13641369 
    13651370                        _controlbar = _createSpan(); 
     
    13731378                        _skin = _api.skin; 
    13741379                         
    1375                         _settings = _utils.extend({}, _defaults, config); 
     1380                        _settings = _utils.extend({}, _defaults, _skin.getComponentSettings('controlbar'), config); 
    13761381                        _layout = _skin.getComponentLayout('controlbar'); 
    13771382                        if (!_layout) _layout = _defaults.layout; 
     
    13791384                        _buildControlbar(); 
    13801385                        _addEventListeners(); 
     1386                        _playlistHandler(); 
    13811387                } 
    13821388                 
     
    13881394                        _api.jwAddEventListener(jwplayer.events.JWPLAYER_MEDIA_BUFFER, _bufferHandler); 
    13891395                        _api.jwAddEventListener(jwplayer.events.JWPLAYER_FULLSCREEN, _fullscreenHandler); 
     1396                        _api.jwAddEventListener(jwplayer.events.JWPLAYER_PLAYLIST_LOADED, _playlistHandler); 
    13901397                } 
    13911398                 
    13921399                function _timeUpdated(evt) { 
    1393                         _duration = evt.duration; 
     1400                        var refreshRequired = false, 
     1401                                timeString; 
    13941402                         
    13951403                        if (_elements.elapsed) { 
    1396                                 _elements.elapsed.innerHTML = _utils.timeFormat(evt.position); 
     1404                                timeString = _utils.timeFormat(evt.position); 
     1405                                _elements.elapsed.innerHTML = timeString; 
     1406                                refreshRequired = (timeString.length != _utils.timeFormat(_position).length); 
    13971407                        } 
    13981408                        if (_elements.duration) { 
    1399                                 _elements.duration.innerHTML = _utils.timeFormat(evt.duration); 
     1409                                timeString = _utils.timeFormat(evt.duration); 
     1410                                _elements.duration.innerHTML = timeString; 
     1411                                refreshRequired = (refreshRequired || (timeString.length != _utils.timeFormat(_duration).length)); 
    14001412                        } 
    14011413                        if (evt.duration > 0) { 
     
    14041416                                _setProgress(0); 
    14051417                        } 
     1418                        _duration = evt.duration; 
     1419                        _position = evt.position; 
     1420                         
     1421                        if (refreshRequired) _resize(); 
    14061422                } 
    14071423                 
     
    14541470                        _toggleButton("fullscreen", evt.fullscreen); 
    14551471                } 
     1472                 
     1473                function _playlistHandler(evt) { 
     1474                        if (_api.jwGetPlaylist().length < 2) { 
     1475                                _css(_internalSelector(".jwnext"), { display: "none" }); 
     1476                                _css(_internalSelector(".jwprev"), { display: "none" }); 
     1477                        } else { 
     1478                                _css(_internalSelector(".jwnext"), { display: undefined }); 
     1479                                _css(_internalSelector(".jwprev"), { display: undefined }); 
     1480                        } 
     1481                        _resize(); 
     1482                } 
    14561483 
    14571484                /** 
     
    14801507                 
    14811508                function _internalSelector(name) { 
    1482                         return '#' + _id + " " + name; 
     1509                        return '#' + _id + (name ? " " + name : ""); 
    14831510                } 
    14841511 
     
    18811908                function _setBuffer(pct) { 
    18821909                        pct = Math.min(Math.max(0, pct), 1); 
    1883                         _css(_internalSelector('.jwtimeSliderBuffer'), { width: pct * 100 + "%" }); 
    1884                 } 
    1885  
    1886                 function _sliderPercent(prefix, pct, fixedWidth) { 
     1910                        //_css(_internalSelector('.jwtimeSliderBuffer'), { width: pct * 100 + "%" }); 
     1911                        if (_elements.timeSliderBuffer) { 
     1912                                _elements.timeSliderBuffer.style.width = pct * 100 + "%"; 
     1913                        } 
     1914                } 
     1915 
     1916                function _sliderPercent(name, pct, fixedWidth) { 
    18871917                        var width = 100 * Math.min(Math.max(0, pct), 1) + "%"; 
    1888                         _css(_internalSelector(prefix+'Progress'), { width: width }); 
    1889                         _css(_internalSelector(prefix+'Thumb'), { left: width }); 
     1918                         
     1919                        //_css(_internalSelector(prefix+'Progress'), { width: width }); 
     1920                        //_css(_internalSelector(prefix+'Thumb'), { left: width }); 
     1921                         
     1922                        // Set style directly on the elements; Using the stylesheets results in some flickering in Chrome. 
     1923                        if (_elements[name+'SliderProgress']) { 
     1924                                _elements[name+'SliderProgress'].style.width = width; 
     1925                        } 
     1926                        if (_elements[name+'SliderThumb']) { 
     1927                                _elements[name+'SliderThumb'].style.left = width; 
     1928                        } 
    18901929                } 
    18911930                 
    18921931                function _setVolume (pct) { 
    1893                         _sliderPercent('.jwvolumeSlider', pct, true); 
     1932                        _sliderPercent('volume', pct, true); 
    18941933                } 
    18951934 
    18961935                function _setProgress(pct) { 
    1897                         _sliderPercent('.jwtimeSlider', pct); 
     1936                        _sliderPercent('time', pct); 
    18981937                } 
    18991938 
     
    20682107                } 
    20692108                 
     2109                var _preplay, _actionOnAttach, _interruptPlay; 
     2110                 
    20702111                function _play() { 
    2071                         if (_model.state == _states.IDLE) { 
    2072                                 _video.load(_model.playlist[_model.item]); 
    2073                         } else if (_model.state == _states.PAUSED) { 
    2074                                 _video.play(); 
    2075                         } 
     2112                        try { 
     2113                                _actionOnAttach = _play; 
     2114                                if (!_preplay) { 
     2115                                        _preplay = true; 
     2116                                        _eventDispatcher.sendEvent(_events.JWPLAYER_MEDIA_BEFOREPLAY); 
     2117                                        _preplay = false; 
     2118                                        if (_interruptPlay) { 
     2119                                                _interruptPlay = false; 
     2120                                                _actionOnAttach = null; 
     2121                                                return; 
     2122                                        } 
     2123                                } 
     2124                                 
     2125                                if (_model.state == _states.IDLE) { 
     2126                                        _video.load(_model.playlist[_model.item]); 
     2127                                } else if (_model.state == _states.PAUSED) { 
     2128                                        _video.play(); 
     2129                                } 
     2130                                 
     2131                                return true; 
     2132                        } catch (err) { 
     2133                                _eventDispatcher.sendEvent(_events.JWPLAYER_ERROR, err); 
     2134                                _actionOnAttach = null; 
     2135                        } 
     2136                        return false; 
    20762137                } 
    20772138 
    20782139                function _stop() { 
    2079                         _video.stop(); 
     2140                        _actionOnAttach = null; 
     2141                        try { 
     2142                                _video.stop(); 
     2143                                if (_preplay) { 
     2144                                        _interruptPlay = true; 
     2145                                } 
     2146                                return true; 
     2147                        } catch (err) { 
     2148                                _eventDispatcher.sendEvent(_events.JWPLAYER_ERROR, err); 
     2149                        } 
     2150                        return false; 
     2151 
    20802152                } 
    20812153 
    20822154                function _pause() { 
     2155                        try { 
     2156                                switch (_model.state) { 
     2157                                        case _states.PLAYING: 
     2158                                        case _states.BUFFERING: 
     2159                                                _video.pause(); 
     2160                                                break; 
     2161                                        default: 
     2162                                                if (_preplay) { 
     2163                                                        _interruptPlay = true; 
     2164                                                } 
     2165                                } 
     2166                                return true; 
     2167                        } catch (err) { 
     2168                                _eventDispatcher.sendEvent(_events.JWPLAYER_ERROR, err); 
     2169                        } 
     2170                        return false; 
     2171 
     2172                         
    20832173                        if (_model.state == _states.PLAYING || _model.state == _states.BUFFERING) { 
    20842174                                _video.pause(); 
     
    21292219                } 
    21302220                 
     2221                /** Used for the InStream API **/ 
     2222                function _detachMedia() { 
     2223                        try { 
     2224                                return _model.getVideo().detachMedia(); 
     2225                        } catch (err) { 
     2226                                return null; 
     2227                        } 
     2228                } 
     2229 
     2230                function _attachMedia() { 
     2231                        try { 
     2232                                var ret = _model.getVideo().attachMedia(); 
     2233                                if (typeof _actionOnAttach == "function") { 
     2234                                        _actionOnAttach(); 
     2235                                } 
     2236                        } catch (err) { 
     2237                                return null; 
     2238                        } 
     2239                } 
     2240                 
     2241                /** Controller API / public methods **/ 
    21312242                this.play = _waitForReady(_play); 
    21322243                this.pause = _waitForReady(_pause); 
     
    21412252                this.setFullscreen = _waitForReady(_setFullscreen); 
    21422253                this.setStretching = _waitForReady(_setStretching); 
    2143                  
    2144 /*              this.playerReady = _playerReady; 
    21452254                this.detachMedia = _detachMedia;  
    21462255                this.attachMedia = _attachMedia; 
    2147                 this.beforePlay = function() {  
    2148                         return _preplay;  
    2149                 } 
    2150 */               
    2151                  
     2256                 
     2257//              this.playerReady = _playerReady; 
     2258//              this.beforePlay = function() {  
     2259//                      return _preplay;  
     2260//              } 
     2261 
    21522262                _init(); 
    21532263        } 
     
    22222332                        _config = _utils.extend({ 
    22232333                                backgroundcolor: '#000' 
    2224                         }, config); 
     2334                        }, _skin.getComponentSettings('display'), config); 
    22252335                        _bufferRotation = !_utils.exists(_config.bufferrotation) ? 15 : parseInt(_config.bufferrotation, 10),  
    22262336                        _bufferInterval = !_utils.exists(_config.bufferinterval) ? 100 : parseInt(_config.bufferinterval, 10); 
     
    24262536                } 
    24272537 
     2538                this.getBGColor = function() { 
     2539                        return _config.backgroundcolor; 
     2540                } 
     2541                 
     2542                /** NOT SUPPORTED : Using this for now to hack around instream API **/ 
     2543                this.setAlternateClickHandler = function(handler) { 
     2544                        _alternateClickHandler = handler; 
     2545                } 
     2546                this.revertAlternateClickHandler = function() { 
     2547                        _alternateClickHandler = undefined; 
     2548                } 
     2549 
    24282550                _init(); 
    24292551        }; 
     
    24612583    }); 
    24622584 
    2463 })(jwplayer.html5);/** 
     2585})(jwplayer.html5);/**  
     2586 * API to control instream playback without interrupting currently playing video 
     2587 * 
     2588 * @author pablo 
     2589 * @version 6.0 
     2590 */ 
     2591(function(html5) { 
     2592        var _jw = jwplayer,  
     2593                _utils = _jw.utils,  
     2594                _events = _jw.events,  
     2595                _states = _events.state; 
     2596         
     2597        html5.instream = function(api, model, view, controller) { 
     2598                var _defaultOptions = { 
     2599                        controlbarseekable:"always", 
     2600                        controlbarpausable:true, 
     2601                        controlbarstoppable:true, 
     2602                        playlistclickable:true 
     2603                }; 
     2604                 
     2605                var _item, 
     2606                        _options, 
     2607                        _api=api, _model=model, _view=view, _controller=controller, 
     2608                        _video, _oldsrc, _oldsources, _oldpos, _oldstate, _olditem, 
     2609                        _provider, _cbar, _disp, _instreamMode = false, 
     2610                        _dispatcher, _instreamContainer, 
     2611                        _self = this; 
     2612 
     2613 
     2614                /***************************************** 
     2615                 *****  Public instream API methods  ***** 
     2616                 *****************************************/ 
     2617 
     2618                /** Load an instream item and initialize playback **/ 
     2619                this.load = function(item, options) { 
     2620                        // Update the instream player's model 
     2621                        _copyModel(); 
     2622                        // Sets internal instream mode to true 
     2623                        _instreamMode = true; 
     2624                        // Instream playback options 
     2625                        _options = _utils.extend(_defaultOptions, options); 
     2626                        // Copy the playlist item passed in and make sure it's formatted as a proper playlist item 
     2627                        _item = html5.playlistitem(item); 
     2628                        // Create (or reuse) video media provider.  No checks right now to make sure it's a valid playlist item (i.e. provider="video"). 
     2629                        _setupProvider(); 
     2630                        // Create the container in which the controls will be placed 
     2631                        _instreamContainer = document.createElement("div"); 
     2632                        _instreamContainer.id = _self.id + "_instream_container"; 
     2633                        // Make sure the original player's provider stops broadcasting events (pseudo-lock...) 
     2634                        _controller.detachMedia(); 
     2635                        // Get the video tag 
     2636                        _video = _provider.getTag(); 
     2637                        // Store this to compare later (in case the main player switches to the next playlist item when we switch out of instream playback mode  
     2638                        _olditem = _model.playlist[_model.item]; 
     2639                        // Keep track of the original player state 
     2640                        _oldstate = _api.jwGetState(); 
     2641                        // If the player's currently playing, pause the video tag 
     2642                        if (_oldstate == _states.BUFFERING || _oldstate == _states.PLAYING) { 
     2643                                _video.pause(); 
     2644                        } 
     2645                         
     2646                        // Copy the video src/sources tags and store the current playback time 
     2647                        _oldsrc = _video.src ? _video.src : _video.currentSrc; 
     2648                        _oldsources = _video.innerHTML; 
     2649                        _oldpos = _video.currentTime; 
     2650                         
     2651                        // Instream display component 
     2652                        _disp = new html5.display(_self); 
     2653                        _disp.setAlternateClickHandler(function(evt) { 
     2654                                if (_fakemodel.state == _states.PAUSED) { 
     2655                                        _self.jwInstreamPlay(); 
     2656                                } else { 
     2657                                        _sendEvent(_events.JWPLAYER_INSTREAM_CLICK, evt); 
     2658                                } 
     2659                        }); 
     2660                        _instreamContainer.appendChild(_disp.getDisplayElement()); 
     2661 
     2662                        // Instream controlbar (if not iOS/Android) 
     2663                        if (!_utils.isMobile()) { 
     2664//                              _cbar = new html5.controlbar(_self, _utils.extend({},_model.plugins.config.controlbar, {})); 
     2665                                _cbar = new html5.controlbar(_self); 
     2666//                              if (_model.plugins.config.controlbar.position == html5.view.positions.OVER) { 
     2667                                        _instreamContainer.appendChild(_cbar.getDisplayElement()); 
     2668//                              } else { 
     2669//                                      var cbarParent = _model.plugins.object.controlbar.getDisplayElement().parentNode; 
     2670//                                      cbarParent.appendChild(_cbar.getDisplayElement()); 
     2671//                              } 
     2672                        } 
     2673 
     2674                        // Show the instream layer 
     2675                        _view.setupInstream(_instreamContainer, _video); 
     2676                        // Resize the instream components to the proper size 
     2677                        _resize(); 
     2678                        // Load the instream item 
     2679                        _provider.load(_item); 
     2680                         
     2681                } 
     2682                         
     2683                /** Stop the instream playback and revert the main player back to its original state **/ 
     2684                this.jwInstreamDestroy = function(complete) { 
     2685                        if (!_instreamMode) return; 
     2686                        // We're not in instream mode anymore. 
     2687                        _instreamMode = false; 
     2688                        if (_oldstate != _states.IDLE) { 
     2689                                // Load the original item into our provider, which sets up the regular player's video tag 
     2690                                _provider.load(_olditem, false); 
     2691                                // We don't want the position interval to be running anymore 
     2692                                //_provider.stop(false); 
     2693                        } else { 
     2694                                _provider.stop(true); 
     2695                        } 
     2696                        // We don't want the instream provider to be attached to the video tag anymore 
     2697                        _provider.detachMedia(); 
     2698                        // Return the view to its normal state 
     2699                        _view.destroyInstream(); 
     2700                        // If we added the controlbar anywhere, let's get rid of it 
     2701                        if (_cbar) try { _cbar.getDisplayElement().parentNode.removeChild(_cbar.getDisplayElement()); } catch(e) {} 
     2702                        // Let listeners know the instream player has been destroyed, and why 
     2703                        _sendEvent(_events.JWPLAYER_INSTREAM_DESTROYED, {reason:(complete ? "complete":"destroyed")}, true); 
     2704                        // Re-attach the controller 
     2705                        _controller.attachMedia(); 
     2706                        if (_oldstate == _states.BUFFERING || _oldstate == _states.PLAYING) { 
     2707                                // Model was already correct; just resume playback 
     2708                                _video.play(); 
     2709                                if (_model.playlist[_model.item] == _olditem) { 
     2710                                        // We need to seek using the player's real provider, since the seek may have to be delayed 
     2711                                        //_model.getMedia().seek(_oldpos); 
     2712                                        _model.getVideo().seek(_oldpos); 
     2713                                } 
     2714                        } 
     2715                        return; 
     2716                }; 
     2717                 
     2718                /** Forward any calls to add and remove events directly to our event dispatcher **/ 
     2719                this.jwInstreamAddEventListener = function(type, listener) { 
     2720                        _dispatcher.addEventListener(type, listener); 
     2721                }  
     2722                this.jwInstreamRemoveEventListener = function(type, listener) { 
     2723                        _dispatcher.removeEventListener(type, listener); 
     2724                } 
     2725 
     2726                /** Start instream playback **/ 
     2727                this.jwInstreamPlay = function() { 
     2728                        if (!_instreamMode) return; 
     2729                        _provider.play(true); 
     2730                } 
     2731 
     2732                /** Pause instream playback **/ 
     2733                this.jwInstreamPause = function() { 
     2734                        if (!_instreamMode) return; 
     2735                        _provider.pause(true); 
     2736                } 
     2737                 
     2738                /** Seek to a point in instream media **/ 
     2739                this.jwInstreamSeek = function(position) { 
     2740                        if (!_instreamMode) return; 
     2741                        _provider.seek(position); 
     2742                } 
     2743                 
     2744                /** Get the current instream state **/ 
     2745                this.jwInstreamGetState = function() { 
     2746                        if (!_instreamMode) return undefined; 
     2747                        return _fakemodel.state; 
     2748                } 
     2749 
     2750                /** Get the current instream playback position **/ 
     2751                this.jwInstreamGetPosition = function() { 
     2752                        if (!_instreamMode) return undefined; 
     2753                        return _fakemodel.position; 
     2754                } 
     2755 
     2756                /** Get the current instream media duration **/ 
     2757                this.jwInstreamGetDuration = function() { 
     2758                        if (!_instreamMode) return undefined; 
     2759                        return _fakemodel.duration; 
     2760                } 
     2761                 
     2762                this.playlistClickable = function() { 
     2763                        return (!_instreamMode || _options.playlistclickable.toString().toLowerCase()=="true"); 
     2764                } 
     2765                 
     2766 
     2767                /***************************** 
     2768                 ****** Private methods ******  
     2769                 *****************************/ 
     2770 
     2771                function _init() { 
     2772                        // Initialize the instream player's model copied from main player's model 
     2773                        //_fakemodel = new html5.model(this, _model.getMedia() ? _model.getMedia().getDisplayElement() : _model.container, _model); 
     2774                        _fakemodel = new html5.model({}); 
     2775                        // Create new event dispatcher 
     2776                        _dispatcher = new _events.eventdispatcher(); 
     2777                        // Listen for player resize events 
     2778                        _api.jwAddEventListener(_events.JWPLAYER_RESIZE, _resize); 
     2779                        _api.jwAddEventListener(_events.JWPLAYER_FULLSCREEN, _resize); 
     2780                } 
     2781 
     2782                function _copyModel() { 
     2783                        _controller.setMute(_model.mute); 
     2784                        _controller.setVolume(_model.volume); 
     2785                } 
     2786                 
     2787                function _setupProvider() { 
     2788                        if (!_provider) { 
     2789//                              _provider = new html5.mediavideo(_fakemodel, _model.getMedia() ? _model.getMedia().getDisplayElement() : _model.container); 
     2790                                _provider = new html5.video(_model.getVideo().getTag()); 
     2791                                _provider.addGlobalListener(_forward); 
     2792                                _provider.addEventListener(_events.JWPLAYER_MEDIA_META, _metaHandler); 
     2793                                _provider.addEventListener(_events.JWPLAYER_MEDIA_COMPLETE, _completeHandler); 
     2794                                _provider.addEventListener(_events.JWPLAYER_MEDIA_BUFFER_FULL, _bufferFullHandler); 
     2795                        } 
     2796                        _provider.attachMedia(); 
     2797                } 
     2798                 
     2799                /** Forward provider events to listeners **/             
     2800                function _forward(evt) { 
     2801                        if (_instreamMode) { 
     2802                                _sendEvent(evt.type, evt); 
     2803                        } 
     2804                } 
     2805                 
     2806                /** Handle the JWPLAYER_MEDIA_BUFFER_FULL event **/              
     2807                function _bufferFullHandler(evt) { 
     2808                        if (_instreamMode) { 
     2809                                _provider.play(); 
     2810                        } 
     2811                } 
     2812 
     2813                /** Handle the JWPLAYER_MEDIA_COMPLETE event **/                 
     2814                function _completeHandler(evt) { 
     2815                        if (_instreamMode) { 
     2816                                setTimeout(function() { 
     2817                                        _self.jwInstreamDestroy(true); 
     2818                                }, 10); 
     2819                        } 
     2820                } 
     2821 
     2822                /** Handle the JWPLAYER_MEDIA_META event **/             
     2823                function _metaHandler(evt) { 
     2824                        // If we're getting video dimension metadata from the provider, allow the view to resize the media 
     2825                        if (evt.metadata.width && evt.metadata.height) { 
     2826                                _view.resizeMedia(); 
     2827                        } 
     2828                } 
     2829                 
     2830                function _sendEvent(type, data, forceSend) { 
     2831                        if (_instreamMode || forceSend) { 
     2832                                _dispatcher.sendEvent(type, data); 
     2833                        } 
     2834                } 
     2835                 
     2836                // Resize handler; resize the components. 
     2837                function _resize() { 
     2838//                      var originalDisp = _model.plugins.object.display.getDisplayElement().style; 
     2839//                       
     2840                        if (_cbar) { 
     2841//                              var originalBar = _model.plugins.object.controlbar.getDisplayElement().style; 
     2842                                _cbar.resize(); 
     2843                                //_cbar.resize(_utils.parseDimension(originalDisp.width), _utils.parseDimension(originalDisp.height)); 
     2844//                              _css(_cbar.getDisplayElement(), _utils.extend({}, originalBar, { zIndex: 1001, opacity: 1 })); 
     2845                        } 
     2846                        if (_disp) { 
     2847//                               
     2848//                              _disp.resize(_utils.parseDimension(originalDisp.width), _utils.parseDimension(originalDisp.height)); 
     2849                                _disp.resize(); 
     2850//                              _css(_disp.getDisplayElement(), _utils.extend({}, originalDisp, { zIndex: 1000 })); 
     2851                        } 
     2852//                      if (_view) { 
     2853//                              _view.resizeMedia(); 
     2854//                      } 
     2855                } 
     2856                 
     2857                 
     2858                /************************************** 
     2859                 *****  Duplicate main html5 api  ***** 
     2860                 **************************************/ 
     2861                 
     2862                this.jwPlay = function(state) { 
     2863                        if (_options.controlbarpausable.toString().toLowerCase()=="true") { 
     2864                                this.jwInstreamPlay(); 
     2865                        } 
     2866                }; 
     2867                 
     2868                this.jwPause = function(state) { 
     2869                        if (_options.controlbarpausable.toString().toLowerCase()=="true") { 
     2870                                this.jwInstreamPause(); 
     2871                        } 
     2872                }; 
     2873 
     2874                this.jwStop = function() { 
     2875                        if (_options.controlbarstoppable.toString().toLowerCase()=="true") { 
     2876                                this.jwInstreamDestroy(); 
     2877                                _api.jwStop(); 
     2878                        } 
     2879                }; 
     2880 
     2881                this.jwSeek = function(position) { 
     2882                        switch(_options.controlbarseekable.toLowerCase()) { 
     2883                        case "always": 
     2884                                this.jwInstreamSeek(position); 
     2885                                break; 
     2886                        case "backwards": 
     2887                                if (_fakemodel.position > position) { 
     2888                                        this.jwInstreamSeek(position); 
     2889                                } 
     2890                                break; 
     2891                        } 
     2892                }; 
     2893                 
     2894                this.jwGetPosition = function() {}; 
     2895                this.jwGetDuration = function() {}; 
     2896                this.jwGetWidth = _api.jwGetWidth; 
     2897                this.jwGetHeight = _api.jwGetHeight; 
     2898                this.jwGetFullscreen = _api.jwGetFullscreen; 
     2899                this.jwSetFullscreen = _api.jwSetFullscreen; 
     2900                this.jwGetVolume = function() { return _model.volume; }; 
     2901                this.jwSetVolume = function(vol) { 
     2902                        _provider.volume(vol); 
     2903                        _api.jwSetVolume(vol); 
     2904                } 
     2905                this.jwGetMute = function() { return _model.mute; }; 
     2906                this.jwSetMute = function(state) { 
     2907                        _provider.mute(state); 
     2908                        _api.jwSetMute(state); 
     2909                } 
     2910                this.jwGetState = function() { return _fakemodel.state; }; 
     2911                this.jwGetPlaylist = function() { return [_item]; }; 
     2912                this.jwGetPlaylistIndex = function() { return 0; }; 
     2913                this.jwGetStretching = function() { return _model.config.stretching; }; 
     2914                this.jwAddEventListener = function(type, handler) { _dispatcher.addEventListener(type, handler); }; 
     2915                this.jwRemoveEventListener = function(type, handler) { _dispatcher.removeEventListener(type, handler); }; 
     2916 
     2917                this.skin = _api.skin; 
     2918                this.id = _api.id + "_instream"; 
     2919 
     2920                _init(); 
     2921                return this; 
     2922        }; 
     2923})(jwplayer.html5); 
     2924 
     2925/** 
    24642926 * jwplayer.html5 model 
    24652927 *  
     
    24902952                                repeat: "", 
    24912953                                playlistsize: 0, 
     2954                                playlistposition: "right", 
    24922955                                stretching: _utils.stretching.UNIFORM, 
    24932956                                autostart: false, 
     
    25753038                                }); 
    25763039                        } 
     3040                } 
     3041                 
     3042                this.componentConfig = function(name) { 
     3043                        return {}; 
    25773044                } 
    25783045                 
     
    26583125 
    26593126                 
     3127                /** InStream API **/ 
     3128                this.jwDetachMedia = _controller.detachMedia; 
     3129                this.jwAttachMedia = _controller.attachMedia; 
     3130                 
     3131                var _instreamPlayer; 
     3132                 
     3133                this.jwLoadInstream = function(item, options) { 
     3134                        if (!_instreamPlayer) { 
     3135                                _instreamPlayer = new html5.instream(_api, _model, _view, _controller); 
     3136                        } 
     3137                        setTimeout(function() { 
     3138                                _instreamPlayer.load(item, options); 
     3139                        }, 10); 
     3140                } 
     3141                 
     3142                this.jwInstreamDestroy = function() { 
     3143                        if (_instreamPlayer) { 
     3144                                _instreamPlayer.jwInstreamDestroy(); 
     3145                        } 
     3146                } 
     3147                 
     3148                /** Events **/ 
    26603149                this.jwAddEventListener = _controller.addEventListener; 
    26613150                this.jwRemoveEventListener = _controller.removeEventListener; 
     3151                 
    26623152                 
    26633153                _init(); 
     
    36374127                _bufferPercent = -1, 
    36384128                // Event dispatcher 
    3639                 _eventDispatcher = new _events.eventdispatcher(); 
    3640  
     4129                _eventDispatcher = new _events.eventdispatcher(), 
     4130                // Whether or not we're listening to video tag events 
     4131                _attached = false; 
     4132                 
    36414133                _utils.extend(this, _eventDispatcher); 
    36424134 
     
    36494141                        _video.controls = true; 
    36504142                        _video.controls = false; 
     4143                         
     4144                        _attached = true; 
    36514145                } 
    36524146 
     
    36584152 
    36594153                function _sendEvent(type, data) { 
    3660                         _eventDispatcher.sendEvent(type, data); 
     4154                        if (_attached) { 
     4155                                _eventDispatcher.sendEvent(type, data); 
     4156                        } 
    36614157                } 
    36624158 
     
    36674163 
    36684164                function _durationUpdateHandler(evt) { 
    3669                         _duration = _video.duration; 
     4165                        if (!_attached) return; 
     4166                        if (_duration < 0) _duration = _video.duration; 
    36704167                        _timeUpdateHandler(); 
    36714168                } 
    36724169 
    36734170                function _timeUpdateHandler(evt) { 
     4171                        if (!_attached) return; 
    36744172                        if (_state == _states.PLAYING && !_dragging) { 
    36754173                                _position = _video.currentTime; 
     
    36854183 
    36864184                function _canPlayHandler(evt) { 
     4185                        if (!_attached) return; 
    36874186                        if (!_canSeek) { 
    36884187                                _canSeek = true; 
     
    37024201 
    37034202                function _playHandler(evt) { 
    3704                         if (_dragging) return; 
     4203                        if (!_attached || _dragging) return; 
    37054204                         
    37064205                        if (_video.paused) { 
     
    37124211                 
    37134212                function _bufferStateHandler(evt) { 
     4213                        if (!_attached) return; 
    37144214                        _setState(_states.BUFFERING); 
    37154215                } 
    37164216 
    37174217                function _errorHandler(evt) { 
     4218                        if (!_attached) return; 
    37184219                        _utils.log("Error: %o", _video.error); 
    37194220                        _setState(_states.IDLE); 
     
    37394240                 
    37404241                this.load = function(item) { 
     4242                        if (!_attached) return; 
     4243 
    37414244                        _item = item; 
    37424245                        _canSeek = false; 
    37434246                        _bufferFull = false; 
    37444247                        _delayedSeek = 0; 
    3745                         _duration = 0; 
     4248                        _duration = item.duration ? item.duration : -1; 
    37464249                        _position = 0; 
    37474250                         
     
    37704273 
    37714274                var _stop = this.stop = function() { 
     4275                        if (!_attached) return; 
    37724276                        _video.removeAttribute("src"); 
    37734277                        _video.load(); 
     
    37774281 
    37784282                this.play = function() { 
    3779                         _video.play(); 
     4283                        if (_attached) _video.play(); 
    37804284                } 
    37814285 
    37824286                this.pause = function() { 
    3783                         _video.pause(); 
     4287                        if (_attached) _video.pause(); 
    37844288                } 
    37854289 
    37864290                this.seekDrag = function(state) { 
     4291                        if (!_attached) return;  
    37874292                        _dragging = state; 
    37884293                        if (state) _video.pause(); 
     
    37914296                 
    37924297                var _seek = this.seek = function(pos) { 
    3793                         if (_canSeek) { 
     4298                        if (!_attached) return;  
     4299                        if (_video.readyState >= _video.HAVE_FUTURE_DATA) { 
    37944300                                _delayedSeek = 0; 
    37954301                                if (!_dragging) { 
     
    38524358                 
    38534359                function _sendBufferUpdate() { 
     4360                        if (!_attached) return;  
    38544361                        var newBuffer = _getBuffer(); 
    38554362                        if (newBuffer != _bufferPercent) { 
     
    38774384                } 
    38784385                 
     4386 
     4387                /** 
     4388                 * Return the video tag and stop listening to events   
     4389                 */ 
     4390                this.detachMedia = function() { 
     4391                        _attached = false; 
     4392                        return _video; 
     4393                } 
     4394                 
     4395                /** 
     4396                 * Begin listening to events again   
     4397                 */ 
     4398                this.attachMedia = function() { 
     4399                        _attached = true; 
     4400                } 
     4401                 
    38794402                // Provide access to video tag 
    3880                 // TODO: remove 
     4403                // TODO: remove; used by InStream 
    38814404                this.getTag = function() { 
    3882                         return videotag; 
     4405                        return _video; 
    38834406                } 
    38844407 
     
    39024425 
    39034426                DOCUMENT = document,  
    3904                 VIEW_CONTAINER_CLASS = "jwplayer",  
    3905                 VIEW_VIDEO_CONTAINER_CLASS = "jwvideocontainer",  
    3906                 VIEW_CONTROLS_CONTAINER_CLASS = "jwcontrolscontainer", 
    3907                 VIEW_PLAYLIST_CONTAINER_CLASS = "jwplaylistcontainer"; 
    3908  
     4427                PLAYER_CLASS = "jwplayer",  
     4428                FULLSCREEN_SELECTOR = PLAYER_CLASS+".jwfullscreen", 
     4429                VIEW_MAIN_CONTAINER_CLASS = "jwmain", 
     4430                VIEW_INSTREAM_CONTAINER_CLASS = "jwinstream", 
     4431                VIEW_VIDEO_CONTAINER_CLASS = "jwvideo",  
     4432                VIEW_CONTROLS_CONTAINER_CLASS = "jwcontrols", 
     4433                VIEW_PLAYLIST_CONTAINER_CLASS = "jwplaylist"; 
     4434                 
    39094435        html5.view = function(api, model) { 
    39104436                var _api = api,  
    39114437                        _model = model,  
    39124438                        _controls = {}, 
     4439                        _playerElement, 
    39134440                        _container, 
    39144441                        _controlsLayer, 
     
    39164443                        _controlsTimeout=0, 
    39174444                        _timeoutDuration = 2000, 
    3918                         _videoLayer; 
     4445                        _videoLayer, 
     4446                        _instreamLayer; 
    39194447 
    39204448                this.setup = function(skin) { 
    39214449                        _api.skin = skin; 
    39224450                         
    3923                         _container = DOCUMENT.createElement("div"); 
    3924                         _container.className = VIEW_CONTAINER_CLASS; 
    3925                         _container.id = _api.id; 
     4451                        _playerElement = _createElement("div", PLAYER_CLASS); 
     4452                        _playerElement.id = _api.id; 
    39264453                         
    39274454                        var replace = document.getElementById(_api.id); 
    3928                         replace.parentNode.replaceChild(_container, replace); 
    3929  
    3930                         _videoLayer = DOCUMENT.createElement("span"); 
    3931                         _videoLayer.className = VIEW_VIDEO_CONTAINER_CLASS; 
     4455                        replace.parentNode.replaceChild(_playerElement, replace); 
     4456                         
     4457                        _container = _createElement("span", VIEW_MAIN_CONTAINER_CLASS); 
     4458                        _videoLayer = _createElement("span", VIEW_VIDEO_CONTAINER_CLASS); 
    39324459                        _videoLayer.appendChild(_model.getVideo().getTag()); 
    3933  
    3934                         _controlsLayer = DOCUMENT.createElement("span"); 
    3935                         _controlsLayer.className = VIEW_CONTROLS_CONTAINER_CLASS; 
    3936  
    3937                         _playlistLayer = DOCUMENT.createElement("span"); 
    3938                         _playlistLayer.className = VIEW_PLAYLIST_CONTAINER_CLASS; 
     4460                        _controlsLayer = _createElement("span", VIEW_CONTROLS_CONTAINER_CLASS); 
     4461                        _instreamLayer = _createElement("span", VIEW_INSTREAM_CONTAINER_CLASS); 
     4462                        _playlistLayer = _createElement("span", VIEW_PLAYLIST_CONTAINER_CLASS); 
    39394463 
    39404464                        _setupControls(); 
     
    39424466                        _container.appendChild(_videoLayer); 
    39434467                        _container.appendChild(_controlsLayer); 
    3944                         _container.appendChild(_playlistLayer); 
     4468                        _container.appendChild(_instreamLayer); 
     4469                        _playerElement.appendChild(_container); 
     4470                        _playerElement.appendChild(_playlistLayer); 
    39454471                         
    39464472                        DOCUMENT.addEventListener('webkitfullscreenchange', _fullscreenChangeHandler, false); 
     
    39524478                        _stateHandler({newstate:_states.IDLE}); 
    39534479                         
    3954                         _container.addEventListener('mouseout', _fadeControls, false); 
    3955                         _container.addEventListener('mousemove', function(evt) { 
     4480                        _playerElement.addEventListener('mouseout', _fadeControls, false); 
     4481                        _playerElement.addEventListener('mousemove', function(evt) { 
    39564482                                _showControls(); 
    39574483                                clearTimeout(_controlsTimeout); 
     
    39614487                } 
    39624488         
     4489                function _createElement(elem, className) { 
     4490                        var newElement = DOCUMENT.createElement(elem); 
     4491                        if (className) newElement.className = className; 
     4492                        return newElement; 
     4493                } 
     4494                 
    39634495                function _fadeControls() { 
    39644496                        if (_api.jwGetState() == _states.PLAYING) { 
     
    39724504                        var width = _model.width, 
    39734505                                height = _model.height, 
    3974                                 cbSettings = _api.skin.getComponentSettings('controlbar'), 
    3975                                 displaySettings = _api.skin.getComponentSettings('display') 
     4506                                cbSettings = _model.componentConfig('controlbar'); 
     4507                                displaySettings = _model.componentConfig('display'); 
    39764508                 
    39774509                        if (height > 40 || height.indexOf("%")) { 
    39784510                                _controls.display = new html5.display(_api, displaySettings); 
    39794511                                _controlsLayer.appendChild(_controls.display.getDisplayElement()); 
     4512                                displaySettings.backgroundcolor = _controls.display.getBGColor(); 
    39804513                        } else { 
    39814514                                displaySettings.backgroundcolor = 'transparent'; 
    39824515                                cbSettings.margin = 0; 
    39834516                        } 
    3984                          
    3985                         if (_model.playlistsize > 0) { 
     4517                        _css(_internalSelector(), { 
     4518                                'background-color': displaySettings.backgroundcolor 
     4519                        }); 
     4520                         
     4521                        if (_model.playlistsize > 0 && _model.playlistposition && _model.playlistposition != "none") { 
    39864522                                _controls.playlist = new html5.playlistcomponent(_api, {}); 
    39874523                                _playlistLayer.appendChild(_controls.playlist.getDisplayElement()); 
     
    39894525 
    39904526                        _resize(width, height); 
    3991                          
    3992                         _css('#'+_container.id, { 
    3993                                 'background-color': displaySettings.backgroundcolor ? displaySettings.backgroundcolor : 0 
    3994                         }); 
    39954527 
    39964528                        if (!_utils.isMobile()) { 
     
    40114543                        if (state) { 
    40124544                                if (!_model.fullscreen) { 
    4013                                         if (_container.requestFullScreen) { 
    4014                                                 _container.requestFullScreen(); 
    4015                                         } else if (_container.mozRequestFullScreen) { 
    4016                                                 _container.mozRequestFullScreen(); 
    4017                                         } else if (_container.webkitRequestFullScreen) { 
    4018                                                 _container.webkitRequestFullScreen(); 
    4019                                         } else { 
    4020                                                 _fakeFullscreen(true); 
     4545                                        _fakeFullscreen(true); 
     4546                                        if (_playerElement.requestFullScreen) { 
     4547                                                _playerElement.requestFullScreen(); 
     4548                                        } else if (_playerElement.mozRequestFullScreen) { 
     4549                                                _playerElement.mozRequestFullScreen(); 
     4550                                        } else if (_playerElement.webkitRequestFullScreen) { 
     4551                                                _playerElement.webkitRequestFullScreen(); 
    40214552                                        } 
    4022                                 } 
    4023                                 _model.setFullscreen(true); 
     4553                                        _model.setFullscreen(true); 
     4554                                } 
    40244555                        } else { 
    40254556                        _fakeFullscreen(false); 
    4026                             if (DOCUMENT.cancelFullScreen) {   
    4027                                 DOCUMENT.cancelFullScreen();   
    4028                             } else if (DOCUMENT.mozCancelFullScreen) {   
    4029                                 DOCUMENT.mozCancelFullScreen();   
    4030                             } else if (DOCUMENT.webkitCancelFullScreen) {   
    4031                                 DOCUMENT.webkitCancelFullScreen();   
    4032                             } 
    4033                                 _model.setFullscreen(false); 
     4557                                if (_model.fullscreen) { 
     4558                                    if (DOCUMENT.cancelFullScreen) {   
     4559                                        DOCUMENT.cancelFullScreen();   
     4560                                    } else if (DOCUMENT.mozCancelFullScreen) {   
     4561                                        DOCUMENT.mozCancelFullScreen();   
     4562                                    } else if (DOCUMENT.webkitCancelFullScreen) {   
     4563                                        DOCUMENT.webkitCancelFullScreen();   
     4564                                    } 
     4565                                        _model.setFullscreen(false); 
     4566                                } 
    40344567                        } 
    40354568                } 
     
    40404573                function _resize(width, height) { 
    40414574                        if (_utils.exists(width) && _utils.exists(height)) { 
    4042                                 _css('#'+_container.id, { 
     4575                                _css(_internalSelector(), { 
    40434576                                        width: width, 
    40444577                                        height: height 
     
    40544587                                _controls.controlbar.resize(width, height); 
    40554588                        } 
    4056                         if (_controls.playlist && _model.playlistsize > 0) { 
     4589                        var playlistSize = _model.playlistsize, 
     4590                                playlistPos = _model.playlistposition 
     4591                         
     4592                        if (_controls.playlist && playlistSize > 0 && playlistPos) { 
    40574593                                _controls.playlist.resize(width, height); 
    4058                                 _css('#'+_container.id+' .' + VIEW_PLAYLIST_CONTAINER_CLASS, { 
    4059                                         right: 0, 
    4060                                         width: _model.playlistsize  
    4061                                 }); 
    4062                                 _css('#'+_container.id + ' .' + VIEW_VIDEO_CONTAINER_CLASS + ',#'+_container.id+' .'+ VIEW_CONTROLS_CONTAINER_CLASS, { 
    4063                                         right: _model.playlistsize 
    4064                                 }); 
     4594                                 
     4595                                var playlistStyle = { display: "block" }, containerStyle = {}; 
     4596                                playlistStyle[playlistPos] = 0; 
     4597                                containerStyle[playlistPos] = playlistSize; 
     4598                                 
     4599                                if (playlistPos == "left" || playlistPos == "right") { 
     4600                                        playlistStyle.width = playlistSize; 
     4601                                } else { 
     4602                                        playlistStyle.height = playlistSize; 
     4603                                } 
     4604                                 
     4605                                _css(_internalSelector(VIEW_PLAYLIST_CONTAINER_CLASS), playlistStyle); 
     4606                                _css(_internalSelector(VIEW_MAIN_CONTAINER_CLASS), containerStyle); 
    40654607                        } 
    40664608 
     
    40714613 
    40724614                this.completeSetup = function() { 
    4073                         _css('#'+_container.id, {opacity: 1}); 
     4615                        _css(_internalSelector(), {opacity: 1}); 
    40744616                } 
    40754617                 
     
    40984640                function _fakeFullscreen(state) { 
    40994641                        if (state) { 
    4100                                 _container.className += " jwfullscreen"; 
     4642                                _playerElement.className += " jwfullscreen"; 
    41014643                        } else { 
    4102                                 _container.className = _container.className.replace(/\s+jwfullscreen/, ""); 
     4644                                _playerElement.className = _playerElement.className.replace(/\s+jwfullscreen/, ""); 
    41034645                        } 
    41044646                } 
     
    41084650                 */ 
    41094651                function _isNativeFullscreen() { 
    4110                         if (DOCUMENT.mozFullScreenElement) return DOCUMENT.mozFullScreenElement.id == _container.id;  
    4111                         else if (DOCUMENT.webkitCurrentFullScreenElement) return DOCUMENT.webkitCurrentFullScreenElement.id == _container.id;  
    4112                         else return false; 
     4652                        var fsElements = [DOCUMENT.mozFullScreenElement, DOCUMENT.webkitCurrentFullScreenElement]; 
     4653                        for (var i=0; i<fsElements.length; i++) { 
     4654                                if (fsElements[i] && fsElements[i].id == _api.id) 
     4655                                        return true; 
     4656                        } 
     4657                        return false; 
    41134658                } 
    41144659                 
     
    41384683                        switch(evt.newstate) { 
    41394684                        case _states.PLAYING: 
    4140                                 if (_utils.isIPod) { 
     4685                                if (_utils.isIPod()) { 
    41414686                                        vidstyle.display = "block"; 
    41424687                                } 
    41434688                                vidstyle.opacity = 1; 
    4144                                 _css('#'+_container.id+' .'+VIEW_VIDEO_CONTAINER_CLASS, vidstyle); 
     4689                                _css(_internalSelector(VIEW_VIDEO_CONTAINER_CLASS), vidstyle); 
    41454690                                _hideControls(); 
    41464691                                break; 
    41474692                        case _states.COMPLETED: 
    41484693                        case _states.IDLE: 
    4149                                 if (_utils.isIPod) { 
     4694                                if (_utils.isIPod()) { 
    41504695                                        vidstyle.display = "none"; 
    41514696                                } 
    41524697                                vidstyle.opacity = 0; 
    4153                                 _css('#'+_container.id+' .'+VIEW_VIDEO_CONTAINER_CLASS, vidstyle); 
     4698                                _css(_internalSelector(VIEW_VIDEO_CONTAINER_CLASS), vidstyle); 
    41544699                                _showControls(); 
    41554700                                break; 
     
    41624707                        } 
    41634708                } 
     4709                 
     4710                function _internalSelector(className) { 
     4711                        return '#' + _api.id + (className ? " ." + className : ""); 
     4712                } 
     4713                 
     4714                this.setupInstream = function(instreamDisplay, instreamVideo) { 
     4715                        _setVisibility(_internalSelector(VIEW_INSTREAM_CONTAINER_CLASS), true); 
     4716                        _setVisibility(_internalSelector(VIEW_CONTROLS_CONTAINER_CLASS), false); 
     4717                        _instreamLayer.appendChild(instreamDisplay); 
     4718                        _instreamVideo = instreamVideo; 
     4719                        _stateHandler({newstate:_states.PLAYING}); 
     4720                        _instreamMode = true; 
     4721                } 
     4722                 
     4723                var _destroyInstream = this.destroyInstream = function() { 
     4724                        _setVisibility(_internalSelector(VIEW_INSTREAM_CONTAINER_CLASS), false); 
     4725                        _setVisibility(_internalSelector(VIEW_CONTROLS_CONTAINER_CLASS), true); 
     4726                        _instreamLayer.innerHTML = ""; 
     4727                        _instreamVideo = null; 
     4728                        _instreamMode = false; 
     4729                        _resize(_model.width, _model.height); 
     4730                } 
     4731                 
     4732                function _setVisibility(selector, state) { 
     4733                        _css(selector, { display: state ? "block" : "none" }); 
     4734                } 
     4735 
     4736                 
    41644737        } 
    41654738 
     
    41694742         *************************************************************/ 
    41704743 
    4171         var JW_CSS_SMOOTH_EASE = "opacity .5s ease"; 
     4744        var JW_CSS_SMOOTH_EASE = "opacity .5s ease", 
     4745                JW_CSS_100PCT = "100%", 
     4746                //JW_CSS_RELATIVE = "relative", 
     4747                JW_CSS_ABSOLUTE = "absolute", 
     4748                JW_CSS_IMPORTANT = " !important"; 
    41724749 
    41734750         
    41744751        // Container styles 
    4175         _css('.' + VIEW_CONTAINER_CLASS, { 
    4176                 position : "relative", 
     4752        _css('.' + PLAYER_CLASS, { 
     4753                position: "relative", 
    41774754                overflow: "hidden", 
    41784755                opacity: 0, 
     
    41824759        }); 
    41834760 
    4184         _css('.' + VIEW_VIDEO_CONTAINER_CLASS + ' ,.'+ VIEW_CONTROLS_CONTAINER_CLASS, { 
    4185                 position : "absolute", 
     4761        _css('.' + VIEW_MAIN_CONTAINER_CLASS, { 
     4762                position : JW_CSS_ABSOLUTE, 
    41864763                left: 0, 
    41874764                right: 0, 
    4188                 height : "100%", 
     4765                top: 0, 
     4766                bottom: 0, 
    41894767        '-webkit-transition': JW_CSS_SMOOTH_EASE, 
    41904768        '-moz-transition': JW_CSS_SMOOTH_EASE, 
     
    41924770        }); 
    41934771 
     4772        _css('.' + VIEW_VIDEO_CONTAINER_CLASS + ' ,.'+ VIEW_CONTROLS_CONTAINER_CLASS, { 
     4773                position : JW_CSS_ABSOLUTE, 
     4774                height : JW_CSS_100PCT, 
     4775                width: JW_CSS_100PCT, 
     4776        '-webkit-transition': JW_CSS_SMOOTH_EASE, 
     4777        '-moz-transition': JW_CSS_SMOOTH_EASE, 
     4778        '-o-transition': JW_CSS_SMOOTH_EASE 
     4779        }); 
     4780 
    41944781        _css('.' + VIEW_VIDEO_CONTAINER_CLASS + " video", { 
    41954782                background : "transparent", 
    4196                 width : "100%", 
    4197                 height : "100%" 
     4783                width : JW_CSS_100PCT, 
     4784                height : JW_CSS_100PCT 
    41984785        }); 
    41994786 
    42004787        _css('.' + VIEW_PLAYLIST_CONTAINER_CLASS, { 
    4201                 position: "absolute", 
    4202                 height : "100%" 
     4788                position: JW_CSS_ABSOLUTE, 
     4789                height : JW_CSS_100PCT, 
     4790                width: JW_CSS_100PCT, 
     4791                display: "none" 
    42034792        }); 
    4204  
    4205          
     4793         
     4794        _css('.' + VIEW_INSTREAM_CONTAINER_CLASS, { 
     4795                overflow: "hidden", 
     4796                position: JW_CSS_ABSOLUTE, 
     4797                top: 0, 
     4798                left: 0, 
     4799                bottom: 0, 
     4800                right: 0, 
     4801                display: 'none' 
     4802        }); 
     4803 
     4804         
     4805 
    42064806        // Fullscreen styles 
    42074807         
    4208         _css('.' + VIEW_CONTAINER_CLASS+':-webkit-full-screen', { 
    4209                 width: "100% !important", 
    4210                 height: "100% !important" 
    4211         }); 
    4212          
    4213         _css('.' + VIEW_CONTAINER_CLASS+':-moz-full-screen', { 
    4214                 width: "100% !important", 
    4215                 height: "100% !important" 
    4216         }); 
    4217          
    4218         _css('.' + VIEW_CONTAINER_CLASS+'.jwfullscreen', { 
    4219                 left: 0, 
     4808        _css(FULLSCREEN_SELECTOR, { 
     4809                width: JW_CSS_100PCT, 
     4810                height: JW_CSS_100PCT, 
     4811                'z-index': 1000, 
     4812                position: "fixed" 
     4813        }, true); 
     4814 
     4815        _css(FULLSCREEN_SELECTOR + ' .'+ VIEW_MAIN_CONTAINER_CLASS, { 
     4816                left: 0,  
    42204817                right: 0, 
    42214818                top: 0, 
    4222                 bottom: 0, 
    4223                 'z-index': 1000, 
    4224                 position: "fixed !important" 
     4819                bottom: 0 
     4820        }, true); 
     4821 
     4822        _css(FULLSCREEN_SELECTOR + ' .'+ VIEW_PLAYLIST_CONTAINER_CLASS, { 
     4823                display: "none" 
     4824        }, true); 
     4825         
     4826        _css('.' + PLAYER_CLASS+' .jwuniform', { 
     4827                'background-size': 'contain' + JW_CSS_IMPORTANT 
    42254828        }); 
    42264829 
    4227         _css('.' + VIEW_CONTAINER_CLASS+' .jwuniform', { 
    4228                 'background-size': 'contain !important' 
     4830        _css('.' + PLAYER_CLASS+' .jwfill', { 
     4831                'background-size': 'cover' + JW_CSS_IMPORTANT 
    42294832        }); 
    42304833 
    4231         _css('.' + VIEW_CONTAINER_CLASS+' .jwfill', { 
    4232                 'background-size': 'cover !important' 
     4834        _css('.' + PLAYER_CLASS+' .jwexactfit', { 
     4835                'background-size': JW_CSS_100PCT + JW_CSS_IMPORTANT 
    42334836        }); 
    42344837 
    4235         _css('.' + VIEW_CONTAINER_CLASS+' .jwexactfit', { 
    4236                 'background-size': '100% 100% !important' 
    4237         }); 
    4238  
    4239         _css('.' + VIEW_CONTAINER_CLASS+' .jwnone', { 
     4838        _css('.' + PLAYER_CLASS+' .jwnone', { 
    42404839                'background-size': null 
    42414840        }); 
  • branches/jw6/jwplayer.min.js

    r2181 r2184  
    1 if(typeof jwplayer=="undefined"){jwplayer=function(a){if(jwplayer.api){return jwplayer.api.selectPlayer(a)}};var $jw=jwplayer;jwplayer.version="6.0";jwplayer.vid=document.createElement("video");jwplayer.audio=document.createElement("audio");jwplayer.source=document.createElement("source");(function(h){var d=document;var p=window;var o=h.utils=function(){};o.exists=function(t){switch(typeof(t)){case"string":return(t.length>0);break;case"object":return(t!==null);case"undefined":return false}return true};var b={},r,a={};function q(){var t=d.createElement("style");t.type="text/css";d.getElementsByTagName("head")[0].appendChild(t);return t}o.css=function(t,v){if(o.isIE()){if(!r){r=q()}}else{if(!b[t]){b[t]=q()}}if(!a[t]){a[t]={}}for(var u in v){var w=g(u,v[u]);if(o.exists(a[t][u])&&!o.exists(w)){delete a[t][u]}else{a[t][u]=w}}if(o.isIE()){i()}else{e(t,b[t])}};function g(t,u){if(typeof u==="undefined"){return undefined}if(typeof u=="number"){if(isNaN(u)){return undefined}switch(t){case"z-index":case"opacity":return u;break;default:if(t.match(/color/i)){return"#"+o.strings.pad(u.toString(16),6)}else{return Math.ceil(u)+"px"}break}}else{return u}}function i(){var t="\n";for(var u in a){t+=s(u)}r.innerHTML=t}function e(t,u){if(u){u.innerHTML=s(t)}}function s(t){var u=t+"{\n";var w=a[t];for(var v in w){u+="  "+v+": "+w[v]+";\n"}u+="}\n";return u}o.clearCss=function(u){for(var v in a){if(v.indexOf(u)>=0){delete a[v]}}for(var t in b){if(t.indexOf(u)>=0){b[t].innerHTML=""}}};o.getAbsolutePath=function(z,y){if(!o.exists(y)){y=d.location.href}if(!o.exists(z)){return undefined}if(j(z)){return z}var A=y.substring(0,y.indexOf("://")+3);var x=y.substring(A.length,y.indexOf("/",A.length+1));var u;if(z.indexOf("/")===0){u=z.split("/")}else{var v=y.split("?")[0];v=v.substring(A.length+x.length+1,v.lastIndexOf("/"));u=v.split("/").concat(z.split("/"))}var t=[];for(var w=0;w<u.length;w++){if(!u[w]||!o.exists(u[w])||u[w]=="."){continue}else{if(u[w]==".."){t.pop()}else{t.push(u[w])}}}return A+x+"/"+t.join("/")};function j(u){if(!o.exists(u)){return}var v=u.indexOf("://");var t=u.indexOf("?");return(v>0&&(t<0||(t>v)))}o.extend=function(){var t=o.extend["arguments"];if(t.length>1){for(var v=1;v<t.length;v++){for(var u in t[v]){t[0][u]=t[v][u]}}return t[0]}return null};o.parseDimension=function(t){if(typeof t=="string"){if(t===""){return 0}else{if(t.lastIndexOf("%")>-1){return t}else{return parseInt(t.replace("px",""),10)}}}return t};o.timeFormat=function(t){if(t>0){str=Math.floor(t/60)<10?"0"+Math.floor(t/60)+":":Math.floor(t/60)+":";str+=Math.floor(t%60)<10?"0"+Math.floor(t%60):Math.floor(t%60);return str}else{return"00:00"}};o.log=function(u,t){if(typeof console!="undefined"&&typeof console.log!="undefined"){if(t){console.log(u,t)}else{console.log(u)}}};o.getBoundingClientRect=function(t){if(typeof t.getBoundingClientRect=="function"){return t.getBoundingClientRect()}else{return{left:t.offsetLeft+d.body.scrollLeft,top:t.offsetTop+d.body.scrollTop,width:t.offsetWidth,height:t.offsetHeight}}};var k=o.userAgentMatch=function(u){var t=navigator.userAgent.toLowerCase();return(t.match(u)!==null)};o.isIE=function(){return k(/msie/i)};o.isMobile=function(){return k(/(iP(hone|ad|od))|android/i)};h.utils.isIOS=function(){return k(/iP(hone|ad|od)/i)};o.isIPod=function(){return k(/iP(hone|od)/i)};o.saveCookie=function(t,u){d.cookie="jwplayer."+t+"="+u+"; path=/"};o.getCookies=function(){var w={};var v=d.cookie.split("; ");for(var u=0;u<v.length;u++){var t=v[u].split("=");if(t[0].indexOf("jwplayer.")==0){w[t[0].substring(9,t[0].length)]=t[1]}}return w};o.ajax=function(x,w,t){var v;if(m(x)&&o.exists(p.XDomainRequest)){v=new XDomainRequest();v.onload=n(v,x,w,t);v.onerror=f(t,x,v)}else{if(o.exists(p.XMLHttpRequest)){v=new XMLHttpRequest();v.onreadystatechange=c(v,x,w,t);v.onerror=f(t,x)}else{if(t){t()}}}try{v.open("GET",x,true);v.send(null)}catch(u){if(t){t(x)}}return v};function m(t){if(t&&t.indexOf("://")>=0){if(t.split("/")[2]!=window.location.href.split("/")[2]){return true}}return false}function f(t,v,u){return function(){t(v)}}function c(u,w,v,t){return function(){if(u.readyState===4){if(u.status==200){n(u,w,v,t)()}else{if(t){t(w)}}}}}function n(u,w,v,t){return function(){if(!o.exists(u.responseXML)){try{var x;if(p.DOMParser){x=(new DOMParser()).parseFromString(u.responseText,"text/xml")}else{x=new ActiveXObject("Microsoft.XMLDOM");x.async="false";x.loadXML(u.responseText)}if(x){u=h.utils.extend({},u,{responseXML:x})}}catch(y){if(t){t(w)}return}}v(u)}}o.typeOf=function(u){var t=typeof u;if(t==="object"){if(!u){return"null"}return(u instanceof Array)?"array":t}else{return t}};o.stretch=function(B,H,G,z,F,A,v){var u=(o.exists(G)&&o.exists(F))?G/F:0,w=(o.exists(z)&&o.exists(A))?z/A:0,E=0,D=0,t={},C;switch(B.toLowerCase()){case l.NONE:case l.FILL:case l.EXACTFIT:C="jw"+B.toLowerCase();break;case l.UNIFORM:C="jw"+B.toLowerCase();if(u>w){if((F*w)/G>0.95){C="jwexactfit"}}else{if((A*u)/z>0.95){C="jwexactfit"}}break;default:break}H.className=H.className.replace(/jw(none|exactfit|uniform|fill)/g,"");H.className+=" "+C};var l=o.stretching={NONE:"none",FILL:"fill",UNIFORM:"uniform",EXACTFIT:"exactfit"}})(jwplayer);(function(b){var a=b.strings=function(){};a.trim=function(c){return c.replace(/^\s*/,"").replace(/\s*$/,"")};a.pad=function(d,e,c){if(!c){c="0"}while(d.length<e){d=c+d}return d};a.serialize=function(c){if(c==null){return null}else{if(c=="true"){return true}else{if(c=="false"){return false}else{if(isNaN(Number(c))||c.length>5||c.length==0){return c}else{return Number(c)}}}}};a.seconds=function(e){e=e.replace(",",".");var c=e.split(":");var d=0;if(e.substr(-1)=="s"){d=Number(e.substr(0,e.length-1))}else{if(e.substr(-1)=="m"){d=Number(e.substr(0,e.length-1))*60}else{if(e.substr(-1)=="h"){d=Number(e.substr(0,e.length-1))*3600}else{if(c.length>1){d=Number(c[c.length-1]);d+=Number(c[c.length-2])*60;if(c.length==3){d+=Number(c[c.length-3])*3600}}else{d=Number(e)}}}}return d};a.xmlAttribute=function(c,d){for(var e=0;e<c.attributes.length;e++){if(c.attributes[e].name&&c.attributes[e].name.toLowerCase()==d.toLowerCase()){return c.attributes[e].value.toString()}}return""};a.jsonToString=function(g){var i=i||{};if(i&&i.stringify){return i.stringify(g)}var d=typeof(g);if(d!="object"||g===null){if(d=="string"){g='"'+g.replace(/"/g,'\\"')+'"'}else{return String(g)}}else{var h=[],c=(g&&g.constructor==Array);for(var e in g){var f=g[e];switch(typeof(f)){case"string":f='"'+f.replace(/"/g,'\\"')+'"';break;case"object":if(b.exists(f)){f=a.jsonToString(f)}break}if(c){if(typeof(f)!="function"){h.push(String(f))}}else{if(typeof(f)!="function"){h.push('"'+e+'":'+String(f))}}}if(c){return"["+String(h)+"]"}else{return"{"+String(h)+"}"}}};a.extension=function(c){if(!c){return""}c=c.substring(c.lastIndexOf("/")+1,c.length).split("?")[0];if(c.lastIndexOf(".")>-1){return c.substr(c.lastIndexOf(".")+1,c.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){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.strings.serialize(a.textContent(g));if(e=="file"&&j.levels){delete j.levels}}if(!j.file){j.file=j.link}}return j}})(jwplayer);(function(d){var h=jwplayer.utils.strings,g=h.xmlAttribute,b=d.localName,a=d.textContent,c=d.numChildren;var f=d.mediaparser=function(){};var e="media";f.parseGroup=function(m,n){for(var k=0;k<c(m);k++){var l=m.childNodes[k];if(l.prefix==e){if(!b(l)){continue}switch(b(l).toLowerCase()){case"content":n.file=g(l,"url");if(g(l,"duration")){n.duration=h.seconds(g(l,"duration"))}if(g(l,"start")){n.start=h.seconds(g(l,"start"))}if(c(l)>0){n=f.parseGroup(l,n)}if(g(l,"width")||g(l,"bitrate")||g(l,"url")){if(!n.levels){n.levels=[]}n.levels.push({width:g(l,"width"),bitrate:g(l,"bitrate"),file:g(l,"url")})}break;case"title":n.title=a(l);break;case"description":n.description=a(l);break;case"keywords":n.tags=a(l);break;case"thumbnail":n.image=g(l,"url");break;case"credit":n.author=a(l);break;case"player":var j=l.url;break;case"group":f.parseGroup(l,n);break}}}return n}})(jwplayer.html5.parsers);(function(f){var g=jwplayer.utils,a=f.textContent,d=f.getChildNode,e=f.numChildren,c=f.localName;f.rssparser={};f.rssparser.parse=function(o){var h=[];for(var m=0;m<e(o);m++){var n=d(o,m),k=c(n).toLowerCase();if(k=="channel"){for(var l=0;l<e(n);l++){var p=d(n,l);if(c(p).toLowerCase()=="item"){h.push(b(p))}}}}return h};function b(l){var m={};for(var j=0;j<l.childNodes.length;j++){var k=l.childNodes[j];var h=c(k);if(!h){continue}switch(h.toLowerCase()){case"enclosure":m.file=g.strings.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=f.mediaparser.parseGroup(l,m);m=f.jwparser.parseEntry(l,m);return new jwplayer.html5.playlistitem(m)}})(jwplayer.html5.parsers);(function(l){var u=l.html5,h=l.utils,i=l.events,p=l.events.state,o=h.css,b="button",n="text",e="divider",q="slider",f="relative",g="absolute",a="none",m="block",s="inline",k="inline-block",c="left",v="right",j="100%",r="width .25s linear, left .25s linear, opacity .25s, background .25s",t=".jwcontrolbar",d=document;u.controlbar=function(C,ao){var A,S,B={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:n}]},center:{position:"center",elements:[{name:"time",type:q}]},right:{position:"right",elements:[{name:"duration",type:n},{name:"blank",type:b},{name:"divider",type:e},{name:"mute",type:b},{name:"volume",type:q},{name:"divider",type:e},{name:"fullscreen",type:b}]}}},R,ay,aj,aw,am,aG,L,ag=false,ap=0,W={play:"pause",mute:"unmute",fullscreen:"normalscreen"},ax={play:false,mute:false,fullscreen:false},z={play:ab,mute:M,fullscreen:Y,next:y,prev:ae},D={time:V,volume:aB};function aA(){aj={};A=C;am=A.id+"_controlbar";aG=0;aw=N();aw.id=am;aw.className="jwcontrolbar";window.addEventListener("mousemove",aF,false);window.addEventListener("mouseup",aF,false);S=A.skin;R=h.extend({},B,ao);ay=S.getComponentLayout("controlbar");if(!ay){ay=B.layout}U();ar();w()}function w(){A.jwAddEventListener(l.events.JWPLAYER_MEDIA_TIME,aH);A.jwAddEventListener(l.events.JWPLAYER_PLAYER_STATE,G);A.jwAddEventListener(l.events.JWPLAYER_MEDIA_MUTE,aC);A.jwAddEventListener(l.events.JWPLAYER_MEDIA_VOLUME,E);A.jwAddEventListener(l.events.JWPLAYER_MEDIA_BUFFER,J);A.jwAddEventListener(l.events.JWPLAYER_FULLSCREEN,F)}function aH(aI){aG=aI.duration;if(aj.elapsed){aj.elapsed.innerHTML=h.timeFormat(aI.position)}if(aj.duration){aj.duration.innerHTML=h.timeFormat(aI.duration)}if(aI.duration>0){av(aI.position/aI.duration)}else{av(0)}}function G(aI){switch(aI.newstate){case p.BUFFERING:case p.PLAYING:o(aq(".jwtimeSliderThumb"),{opacity:1});Q("play",true);break;case p.PAUSED:if(!ag){Q("play",false)}break;case p.IDLE:Q("play",false);o(aq(".jwtimeSliderThumb"),{opacity:0});if(aj.timeRail){aj.timeRail.className="jwrail";setTimeout(function(){aj.timeRail.className+=" jwsmooth"},100)}az(0);aH({position:0,duration:0});break;case p.COMPLETED:o(aq(),{opacity:0});break}}function aC(aI){Q("mute",aI.mute);x(aI.mute?0:L)}function E(aI){L=aI.volume/100;x(L)}function J(aI){az(aI.bufferPercent/100)}function F(aI){Q("fullscreen",aI.fullscreen)}function U(){h.clearCss("#"+am);o("#"+am,{height:aa("background").height,bottom:R.margin?R.margin:0,left:R.margin?R.margin:0,right:R.margin?R.margin:0});o(aq(".jwtext"),{font:R.fontsize+"px/"+aa("background").height+"px "+R.font,color:R.fontcolor,"font-weight":R.fontweight,"font-style":R.fontstyle,"text-align":"center",padding:"0 5px"})}function aq(aI){return"#"+am+" "+aI}function N(){return d.createElement("span")}function ar(){var aK=ak("capLeft");var aJ=ak("capRight");var aI=ak("background",{position:g,left:aa("capLeft").width,right:aa("capRight").width,"background-repeat":"repeat-x"},true);if(aI){aw.appendChild(aI)}if(aK){aw.appendChild(aK)}at();if(aJ){aw.appendChild(aJ)}}function O(aI){switch(aI.type){case e:return ad(aI);break;case n:return al(aI.name);break;case b:if(aI.name!="blank"){return ac(aI.name)}break;case q:return P(aI.name);break}}function ak(aK,aN,aJ,aP){var aM=N();aM.className="jw"+aK;var aI=aP?" left center":" center";var aL=aa(aK);aM.innerHTML="&nbsp;";if(!aL||aL.src==""){return}var aO;if(aJ){aO={background:"url('"+aL.src+"') repeat-x "+aI}}else{aO={background:"url('"+aL.src+"') no-repeat"+aI,width:aL.width}}o(aq(".jw"+aK),h.extend(aO,aN));aj[aK]=aM;return aM}function ac(aK){if(!aa(aK+"Button").src){return null}var aL=d.createElement("button");aL.className="jw"+aK;aL.addEventListener("click",ah(aK),false);var aM=aa(aK+"Button");var aJ=aa(aK+"ButtonOver");aL.innerHTML="&nbsp;";T(aq(".jw"+aK),aM,aJ);var aI=W[aK];if(aI){T(aq(".jw"+aK+".jwtoggle"),aa(aI+"Button"),aa(aI+"ButtonOver"))}aj[aK]=aL;return aL}function T(aI,aJ,aK){if(!aJ.src){return}o(aI,{width:aJ.width,background:"url("+aJ.src+") center no-repeat"});if(aK.src){o(aI+":hover",{background:"url("+aK.src+") center no-repeat"})}}function ah(aI){return function(){if(z[aI]){z[aI]()}}}function ab(){if(ax.play){A.jwPause()}else{A.jwPlay()}}function M(){A.jwSetMute();aC({mute:ax.mute})}function aB(aI){if(aI<0.1){aI=0}if(aI>0.9){aI=1}A.jwSetVolume(aI*100);x(aI)}function V(aI){A.jwSeek(aI*aG)}function Y(){A.jwSetFullscreen()}function y(){A.jwPlaylistNext()}function ae(){A.jwPlaylistNext()}function Q(aI,aJ){if(!h.exists(aJ)){aJ=!ax[aI]}if(aj[aI]){aj[aI].className="jw"+aI+(aJ?" jwtoggle jwtoggling":" jwtoggling");setTimeout(function(){aj[aI].className=aj[aI].className.replace(" jwtoggling","")},100)}ax[aI]=aJ}function K(aI){return am+"_"+aI}function al(aI,aM){var aK=N();aK.id=K(aI);aK.className="jwtext jw"+aI;var aJ={};var aL=aa(aI+"Background");if(aL.src){aJ.background="url("+aL.src+") no-repeat center";aJ["background-size"]="100% "+aa("background").height+"px"}o(aq(".jw"+aI),aJ);aK.innerHTML="00:00";aj[aI]=aK;return aK}function ad(aJ){if(aJ.width){var aI=N();aI.className="jwblankDivider";o(aI,{width:parseInt(aJ.width)});return aI}else{if(aJ.element){return ak(aJ.element)}else{return ak(aJ.name)}}}function P(aI){var aL=N();aL.className="jwslider jw"+aI;var aK=ak(aI+"SliderCapLeft");var aJ=ak(aI+"SliderCapRight");if(aJ){aJ.className+=" jwcapRight"}var aM=an(aI);if(aK){aL.appendChild(aK)}aL.appendChild(aM);if(aK){aL.appendChild(aJ)}o(aq(".jw"+aI+" .jwrail"),{left:aa(aI+"SliderCapLeft").width,right:aa(aI+"SliderCapRight").width,});aj[aI]=aL;if(aI=="time"){aE(aL);av(0);az(0)}else{if(aI=="volume"){au(aL)}}return aL}function an(aK){var aN=N();aN.className="jwrail jwsmooth";var aI=["Rail","Buffer","Progress"];for(var aM=0;aM<aI.length;aM++){var aL=ak(aK+"Slider"+aI[aM],null,true,(aK=="volume"));if(aL){aL.className+=" jwstretch";aN.appendChild(aL)}}var aJ=ak(aK+"SliderThumb");if(aJ){o(aq("."+aJ.className),{opacity:0});aJ.className+=" jwthumb";aN.appendChild(aJ)}aN.addEventListener("mousedown",H(aK),false);aj[aK+"Rail"]=aN;return aN}function I(){var aI=A.jwGetState();return(aI==p.IDLE||aI==p.COMPLETED)}function H(aI){return(function(aJ){if(aJ.button!=0){return}aj[aI+"Rail"].className="jwrail";if(aI=="time"){if(!I()){A.jwSeekDrag(true);ag=aI}}else{ag=aI}})}function aF(aI){if(!ag||aI.button!=0){return}var aM=aj[ag].getElementsByClassName("jwrail")[0],aN=h.getBoundingClientRect(aM),aL=(aI.clientX-aN.left)/aN.width;if(aI.type=="mouseup"){var aJ=ag;if(aJ=="time"){A.jwSeekDrag(false)}aj[aJ+"Rail"].className="jwrail jwsmooth";ag=null;D[aJ](aL)}else{if(ag=="time"){av(aL)}else{x(aL)}var aK=(new Date()).getTime();if(aK-ap>500){ap=aK;D[ag](aL)}}}function aE(aI){if(aj.timeSliderThumb){o(aq(".jwtimeSliderThumb"),{"margin-left":(aa("timeSliderThumb").width/-2)})}az(0);av(0)}function au(aK){var aJ=aa("volumeSliderCapLeft").width,aI=aa("volumeSliderCapRight").width,aL=aa("volumeSliderRail").width;o(aq(".jwvolume"),{width:(aJ+aL+aI)})}var X={};function at(){aD("left");aD("center");aD("right");aw.appendChild(X.left);aw.appendChild(X.center);aw.appendChild(X.right);o(aq(".jwright"),{right:aa("capRight").width})}function aD(aJ){var aI=N();aI.className="jwgroup jw"+aJ;X[aJ]=aI;if(ay[aJ]){Z(ay[aJ],X[aJ])}}function Z(aL,aI){if(aL&&aL.elements.length>0){for(var aK=0;aK<aL.elements.length;aK++){var aJ=O(aL.elements[aK]);if(aJ){aI.appendChild(aJ)}}}}var af=this.resize=function(aJ,aI){o(aq(".jwgroup.jwcenter"),{left:Math.round(h.parseDimension(X.left.offsetWidth)+aa("capLeft").width),right:Math.round(h.parseDimension(X.right.offsetWidth)+aa("capRight").width)})};this.getDisplayElement=function(){return aw};function az(aI){aI=Math.min(Math.max(0,aI),1);o(aq(".jwtimeSliderBuffer"),{width:aI*100+"%"})}function ai(aK,aJ,aL){var aI=100*Math.min(Math.max(0,aJ),1)+"%";o(aq(aK+"Progress"),{width:aI});o(aq(aK+"Thumb"),{left:aI})}function x(aI){ai(".jwvolumeSlider",aI,true)}function av(aI){ai(".jwtimeSlider",aI)}function aa(aI){var aJ=S.getSkinElement("controlbar",aI);if(aJ){return aJ}else{return{width:0,height:0,src:"",image:undefined,ready:false}}}this.show=function(){o(aq(),{opacity:1})};this.hide=function(){o(aq(),{opacity:0})};aA()};o(t,{position:g,overflow:"hidden","-webkit-transition":r,"-moz-transition":r,"-o-transition":r});o(t+" span",{height:j,"-webkit-user-select":a,"-webkit-user-drag":a,"user-select":a,"user-drag":a});o(t+" .jwgroup",{display:s});o(t+" span, "+t+" .jwgroup button,"+t+" .jwleft",{position:f,"float":c});o(t+" .jwright",{position:g});o(t+" .jwcenter",{position:g});o(t+" button",{display:k,height:j,border:a,cursor:"pointer","-webkit-transition":r,"-moz-transition":r,"-o-transition":r});o(t+" .jwcapRight",{right:0,position:g});o(t+" .jwtime,"+t+" .jwgroup span.jwstretch",{position:g,height:j,width:j,left:0});o(t+" .jwrail,"+t+" .jwthumb",{position:g,height:j,cursor:"pointer"});o(t+" .jwtime .jwsmooth span",{"-webkit-transition":r,"-moz-transition":r,"-o-transition":r});o(t+" .jwdivider+.jwdivider",{display:a});o(t+" .jwtext",{padding:"0 5px","text-align":"center"});o(t+" .jwtoggling",{"-webkit-transition":a,"-moz-transition":a,"-o-transition":a})})(jwplayer);(function(a){var e=jwplayer,c=e.utils,d=e.events,b=d.state;a.controller=function(g,r){var w=g,f=r,l=g.getVideo(),j=new d.eventdispatcher(w.id,w.config.debug);c.extend(this,j);function m(){w.addGlobalListener(z);w.addEventListener(d.JWPLAYER_MEDIA_BUFFER_FULL,t)}function z(B){j.sendEvent(B.type,B)}function t(B){l.play()}function A(B){k();switch(c.typeOf(B)){case"string":w.setPlaylist(new a.playlist({file:B}));w.setItem(0);break;case"object":case"array":w.setPlaylist(new a.playlist(B));w.setItem(0);break;case"number":w.setItem(B);break}}function q(){if(w.state==b.IDLE){l.load(w.playlist[w.item])}else{if(w.state==b.PAUSED){l.play()}}}function k(){l.stop()}function y(){if(w.state==b.PLAYING||w.state==b.BUFFERING){l.pause()}}function u(B){l.seek(B)}function x(B){l.volume(B)}function n(B){if(!c.exists(B)){B=!w.mute}l.mute(B)}function s(B){f.fullscreen(B)}function p(B){w.stretching=B;f.resize()}function o(B){A(w.item);q()}function h(){o(w.item-1)}function i(){o(w.item+1)}function v(B){return function(){B.apply(this,arguments)}}this.play=v(q);this.pause=v(y);this.seek=v(u);this.stop=v(k);this.load=v(A);this.next=v(i);this.prev=v(h);this.item=v(o);this.setVolume=v(x);this.setMute=v(n);this.setFullscreen=v(s);this.setStretching=v(p);m()}})(jwplayer.html5);(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 m=jwplayer.utils,j=m.css,d=jwplayer.events,e=d.state,l=g.utils.animations.rotate,k=document,a=".jwdisplay",i=".jwpreview",b="absolute",c="none",h="100%",f="opacity .25s";g.display=function(D,P){var J=D,z=D.skin,s,n,q,w,K,O,C={},o,B,M,G,x=m.extend({backgroundcolor:"#000"},P);_bufferRotation=!m.exists(x.bufferrotation)?15:parseInt(x.bufferrotation,10),_bufferInterval=!m.exists(x.bufferinterval)?100:parseInt(x.bufferinterval,10);function A(){s=k.createElement("div");s.id=J.id+"_display";s.className="jwdisplay";n=k.createElement("div");n.className="jwpreview";s.appendChild(n);J.jwAddEventListener(d.JWPLAYER_PLAYER_STATE,y);J.jwAddEventListener(d.JWPLAYER_PLAYLIST_ITEM,I);s.addEventListener("click",L,false);p();y({newstate:e.IDLE})}function L(R){switch(J.jwGetState()){case e.PLAYING:case e.BUFFERING:J.jwPause();break;default:J.jwPlay();break}}function p(){var R=["play","buffer"];for(var U=0;U<R.length;U++){var Y=R[U],W=E(Y+"Icon"),T=E(Y+"IconOver"),V=k.createElement("div"),S=E("background"),X=E("backgroundOver");button=k.createElement("button");if(W){button.className="jw"+Y;V.className="jwicon";button.appendChild(V);u("#"+s.id+" ."+button.className,S,X);u("#"+s.id+" ."+button.className+" div",W,T);if(X||T){button.addEventListener("mouseover",F(button),false);button.addEventListener("mouseout",H(button),false)}C[Y]=button}}}function F(R){return function(S){if(R.className.indexOf("jwhover")<0){R.className+=" jwhover"}if(R.childNodes[0].className.indexOf("jwhover")<0){R.childNodes[0].className+=" jwhover"}}}function H(R){return function(S){R.className=R.className.replace(" jwhover","");R.childNodes[0].className=R.childNodes[0].className.replace(" jwhover","")}}function u(R,S,T){if(!(S&&S.src)){return}j(R,{width:S.width,height:S.height,"margin-left":S.width/-2,"margin-top":S.height/-2,background:"url("+S.src+") center no-repeat"});if(T&&T.src){j(R+".jwhover",{background:"url("+T.src+") center no-repeat"})}}function Q(R){if(B){s.removeChild(B)}B=C[R];if(B){s.appendChild(B)}}function I(){var R=J.jwGetPlaylist()[J.jwGetPlaylistIndex()];var S=R?R.image:"";if(q!=S){q=S;N(i,false);t()}}function y(R){clearInterval(G);switch(R.newstate){case e.COMPLETED:case e.IDLE:Q("play");N(i,true);break;case e.BUFFERING:Q("buffer");M=0;G=setInterval(function(){M+=_bufferRotation;l(B.childNodes[0],M%360)},_bufferInterval);break;case e.PLAYING:Q();N(i,false);break;case e.PAUSED:Q("play");break}}this.getDisplayElement=function(){return s};function r(R){return"#"+s.id+" "+R}function t(){if(q){var R=new Image();R.addEventListener("load",function(){w=R.width;K=R.height;v();j(r(i),{"background-image":q?("url("+q+")"):"",});N(i,true)},false);R.src=q}else{N(i,false);w=K=0}}function E(R){var S=z.getSkinElement("display",R);if(S){return S}return null}function v(){m.stretch(J.jwGetStretching(),n,s.clientWidth,s.clientHeight,w,K)}this.resize=v;function N(R,S){j(r(R),{opacity:S?1:0})}this.show=function(){N("",true)};this.hide=function(){N("",false)};A()};j(a,{position:b,cursor:"pointer",width:h,height:h,overflow:"hidden"});j(a+" .jwpreview",{position:b,width:h,height:h,"background-repeat":"no-repeat","background-position":"center",overflow:"hidden"});j(a+", "+a+" *",{"-webkit-transition":f,"-moz-transition":f,"-o-transition":f});j(a+" button, "+a+" .jwicon",{border:c,position:b,left:"50%",top:"50%",padding:0,cursor:"pointer"})})(jwplayer.html5);(function(a){var b=jwplayer.utils,c=jwplayer.events;a.model=function(d){var j=this,f,l,m=b.getCookies(),h={width:480,height:320,item:0,playlist:[],skin:undefined,volume:90,mute:false,repeat:"",playlistsize:0,stretching:b.stretching.UNIFORM,autostart:false,debug:undefined};function i(n){return n}function k(){b.extend(j,new c.eventdispatcher());j.config=b.extend({},h,m,i(d));b.extend(j,{id:d.id,state:c.state.IDLE,position:0,buffer:0,},j.config);j.setItem(j.config.item);l=document.createElement("video");f=new a.video(l);f.addGlobalListener(e)}var g={};g[c.JWPLAYER_MEDIA_MUTE]="mute";g[c.JWPLAYER_MEDIA_VOLUME]="volume";g[c.JWPLAYER_PLAYER_STATE]="newstate->state";g[c.JWPLAYER_MEDIA_BUFFER]="bufferPercent->buffer";g[c.JWPLAYER_MEDIA_TIME]="position";function e(n){var p=g[n.type];if(p){var q=p.split("->"),r=q[0],o=q[1]?q[1]:r;if(j[o]!=n[r]){j[o]=n[r];j.sendEvent(n.type,n)}}else{j.sendEvent(n.type,n)}}this.getVideo=function(){return f};this.seekDrag=function(n){f.seekDrag(n)};this.setFullscreen=function(n){if(n!=j.fullscreen){j.fullscreen=n;j.sendEvent(c.JWPLAYER_FULLSCREEN,{fullscreen:n})}};this.setPlaylist=function(n){j.item=-1;j.playlist=n;j.sendEvent(c.JWPLAYER_PLAYLIST_LOADED,{playlist:n})};this.setItem=function(n){var o;if(n==j.playlist.length||n<-1){o=0}else{if(n==-1||n>j.playlist.length){o=j.playlist.length-1}else{o=n}}if(o!=j.item){j.item=o;j.sendEvent(c.JWPLAYER_PLAYLIST_ITEM,{index:j.item})}};k()}})(jwplayer.html5);(function(a){a.player=function(b){var j=this,h=new a.model(b),e=new a.view(this,h),f=new a.controller(h,e);function i(){j.id=h.id;var k=new a.setup(h,e,f);k.addEventListener(jwplayer.events.JWPLAYER_READY,c);k.addEventListener(jwplayer.events.JWPLAYER_ERROR,g);k.start()}function c(k){e.completeSetup();f.sendEvent(k.type,k);f.sendEvent(jwplayer.events.JWPLAYER_PLAYLIST_LOADED,{playlist:h.playlist});f.sendEvent(jwplayer.events.JWPLAYER_PLAYLIST_ITEM,{index:h.item});f.load();setTimeout(e.resize,0)}function g(k){console.log(k);alert("Can't set up: "+k.message)}this.jwPlay=f.play;this.jwPause=f.pause;this.jwStop=f.stop;this.jwSeek=f.seek;this.jwSetVolume=f.setVolume;this.jwSetMute=f.setMute;this.jwLoad=f.load;this.jwPlaylistNext=f.next;this.jwPlaylistPrev=f.prev;this.jwPlaylistItem=f.item;this.jwSetFullscreen=f.setFullscreen;this.jwResize=e.resize;this.jwSeekDrag=h.seekDrag;this.jwSetStretching=f.setStretching;function d(k){return function(){return h[k]}}this.jwGetPlaylistIndex=d("item");this.jwGetPosition=d("position");this.jwGetDuration=d("duration");this.jwGetBuffer=d("buffer");this.jwGetWidth=d("width");this.jwGetHeight=d("height");this.jwGetFullscreen=d("fullscreen");this.jwGetVolume=d("volume");this.jwGetMute=d("mute");this.jwGetState=d("state");this.jwGetStretching=d("stretching");this.jwGetPlaylist=d("playlist");this.jwAddEventListener=f.addEventListener;this.jwRemoveEventListener=f.removeEventListener;i()}})(jwplayer.html5);(function(a){var b=jwplayer.utils;a.playlist=function(c){var e=[];if(c&&c instanceof Array&&c.length>0){for(var d in c){if(!isNaN(parseInt(d))){e.push(new a.playlistitem(c[d]))}}}else{e.push(new a.playlistitem(c))}return e}})(jwplayer.html5);(function(e){var c={size:180,itemheight:60,thumbs:true,fontcolor:"#000000",overcolor:"",activecolor:"",backgroundcolor:"#f8f8f8",font:"_sans",fontsize:"",fontstyle:"",fontweight:""},i={_sans:"Arial, Helvetica, sans-serif",_serif:"Times, Times New Roman, serif",_typewriter:"Courier New, Courier, monospace"},k=jwplayer.utils,g=k.css,d=jwplayer.events,j=".jwplaylist",h=document,a="absolute",b="none",f="100%";e.playlistcomponent=function(y,I){var E=y,t=E.skin,m=k.extend({},c,E.skin.getComponentSettings("playlist"),I),F,s,J,l,o,n,r=-1,p={background:undefined,item:undefined,itemOver:undefined,itemImage:undefined,itemActive:undefined};this.getDisplayElement=function(){return F};this.resize=function(L,K){s=L;J=K};this.show=function(){_show(F)};this.hide=function(){_hide(F)};function q(){F=h.createElement("div");F.id=E.id+"_jwplayer_playlistcomponent";F.className="jwplaylist";H();if(p.item){m.itemheight=p.item.height}v();E.jwAddEventListener(jwplayer.events.JWPLAYER_PLAYLIST_LOADED,z);E.jwAddEventListener(jwplayer.events.JWPLAYER_PLAYLIST_ITEM,C)}function v(){var O=0,N=0,K=0,M=m.itemheight,Q=m.fontsize;k.clearCss("#"+F.id);g("#"+F.id+" .jwlist",{"background-color":m.backgroundcolor,"background-image":p.background?"url("+p.background.src+")":"",color:m.fontcolor,"font-family":i[m.font]?i[m.font]:i._sans,"font-size":(Q?Q:11)+"px","font-style":m.fontstyle,"font-weight":m.fontweight});if(p.itemImage){O=(M-p.itemImage.height)/2;N=p.itemImage.width;K=p.itemImage.height}else{N=M*4/3;K=M}g("#"+F.id+" .jwplaylistimg",{height:K,width:N,margin:O});g("#"+F.id+" .jwlist li",{"background-image":p.item?"url("+p.item.src+")":"",height:M,"background-size":f+" "+M+"px"});var L={overflow:"hidden"};if(m.activecolor!==""){L.color=m.activecolor}if(p.itemActive){L["background-image"]="url("+p.itemActive.src+")"}g("#"+F.id+" .jwlist li.active",L);var P={overflow:"hidden"};if(m.overcolor!==""){P.color=m.overcolor}if(p.itemOver){P["background-image"]="url("+p.itemOver.src+")"}g("#"+F.id+" .jwlist li:hover",P);g("#"+F.id+" .jwtextwrapper",{padding:"5px 5px 0 "+(O?0:"5px"),height:M-5});g("#"+F.id+" .jwtitle",{height:Q?Q+10:20,"line-height":Q?Q+10:20,overflow:"hidden","font-size":Q?Q:13,"font-weight":m.fontweight?m.fontweight:"bold"});g("#"+F.id+" .jwdescription",{display:"block","line-height":Q?Q+4:16,overflow:"hidden",height:M,position:"relative"})}function w(){var K=h.createElement("ul");K.className="jwlist";K.id=F.id+"_ul"+Math.round(Math.random()*10000000);return K}function x(L){var N=l[L],K=h.createElement("li");K.className="jwitem";K.id=n.id+"_item_"+L;g(K,{height:m.itemheight,display:"block",cursor:"pointer",backgroundImage:p.item?"url("+p.item.src+")":"",backgroundSize:"100% "+m.itemheight+"px"});var M=h.createElement("div");M.className="jwplaylistimg jwfill";if(D()&&(N.image||N["playlist.image"]||p.itemImage)){var Q;if(N["playlist.image"]){Q=N["playlist.image"]}else{if(N.image){Q=N.image}else{if(p.itemImage){Q=p.itemImage.src}}}g("#"+K.id+" .jwplaylistimg",{"background-image":Q?"url("+Q+")":null});K.appendChild(M)}var R=h.createElement("div");R.className="jwtextwrapper";var P=h.createElement("span");P.className="jwtitle";P.innerHTML=N?N.title:"";R.appendChild(P);if(N.description){var O=h.createElement("span");O.className="jwdescription";O.innerHTML=N.description;R.appendChild(O)}K.appendChild(R);return K}function z(L){F.innerHTML="";l=A();if(!l){return}items=[];n=w();for(var M=0;M<l.length;M++){var K=x(M);K.onclick=G(M);n.appendChild(K);items.push(K)}r=E.jwGetPlaylistIndex();F.appendChild(n);if(k.isIOS()&&window.iScroll){n.style.height=m.itemheight*l.length+"px";var N=new iScroll(F.id)}}function A(){var L=E.jwGetPlaylist();var M=[];for(var K=0;K<L.length;K++){if(!L[K]["ova.hidden"]){M.push(L[K])}}return M}function G(K){return function(){E.jwPlaylistItem(K);E.jwPlay(true)}}function u(){n.scrollTop=E.jwGetPlaylistIndex()*m.itemheight}function D(){return m.thumbs.toString().toLowerCase()=="true"}function C(K){if(r>=0){h.getElementById(n.id+"_item_"+r).className="jwitem";r=K.index}h.getElementById(n.id+"_item_"+K.index).className="jwitem active";u()}function H(){for(var K in p){p[K]=B(K)}}function B(K){return t.getSkinElement("playlist",K)}q();return this};g(j,{overflow:"hidden",position:"absolute",width:f,height:f});g(j+" .jwplaylistimg",{position:"relative",width:f,"float":"left",margin:"0 5px 0 0",background:"black",overflow:"hidden"});g(j+" .jwlist",{width:f,height:f,"list-style":"none",margin:0,padding:0,"overflow-y":"auto"});g(j+" .jwlist li",{width:f});g(j+" .jwtextwrapper",{overflow:"hidden"})})(jwplayer.html5);(function(a){a.playlistitem=function(c){var d={description:"",image:"",link:"",mediaid:"",title:"",provider:"",file:"",duration:-1,start:0,currentLevel:-1,levels:[]};var b=jwplayer.utils.extend({},d,c);if(b.levels.length===0){b.levels[0]=new a.playlistitemlevel(b)}return b}})(jwplayer.html5);(function(a){a.html5.playlistitemlevel=function(b){var d={file:"",streamer:"",bitrate:0,width:0};for(var c in d){if(a.utils.exists(b[c])){d[c]=b[c]}}return d}})(jwplayer);(function(a){var d=jwplayer,b=d.utils,c=d.events;a.playlistloader=function(){var f=new c.eventdispatcher();b.extend(this,f);this.load=function(h){b.ajax(h,g,e)};function g(i){try{var k=i.responseXML.firstChild;if(a.parsers.localName(k)=="xml"){k=k.nextSibling}var h=a.parsers.rssparser.parse(k);f.sendEvent(c.JWPLAYER_PLAYLIST_LOADED,{playlist:new a.playlist(h)})}catch(j){e("Could not load the playlist.")}}function e(h){f.sendEvent(c.JWPLAYER_ERROR,{message:h?h:"Could not load playlist an unknown reason."})}}})(jwplayer.html5);(function(f){var h=jwplayer,k=h.utils,e=h.events,i=1,d=2,c=3,j=4,b=5,a=6,g=7;f.setup=function(q,F,G){var J=q,o=F,D=G,s={},A={},y,x=new e.eventdispatcher(),t=false,u=[];function r(){p(i,n);p(d,N,i);p(c,w,i);p(j,I,c);p(b,M,j+","+d);p(a,H,b+","+c);p(g,B,a)}function p(O,Q,P){u.push({name:O,method:Q,depends:P})}function E(){for(var Q=0;Q<u.length;Q++){var O=u[Q];if(L(O.depends)){u.splice(Q,1);try{O.method();E()}catch(P){v(P.message)}return}}if(u.length>0&&!t){setTimeout(E,500)}}function L(Q){if(!Q){return true}var P=Q.toString().split(",");for(var O=0;O<P.length;O++){if(!s[P[O]]){return false}}return true}function m(O){s[O]=true}function n(){m(i)}function N(){y=new f.skin();y.load(J.config.skin,z)}function z(O){m(d)}function w(){switch(k.typeOf(J.config.playlist)){case"string":var O=new f.playlistloader();O.addEventListener(e.JWPLAYER_PLAYLIST_LOADED,l);O.addEventListener(e.JWPLAYER_ERROR,C);O.load(J.config.playlist);break;case"array":J.playlist=new f.playlist(J.config.playlist);m(c)}}function l(O){J.setPlaylist(O.playlist);m(c)}function C(O){v(O.message)}function I(){var P=J.playlist[J.item].image;if(P){var O=new Image();O.addEventListener("load",K,false);O.addEventListener("error",K,false);O.src=P}else{m(j)}}function K(O){m(j)}function M(){o.setup(y);m(b)}function H(){m(a)}function B(){x.sendEvent(e.JWPLAYER_READY);m(g)}function v(O){t=true;x.sendEvent(e.JWPLAYER_ERROR,{message:O})}k.extend(this,x);this.start=E;r()}})(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,p,k){var o={};var d=p;var l=k;var f=true;var j;var n=g;var s=false;function m(){if(typeof n!="string"||n===""){e(a.defaultskin().xml)}else{b.ajax(b.getAbsolutePath(n),function(t){try{if(b.exists(t.responseXML)){e(t.responseXML);return}}catch(u){i()}e(a.defaultskin().xml)},function(t){e(a.defaultskin().xml)})}}function e(y){var E=y.getElementsByTagName("component");if(E.length===0){return}for(var H=0;H<E.length;H++){var C=E[H].getAttribute("name");var B={settings:{},elements:{},layout:{}};o[C]=B;var G=E[H].getElementsByTagName("elements")[0].getElementsByTagName("element");for(var F=0;F<G.length;F++){c(G[F],C)}var z=E[H].getElementsByTagName("settings")[0];if(z&&z.childNodes.length>0){var K=z.getElementsByTagName("setting");for(var P=0;P<K.length;P++){var Q=K[P].getAttribute("name");var I=K[P].getAttribute("value");var x=/color$/.test(Q)?"color":null;o[C].settings[Q]=b.typechecker(I,x)}}var L=E[H].getElementsByTagName("layout")[0];if(L&&L.childNodes.length>0){var M=L.getElementsByTagName("group");for(var w=0;w<M.length;w++){var A=M[w];o[C].layout[A.getAttribute("position")]={elements:[]};for(var O=0;O<A.attributes.length;O++){var D=A.attributes[O];o[C].layout[A.getAttribute("position")][D.name]=D.value}var N=A.getElementsByTagName("*");for(var v=0;v<N.length;v++){var t=N[v];o[C].layout[A.getAttribute("position")].elements.push({type:t.tagName});for(var u=0;u<t.attributes.length;u++){var J=t.attributes[u];o[C].layout[A.getAttribute("position")].elements[v][J.name]=J.value}if(!b.exists(o[C].layout[A.getAttribute("position")].elements[v].name)){o[C].layout[A.getAttribute("position")].elements[v].name=t.tagName}}}}f=false;r()}}function r(){clearInterval(j);if(!s){j=setInterval(function(){q()},100)}}function c(y,x){var w=new Image();var t=y.getAttribute("name");var v=y.getAttribute("src");var A;if(v.indexOf("data:image/png;base64,")===0){A=v}else{var u=b.getAbsolutePath(n);var z=u.substr(0,u.lastIndexOf("/"));A=[z,x,v].join("/")}o[x].elements[t]={height:0,width:0,src:"",ready:false,image:w};w.onload=function(B){h(w,t,x)};w.onerror=function(B){s=true;r();l()};w.src=A}function i(){for(var u in o){var w=o[u];for(var t in w.elements){var x=w.elements[t];var v=x.image;v.onload=null;v.onerror=null;delete x.image;delete w.elements[t]}delete o[u]}}function q(){for(var t in o){if(t!="properties"){for(var u in o[t].elements){if(!o[t].elements[u].ready){return}}}}if(f===false){clearInterval(j);d(o)}}function h(t,v,u){if(o[u]&&o[u].elements[v]){o[u].elements[v].height=t.height;o[u].elements[v].width=t.width;o[u].elements[v].src=t.src;o[u].elements[v].ready=true;r()}else{b.log("Loaded an image for a missing element: "+u+"."+v)}}m()}})(jwplayer.html5);(function(a){var e=jwplayer,c=e.utils,d=e.events,b=d.state;a.video=function(M){var G={abort:t,canplay:o,canplaythrough:t,durationchange:x,emptied:t,ended:t,error:k,loadeddata:t,loadedmetadata:o,loadstart:t,pause:L,play:L,playing:L,progress:t,ratechange:t,readystatechange:t,seeked:t,seeking:t,stalled:t,suspend:t,timeupdate:N,volumechange:i,waiting:q},s={mp4:"video/mp4",webm:"video/webm",m3u8:"audio/x-mpegurl"},y,v,j,R,m,J,Q,B,H,z,f=b.IDLE,C=0,l=-1,A=-1,E=new d.eventdispatcher();c.extend(this,E);function O(S){j=S;I();j.controls=true;j.controls=false}function I(){for(var S in G){j.addEventListener(S,G[S],false)}}function p(S,T){E.sendEvent(S,T)}function t(S){}function x(S){R=j.duration;N()}function N(S){if(f==b.PLAYING&&!z){m=j.currentTime;p(d.JWPLAYER_MEDIA_TIME,{position:m,duration:R});if(m>=R&&R>0){K()}}}function o(S){if(!Q){Q=true;n();if(H>0){w(H)}}}function n(){if(!B){B=true;p(d.JWPLAYER_MEDIA_BUFFER_FULL)}}function L(S){if(z){return}if(j.paused){r(b.PAUSED)}else{r(b.PLAYING)}}function q(S){r(b.BUFFERING)}function k(S){c.log("Error: %o",j.error);r(b.IDLE)}function g(S){var T=s[c.strings.extension(S)];return(!!T&&j.canPlayType(T))}function D(T){if(T.levels&&T.levels.length>0){for(var S=0;S<T.levels.length;S++){if(g(T.levels[S].file)){return T.levels[S].file}}}else{if(T.file&&g(T.file)){return T.file}}return null}this.load=function(S){y=S;Q=false;B=false;H=0;R=0;m=0;v=D(y);if(!v){c.log("Could not find a file to play.");return}r(b.BUFFERING);j.src=v;j.load();l=setInterval(h,100);if(c.isMobile()){j.controls=true}if(c.isIPod()){n()}};var u=this.stop=function(){j.removeAttribute("src");j.load();clearInterval(l);r(b.IDLE)};this.play=function(){j.play()};this.pause=function(){j.pause()};this.seekDrag=function(S){z=S;if(S){j.pause()}else{j.play()}};var w=this.seek=function(S){if(Q){H=0;if(!z){p(d.JWPLAYER_MEDIA_SEEK,{position:m,offset:S})}j.currentTime=S}else{H=S}};var P=this.volume=function(S){if(j.muted){j.muted=false}j.volume=S/100};function i(S){p(d.JWPLAYER_MEDIA_VOLUME,{volume:Math.round(j.volume*100)});p(d.JWPLAYER_MEDIA_MUTE,{mute:j.muted})}this.mute=function(S){if(!c.exists(S)){S=!j.mute}if(S){C=j.volume*100;P(0);j.muted=true}else{P(C)}};function r(S){if(S==b.PAUSED&&f==b.IDLE){return}if(z){return}if(f!=S){var T=f;f=S;p(d.JWPLAYER_PLAYER_STATE,{oldstate:T,newstate:S})}}function h(){var S=F();if(S!=A){A=S;p(d.JWPLAYER_MEDIA_BUFFER,{bufferPercent:Math.round(A*100)})}if(S>=1){clearInterval(l)}}function F(){if(j.buffered.length==0||j.duration==0){return 0}else{return j.buffered.end(j.buffered.length-1)/j.duration}}function K(){u();p(d.JWPLAYER_MEDIA_COMPLETE)}this.getTag=function(){return M};O(M)}})(jwplayer.html5);(function(g){var h=jwplayer,l=h.utils,i=l.css,d=jwplayer.events,e=d.state,k=document,b="jwplayer",c="jwvideocontainer",j="jwcontrolscontainer",a="jwplaylistcontainer";g.view=function(y,o){var B=y,E=o,C={},u,H,D,m=0,z=2000,v;this.setup=function(J){B.skin=J;u=k.createElement("div");u.className=b;u.id=B.id;var I=document.getElementById(B.id);I.parentNode.replaceChild(u,I);v=k.createElement("span");v.className=c;v.appendChild(E.getVideo().getTag());H=k.createElement("span");H.className=j;D=k.createElement("span");D.className=a;x();u.appendChild(v);u.appendChild(H);u.appendChild(D);k.addEventListener("webkitfullscreenchange",n,false);k.addEventListener("mozfullscreenchange",n,false);k.addEventListener("keydown",r,false);B.jwAddEventListener(d.JWPLAYER_PLAYER_STATE,t);t({newstate:e.IDLE});u.addEventListener("mouseout",A,false);u.addEventListener("mousemove",function(K){q();clearTimeout(m);m=setTimeout(A,z)},false)};function A(){if(B.jwGetState()==e.PLAYING){w()}clearTimeout(m);m=0}function x(){var K=E.width,I=E.height,L=B.skin.getComponentSettings("controlbar"),J=B.skin.getComponentSettings("display");if(I>40||I.indexOf("%")){C.display=new g.display(B,J);H.appendChild(C.display.getDisplayElement())}else{J.backgroundcolor="transparent";L.margin=0}if(E.playlistsize>0){C.playlist=new g.playlistcomponent(B,{});D.appendChild(C.playlist.getDisplayElement())}s(K,I);i("#"+u.id,{"background-color":J.backgroundcolor?J.backgroundcolor:0});if(!l.isMobile()){C.controlbar=new g.controlbar(B,L);H.appendChild(C.controlbar.getDisplayElement())}}var G=this.fullscreen=function(I){if(!l.exists(I)){I=!E.fullscreen}if(I){if(!E.fullscreen){if(u.requestFullScreen){u.requestFullScreen()}else{if(u.mozRequestFullScreen){u.mozRequestFullScreen()}else{if(u.webkitRequestFullScreen){u.webkitRequestFullScreen()}else{p(true)}}}}E.setFullscreen(true)}else{p(false);if(k.cancelFullScreen){k.cancelFullScreen()}else{if(k.mozCancelFullScreen){k.mozCancelFullScreen()}else{if(k.webkitCancelFullScreen){k.webkitCancelFullScreen()}}}E.setFullscreen(false)}};function s(J,I){if(l.exists(J)&&l.exists(I)){i("#"+u.id,{width:J,height:I});E.width=J;E.height=I}if(C.display){C.display.resize(J,I)}if(C.controlbar){C.controlbar.resize(J,I)}if(C.playlist&&E.playlistsize>0){C.playlist.resize(J,I);i("#"+u.id+" ."+a,{right:0,width:E.playlistsize});i("#"+u.id+" ."+c+",#"+u.id+" ."+j,{right:E.playlistsize})}return}this.resize=s;this.completeSetup=function(){i("#"+u.id,{opacity:1})};function r(I){switch(I.keyCode){case 27:if(E.fullscreen){G(false)}break;case 32:B.jwPlay();break}}function p(I){if(I){u.className+=" jwfullscreen"}else{u.className=u.className.replace(/\s+jwfullscreen/,"")}}function F(){if(k.mozFullScreenElement){return k.mozFullScreenElement.id==u.id}else{if(k.webkitCurrentFullScreenElement){return k.webkitCurrentFullScreenElement.id==u.id}else{return false}}}function n(I){E.setFullscreen(F());G(E.fullscreen)}function w(){if(C.controlbar){C.controlbar.hide()}if(C.display){C.display.hide()}}function q(){if(C.controlbar){C.controlbar.show()}if(C.display){C.display.show()}}function t(I){var J={};switch(I.newstate){case e.PLAYING:if(l.isIPod){J.display="block"}J.opacity=1;i("#"+u.id+" ."+c,J);w();break;case e.COMPLETED:case e.IDLE:if(l.isIPod){J.display="none"}J.opacity=0;i("#"+u.id+" ."+c,J);q();break;case e.BUFFERING:case e.PAUSED:if(!l.isMobile()){q()}break}}};var f="opacity .5s ease";i("."+b,{position:"relative",overflow:"hidden",opacity:0,"-webkit-transition":f,"-moz-transition":f,"-o-transition":f});i("."+c+" ,."+j,{position:"absolute",left:0,right:0,height:"100%","-webkit-transition":f,"-moz-transition":f,"-o-transition":f});i("."+c+" video",{background:"transparent",width:"100%",height:"100%"});i("."+a,{position:"absolute",height:"100%"});i("."+b+":-webkit-full-screen",{width:"100% !important",height:"100% !important"});i("."+b+":-moz-full-screen",{width:"100% !important",height:"100% !important"});i("."+b+".jwfullscreen",{left:0,right:0,top:0,bottom:0,"z-index":1000,position:"fixed !important"});i("."+b+" .jwuniform",{"background-size":"contain !important"});i("."+b+" .jwfill",{"background-size":"cover !important"});i("."+b+" .jwexactfit",{"background-size":"100% 100% !important"});i("."+b+" .jwnone",{"background-size":null})})(jwplayer.html5)}; 
     1if(typeof jwplayer=="undefined"){jwplayer=function(a){if(jwplayer.api){return jwplayer.api.selectPlayer(a)}};var $jw=jwplayer;jwplayer.version="6.0";jwplayer.vid=document.createElement("video");jwplayer.audio=document.createElement("audio");jwplayer.source=document.createElement("source");(function(h){var d=document;var p=window;var o=h.utils=function(){};o.exists=function(t){switch(typeof(t)){case"string":return(t.length>0);break;case"object":return(t!==null);case"undefined":return false}return true};var b={},r,a={};function q(){var t=d.createElement("style");t.type="text/css";d.getElementsByTagName("head")[0].appendChild(t);return t}o.css=function(t,w,u){if(!o.exists(u)){u=false}if(o.isIE()){if(!r){r=q()}}else{if(!b[t]){b[t]=q()}}if(!a[t]){a[t]={}}for(var v in w){var x=g(v,w[v],u);if(o.exists(a[t][v])&&!o.exists(x)){delete a[t][v]}else{a[t][v]=x}}if(o.isIE()){i()}else{e(t,b[t])}};function g(v,w,t){if(typeof w==="undefined"){return undefined}var u=t?" !important":"";if(typeof w=="number"){if(isNaN(w)){return undefined}switch(v){case"z-index":case"opacity":return w+u;break;default:if(v.match(/color/i)){return"#"+o.strings.pad(w.toString(16),6)}else{return Math.ceil(w)+"px"+u}break}}else{return w+u}}function i(){var t="\n";for(var u in a){t+=s(u)}r.innerHTML=t}function e(t,u){if(u){u.innerHTML=s(t)}}function s(t){var u=t+"{\n";var w=a[t];for(var v in w){u+="  "+v+": "+w[v]+";\n"}u+="}\n";return u}o.clearCss=function(u){for(var v in a){if(v.indexOf(u)>=0){delete a[v]}}for(var t in b){if(t.indexOf(u)>=0){b[t].innerHTML=""}}};o.getAbsolutePath=function(z,y){if(!o.exists(y)){y=d.location.href}if(!o.exists(z)){return undefined}if(j(z)){return z}var A=y.substring(0,y.indexOf("://")+3);var x=y.substring(A.length,y.indexOf("/",A.length+1));var u;if(z.indexOf("/")===0){u=z.split("/")}else{var v=y.split("?")[0];v=v.substring(A.length+x.length+1,v.lastIndexOf("/"));u=v.split("/").concat(z.split("/"))}var t=[];for(var w=0;w<u.length;w++){if(!u[w]||!o.exists(u[w])||u[w]=="."){continue}else{if(u[w]==".."){t.pop()}else{t.push(u[w])}}}return A+x+"/"+t.join("/")};function j(u){if(!o.exists(u)){return}var v=u.indexOf("://");var t=u.indexOf("?");return(v>0&&(t<0||(t>v)))}o.extend=function(){var t=o.extend["arguments"];if(t.length>1){for(var v=1;v<t.length;v++){for(var u in t[v]){t[0][u]=t[v][u]}}return t[0]}return null};o.parseDimension=function(t){if(typeof t=="string"){if(t===""){return 0}else{if(t.lastIndexOf("%")>-1){return t}else{return parseInt(t.replace("px",""),10)}}}return t};o.timeFormat=function(t){if(t>0){str=Math.floor(t/60)<10?"0"+Math.floor(t/60)+":":Math.floor(t/60)+":";str+=Math.floor(t%60)<10?"0"+Math.floor(t%60):Math.floor(t%60);return str}else{return"00:00"}};o.log=function(u,t){if(typeof console!="undefined"&&typeof console.log!="undefined"){if(t){console.log(u,t)}else{console.log(u)}}};o.getBoundingClientRect=function(t){if(typeof t.getBoundingClientRect=="function"){return t.getBoundingClientRect()}else{return{left:t.offsetLeft+d.body.scrollLeft,top:t.offsetTop+d.body.scrollTop,width:t.offsetWidth,height:t.offsetHeight}}};var k=o.userAgentMatch=function(u){var t=navigator.userAgent.toLowerCase();return(t.match(u)!==null)};o.isIE=function(){return k(/msie/i)};o.isMobile=function(){return k(/(iP(hone|ad|od))|android/i)};h.utils.isIOS=function(){return k(/iP(hone|ad|od)/i)};o.isIPod=function(){return k(/iP(hone|od)/i)};o.saveCookie=function(t,u){d.cookie="jwplayer."+t+"="+u+"; path=/"};o.getCookies=function(){var w={};var v=d.cookie.split("; ");for(var u=0;u<v.length;u++){var t=v[u].split("=");if(t[0].indexOf("jwplayer.")==0){w[t[0].substring(9,t[0].length)]=t[1]}}return w};o.ajax=function(x,w,t){var v;if(m(x)&&o.exists(p.XDomainRequest)){v=new XDomainRequest();v.onload=n(v,x,w,t);v.onerror=f(t,x,v)}else{if(o.exists(p.XMLHttpRequest)){v=new XMLHttpRequest();v.onreadystatechange=c(v,x,w,t);v.onerror=f(t,x)}else{if(t){t()}}}try{v.open("GET",x,true);v.send(null)}catch(u){if(t){t(x)}}return v};function m(t){if(t&&t.indexOf("://")>=0){if(t.split("/")[2]!=window.location.href.split("/")[2]){return true}}return false}function f(t,v,u){return function(){t(v)}}function c(u,w,v,t){return function(){if(u.readyState===4){if(u.status==200){n(u,w,v,t)()}else{if(t){t(w)}}}}}function n(u,w,v,t){return function(){if(!o.exists(u.responseXML)){try{var x;if(p.DOMParser){x=(new DOMParser()).parseFromString(u.responseText,"text/xml")}else{x=new ActiveXObject("Microsoft.XMLDOM");x.async="false";x.loadXML(u.responseText)}if(x){u=h.utils.extend({},u,{responseXML:x})}}catch(y){if(t){t(w)}return}}v(u)}}o.typeOf=function(u){var t=typeof u;if(t==="object"){if(!u){return"null"}return(u instanceof Array)?"array":t}else{return t}};o.stretch=function(B,H,G,z,F,A,v){var u=(o.exists(G)&&o.exists(F))?G/F:0,w=(o.exists(z)&&o.exists(A))?z/A:0,E=0,D=0,t={},C;switch(B.toLowerCase()){case l.NONE:case l.FILL:case l.EXACTFIT:C="jw"+B.toLowerCase();break;case l.UNIFORM:C="jw"+B.toLowerCase();if(u>w){if((F*w)/G>0.95){C="jwexactfit"}}else{if((A*u)/z>0.95){C="jwexactfit"}}break;default:break}H.className=H.className.replace(/\s*jw(none|exactfit|uniform|fill)/g,"");H.className+=" "+C};var l=o.stretching={NONE:"none",FILL:"fill",UNIFORM:"uniform",EXACTFIT:"exactfit"}})(jwplayer);(function(b){var a=b.strings=function(){};a.trim=function(c){return c.replace(/^\s*/,"").replace(/\s*$/,"")};a.pad=function(d,e,c){if(!c){c="0"}while(d.length<e){d=c+d}return d};a.serialize=function(c){if(c==null){return null}else{if(c=="true"){return true}else{if(c=="false"){return false}else{if(isNaN(Number(c))||c.length>5||c.length==0){return c}else{return Number(c)}}}}};a.seconds=function(e){e=e.replace(",",".");var c=e.split(":");var d=0;if(e.substr(-1)=="s"){d=Number(e.substr(0,e.length-1))}else{if(e.substr(-1)=="m"){d=Number(e.substr(0,e.length-1))*60}else{if(e.substr(-1)=="h"){d=Number(e.substr(0,e.length-1))*3600}else{if(c.length>1){d=Number(c[c.length-1]);d+=Number(c[c.length-2])*60;if(c.length==3){d+=Number(c[c.length-3])*3600}}else{d=Number(e)}}}}return d};a.xmlAttribute=function(c,d){for(var e=0;e<c.attributes.length;e++){if(c.attributes[e].name&&c.attributes[e].name.toLowerCase()==d.toLowerCase()){return c.attributes[e].value.toString()}}return""};a.jsonToString=function(g){var i=i||{};if(i&&i.stringify){return i.stringify(g)}var d=typeof(g);if(d!="object"||g===null){if(d=="string"){g='"'+g.replace(/"/g,'\\"')+'"'}else{return String(g)}}else{var h=[],c=(g&&g.constructor==Array);for(var e in g){var f=g[e];switch(typeof(f)){case"string":f='"'+f.replace(/"/g,'\\"')+'"';break;case"object":if(b.exists(f)){f=a.jsonToString(f)}break}if(c){if(typeof(f)!="function"){h.push(String(f))}}else{if(typeof(f)!="function"){h.push('"'+e+'":'+String(f))}}}if(c){return"["+String(h)+"]"}else{return"{"+String(h)+"}"}}};a.extension=function(c){if(!c){return""}c=c.substring(c.lastIndexOf("/")+1,c.length).split("?")[0];if(c.lastIndexOf(".")>-1){return c.substr(c.lastIndexOf(".")+1,c.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){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.strings.serialize(a.textContent(g));if(e=="file"&&j.levels){delete j.levels}}if(!j.file){j.file=j.link}}return j}})(jwplayer);(function(d){var h=jwplayer.utils.strings,g=h.xmlAttribute,b=d.localName,a=d.textContent,c=d.numChildren;var f=d.mediaparser=function(){};var e="media";f.parseGroup=function(m,n){for(var k=0;k<c(m);k++){var l=m.childNodes[k];if(l.prefix==e){if(!b(l)){continue}switch(b(l).toLowerCase()){case"content":n.file=g(l,"url");if(g(l,"duration")){n.duration=h.seconds(g(l,"duration"))}if(g(l,"start")){n.start=h.seconds(g(l,"start"))}if(c(l)>0){n=f.parseGroup(l,n)}if(g(l,"width")||g(l,"bitrate")||g(l,"url")){if(!n.levels){n.levels=[]}n.levels.push({width:g(l,"width"),bitrate:g(l,"bitrate"),file:g(l,"url")})}break;case"title":n.title=a(l);break;case"description":n.description=a(l);break;case"keywords":n.tags=a(l);break;case"thumbnail":n.image=g(l,"url");break;case"credit":n.author=a(l);break;case"player":var j=l.url;break;case"group":f.parseGroup(l,n);break}}}return n}})(jwplayer.html5.parsers);(function(f){var g=jwplayer.utils,a=f.textContent,d=f.getChildNode,e=f.numChildren,c=f.localName;f.rssparser={};f.rssparser.parse=function(o){var h=[];for(var m=0;m<e(o);m++){var n=d(o,m),k=c(n).toLowerCase();if(k=="channel"){for(var l=0;l<e(n);l++){var p=d(n,l);if(c(p).toLowerCase()=="item"){h.push(b(p))}}}}return h};function b(l){var m={};for(var j=0;j<l.childNodes.length;j++){var k=l.childNodes[j];var h=c(k);if(!h){continue}switch(h.toLowerCase()){case"enclosure":m.file=g.strings.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=f.mediaparser.parseGroup(l,m);m=f.jwparser.parseEntry(l,m);return new jwplayer.html5.playlistitem(m)}})(jwplayer.html5.parsers);(function(l){var u=l.html5,h=l.utils,i=l.events,p=l.events.state,o=h.css,b="button",n="text",e="divider",q="slider",f="relative",g="absolute",a="none",m="block",s="inline",k="inline-block",c="left",v="right",j="100%",r="width .25s linear, left .25s linear, opacity .25s, background .25s",t=".jwcontrolbar",d=document;u.controlbar=function(C,aq){var A,V,B={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:n}]},center:{position:"center",elements:[{name:"time",type:q}]},right:{position:"right",elements:[{name:"duration",type:n},{name:"blank",type:b},{name:"divider",type:e},{name:"mute",type:b},{name:"volume",type:q},{name:"divider",type:e},{name:"fullscreen",type:b}]}}},T,aA,al,ay,ao,aI,J,M,ai=false,ar=0,Y={play:"pause",mute:"unmute",fullscreen:"normalscreen"},az={play:false,mute:false,fullscreen:false},z={play:ad,mute:N,fullscreen:aa,next:y,prev:ag},D={time:X,volume:aD};function aC(){al={};A=C;ao=A.id+"_controlbar";aI=J=0;ay=O();ay.id=ao;ay.className="jwcontrolbar";window.addEventListener("mousemove",aH,false);window.addEventListener("mouseup",aH,false);V=A.skin;T=h.extend({},B,V.getComponentSettings("controlbar"),aq);aA=V.getComponentLayout("controlbar");if(!aA){aA=B.layout}W();au();w();P()}function w(){A.jwAddEventListener(l.events.JWPLAYER_MEDIA_TIME,aJ);A.jwAddEventListener(l.events.JWPLAYER_PLAYER_STATE,G);A.jwAddEventListener(l.events.JWPLAYER_MEDIA_MUTE,aE);A.jwAddEventListener(l.events.JWPLAYER_MEDIA_VOLUME,E);A.jwAddEventListener(l.events.JWPLAYER_MEDIA_BUFFER,K);A.jwAddEventListener(l.events.JWPLAYER_FULLSCREEN,F);A.jwAddEventListener(l.events.JWPLAYER_PLAYLIST_LOADED,P)}function aJ(aL){var aK=false,aM;if(al.elapsed){aM=h.timeFormat(aL.position);al.elapsed.innerHTML=aM;aK=(aM.length!=h.timeFormat(J).length)}if(al.duration){aM=h.timeFormat(aL.duration);al.duration.innerHTML=aM;aK=(aK||(aM.length!=h.timeFormat(aI).length))}if(aL.duration>0){ax(aL.position/aL.duration)}else{ax(0)}aI=aL.duration;J=aL.position;if(aK){ah()}}function G(aK){switch(aK.newstate){case p.BUFFERING:case p.PLAYING:o(at(".jwtimeSliderThumb"),{opacity:1});S("play",true);break;case p.PAUSED:if(!ai){S("play",false)}break;case p.IDLE:S("play",false);o(at(".jwtimeSliderThumb"),{opacity:0});if(al.timeRail){al.timeRail.className="jwrail";setTimeout(function(){al.timeRail.className+=" jwsmooth"},100)}aB(0);aJ({position:0,duration:0});break;case p.COMPLETED:o(at(),{opacity:0});break}}function aE(aK){S("mute",aK.mute);x(aK.mute?0:M)}function E(aK){M=aK.volume/100;x(M)}function K(aK){aB(aK.bufferPercent/100)}function F(aK){S("fullscreen",aK.fullscreen)}function P(aK){if(A.jwGetPlaylist().length<2){o(at(".jwnext"),{display:"none"});o(at(".jwprev"),{display:"none"})}else{o(at(".jwnext"),{display:undefined});o(at(".jwprev"),{display:undefined})}ah()}function W(){h.clearCss("#"+ao);o("#"+ao,{height:ac("background").height,bottom:T.margin?T.margin:0,left:T.margin?T.margin:0,right:T.margin?T.margin:0});o(at(".jwtext"),{font:T.fontsize+"px/"+ac("background").height+"px "+T.font,color:T.fontcolor,"font-weight":T.fontweight,"font-style":T.fontstyle,"text-align":"center",padding:"0 5px"})}function at(aK){return"#"+ao+(aK?" "+aK:"")}function O(){return d.createElement("span")}function au(){var aM=am("capLeft");var aL=am("capRight");var aK=am("background",{position:g,left:ac("capLeft").width,right:ac("capRight").width,"background-repeat":"repeat-x"},true);if(aK){ay.appendChild(aK)}if(aM){ay.appendChild(aM)}av();if(aL){ay.appendChild(aL)}}function Q(aK){switch(aK.type){case e:return af(aK);break;case n:return an(aK.name);break;case b:if(aK.name!="blank"){return ae(aK.name)}break;case q:return R(aK.name);break}}function am(aM,aP,aL,aR){var aO=O();aO.className="jw"+aM;var aK=aR?" left center":" center";var aN=ac(aM);aO.innerHTML="&nbsp;";if(!aN||aN.src==""){return}var aQ;if(aL){aQ={background:"url('"+aN.src+"') repeat-x "+aK}}else{aQ={background:"url('"+aN.src+"') no-repeat"+aK,width:aN.width}}o(at(".jw"+aM),h.extend(aQ,aP));al[aM]=aO;return aO}function ae(aM){if(!ac(aM+"Button").src){return null}var aN=d.createElement("button");aN.className="jw"+aM;aN.addEventListener("click",aj(aM),false);var aO=ac(aM+"Button");var aL=ac(aM+"ButtonOver");aN.innerHTML="&nbsp;";U(at(".jw"+aM),aO,aL);var aK=Y[aM];if(aK){U(at(".jw"+aM+".jwtoggle"),ac(aK+"Button"),ac(aK+"ButtonOver"))}al[aM]=aN;return aN}function U(aK,aL,aM){if(!aL.src){return}o(aK,{width:aL.width,background:"url("+aL.src+") center no-repeat"});if(aM.src){o(aK+":hover",{background:"url("+aM.src+") center no-repeat"})}}function aj(aK){return function(){if(z[aK]){z[aK]()}}}function ad(){if(az.play){A.jwPause()}else{A.jwPlay()}}function N(){A.jwSetMute();aE({mute:az.mute})}function aD(aK){if(aK<0.1){aK=0}if(aK>0.9){aK=1}A.jwSetVolume(aK*100);x(aK)}function X(aK){A.jwSeek(aK*aI)}function aa(){A.jwSetFullscreen()}function y(){A.jwPlaylistNext()}function ag(){A.jwPlaylistNext()}function S(aK,aL){if(!h.exists(aL)){aL=!az[aK]}if(al[aK]){al[aK].className="jw"+aK+(aL?" jwtoggle jwtoggling":" jwtoggling");setTimeout(function(){al[aK].className=al[aK].className.replace(" jwtoggling","")},100)}az[aK]=aL}function L(aK){return ao+"_"+aK}function an(aK,aO){var aM=O();aM.id=L(aK);aM.className="jwtext jw"+aK;var aL={};var aN=ac(aK+"Background");if(aN.src){aL.background="url("+aN.src+") no-repeat center";aL["background-size"]="100% "+ac("background").height+"px"}o(at(".jw"+aK),aL);aM.innerHTML="00:00";al[aK]=aM;return aM}function af(aL){if(aL.width){var aK=O();aK.className="jwblankDivider";o(aK,{width:parseInt(aL.width)});return aK}else{if(aL.element){return am(aL.element)}else{return am(aL.name)}}}function R(aK){var aN=O();aN.className="jwslider jw"+aK;var aM=am(aK+"SliderCapLeft");var aL=am(aK+"SliderCapRight");if(aL){aL.className+=" jwcapRight"}var aO=ap(aK);if(aM){aN.appendChild(aM)}aN.appendChild(aO);if(aM){aN.appendChild(aL)}o(at(".jw"+aK+" .jwrail"),{left:ac(aK+"SliderCapLeft").width,right:ac(aK+"SliderCapRight").width,});al[aK]=aN;if(aK=="time"){aG(aN);ax(0);aB(0)}else{if(aK=="volume"){aw(aN)}}return aN}function ap(aM){var aP=O();aP.className="jwrail jwsmooth";var aK=["Rail","Buffer","Progress"];for(var aO=0;aO<aK.length;aO++){var aN=am(aM+"Slider"+aK[aO],null,true,(aM=="volume"));if(aN){aN.className+=" jwstretch";aP.appendChild(aN)}}var aL=am(aM+"SliderThumb");if(aL){o(at("."+aL.className),{opacity:0});aL.className+=" jwthumb";aP.appendChild(aL)}aP.addEventListener("mousedown",H(aM),false);al[aM+"Rail"]=aP;return aP}function I(){var aK=A.jwGetState();return(aK==p.IDLE||aK==p.COMPLETED)}function H(aK){return(function(aL){if(aL.button!=0){return}al[aK+"Rail"].className="jwrail";if(aK=="time"){if(!I()){A.jwSeekDrag(true);ai=aK}}else{ai=aK}})}function aH(aK){if(!ai||aK.button!=0){return}var aO=al[ai].getElementsByClassName("jwrail")[0],aP=h.getBoundingClientRect(aO),aN=(aK.clientX-aP.left)/aP.width;if(aK.type=="mouseup"){var aL=ai;if(aL=="time"){A.jwSeekDrag(false)}al[aL+"Rail"].className="jwrail jwsmooth";ai=null;D[aL](aN)}else{if(ai=="time"){ax(aN)}else{x(aN)}var aM=(new Date()).getTime();if(aM-ar>500){ar=aM;D[ai](aN)}}}function aG(aK){if(al.timeSliderThumb){o(at(".jwtimeSliderThumb"),{"margin-left":(ac("timeSliderThumb").width/-2)})}aB(0);ax(0)}function aw(aM){var aL=ac("volumeSliderCapLeft").width,aK=ac("volumeSliderCapRight").width,aN=ac("volumeSliderRail").width;o(at(".jwvolume"),{width:(aL+aN+aK)})}var Z={};function av(){aF("left");aF("center");aF("right");ay.appendChild(Z.left);ay.appendChild(Z.center);ay.appendChild(Z.right);o(at(".jwright"),{right:ac("capRight").width})}function aF(aL){var aK=O();aK.className="jwgroup jw"+aL;Z[aL]=aK;if(aA[aL]){ab(aA[aL],Z[aL])}}function ab(aN,aK){if(aN&&aN.elements.length>0){for(var aM=0;aM<aN.elements.length;aM++){var aL=Q(aN.elements[aM]);if(aL){aK.appendChild(aL)}}}}var ah=this.resize=function(aL,aK){o(at(".jwgroup.jwcenter"),{left:Math.round(h.parseDimension(Z.left.offsetWidth)+ac("capLeft").width),right:Math.round(h.parseDimension(Z.right.offsetWidth)+ac("capRight").width)})};this.getDisplayElement=function(){return ay};function aB(aK){aK=Math.min(Math.max(0,aK),1);if(al.timeSliderBuffer){al.timeSliderBuffer.style.width=aK*100+"%"}}function ak(aK,aM,aN){var aL=100*Math.min(Math.max(0,aM),1)+"%";if(al[aK+"SliderProgress"]){al[aK+"SliderProgress"].style.width=aL}if(al[aK+"SliderThumb"]){al[aK+"SliderThumb"].style.left=aL}}function x(aK){ak("volume",aK,true)}function ax(aK){ak("time",aK)}function ac(aK){var aL=V.getSkinElement("controlbar",aK);if(aL){return aL}else{return{width:0,height:0,src:"",image:undefined,ready:false}}}this.show=function(){o(at(),{opacity:1})};this.hide=function(){o(at(),{opacity:0})};aC()};o(t,{position:g,overflow:"hidden","-webkit-transition":r,"-moz-transition":r,"-o-transition":r});o(t+" span",{height:j,"-webkit-user-select":a,"-webkit-user-drag":a,"user-select":a,"user-drag":a});o(t+" .jwgroup",{display:s});o(t+" span, "+t+" .jwgroup button,"+t+" .jwleft",{position:f,"float":c});o(t+" .jwright",{position:g});o(t+" .jwcenter",{position:g});o(t+" button",{display:k,height:j,border:a,cursor:"pointer","-webkit-transition":r,"-moz-transition":r,"-o-transition":r});o(t+" .jwcapRight",{right:0,position:g});o(t+" .jwtime,"+t+" .jwgroup span.jwstretch",{position:g,height:j,width:j,left:0});o(t+" .jwrail,"+t+" .jwthumb",{position:g,height:j,cursor:"pointer"});o(t+" .jwtime .jwsmooth span",{"-webkit-transition":r,"-moz-transition":r,"-o-transition":r});o(t+" .jwdivider+.jwdivider",{display:a});o(t+" .jwtext",{padding:"0 5px","text-align":"center"});o(t+" .jwtoggling",{"-webkit-transition":a,"-moz-transition":a,"-o-transition":a})})(jwplayer);(function(a){var e=jwplayer,c=e.utils,d=e.events,b=d.state;a.controller=function(h,v){var B=h,f=v,o=h.getVideo(),l=new d.eventdispatcher(B.id,B.config.debug);c.extend(this,l);function p(){B.addGlobalListener(E);B.addEventListener(d.JWPLAYER_MEDIA_BUFFER_FULL,y)}function E(G){l.sendEvent(G.type,G)}function y(G){o.play()}function F(G){n();switch(c.typeOf(G)){case"string":B.setPlaylist(new a.playlist({file:G}));B.setItem(0);break;case"object":case"array":B.setPlaylist(new a.playlist(G));B.setItem(0);break;case"number":B.setItem(G);break}}var q,k,m;function u(){try{k=u;if(!q){q=true;l.sendEvent(d.JWPLAYER_MEDIA_BEFOREPLAY);q=false;if(m){m=false;k=null;return}}if(B.state==b.IDLE){o.load(B.playlist[B.item])}else{if(B.state==b.PAUSED){o.play()}}return true}catch(G){l.sendEvent(d.JWPLAYER_ERROR,G);k=null}return false}function n(){k=null;try{o.stop();if(q){m=true}return true}catch(G){l.sendEvent(d.JWPLAYER_ERROR,G)}return false}function D(){try{switch(B.state){case b.PLAYING:case b.BUFFERING:o.pause();break;default:if(q){m=true}}return true}catch(G){l.sendEvent(d.JWPLAYER_ERROR,G)}return false;if(B.state==b.PLAYING||B.state==b.BUFFERING){o.pause()}}function z(G){o.seek(G)}function C(G){o.volume(G)}function r(G){if(!c.exists(G)){G=!B.mute}o.mute(G)}function x(G){f.fullscreen(G)}function t(G){B.stretching=G;f.resize()}function s(G){F(B.item);u()}function i(){s(B.item-1)}function j(){s(B.item+1)}function A(G){return function(){G.apply(this,arguments)}}function w(){try{return B.getVideo().detachMedia()}catch(G){return null}}function g(){try{var G=B.getVideo().attachMedia();if(typeof k=="function"){k()}}catch(H){return null}}this.play=A(u);this.pause=A(D);this.seek=A(z);this.stop=A(n);this.load=A(F);this.next=A(j);this.prev=A(i);this.item=A(s);this.setVolume=A(C);this.setMute=A(r);this.setFullscreen=A(x);this.setStretching=A(t);this.detachMedia=w;this.attachMedia=g;p()}})(jwplayer.html5);(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 m=jwplayer.utils,j=m.css,d=jwplayer.events,e=d.state,l=g.utils.animations.rotate,k=document,a=".jwdisplay",i=".jwpreview",b="absolute",c="none",h="100%",f="opacity .25s";g.display=function(D,P){var J=D,z=D.skin,s,n,q,w,K,O,C={},o,B,M,G,x=m.extend({backgroundcolor:"#000"},z.getComponentSettings("display"),P);_bufferRotation=!m.exists(x.bufferrotation)?15:parseInt(x.bufferrotation,10),_bufferInterval=!m.exists(x.bufferinterval)?100:parseInt(x.bufferinterval,10);function A(){s=k.createElement("div");s.id=J.id+"_display";s.className="jwdisplay";n=k.createElement("div");n.className="jwpreview";s.appendChild(n);J.jwAddEventListener(d.JWPLAYER_PLAYER_STATE,y);J.jwAddEventListener(d.JWPLAYER_PLAYLIST_ITEM,I);s.addEventListener("click",L,false);p();y({newstate:e.IDLE})}function L(R){switch(J.jwGetState()){case e.PLAYING:case e.BUFFERING:J.jwPause();break;default:J.jwPlay();break}}function p(){var R=["play","buffer"];for(var U=0;U<R.length;U++){var Y=R[U],W=E(Y+"Icon"),T=E(Y+"IconOver"),V=k.createElement("div"),S=E("background"),X=E("backgroundOver");button=k.createElement("button");if(W){button.className="jw"+Y;V.className="jwicon";button.appendChild(V);u("#"+s.id+" ."+button.className,S,X);u("#"+s.id+" ."+button.className+" div",W,T);if(X||T){button.addEventListener("mouseover",F(button),false);button.addEventListener("mouseout",H(button),false)}C[Y]=button}}}function F(R){return function(S){if(R.className.indexOf("jwhover")<0){R.className+=" jwhover"}if(R.childNodes[0].className.indexOf("jwhover")<0){R.childNodes[0].className+=" jwhover"}}}function H(R){return function(S){R.className=R.className.replace(" jwhover","");R.childNodes[0].className=R.childNodes[0].className.replace(" jwhover","")}}function u(R,S,T){if(!(S&&S.src)){return}j(R,{width:S.width,height:S.height,"margin-left":S.width/-2,"margin-top":S.height/-2,background:"url("+S.src+") center no-repeat"});if(T&&T.src){j(R+".jwhover",{background:"url("+T.src+") center no-repeat"})}}function Q(R){if(B){s.removeChild(B)}B=C[R];if(B){s.appendChild(B)}}function I(){var R=J.jwGetPlaylist()[J.jwGetPlaylistIndex()];var S=R?R.image:"";if(q!=S){q=S;N(i,false);t()}}function y(R){clearInterval(G);switch(R.newstate){case e.COMPLETED:case e.IDLE:Q("play");N(i,true);break;case e.BUFFERING:Q("buffer");M=0;G=setInterval(function(){M+=_bufferRotation;l(B.childNodes[0],M%360)},_bufferInterval);break;case e.PLAYING:Q();N(i,false);break;case e.PAUSED:Q("play");break}}this.getDisplayElement=function(){return s};function r(R){return"#"+s.id+" "+R}function t(){if(q){var R=new Image();R.addEventListener("load",function(){w=R.width;K=R.height;v();j(r(i),{"background-image":q?("url("+q+")"):"",});N(i,true)},false);R.src=q}else{N(i,false);w=K=0}}function E(R){var S=z.getSkinElement("display",R);if(S){return S}return null}function v(){m.stretch(J.jwGetStretching(),n,s.clientWidth,s.clientHeight,w,K)}this.resize=v;function N(R,S){j(r(R),{opacity:S?1:0})}this.show=function(){N("",true)};this.hide=function(){N("",false)};this.getBGColor=function(){return x.backgroundcolor};this.setAlternateClickHandler=function(R){_alternateClickHandler=R};this.revertAlternateClickHandler=function(){_alternateClickHandler=undefined};A()};j(a,{position:b,cursor:"pointer",width:h,height:h,overflow:"hidden"});j(a+" .jwpreview",{position:b,width:h,height:h,"background-repeat":"no-repeat","background-position":"center",overflow:"hidden"});j(a+", "+a+" *",{"-webkit-transition":f,"-moz-transition":f,"-o-transition":f});j(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;a.instream=function(A,o,z,B){var v={controlbarseekable:"always",controlbarpausable:true,controlbarstoppable:true,playlistclickable:true};var x,C,E=A,G=o,l=z,y=B,t,J,q,I,h,i,j,n,s,k=false,m,g,p=this;this.load=function(N,M){f();k=true;C=c.extend(v,M);x=a.playlistitem(N);H();g=document.createElement("div");g.id=p.id+"_instream_container";y.detachMedia();t=j.getTag();i=G.playlist[G.item];h=E.jwGetState();if(h==b.BUFFERING||h==b.PLAYING){t.pause()}J=t.src?t.src:t.currentSrc;q=t.innerHTML;I=t.currentTime;s=new a.display(p);s.setAlternateClickHandler(function(O){if(_fakemodel.state==b.PAUSED){p.jwInstreamPlay()}else{F(d.JWPLAYER_INSTREAM_CLICK,O)}});g.appendChild(s.getDisplayElement());if(!c.isMobile()){n=new a.controlbar(p);g.appendChild(n.getDisplayElement())}l.setupInstream(g,t);r();j.load(x)};this.jwInstreamDestroy=function(M){if(!k){return}k=false;if(h!=b.IDLE){j.load(i,false)}else{j.stop(true)}j.detachMedia();l.destroyInstream();if(n){try{n.getDisplayElement().parentNode.removeChild(n.getDisplayElement())}catch(N){}}F(d.JWPLAYER_INSTREAM_DESTROYED,{reason:(M?"complete":"destroyed")},true);y.attachMedia();if(h==b.BUFFERING||h==b.PLAYING){t.play();if(G.playlist[G.item]==i){G.getVideo().seek(I)}}return};this.jwInstreamAddEventListener=function(M,N){m.addEventListener(M,N)};this.jwInstreamRemoveEventListener=function(M,N){m.removeEventListener(M,N)};this.jwInstreamPlay=function(){if(!k){return}j.play(true)};this.jwInstreamPause=function(){if(!k){return}j.pause(true)};this.jwInstreamSeek=function(M){if(!k){return}j.seek(M)};this.jwInstreamGetState=function(){if(!k){return undefined}return _fakemodel.state};this.jwInstreamGetPosition=function(){if(!k){return undefined}return _fakemodel.position};this.jwInstreamGetDuration=function(){if(!k){return undefined}return _fakemodel.duration};this.playlistClickable=function(){return(!k||C.playlistclickable.toString().toLowerCase()=="true")};function u(){_fakemodel=new a.model({});m=new d.eventdispatcher();E.jwAddEventListener(d.JWPLAYER_RESIZE,r);E.jwAddEventListener(d.JWPLAYER_FULLSCREEN,r)}function f(){y.setMute(G.mute);y.setVolume(G.volume)}function H(){if(!j){j=new a.video(G.getVideo().getTag());j.addGlobalListener(K);j.addEventListener(d.JWPLAYER_MEDIA_META,L);j.addEventListener(d.JWPLAYER_MEDIA_COMPLETE,w);j.addEventListener(d.JWPLAYER_MEDIA_BUFFER_FULL,D)}j.attachMedia()}function K(M){if(k){F(M.type,M)}}function D(M){if(k){j.play()}}function w(M){if(k){setTimeout(function(){p.jwInstreamDestroy(true)},10)}}function L(M){if(M.metadata.width&&M.metadata.height){l.resizeMedia()}}function F(M,N,O){if(k||O){m.sendEvent(M,N)}}function r(){if(n){n.resize()}if(s){s.resize()}}this.jwPlay=function(M){if(C.controlbarpausable.toString().toLowerCase()=="true"){this.jwInstreamPlay()}};this.jwPause=function(M){if(C.controlbarpausable.toString().toLowerCase()=="true"){this.jwInstreamPause()}};this.jwStop=function(){if(C.controlbarstoppable.toString().toLowerCase()=="true"){this.jwInstreamDestroy();E.jwStop()}};this.jwSeek=function(M){switch(C.controlbarseekable.toLowerCase()){case"always":this.jwInstreamSeek(M);break;case"backwards":if(_fakemodel.position>M){this.jwInstreamSeek(M)}break}};this.jwGetPosition=function(){};this.jwGetDuration=function(){};this.jwGetWidth=E.jwGetWidth;this.jwGetHeight=E.jwGetHeight;this.jwGetFullscreen=E.jwGetFullscreen;this.jwSetFullscreen=E.jwSetFullscreen;this.jwGetVolume=function(){return G.volume};this.jwSetVolume=function(M){j.volume(M);E.jwSetVolume(M)};this.jwGetMute=function(){return G.mute};this.jwSetMute=function(M){j.mute(M);E.jwSetMute(M)};this.jwGetState=function(){return _fakemodel.state};this.jwGetPlaylist=function(){return[x]};this.jwGetPlaylistIndex=function(){return 0};this.jwGetStretching=function(){return G.config.stretching};this.jwAddEventListener=function(N,M){m.addEventListener(N,M)};this.jwRemoveEventListener=function(N,M){m.removeEventListener(N,M)};this.skin=E.skin;this.id=E.id+"_instream";u();return this}})(jwplayer.html5);(function(a){var b=jwplayer.utils,c=jwplayer.events;a.model=function(d){var j=this,f,l,m=b.getCookies(),h={width:480,height:320,item:0,playlist:[],skin:undefined,volume:90,mute:false,repeat:"",playlistsize:0,playlistposition:"right",stretching:b.stretching.UNIFORM,autostart:false,debug:undefined};function i(n){return n}function k(){b.extend(j,new c.eventdispatcher());j.config=b.extend({},h,m,i(d));b.extend(j,{id:d.id,state:c.state.IDLE,position:0,buffer:0,},j.config);j.setItem(j.config.item);l=document.createElement("video");f=new a.video(l);f.addGlobalListener(e)}var g={};g[c.JWPLAYER_MEDIA_MUTE]="mute";g[c.JWPLAYER_MEDIA_VOLUME]="volume";g[c.JWPLAYER_PLAYER_STATE]="newstate->state";g[c.JWPLAYER_MEDIA_BUFFER]="bufferPercent->buffer";g[c.JWPLAYER_MEDIA_TIME]="position";function e(n){var p=g[n.type];if(p){var q=p.split("->"),r=q[0],o=q[1]?q[1]:r;if(j[o]!=n[r]){j[o]=n[r];j.sendEvent(n.type,n)}}else{j.sendEvent(n.type,n)}}this.getVideo=function(){return f};this.seekDrag=function(n){f.seekDrag(n)};this.setFullscreen=function(n){if(n!=j.fullscreen){j.fullscreen=n;j.sendEvent(c.JWPLAYER_FULLSCREEN,{fullscreen:n})}};this.setPlaylist=function(n){j.item=-1;j.playlist=n;j.sendEvent(c.JWPLAYER_PLAYLIST_LOADED,{playlist:n})};this.setItem=function(n){var o;if(n==j.playlist.length||n<-1){o=0}else{if(n==-1||n>j.playlist.length){o=j.playlist.length-1}else{o=n}}if(o!=j.item){j.item=o;j.sendEvent(c.JWPLAYER_PLAYLIST_ITEM,{index:j.item})}};this.componentConfig=function(n){return{}};k()}})(jwplayer.html5);(function(a){a.player=function(c){var k=this,i=new a.model(c),f=new a.view(this,i),g=new a.controller(i,f);function j(){k.id=i.id;var l=new a.setup(i,f,g);l.addEventListener(jwplayer.events.JWPLAYER_READY,d);l.addEventListener(jwplayer.events.JWPLAYER_ERROR,h);l.start()}function d(l){f.completeSetup();g.sendEvent(l.type,l);g.sendEvent(jwplayer.events.JWPLAYER_PLAYLIST_LOADED,{playlist:i.playlist});g.sendEvent(jwplayer.events.JWPLAYER_PLAYLIST_ITEM,{index:i.item});g.load();setTimeout(f.resize,0)}function h(l){console.log(l);alert("Can't set up: "+l.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=i.seekDrag;this.jwSetStretching=g.setStretching;function e(l){return function(){return i[l]}}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(m,l){if(!b){b=new a.instream(k,i,f,g)}setTimeout(function(){b.load(m,l)},10)};this.jwInstreamDestroy=function(){if(b){b.jwInstreamDestroy()}};this.jwAddEventListener=g.addEventListener;this.jwRemoveEventListener=g.removeEventListener;j()}})(jwplayer.html5);(function(a){var b=jwplayer.utils;a.playlist=function(c){var e=[];if(c&&c instanceof Array&&c.length>0){for(var d in c){if(!isNaN(parseInt(d))){e.push(new a.playlistitem(c[d]))}}}else{e.push(new a.playlistitem(c))}return e}})(jwplayer.html5);(function(e){var c={size:180,itemheight:60,thumbs:true,fontcolor:"#000000",overcolor:"",activecolor:"",backgroundcolor:"#f8f8f8",font:"_sans",fontsize:"",fontstyle:"",fontweight:""},i={_sans:"Arial, Helvetica, sans-serif",_serif:"Times, Times New Roman, serif",_typewriter:"Courier New, Courier, monospace"},k=jwplayer.utils,g=k.css,d=jwplayer.events,j=".jwplaylist",h=document,a="absolute",b="none",f="100%";e.playlistcomponent=function(y,I){var E=y,t=E.skin,m=k.extend({},c,E.skin.getComponentSettings("playlist"),I),F,s,J,l,o,n,r=-1,p={background:undefined,item:undefined,itemOver:undefined,itemImage:undefined,itemActive:undefined};this.getDisplayElement=function(){return F};this.resize=function(L,K){s=L;J=K};this.show=function(){_show(F)};this.hide=function(){_hide(F)};function q(){F=h.createElement("div");F.id=E.id+"_jwplayer_playlistcomponent";F.className="jwplaylist";H();if(p.item){m.itemheight=p.item.height}v();E.jwAddEventListener(jwplayer.events.JWPLAYER_PLAYLIST_LOADED,z);E.jwAddEventListener(jwplayer.events.JWPLAYER_PLAYLIST_ITEM,C)}function v(){var O=0,N=0,K=0,M=m.itemheight,Q=m.fontsize;k.clearCss("#"+F.id);g("#"+F.id+" .jwlist",{"background-color":m.backgroundcolor,"background-image":p.background?"url("+p.background.src+")":"",color:m.fontcolor,"font-family":i[m.font]?i[m.font]:i._sans,"font-size":(Q?Q:11)+"px","font-style":m.fontstyle,"font-weight":m.fontweight});if(p.itemImage){O=(M-p.itemImage.height)/2;N=p.itemImage.width;K=p.itemImage.height}else{N=M*4/3;K=M}g("#"+F.id+" .jwplaylistimg",{height:K,width:N,margin:O});g("#"+F.id+" .jwlist li",{"background-image":p.item?"url("+p.item.src+")":"",height:M,"background-size":f+" "+M+"px"});var L={overflow:"hidden"};if(m.activecolor!==""){L.color=m.activecolor}if(p.itemActive){L["background-image"]="url("+p.itemActive.src+")"}g("#"+F.id+" .jwlist li.active",L);var P={overflow:"hidden"};if(m.overcolor!==""){P.color=m.overcolor}if(p.itemOver){P["background-image"]="url("+p.itemOver.src+")"}g("#"+F.id+" .jwlist li:hover",P);g("#"+F.id+" .jwtextwrapper",{padding:"5px 5px 0 "+(O?0:"5px"),height:M-5});g("#"+F.id+" .jwtitle",{height:Q?Q+10:20,"line-height":Q?Q+10:20,overflow:"hidden","font-size":Q?Q:13,"font-weight":m.fontweight?m.fontweight:"bold"});g("#"+F.id+" .jwdescription",{display:"block","line-height":Q?Q+4:16,overflow:"hidden",height:M,position:"relative"})}function w(){var K=h.createElement("ul");K.className="jwlist";K.id=F.id+"_ul"+Math.round(Math.random()*10000000);return K}function x(L){var N=l[L],K=h.createElement("li");K.className="jwitem";K.id=n.id+"_item_"+L;g(K,{height:m.itemheight,display:"block",cursor:"pointer",backgroundImage:p.item?"url("+p.item.src+")":"",backgroundSize:"100% "+m.itemheight+"px"});var M=h.createElement("div");M.className="jwplaylistimg jwfill";if(D()&&(N.image||N["playlist.image"]||p.itemImage)){var Q;if(N["playlist.image"]){Q=N["playlist.image"]}else{if(N.image){Q=N.image}else{if(p.itemImage){Q=p.itemImage.src}}}g("#"+K.id+" .jwplaylistimg",{"background-image":Q?"url("+Q+")":null});K.appendChild(M)}var R=h.createElement("div");R.className="jwtextwrapper";var P=h.createElement("span");P.className="jwtitle";P.innerHTML=N?N.title:"";R.appendChild(P);if(N.description){var O=h.createElement("span");O.className="jwdescription";O.innerHTML=N.description;R.appendChild(O)}K.appendChild(R);return K}function z(L){F.innerHTML="";l=A();if(!l){return}items=[];n=w();for(var M=0;M<l.length;M++){var K=x(M);K.onclick=G(M);n.appendChild(K);items.push(K)}r=E.jwGetPlaylistIndex();F.appendChild(n);if(k.isIOS()&&window.iScroll){n.style.height=m.itemheight*l.length+"px";var N=new iScroll(F.id)}}function A(){var L=E.jwGetPlaylist();var M=[];for(var K=0;K<L.length;K++){if(!L[K]["ova.hidden"]){M.push(L[K])}}return M}function G(K){return function(){E.jwPlaylistItem(K);E.jwPlay(true)}}function u(){n.scrollTop=E.jwGetPlaylistIndex()*m.itemheight}function D(){return m.thumbs.toString().toLowerCase()=="true"}function C(K){if(r>=0){h.getElementById(n.id+"_item_"+r).className="jwitem";r=K.index}h.getElementById(n.id+"_item_"+K.index).className="jwitem active";u()}function H(){for(var K in p){p[K]=B(K)}}function B(K){return t.getSkinElement("playlist",K)}q();return this};g(j,{overflow:"hidden",position:"absolute",width:f,height:f});g(j+" .jwplaylistimg",{position:"relative",width:f,"float":"left",margin:"0 5px 0 0",background:"black",overflow:"hidden"});g(j+" .jwlist",{width:f,height:f,"list-style":"none",margin:0,padding:0,"overflow-y":"auto"});g(j+" .jwlist li",{width:f});g(j+" .jwtextwrapper",{overflow:"hidden"})})(jwplayer.html5);(function(a){a.playlistitem=function(c){var d={description:"",image:"",link:"",mediaid:"",title:"",provider:"",file:"",duration:-1,start:0,currentLevel:-1,levels:[]};var b=jwplayer.utils.extend({},d,c);if(b.levels.length===0){b.levels[0]=new a.playlistitemlevel(b)}return b}})(jwplayer.html5);(function(a){a.html5.playlistitemlevel=function(b){var d={file:"",streamer:"",bitrate:0,width:0};for(var c in d){if(a.utils.exists(b[c])){d[c]=b[c]}}return d}})(jwplayer);(function(a){var d=jwplayer,b=d.utils,c=d.events;a.playlistloader=function(){var f=new c.eventdispatcher();b.extend(this,f);this.load=function(h){b.ajax(h,g,e)};function g(i){try{var k=i.responseXML.firstChild;if(a.parsers.localName(k)=="xml"){k=k.nextSibling}var h=a.parsers.rssparser.parse(k);f.sendEvent(c.JWPLAYER_PLAYLIST_LOADED,{playlist:new a.playlist(h)})}catch(j){e("Could not load the playlist.")}}function e(h){f.sendEvent(c.JWPLAYER_ERROR,{message:h?h:"Could not load playlist an unknown reason."})}}})(jwplayer.html5);(function(f){var h=jwplayer,k=h.utils,e=h.events,i=1,d=2,c=3,j=4,b=5,a=6,g=7;f.setup=function(q,F,G){var J=q,o=F,D=G,s={},A={},y,x=new e.eventdispatcher(),t=false,u=[];function r(){p(i,n);p(d,N,i);p(c,w,i);p(j,I,c);p(b,M,j+","+d);p(a,H,b+","+c);p(g,B,a)}function p(O,Q,P){u.push({name:O,method:Q,depends:P})}function E(){for(var Q=0;Q<u.length;Q++){var O=u[Q];if(L(O.depends)){u.splice(Q,1);try{O.method();E()}catch(P){v(P.message)}return}}if(u.length>0&&!t){setTimeout(E,500)}}function L(Q){if(!Q){return true}var P=Q.toString().split(",");for(var O=0;O<P.length;O++){if(!s[P[O]]){return false}}return true}function m(O){s[O]=true}function n(){m(i)}function N(){y=new f.skin();y.load(J.config.skin,z)}function z(O){m(d)}function w(){switch(k.typeOf(J.config.playlist)){case"string":var O=new f.playlistloader();O.addEventListener(e.JWPLAYER_PLAYLIST_LOADED,l);O.addEventListener(e.JWPLAYER_ERROR,C);O.load(J.config.playlist);break;case"array":J.playlist=new f.playlist(J.config.playlist);m(c)}}function l(O){J.setPlaylist(O.playlist);m(c)}function C(O){v(O.message)}function I(){var P=J.playlist[J.item].image;if(P){var O=new Image();O.addEventListener("load",K,false);O.addEventListener("error",K,false);O.src=P}else{m(j)}}function K(O){m(j)}function M(){o.setup(y);m(b)}function H(){m(a)}function B(){x.sendEvent(e.JWPLAYER_READY);m(g)}function v(O){t=true;x.sendEvent(e.JWPLAYER_ERROR,{message:O})}k.extend(this,x);this.start=E;r()}})(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,p,k){var o={};var d=p;var l=k;var f=true;var j;var n=g;var s=false;function m(){if(typeof n!="string"||n===""){e(a.defaultskin().xml)}else{b.ajax(b.getAbsolutePath(n),function(t){try{if(b.exists(t.responseXML)){e(t.responseXML);return}}catch(u){i()}e(a.defaultskin().xml)},function(t){e(a.defaultskin().xml)})}}function e(y){var E=y.getElementsByTagName("component");if(E.length===0){return}for(var H=0;H<E.length;H++){var C=E[H].getAttribute("name");var B={settings:{},elements:{},layout:{}};o[C]=B;var G=E[H].getElementsByTagName("elements")[0].getElementsByTagName("element");for(var F=0;F<G.length;F++){c(G[F],C)}var z=E[H].getElementsByTagName("settings")[0];if(z&&z.childNodes.length>0){var K=z.getElementsByTagName("setting");for(var P=0;P<K.length;P++){var Q=K[P].getAttribute("name");var I=K[P].getAttribute("value");var x=/color$/.test(Q)?"color":null;o[C].settings[Q]=b.typechecker(I,x)}}var L=E[H].getElementsByTagName("layout")[0];if(L&&L.childNodes.length>0){var M=L.getElementsByTagName("group");for(var w=0;w<M.length;w++){var A=M[w];o[C].layout[A.getAttribute("position")]={elements:[]};for(var O=0;O<A.attributes.length;O++){var D=A.attributes[O];o[C].layout[A.getAttribute("position")][D.name]=D.value}var N=A.getElementsByTagName("*");for(var v=0;v<N.length;v++){var t=N[v];o[C].layout[A.getAttribute("position")].elements.push({type:t.tagName});for(var u=0;u<t.attributes.length;u++){var J=t.attributes[u];o[C].layout[A.getAttribute("position")].elements[v][J.name]=J.value}if(!b.exists(o[C].layout[A.getAttribute("position")].elements[v].name)){o[C].layout[A.getAttribute("position")].elements[v].name=t.tagName}}}}f=false;r()}}function r(){clearInterval(j);if(!s){j=setInterval(function(){q()},100)}}function c(y,x){var w=new Image();var t=y.getAttribute("name");var v=y.getAttribute("src");var A;if(v.indexOf("data:image/png;base64,")===0){A=v}else{var u=b.getAbsolutePath(n);var z=u.substr(0,u.lastIndexOf("/"));A=[z,x,v].join("/")}o[x].elements[t]={height:0,width:0,src:"",ready:false,image:w};w.onload=function(B){h(w,t,x)};w.onerror=function(B){s=true;r();l()};w.src=A}function i(){for(var u in o){var w=o[u];for(var t in w.elements){var x=w.elements[t];var v=x.image;v.onload=null;v.onerror=null;delete x.image;delete w.elements[t]}delete o[u]}}function q(){for(var t in o){if(t!="properties"){for(var u in o[t].elements){if(!o[t].elements[u].ready){return}}}}if(f===false){clearInterval(j);d(o)}}function h(t,v,u){if(o[u]&&o[u].elements[v]){o[u].elements[v].height=t.height;o[u].elements[v].width=t.width;o[u].elements[v].src=t.src;o[u].elements[v].ready=true;r()}else{b.log("Loaded an image for a missing element: "+u+"."+v)}}m()}})(jwplayer.html5);(function(a){var e=jwplayer,c=e.utils,d=e.events,b=d.state;a.video=function(N){var H={abort:u,canplay:o,canplaythrough:u,durationchange:y,emptied:u,ended:u,error:k,loadeddata:u,loadedmetadata:o,loadstart:u,pause:M,play:M,playing:M,progress:u,ratechange:u,readystatechange:u,seeked:u,seeking:u,stalled:u,suspend:u,timeupdate:O,volumechange:i,waiting:r},t={mp4:"video/mp4",webm:"video/webm",m3u8:"audio/x-mpegurl"},z,w,j,S,m,K,R,C,I,A,f=b.IDLE,D=0,l=-1,B=-1,F=new d.eventdispatcher(),q=false;c.extend(this,F);function P(T){j=T;J();j.controls=true;j.controls=false;q=true}function J(){for(var T in H){j.addEventListener(T,H[T],false)}}function p(T,U){if(q){F.sendEvent(T,U)}}function u(T){}function y(T){if(!q){return}if(S<0){S=j.duration}O()}function O(T){if(!q){return}if(f==b.PLAYING&&!A){m=j.currentTime;p(d.JWPLAYER_MEDIA_TIME,{position:m,duration:S});if(m>=S&&S>0){L()}}}function o(T){if(!q){return}if(!R){R=true;n();if(I>0){x(I)}}}function n(){if(!C){C=true;p(d.JWPLAYER_MEDIA_BUFFER_FULL)}}function M(T){if(!q||A){return}if(j.paused){s(b.PAUSED)}else{s(b.PLAYING)}}function r(T){if(!q){return}s(b.BUFFERING)}function k(T){if(!q){return}c.log("Error: %o",j.error);s(b.IDLE)}function g(T){var U=t[c.strings.extension(T)];return(!!U&&j.canPlayType(U))}function E(U){if(U.levels&&U.levels.length>0){for(var T=0;T<U.levels.length;T++){if(g(U.levels[T].file)){return U.levels[T].file}}}else{if(U.file&&g(U.file)){return U.file}}return null}this.load=function(T){if(!q){return}z=T;R=false;C=false;I=0;S=T.duration?T.duration:-1;m=0;w=E(z);if(!w){c.log("Could not find a file to play.");return}s(b.BUFFERING);j.src=w;j.load();l=setInterval(h,100);if(c.isMobile()){j.controls=true}if(c.isIPod()){n()}};var v=this.stop=function(){if(!q){return}j.removeAttribute("src");j.load();clearInterval(l);s(b.IDLE)};this.play=function(){if(q){j.play()}};this.pause=function(){if(q){j.pause()}};this.seekDrag=function(T){if(!q){return}A=T;if(T){j.pause()}else{j.play()}};var x=this.seek=function(T){if(!q){return}if(j.readyState>=j.HAVE_FUTURE_DATA){I=0;if(!A){p(d.JWPLAYER_MEDIA_SEEK,{position:m,offset:T})}j.currentTime=T}else{I=T}};var Q=this.volume=function(T){if(j.muted){j.muted=false}j.volume=T/100};function i(T){p(d.JWPLAYER_MEDIA_VOLUME,{volume:Math.round(j.volume*100)});p(d.JWPLAYER_MEDIA_MUTE,{mute:j.muted})}this.mute=function(T){if(!c.exists(T)){T=!j.mute}if(T){D=j.volume*100;Q(0);j.muted=true}else{Q(D)}};function s(T){if(T==b.PAUSED&&f==b.IDLE){return}if(A){return}if(f!=T){var U=f;f=T;p(d.JWPLAYER_PLAYER_STATE,{oldstate:U,newstate:T})}}function h(){if(!q){return}var T=G();if(T!=B){B=T;p(d.JWPLAYER_MEDIA_BUFFER,{bufferPercent:Math.round(B*100)})}if(T>=1){clearInterval(l)}}function G(){if(j.buffered.length==0||j.duration==0){return 0}else{return j.buffered.end(j.buffered.length-1)/j.duration}}function L(){v();p(d.JWPLAYER_MEDIA_COMPLETE)}this.detachMedia=function(){q=false;return j};this.attachMedia=function(){q=true};this.getTag=function(){return j};P(N)}})(jwplayer.html5);(function(g){var b=jwplayer,h=b.utils,m=h.css,i=jwplayer.events,n=i.state,d=document,k="jwplayer",a=k+".jwfullscreen",l="jwmain",r="jwinstream",q="jwvideo",c="jwcontrols",e="jwplaylist";g.view=function(G,v){var J=G,M=v,K={},S,C,T,L,s=0,H=2000,D,z;this.setup=function(V){J.skin=V;S=P("div",k);S.id=J.id;var U=document.getElementById(J.id);U.parentNode.replaceChild(S,U);C=P("span",l);D=P("span",q);D.appendChild(M.getVideo().getTag());T=P("span",c);z=P("span",r);L=P("span",e);F();C.appendChild(D);C.appendChild(T);C.appendChild(z);S.appendChild(C);S.appendChild(L);d.addEventListener("webkitfullscreenchange",t,false);d.addEventListener("mozfullscreenchange",t,false);d.addEventListener("keydown",y,false);J.jwAddEventListener(i.JWPLAYER_PLAYER_STATE,B);B({newstate:n.IDLE});S.addEventListener("mouseout",I,false);S.addEventListener("mousemove",function(W){x();clearTimeout(s);s=setTimeout(I,H)},false)};function P(V,U){var W=d.createElement(V);if(U){W.className=U}return W}function I(){if(J.jwGetState()==n.PLAYING){E()}clearTimeout(s);s=0}function F(){var V=M.width,U=M.height,W=M.componentConfig("controlbar");displaySettings=M.componentConfig("display");if(U>40||U.indexOf("%")){K.display=new g.display(J,displaySettings);T.appendChild(K.display.getDisplayElement());displaySettings.backgroundcolor=K.display.getBGColor()}else{displaySettings.backgroundcolor="transparent";W.margin=0}m(u(),{"background-color":displaySettings.backgroundcolor});if(M.playlistsize>0&&M.playlistposition&&M.playlistposition!="none"){K.playlist=new g.playlistcomponent(J,{});L.appendChild(K.playlist.getDisplayElement())}A(V,U);if(!h.isMobile()){K.controlbar=new g.controlbar(J,W);T.appendChild(K.controlbar.getDisplayElement())}}var R=this.fullscreen=function(U){if(!h.exists(U)){U=!M.fullscreen}if(U){if(!M.fullscreen){w(true);if(S.requestFullScreen){S.requestFullScreen()}else{if(S.mozRequestFullScreen){S.mozRequestFullScreen()}else{if(S.webkitRequestFullScreen){S.webkitRequestFullScreen()}}}M.setFullscreen(true)}}else{w(false);if(M.fullscreen){if(d.cancelFullScreen){d.cancelFullScreen()}else{if(d.mozCancelFullScreen){d.mozCancelFullScreen()}else{if(d.webkitCancelFullScreen){d.webkitCancelFullScreen()}}}M.setFullscreen(false)}}};function A(W,U){if(h.exists(W)&&h.exists(U)){m(u(),{width:W,height:U});M.width=W;M.height=U}if(K.display){K.display.resize(W,U)}if(K.controlbar){K.controlbar.resize(W,U)}var Y=M.playlistsize,Z=M.playlistposition;if(K.playlist&&Y>0&&Z){K.playlist.resize(W,U);var V={display:"block"},X={};V[Z]=0;X[Z]=Y;if(Z=="left"||Z=="right"){V.width=Y}else{V.height=Y}m(u(e),V);m(u(l),X)}return}this.resize=A;this.completeSetup=function(){m(u(),{opacity:1})};function y(U){switch(U.keyCode){case 27:if(M.fullscreen){R(false)}break;case 32:J.jwPlay();break}}function w(U){if(U){S.className+=" jwfullscreen"}else{S.className=S.className.replace(/\s+jwfullscreen/,"")}}function N(){var U=[d.mozFullScreenElement,d.webkitCurrentFullScreenElement];for(var V=0;V<U.length;V++){if(U[V]&&U[V].id==J.id){return true}}return false}function t(U){M.setFullscreen(N());R(M.fullscreen)}function E(){if(K.controlbar){K.controlbar.hide()}if(K.display){K.display.hide()}}function x(){if(K.controlbar){K.controlbar.show()}if(K.display){K.display.show()}}function B(U){var V={};switch(U.newstate){case n.PLAYING:if(h.isIPod()){V.display="block"}V.opacity=1;m(u(q),V);E();break;case n.COMPLETED:case n.IDLE:if(h.isIPod()){V.display="none"}V.opacity=0;m(u(q),V);x();break;case n.BUFFERING:case n.PAUSED:if(!h.isMobile()){x()}break}}function u(U){return"#"+J.id+(U?" ."+U:"")}this.setupInstream=function(U,V){O(u(r),true);O(u(c),false);z.appendChild(U);_instreamVideo=V;B({newstate:n.PLAYING});_instreamMode=true};var Q=this.destroyInstream=function(){O(u(r),false);O(u(c),true);z.innerHTML="";_instreamVideo=null;_instreamMode=false;A(M.width,M.height)};function O(U,V){m(U,{display:V?"block":"none"})}};var p="opacity .5s ease",j="100%",f="absolute",o=" !important";m("."+k,{position:"relative",overflow:"hidden",opacity:0,"-webkit-transition":p,"-moz-transition":p,"-o-transition":p});m("."+l,{position:f,left:0,right:0,top:0,bottom:0,"-webkit-transition":p,"-moz-transition":p,"-o-transition":p});m("."+q+" ,."+c,{position:f,height:j,width:j,"-webkit-transition":p,"-moz-transition":p,"-o-transition":p});m("."+q+" video",{background:"transparent",width:j,height:j});m("."+e,{position:f,height:j,width:j,display:"none"});m("."+r,{overflow:"hidden",position:f,top:0,left:0,bottom:0,right:0,display:"none"});m(a,{width:j,height:j,"z-index":1000,position:"fixed"},true);m(a+" ."+l,{left:0,right:0,top:0,bottom:0},true);m(a+" ."+e,{display:"none"},true);m("."+k+" .jwuniform",{"background-size":"contain"+o});m("."+k+" .jwfill",{"background-size":"cover"+o});m("."+k+" .jwexactfit",{"background-size":j+o});m("."+k+" .jwnone",{"background-size":null})})(jwplayer.html5)}; 
  • branches/jw6/src/js/html5/jwplayer.html5.controlbar.js

    r2180 r2184  
    119119                        _id, 
    120120                        _duration, 
     121                        _position, 
    121122                        _currentVolume, 
    122123                        _dragging = false, 
     
    154155 
    155156                        _id = _api.id + "_controlbar"; 
    156                         _duration = 0; 
     157                        _duration = _position = 0; 
    157158 
    158159                        _controlbar = _createSpan(); 
     
    166167                        _skin = _api.skin; 
    167168                         
    168                         _settings = _utils.extend({}, _defaults, config); 
     169                        _settings = _utils.extend({}, _defaults, _skin.getComponentSettings('controlbar'), config); 
    169170                        _layout = _skin.getComponentLayout('controlbar'); 
    170171                        if (!_layout) _layout = _defaults.layout; 
     
    172173                        _buildControlbar(); 
    173174                        _addEventListeners(); 
     175                        _playlistHandler(); 
    174176                } 
    175177                 
     
    181183                        _api.jwAddEventListener(jwplayer.events.JWPLAYER_MEDIA_BUFFER, _bufferHandler); 
    182184                        _api.jwAddEventListener(jwplayer.events.JWPLAYER_FULLSCREEN, _fullscreenHandler); 
     185                        _api.jwAddEventListener(jwplayer.events.JWPLAYER_PLAYLIST_LOADED, _playlistHandler); 
    183186                } 
    184187                 
    185188                function _timeUpdated(evt) { 
    186                         _duration = evt.duration; 
     189                        var refreshRequired = false, 
     190                                timeString; 
    187191                         
    188192                        if (_elements.elapsed) { 
    189                                 _elements.elapsed.innerHTML = _utils.timeFormat(evt.position); 
     193                                timeString = _utils.timeFormat(evt.position); 
     194                                _elements.elapsed.innerHTML = timeString; 
     195                                refreshRequired = (timeString.length != _utils.timeFormat(_position).length); 
    190196                        } 
    191197                        if (_elements.duration) { 
    192                                 _elements.duration.innerHTML = _utils.timeFormat(evt.duration); 
     198                                timeString = _utils.timeFormat(evt.duration); 
     199                                _elements.duration.innerHTML = timeString; 
     200                                refreshRequired = (refreshRequired || (timeString.length != _utils.timeFormat(_duration).length)); 
    193201                        } 
    194202                        if (evt.duration > 0) { 
     
    197205                                _setProgress(0); 
    198206                        } 
     207                        _duration = evt.duration; 
     208                        _position = evt.position; 
     209                         
     210                        if (refreshRequired) _resize(); 
    199211                } 
    200212                 
     
    247259                        _toggleButton("fullscreen", evt.fullscreen); 
    248260                } 
     261                 
     262                function _playlistHandler(evt) { 
     263                        if (_api.jwGetPlaylist().length < 2) { 
     264                                _css(_internalSelector(".jwnext"), { display: "none" }); 
     265                                _css(_internalSelector(".jwprev"), { display: "none" }); 
     266                        } else { 
     267                                _css(_internalSelector(".jwnext"), { display: undefined }); 
     268                                _css(_internalSelector(".jwprev"), { display: undefined }); 
     269                        } 
     270                        _resize(); 
     271                } 
    249272 
    250273                /** 
     
    273296                 
    274297                function _internalSelector(name) { 
    275                         return '#' + _id + " " + name; 
     298                        return '#' + _id + (name ? " " + name : ""); 
    276299                } 
    277300 
     
    674697                function _setBuffer(pct) { 
    675698                        pct = Math.min(Math.max(0, pct), 1); 
    676                         _css(_internalSelector('.jwtimeSliderBuffer'), { width: pct * 100 + "%" }); 
    677                 } 
    678  
    679                 function _sliderPercent(prefix, pct, fixedWidth) { 
     699                        //_css(_internalSelector('.jwtimeSliderBuffer'), { width: pct * 100 + "%" }); 
     700                        if (_elements.timeSliderBuffer) { 
     701                                _elements.timeSliderBuffer.style.width = pct * 100 + "%"; 
     702                        } 
     703                } 
     704 
     705                function _sliderPercent(name, pct, fixedWidth) { 
    680706                        var width = 100 * Math.min(Math.max(0, pct), 1) + "%"; 
    681                         _css(_internalSelector(prefix+'Progress'), { width: width }); 
    682                         _css(_internalSelector(prefix+'Thumb'), { left: width }); 
     707                         
     708                        //_css(_internalSelector(prefix+'Progress'), { width: width }); 
     709                        //_css(_internalSelector(prefix+'Thumb'), { left: width }); 
     710                         
     711                        // Set style directly on the elements; Using the stylesheets results in some flickering in Chrome. 
     712                        if (_elements[name+'SliderProgress']) { 
     713                                _elements[name+'SliderProgress'].style.width = width; 
     714                        } 
     715                        if (_elements[name+'SliderThumb']) { 
     716                                _elements[name+'SliderThumb'].style.left = width; 
     717                        } 
    683718                } 
    684719                 
    685720                function _setVolume (pct) { 
    686                         _sliderPercent('.jwvolumeSlider', pct, true); 
     721                        _sliderPercent('volume', pct, true); 
    687722                } 
    688723 
    689724                function _setProgress(pct) { 
    690                         _sliderPercent('.jwtimeSlider', pct); 
     725                        _sliderPercent('time', pct); 
    691726                } 
    692727 
  • branches/jw6/src/js/html5/jwplayer.html5.controller.js

    r2180 r2184  
    5252                } 
    5353                 
     54                var _preplay, _actionOnAttach, _interruptPlay; 
     55                 
    5456                function _play() { 
    55                         if (_model.state == _states.IDLE) { 
    56                                 _video.load(_model.playlist[_model.item]); 
    57                         } else if (_model.state == _states.PAUSED) { 
    58                                 _video.play(); 
    59                         } 
     57                        try { 
     58                                _actionOnAttach = _play; 
     59                                if (!_preplay) { 
     60                                        _preplay = true; 
     61                                        _eventDispatcher.sendEvent(_events.JWPLAYER_MEDIA_BEFOREPLAY); 
     62                                        _preplay = false; 
     63                                        if (_interruptPlay) { 
     64                                                _interruptPlay = false; 
     65                                                _actionOnAttach = null; 
     66                                                return; 
     67                                        } 
     68                                } 
     69                                 
     70                                if (_model.state == _states.IDLE) { 
     71                                        _video.load(_model.playlist[_model.item]); 
     72                                } else if (_model.state == _states.PAUSED) { 
     73                                        _video.play(); 
     74                                } 
     75                                 
     76                                return true; 
     77                        } catch (err) { 
     78                                _eventDispatcher.sendEvent(_events.JWPLAYER_ERROR, err); 
     79                                _actionOnAttach = null; 
     80                        } 
     81                        return false; 
    6082                } 
    6183 
    6284                function _stop() { 
    63                         _video.stop(); 
     85                        _actionOnAttach = null; 
     86                        try { 
     87                                _video.stop(); 
     88                                if (_preplay) { 
     89                                        _interruptPlay = true; 
     90                                } 
     91                                return true; 
     92                        } catch (err) { 
     93                                _eventDispatcher.sendEvent(_events.JWPLAYER_ERROR, err); 
     94                        } 
     95                        return false; 
     96 
    6497                } 
    6598 
    6699                function _pause() { 
     100                        try { 
     101                                switch (_model.state) { 
     102                                        case _states.PLAYING: 
     103                                        case _states.BUFFERING: 
     104                                                _video.pause(); 
     105                                                break; 
     106                                        default: 
     107                                                if (_preplay) { 
     108                                                        _interruptPlay = true; 
     109                                                } 
     110                                } 
     111                                return true; 
     112                        } catch (err) { 
     113                                _eventDispatcher.sendEvent(_events.JWPLAYER_ERROR, err); 
     114                        } 
     115                        return false; 
     116 
     117                         
    67118                        if (_model.state == _states.PLAYING || _model.state == _states.BUFFERING) { 
    68119                                _video.pause(); 
     
    113164                } 
    114165                 
     166                /** Used for the InStream API **/ 
     167                function _detachMedia() { 
     168                        try { 
     169                                return _model.getVideo().detachMedia(); 
     170                        } catch (err) { 
     171                                return null; 
     172                        } 
     173                } 
     174 
     175                function _attachMedia() { 
     176                        try { 
     177                                var ret = _model.getVideo().attachMedia(); 
     178                                if (typeof _actionOnAttach == "function") { 
     179                                        _actionOnAttach(); 
     180                                } 
     181                        } catch (err) { 
     182                                return null; 
     183                        } 
     184                } 
     185                 
     186                /** Controller API / public methods **/ 
    115187                this.play = _waitForReady(_play); 
    116188                this.pause = _waitForReady(_pause); 
     
    125197                this.setFullscreen = _waitForReady(_setFullscreen); 
    126198                this.setStretching = _waitForReady(_setStretching); 
    127                  
    128 /*              this.playerReady = _playerReady; 
    129199                this.detachMedia = _detachMedia;  
    130200                this.attachMedia = _attachMedia; 
    131                 this.beforePlay = function() {  
    132                         return _preplay;  
    133                 } 
    134 */               
    135                  
     201                 
     202//              this.playerReady = _playerReady; 
     203//              this.beforePlay = function() {  
     204//                      return _preplay;  
     205//              } 
     206 
    136207                _init(); 
    137208        } 
  • branches/jw6/src/js/html5/jwplayer.html5.display.js

    r2180 r2184  
    4242                        _config = _utils.extend({ 
    4343                                backgroundcolor: '#000' 
    44                         }, config); 
     44                        }, _skin.getComponentSettings('display'), config); 
    4545                        _bufferRotation = !_utils.exists(_config.bufferrotation) ? 15 : parseInt(_config.bufferrotation, 10),  
    4646                        _bufferInterval = !_utils.exists(_config.bufferinterval) ? 100 : parseInt(_config.bufferinterval, 10); 
     
    246246                } 
    247247 
     248                this.getBGColor = function() { 
     249                        return _config.backgroundcolor; 
     250                } 
     251                 
     252                /** NOT SUPPORTED : Using this for now to hack around instream API **/ 
     253                this.setAlternateClickHandler = function(handler) { 
     254                        _alternateClickHandler = handler; 
     255                } 
     256                this.revertAlternateClickHandler = function() { 
     257                        _alternateClickHandler = undefined; 
     258                } 
     259 
    248260                _init(); 
    249261        }; 
  • branches/jw6/src/js/html5/jwplayer.html5.model.js

    r2181 r2184  
    2828                                repeat: "", 
    2929                                playlistsize: 0, 
     30                                playlistposition: "right", 
    3031                                stretching: _utils.stretching.UNIFORM, 
    3132                                autostart: false, 
     
    115116                } 
    116117                 
     118                this.componentConfig = function(name) { 
     119                        return {}; 
     120                } 
     121                 
    117122                _init(); 
    118123        } 
  • branches/jw6/src/js/html5/jwplayer.html5.player.js

    r2180 r2184  
    7777 
    7878                 
     79                /** InStream API **/ 
     80                this.jwDetachMedia = _controller.detachMedia; 
     81                this.jwAttachMedia = _controller.attachMedia; 
     82                 
     83                var _instreamPlayer; 
     84                 
     85                this.jwLoadInstream = function(item, options) { 
     86                        if (!_instreamPlayer) { 
     87                                _instreamPlayer = new html5.instream(_api, _model, _view, _controller); 
     88                        } 
     89                        setTimeout(function() { 
     90                                _instreamPlayer.load(item, options); 
     91                        }, 10); 
     92                } 
     93                 
     94                this.jwInstreamDestroy = function() { 
     95                        if (_instreamPlayer) { 
     96                                _instreamPlayer.jwInstreamDestroy(); 
     97                        } 
     98                } 
     99                 
     100                /** Events **/ 
    79101                this.jwAddEventListener = _controller.addEventListener; 
    80102                this.jwRemoveEventListener = _controller.removeEventListener; 
     103                 
    81104                 
    82105                _init(); 
  • branches/jw6/src/js/html5/jwplayer.html5.video.js

    r2180 r2184  
    7878                _bufferPercent = -1, 
    7979                // Event dispatcher 
    80                 _eventDispatcher = new _events.eventdispatcher(); 
    81  
     80                _eventDispatcher = new _events.eventdispatcher(), 
     81                // Whether or not we're listening to video tag events 
     82                _attached = false; 
     83                 
    8284                _utils.extend(this, _eventDispatcher); 
    8385 
     
    9092                        _video.controls = true; 
    9193                        _video.controls = false; 
     94                         
     95                        _attached = true; 
    9296                } 
    9397 
     
    99103 
    100104                function _sendEvent(type, data) { 
    101                         _eventDispatcher.sendEvent(type, data); 
     105                        if (_attached) { 
     106                                _eventDispatcher.sendEvent(type, data); 
     107                        } 
    102108                } 
    103109 
     
    108114 
    109115                function _durationUpdateHandler(evt) { 
    110                         _duration = _video.duration; 
     116                        if (!_attached) return; 
     117                        if (_duration < 0) _duration = _video.duration; 
    111118                        _timeUpdateHandler(); 
    112119                } 
    113120 
    114121                function _timeUpdateHandler(evt) { 
     122                        if (!_attached) return; 
    115123                        if (_state == _states.PLAYING && !_dragging) { 
    116124                                _position = _video.currentTime; 
     
    126134 
    127135                function _canPlayHandler(evt) { 
     136                        if (!_attached) return; 
    128137                        if (!_canSeek) { 
    129138                                _canSeek = true; 
     
    143152 
    144153                function _playHandler(evt) { 
    145                         if (_dragging) return; 
     154                        if (!_attached || _dragging) return; 
    146155                         
    147156                        if (_video.paused) { 
     
    153162                 
    154163                function _bufferStateHandler(evt) { 
     164                        if (!_attached) return; 
    155165                        _setState(_states.BUFFERING); 
    156166                } 
    157167 
    158168                function _errorHandler(evt) { 
     169                        if (!_attached) return; 
    159170                        _utils.log("Error: %o", _video.error); 
    160171                        _setState(_states.IDLE); 
     
    180191                 
    181192                this.load = function(item) { 
     193                        if (!_attached) return; 
     194 
    182195                        _item = item; 
    183196                        _canSeek = false; 
    184197                        _bufferFull = false; 
    185198                        _delayedSeek = 0; 
    186                         _duration = 0; 
     199                        _duration = item.duration ? item.duration : -1; 
    187200                        _position = 0; 
    188201                         
     
    211224 
    212225                var _stop = this.stop = function() { 
     226                        if (!_attached) return; 
    213227                        _video.removeAttribute("src"); 
    214228                        _video.load(); 
     
    218232 
    219233                this.play = function() { 
    220                         _video.play(); 
     234                        if (_attached) _video.play(); 
    221235                } 
    222236 
    223237                this.pause = function() { 
    224                         _video.pause(); 
     238                        if (_attached) _video.pause(); 
    225239                } 
    226240 
    227241                this.seekDrag = function(state) { 
     242                        if (!_attached) return;  
    228243                        _dragging = state; 
    229244                        if (state) _video.pause(); 
     
    232247                 
    233248                var _seek = this.seek = function(pos) { 
    234                         if (_canSeek) { 
     249                        if (!_attached) return;  
     250                        if (_video.readyState >= _video.HAVE_FUTURE_DATA) { 
    235251                                _delayedSeek = 0; 
    236252                                if (!_dragging) { 
     
    293309                 
    294310                function _sendBufferUpdate() { 
     311                        if (!_attached) return;  
    295312                        var newBuffer = _getBuffer(); 
    296313                        if (newBuffer != _bufferPercent) { 
     
    318335                } 
    319336                 
     337 
     338                /** 
     339                 * Return the video tag and stop listening to events   
     340                 */ 
     341                this.detachMedia = function() { 
     342                        _attached = false; 
     343                        return _video; 
     344                } 
     345                 
     346                /** 
     347                 * Begin listening to events again   
     348                 */ 
     349                this.attachMedia = function() { 
     350                        _attached = true; 
     351                } 
     352                 
    320353                // Provide access to video tag 
    321                 // TODO: remove 
     354                // TODO: remove; used by InStream 
    322355                this.getTag = function() { 
    323                         return videotag; 
     356                        return _video; 
    324357                } 
    325358 
  • branches/jw6/src/js/html5/jwplayer.html5.view.js

    r2181 r2184  
    1313 
    1414                DOCUMENT = document,  
    15                 VIEW_CONTAINER_CLASS = "jwplayer",  
    16                 VIEW_VIDEO_CONTAINER_CLASS = "jwvideocontainer",  
    17                 VIEW_CONTROLS_CONTAINER_CLASS = "jwcontrolscontainer", 
    18                 VIEW_PLAYLIST_CONTAINER_CLASS = "jwplaylistcontainer"; 
    19  
     15                PLAYER_CLASS = "jwplayer",  
     16                FULLSCREEN_SELECTOR = PLAYER_CLASS+".jwfullscreen", 
     17                VIEW_MAIN_CONTAINER_CLASS = "jwmain", 
     18                VIEW_INSTREAM_CONTAINER_CLASS = "jwinstream", 
     19                VIEW_VIDEO_CONTAINER_CLASS = "jwvideo",  
     20                VIEW_CONTROLS_CONTAINER_CLASS = "jwcontrols", 
     21                VIEW_PLAYLIST_CONTAINER_CLASS = "jwplaylist"; 
     22                 
    2023        html5.view = function(api, model) { 
    2124                var _api = api,  
    2225                        _model = model,  
    2326                        _controls = {}, 
     27                        _playerElement, 
    2428                        _container, 
    2529                        _controlsLayer, 
     
    2731                        _controlsTimeout=0, 
    2832                        _timeoutDuration = 2000, 
    29                         _videoLayer; 
     33                        _videoLayer, 
     34                        _instreamLayer; 
    3035 
    3136                this.setup = function(skin) { 
    3237                        _api.skin = skin; 
    3338                         
    34                         _container = DOCUMENT.createElement("div"); 
    35                         _container.className = VIEW_CONTAINER_CLASS; 
    36                         _container.id = _api.id; 
     39                        _playerElement = _createElement("div", PLAYER_CLASS); 
     40                        _playerElement.id = _api.id; 
    3741                         
    3842                        var replace = document.getElementById(_api.id); 
    39                         replace.parentNode.replaceChild(_container, replace); 
    40  
    41                         _videoLayer = DOCUMENT.createElement("span"); 
    42                         _videoLayer.className = VIEW_VIDEO_CONTAINER_CLASS; 
     43                        replace.parentNode.replaceChild(_playerElement, replace); 
     44                         
     45                        _container = _createElement("span", VIEW_MAIN_CONTAINER_CLASS); 
     46                        _videoLayer = _createElement("span", VIEW_VIDEO_CONTAINER_CLASS); 
    4347                        _videoLayer.appendChild(_model.getVideo().getTag()); 
    44  
    45                         _controlsLayer = DOCUMENT.createElement("span"); 
    46                         _controlsLayer.className = VIEW_CONTROLS_CONTAINER_CLASS; 
    47  
    48                         _playlistLayer = DOCUMENT.createElement("span"); 
    49                         _playlistLayer.className = VIEW_PLAYLIST_CONTAINER_CLASS; 
     48                        _controlsLayer = _createElement("span", VIEW_CONTROLS_CONTAINER_CLASS); 
     49                        _instreamLayer = _createElement("span", VIEW_INSTREAM_CONTAINER_CLASS); 
     50                        _playlistLayer = _createElement("span", VIEW_PLAYLIST_CONTAINER_CLASS); 
    5051 
    5152                        _setupControls(); 
     
    5354                        _container.appendChild(_videoLayer); 
    5455                        _container.appendChild(_controlsLayer); 
    55                         _container.appendChild(_playlistLayer); 
     56                        _container.appendChild(_instreamLayer); 
     57                        _playerElement.appendChild(_container); 
     58                        _playerElement.appendChild(_playlistLayer); 
    5659                         
    5760                        DOCUMENT.addEventListener('webkitfullscreenchange', _fullscreenChangeHandler, false); 
     
    6366                        _stateHandler({newstate:_states.IDLE}); 
    6467                         
    65                         _container.addEventListener('mouseout', _fadeControls, false); 
    66                         _container.addEventListener('mousemove', function(evt) { 
     68                        _playerElement.addEventListener('mouseout', _fadeControls, false); 
     69                        _playerElement.addEventListener('mousemove', function(evt) { 
    6770                                _showControls(); 
    6871                                clearTimeout(_controlsTimeout); 
     
    7275                } 
    7376         
     77                function _createElement(elem, className) { 
     78                        var newElement = DOCUMENT.createElement(elem); 
     79                        if (className) newElement.className = className; 
     80                        return newElement; 
     81                } 
     82                 
    7483                function _fadeControls() { 
    7584                        if (_api.jwGetState() == _states.PLAYING) { 
     
    8392                        var width = _model.width, 
    8493                                height = _model.height, 
    85                                 cbSettings = _api.skin.getComponentSettings('controlbar'), 
    86                                 displaySettings = _api.skin.getComponentSettings('display') 
     94                                cbSettings = _model.componentConfig('controlbar'); 
     95                                displaySettings = _model.componentConfig('display'); 
    8796                 
    8897                        if (height > 40 || height.indexOf("%")) { 
    8998                                _controls.display = new html5.display(_api, displaySettings); 
    9099                                _controlsLayer.appendChild(_controls.display.getDisplayElement()); 
     100                                displaySettings.backgroundcolor = _controls.display.getBGColor(); 
    91101                        } else { 
    92102                                displaySettings.backgroundcolor = 'transparent'; 
    93103                                cbSettings.margin = 0; 
    94104                        } 
    95                          
    96                         if (_model.playlistsize > 0) { 
     105                        _css(_internalSelector(), { 
     106                                'background-color': displaySettings.backgroundcolor 
     107                        }); 
     108                         
     109                        if (_model.playlistsize > 0 && _model.playlistposition && _model.playlistposition != "none") { 
    97110                                _controls.playlist = new html5.playlistcomponent(_api, {}); 
    98111                                _playlistLayer.appendChild(_controls.playlist.getDisplayElement()); 
     
    100113 
    101114                        _resize(width, height); 
    102                          
    103                         _css('#'+_container.id, { 
    104                                 'background-color': displaySettings.backgroundcolor ? displaySettings.backgroundcolor : 0 
    105                         }); 
    106115 
    107116                        if (!_utils.isMobile()) { 
     
    122131                        if (state) { 
    123132                                if (!_model.fullscreen) { 
    124                                         if (_container.requestFullScreen) { 
    125                                                 _container.requestFullScreen(); 
    126                                         } else if (_container.mozRequestFullScreen) { 
    127                                                 _container.mozRequestFullScreen(); 
    128                                         } else if (_container.webkitRequestFullScreen) { 
    129                                                 _container.webkitRequestFullScreen(); 
    130                                         } else { 
    131                                                 _fakeFullscreen(true); 
     133                                        _fakeFullscreen(true); 
     134                                        if (_playerElement.requestFullScreen) { 
     135                                                _playerElement.requestFullScreen(); 
     136                                        } else if (_playerElement.mozRequestFullScreen) { 
     137                                                _playerElement.mozRequestFullScreen(); 
     138                                        } else if (_playerElement.webkitRequestFullScreen) { 
     139                                                _playerElement.webkitRequestFullScreen(); 
    132140                                        } 
    133                                 } 
    134                                 _model.setFullscreen(true); 
     141                                        _model.setFullscreen(true); 
     142                                } 
    135143                        } else { 
    136144                        _fakeFullscreen(false); 
    137                             if (DOCUMENT.cancelFullScreen) {   
    138                                 DOCUMENT.cancelFullScreen();   
    139                             } else if (DOCUMENT.mozCancelFullScreen) {   
    140                                 DOCUMENT.mozCancelFullScreen();   
    141                             } else if (DOCUMENT.webkitCancelFullScreen) {   
    142                                 DOCUMENT.webkitCancelFullScreen();   
    143                             } 
    144                                 _model.setFullscreen(false); 
     145                                if (_model.fullscreen) { 
     146                                    if (DOCUMENT.cancelFullScreen) {   
     147                                        DOCUMENT.cancelFullScreen();   
     148                                    } else if (DOCUMENT.mozCancelFullScreen) {   
     149                                        DOCUMENT.mozCancelFullScreen();   
     150                                    } else if (DOCUMENT.webkitCancelFullScreen) {   
     151                                        DOCUMENT.webkitCancelFullScreen();   
     152                                    } 
     153                                        _model.setFullscreen(false); 
     154                                } 
    145155                        } 
    146156                } 
     
    151161                function _resize(width, height) { 
    152162                        if (_utils.exists(width) && _utils.exists(height)) { 
    153                                 _css('#'+_container.id, { 
     163                                _css(_internalSelector(), { 
    154164                                        width: width, 
    155165                                        height: height 
     
    165175                                _controls.controlbar.resize(width, height); 
    166176                        } 
    167                         if (_controls.playlist && _model.playlistsize > 0) { 
     177                        var playlistSize = _model.playlistsize, 
     178                                playlistPos = _model.playlistposition 
     179                         
     180                        if (_controls.playlist && playlistSize > 0 && playlistPos) { 
    168181                                _controls.playlist.resize(width, height); 
    169                                 _css('#'+_container.id+' .' + VIEW_PLAYLIST_CONTAINER_CLASS, { 
    170                                         right: 0, 
    171                                         width: _model.playlistsize  
    172                                 }); 
    173                                 _css('#'+_container.id + ' .' + VIEW_VIDEO_CONTAINER_CLASS + ',#'+_container.id+' .'+ VIEW_CONTROLS_CONTAINER_CLASS, { 
    174                                         right: _model.playlistsize 
    175                                 }); 
     182                                 
     183                                var playlistStyle = { display: "block" }, containerStyle = {}; 
     184                                playlistStyle[playlistPos] = 0; 
     185                                containerStyle[playlistPos] = playlistSize; 
     186                                 
     187                                if (playlistPos == "left" || playlistPos == "right") { 
     188                                        playlistStyle.width = playlistSize; 
     189                                } else { 
     190                                        playlistStyle.height = playlistSize; 
     191                                } 
     192                                 
     193                                _css(_internalSelector(VIEW_PLAYLIST_CONTAINER_CLASS), playlistStyle); 
     194                                _css(_internalSelector(VIEW_MAIN_CONTAINER_CLASS), containerStyle); 
    176195                        } 
    177196 
     
    182201 
    183202                this.completeSetup = function() { 
    184                         _css('#'+_container.id, {opacity: 1}); 
     203                        _css(_internalSelector(), {opacity: 1}); 
    185204                } 
    186205                 
     
    209228                function _fakeFullscreen(state) { 
    210229                        if (state) { 
    211                                 _container.className += " jwfullscreen"; 
     230                                _playerElement.className += " jwfullscreen"; 
    212231                        } else { 
    213                                 _container.className = _container.className.replace(/\s+jwfullscreen/, ""); 
     232                                _playerElement.className = _playerElement.className.replace(/\s+jwfullscreen/, ""); 
    214233                        } 
    215234                } 
     
    219238                 */ 
    220239                function _isNativeFullscreen() { 
    221                         if (DOCUMENT.mozFullScreenElement) return DOCUMENT.mozFullScreenElement.id == _container.id;  
    222                         else if (DOCUMENT.webkitCurrentFullScreenElement) return DOCUMENT.webkitCurrentFullScreenElement.id == _container.id;  
    223                         else return false; 
     240                        var fsElements = [DOCUMENT.mozFullScreenElement, DOCUMENT.webkitCurrentFullScreenElement]; 
     241                        for (var i=0; i<fsElements.length; i++) { 
     242                                if (fsElements[i] && fsElements[i].id == _api.id) 
     243                                        return true; 
     244                        } 
     245                        return false; 
    224246                } 
    225247                 
     
    249271                        switch(evt.newstate) { 
    250272                        case _states.PLAYING: 
    251                                 if (_utils.isIPod) { 
     273                                if (_utils.isIPod()) { 
    252274                                        vidstyle.display = "block"; 
    253275                                } 
    254276                                vidstyle.opacity = 1; 
    255                                 _css('#'+_container.id+' .'+VIEW_VIDEO_CONTAINER_CLASS, vidstyle); 
     277                                _css(_internalSelector(VIEW_VIDEO_CONTAINER_CLASS), vidstyle); 
    256278                                _hideControls(); 
    257279                                break; 
    258280                        case _states.COMPLETED: 
    259281                        case _states.IDLE: 
    260                                 if (_utils.isIPod) { 
     282                                if (_utils.isIPod()) { 
    261283                                        vidstyle.display = "none"; 
    262284                                } 
    263285                                vidstyle.opacity = 0; 
    264                                 _css('#'+_container.id+' .'+VIEW_VIDEO_CONTAINER_CLASS, vidstyle); 
     286                                _css(_internalSelector(VIEW_VIDEO_CONTAINER_CLASS), vidstyle); 
    265287                                _showControls(); 
    266288                                break; 
     
    273295                        } 
    274296                } 
     297                 
     298                function _internalSelector(className) { 
     299                        return '#' + _api.id + (className ? " ." + className : ""); 
     300                } 
     301                 
     302                this.setupInstream = function(instreamDisplay, instreamVideo) { 
     303                        _setVisibility(_internalSelector(VIEW_INSTREAM_CONTAINER_CLASS), true); 
     304                        _setVisibility(_internalSelector(VIEW_CONTROLS_CONTAINER_CLASS), false); 
     305                        _instreamLayer.appendChild(instreamDisplay); 
     306                        _instreamVideo = instreamVideo; 
     307                        _stateHandler({newstate:_states.PLAYING}); 
     308                        _instreamMode = true; 
     309                } 
     310                 
     311                var _destroyInstream = this.destroyInstream = function() { 
     312                        _setVisibility(_internalSelector(VIEW_INSTREAM_CONTAINER_CLASS), false); 
     313                        _setVisibility(_internalSelector(VIEW_CONTROLS_CONTAINER_CLASS), true); 
     314                        _instreamLayer.innerHTML = ""; 
     315                        _instreamVideo = null; 
     316                        _instreamMode = false; 
     317                        _resize(_model.width, _model.height); 
     318                } 
     319                 
     320                function _setVisibility(selector, state) { 
     321                        _css(selector, { display: state ? "block" : "none" }); 
     322                } 
     323 
     324                 
    275325        } 
    276326 
     
    280330         *************************************************************/ 
    281331 
    282         var JW_CSS_SMOOTH_EASE = "opacity .5s ease"; 
     332        var JW_CSS_SMOOTH_EASE = "opacity .5s ease", 
     333                JW_CSS_100PCT = "100%", 
     334                //JW_CSS_RELATIVE = "relative", 
     335                JW_CSS_ABSOLUTE = "absolute", 
     336                JW_CSS_IMPORTANT = " !important"; 
    283337 
    284338         
    285339        // Container styles 
    286         _css('.' + VIEW_CONTAINER_CLASS, { 
    287                 position : "relative", 
     340        _css('.' + PLAYER_CLASS, { 
     341                position: "relative", 
    288342                overflow: "hidden", 
    289343                opacity: 0, 
     
    293347        }); 
    294348 
    295         _css('.' + VIEW_VIDEO_CONTAINER_CLASS + ' ,.'+ VIEW_CONTROLS_CONTAINER_CLASS, { 
    296                 position : "absolute", 
    297                 left: 0, 
    298                 right: 0, 
    299                 height : "100%", 
    300         '-webkit-transition': JW_CSS_SMOOTH_EASE, 
    301         '-moz-transition': JW_CSS_SMOOTH_EASE, 
    302         '-o-transition': JW_CSS_SMOOTH_EASE 
    303         }); 
    304  
    305         _css('.' + VIEW_VIDEO_CONTAINER_CLASS + " video", { 
    306                 background : "transparent", 
    307                 width : "100%", 
    308                 height : "100%" 
    309         }); 
    310  
    311         _css('.' + VIEW_PLAYLIST_CONTAINER_CLASS, { 
    312                 position: "absolute", 
    313                 height : "100%" 
    314         }); 
    315  
    316          
    317         // Fullscreen styles 
    318          
    319         _css('.' + VIEW_CONTAINER_CLASS+':-webkit-full-screen', { 
    320                 width: "100% !important", 
    321                 height: "100% !important" 
    322         }); 
    323          
    324         _css('.' + VIEW_CONTAINER_CLASS+':-moz-full-screen', { 
    325                 width: "100% !important", 
    326                 height: "100% !important" 
    327         }); 
    328          
    329         _css('.' + VIEW_CONTAINER_CLASS+'.jwfullscreen', { 
     349        _css('.' + VIEW_MAIN_CONTAINER_CLASS, { 
     350                position : JW_CSS_ABSOLUTE, 
    330351                left: 0, 
    331352                right: 0, 
    332353                top: 0, 
    333354                bottom: 0, 
     355        '-webkit-transition': JW_CSS_SMOOTH_EASE, 
     356        '-moz-transition': JW_CSS_SMOOTH_EASE, 
     357        '-o-transition': JW_CSS_SMOOTH_EASE 
     358        }); 
     359 
     360        _css('.' + VIEW_VIDEO_CONTAINER_CLASS + ' ,.'+ VIEW_CONTROLS_CONTAINER_CLASS, { 
     361                position : JW_CSS_ABSOLUTE, 
     362                height : JW_CSS_100PCT, 
     363                width: JW_CSS_100PCT, 
     364        '-webkit-transition': JW_CSS_SMOOTH_EASE, 
     365        '-moz-transition': JW_CSS_SMOOTH_EASE, 
     366        '-o-transition': JW_CSS_SMOOTH_EASE 
     367        }); 
     368 
     369        _css('.' + VIEW_VIDEO_CONTAINER_CLASS + " video", { 
     370                background : "transparent", 
     371                width : JW_CSS_100PCT, 
     372                height : JW_CSS_100PCT 
     373        }); 
     374 
     375        _css('.' + VIEW_PLAYLIST_CONTAINER_CLASS, { 
     376                position: JW_CSS_ABSOLUTE, 
     377                height : JW_CSS_100PCT, 
     378                width: JW_CSS_100PCT, 
     379                display: "none" 
     380        }); 
     381         
     382        _css('.' + VIEW_INSTREAM_CONTAINER_CLASS, { 
     383                overflow: "hidden", 
     384                position: JW_CSS_ABSOLUTE, 
     385                top: 0, 
     386                left: 0, 
     387                bottom: 0, 
     388                right: 0, 
     389                display: 'none' 
     390        }); 
     391 
     392         
     393 
     394        // Fullscreen styles 
     395         
     396        _css(FULLSCREEN_SELECTOR, { 
     397                width: JW_CSS_100PCT, 
     398                height: JW_CSS_100PCT, 
    334399                'z-index': 1000, 
    335                 position: "fixed !important" 
    336         }); 
    337  
    338         _css('.' + VIEW_CONTAINER_CLASS+' .jwuniform', { 
    339                 'background-size': 'contain !important' 
    340         }); 
    341  
    342         _css('.' + VIEW_CONTAINER_CLASS+' .jwfill', { 
    343                 'background-size': 'cover !important' 
    344         }); 
    345  
    346         _css('.' + VIEW_CONTAINER_CLASS+' .jwexactfit', { 
    347                 'background-size': '100% 100% !important' 
    348         }); 
    349  
    350         _css('.' + VIEW_CONTAINER_CLASS+' .jwnone', { 
     400                position: "fixed" 
     401        }, true); 
     402 
     403        _css(FULLSCREEN_SELECTOR + ' .'+ VIEW_MAIN_CONTAINER_CLASS, { 
     404                left: 0,  
     405                right: 0, 
     406                top: 0, 
     407                bottom: 0 
     408        }, true); 
     409 
     410        _css(FULLSCREEN_SELECTOR + ' .'+ VIEW_PLAYLIST_CONTAINER_CLASS, { 
     411                display: "none" 
     412        }, true); 
     413         
     414        _css('.' + PLAYER_CLASS+' .jwuniform', { 
     415                'background-size': 'contain' + JW_CSS_IMPORTANT 
     416        }); 
     417 
     418        _css('.' + PLAYER_CLASS+' .jwfill', { 
     419                'background-size': 'cover' + JW_CSS_IMPORTANT 
     420        }); 
     421 
     422        _css('.' + PLAYER_CLASS+' .jwexactfit', { 
     423                'background-size': JW_CSS_100PCT + JW_CSS_IMPORTANT 
     424        }); 
     425 
     426        _css('.' + PLAYER_CLASS+' .jwnone', { 
    351427                'background-size': null 
    352428        }); 
  • branches/jw6/src/js/utils/jwplayer.utils.js

    r2181 r2184  
    4343        } 
    4444         
    45         utils.css = function(selector, styles) { 
     45        utils.css = function(selector, styles, important) { 
     46                if (!utils.exists(important)) important = false; 
     47                 
    4648                if (utils.isIE()) { 
    4749                        if (!_styleSheet) { 
     
    5759 
    5860                for (var style in styles) { 
    59                         var val = _styleValue(style, styles[style]); 
     61                        var val = _styleValue(style, styles[style], important); 
    6062                        if (utils.exists(_rules[selector][style]) && !utils.exists(val)) { 
    6163                                delete _rules[selector][style]; 
     
    7375        } 
    7476         
    75         function _styleValue(style, value) { 
     77        function _styleValue(style, value, important) { 
    7678                if (typeof value === "undefined") { 
    7779                        return undefined; 
    7880                }  
     81                 
     82                var importantString = important ? " !important" : ""; 
    7983 
    8084                if (typeof value == "number") { 
     
    8589                        case "z-index": 
    8690                        case "opacity": 
    87                                 return value; 
     91                                return value + importantString; 
    8892                                break; 
    8993                        default: 
     
    9195                                        return "#" + utils.strings.pad(value.toString(16), 6); 
    9296                                } else { 
    93                                         return Math.ceil(value) + "px"; 
     97                                        return Math.ceil(value) + "px" + importantString; 
    9498                                } 
    9599                                break; 
    96100                        } 
    97101                } else { 
    98                         return value; 
     102                        return value + importantString; 
    99103                } 
    100104        } 
     
    433437                } 
    434438 
    435                 domelement.className = domelement.className.replace(/jw(none|exactfit|uniform|fill)/g, ""); 
     439                domelement.className = domelement.className.replace(/\s*jw(none|exactfit|uniform|fill)/g, ""); 
    436440                domelement.className += " " + stretchClass; 
    437441        }; 
  • branches/jw6/test/controller.html

    r2181 r2184  
    6060      skin: <select name="skin" onchange="init()"> 
    6161        <option value="">default</option> 
    62         <option value="../../../skins/beelden/beelden.xml"  selected>beelden</option> 
     62        <option value="../../../skins/beelden/beelden.xml">beelden</option> 
    6363        <option value="../../../skins/stormtrooper/stormtrooper.xml">stormtrooper</option> 
    64         <option value="../../../skins/glow/src/glow.xml">glow</option> 
     64        <option value="../../../skins/glow/src/glow.xml" selected>glow</option> 
    6565        <option value="../../../skins/five/five.xml">five</option> 
    6666        <option value="../../../tags/skins/snel/snel.xml">snel</option> 
Note: See TracChangeset for help on using the changeset viewer.