/** 
 * Kendo UI v2016.3.1118 (http://www.telerik.com/kendo-ui)                                                                                                                                              
 * Copyright 2016 Telerik AD. All rights reserved.                                                                                                                                                      
 *                                                                                                                                                                                                      
 * Kendo UI commercial licenses may be obtained at                                                                                                                                                      
 * http://www.telerik.com/purchase/license-agreement/kendo-ui-complete                                                                                                                                  
 * If you do not own a commercial license, this file shall be governed by the trial license terms.                                                                                                      
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       

*/
!function(e,define){define("kendo.mediaplayer.min",["kendo.slider.min","kendo.toolbar.min","kendo.dropdownlist.min","kendo.tooltip.min"],e)}(function(){return function(e,t){var i=window.kendo,s="end",a="pause",n="play",l="ready",r="timeChange",o="volumeChange",h="k-i-fullscreen-enter",u="k-i-fullscreen-exit",d="k-i-volume-mute",m="k-i-volume-low",_="k-i-volume-high",p="k-mediaplayer-quality",c="k-i-play",y="k-i-pause",g="k-mediaplayer-titlebar",f="k-title",v="k-mediaplayer-toolbar",w="k-mediaplayer-seekbar",T="k-mediaplayer-volume",k="k-mediaplayer-media",b="k-mediaplayer-overlay",C="k-mediaplayer-yt",D=".",S=i.ui,H=".kendoMediaPlayer",P=new Date(1970,0,1),B=60*P.getTimezoneOffset(),I=i.ui.Widget,V=e.isArray,F={shortTime:"mm:ss",longTime:"HH:mm:ss"},R=i.template,x=e.proxy,M=i.keys,U={htmlPlayer:"<video class='"+k+"'> </video>",titleBar:R("<div class='"+g+"' role='heading'><span class='"+f+"'>Video Title</span></div>"),toolBar:"<div class='"+v+"'> </div>",youtubePlayer:"<div class='"+C+"'> </div>",toolBarTime:"<span class='k-mediaplayer-currenttime'>00:00:00</span> / <span class='k-mediaplayer-duration'>00:00:00</span>",slider:"<input class='"+w+"' value='0' title='seekbar' />",volumeSlider:"<input class='"+T+"' title='volume'/>",qualityDropDown:"<input class='"+p+"' title='video quality' />",toolTip:"#= kendo.toString(new Date(value), 'HH:mm:ss') #"},q=I.extend({init:function(t,s){this.wrapper=e(t),I.fn.init.call(this,t,s),this.wrapper.addClass("k-mediaplayer k-widget"),s=this.options,this._currentIndex=0,this._createTitlebar(),this._createToolbar(),this._createDropDown(),this._createSlider(),this._createVolumeSlider(),this._timers={},this._aria(),this._navigatable(),s.media&&this.media(this.options.media),i.notify(this)},events:[s,a,n,l,r,o],options:{name:"MediaPlayer",autoPlay:!1,autoRepeat:!1,volume:100,fullScreen:!1,mute:!1,navigatable:!1,forwardSeek:!0,media:null,messages:{pause:"Pause",play:"Play",mute:"Mute",unmute:"Unmute",quality:"Quality",fullscreen:"Full Screen"}},_msToTime:function(e){var t=new Date(P.getTime());return t.setSeconds(e),t},_timeToSec:function(e){var t=new Date(e).getTime();return t/1e3},_createTitlebar:function(){this._titleBar=this.wrapper.find(D+g),0===this._titleBar.length&&(this._titleBar=this.wrapper.find(D+g),this.wrapper.append(U.titleBar),this._titleBar=this.wrapper.find(D+g))},_createSlider:function(){var e=this.wrapper.find(D+w);this._slider||(this._sliderDragChangeHandler=x(this._sliderDragChange,this),this._sliderDraggingHandler=x(this._sliderDragging,this),e=this.wrapper.find(D+w),this._slider=new S.Slider(e[0],{smallStep:1e3,tickPlacement:"none",showButtons:!1,change:this._sliderDragChangeHandler,slide:this._sliderDraggingHandler,tooltip:{template:U.toolTip},dragHandleTitle:""}))},_createVolumeSlider:function(){var t=this.wrapper.find(D+T);this._volumeSlider||(this._volumeDraggingHandler=x(this._volumeDragging,this),this._volumeChangeHandler=x(this._volumeChange,this),t=e(D+T),t.width(87),this._volumeSlider=new S.Slider(t[0],{smallStep:1,min:0,max:100,value:this.options.volume,slide:this._volumeDraggingHandler,change:this._volumeChangeHandler,tickPlacement:"none",showButtons:!1,tooltip:{enabled:!1},dragHandleTitle:""}))},_resetTime:function(){this._youTubeVideo?this._ytmedia.seekTo(0,!0):this._media.currentTime=0,this._mediaTimeUpdate(),e.grep(this._toolBar.options.items,function(e){return!!e.template}).template=U.toolBarTime},_currentUrl:function(){var e=this.media();return V(e.source)?e.source[this._currentIndex].url:e.source},_isYouTubeUrl:function(){return!!this._currentUrl().match("youtube.com/|youtu.be/")},_setPlayerUrl:function(){var e,t=this._youTubeVideo;this.stop(),this._youTubeVideo=this._isYouTubeUrl(),t!==this._youTubeVideo&&(this.wrapper.find(D+C).toggle(),this.wrapper.find(D+k).toggle()),e=this._media||this._ytmedia,this._initializePlayer(),e&&(this.mute(this.mute()),this.volume(this.volume())),this._youTubeVideo?this._ytmedia&&(this._videoOverlay&&this._videoOverlay.hide(),this.options.autoPlay?(this._ytmedia.loadVideoById(this._getMediaId()),this._playStateToggle(!0)):(this._ytmedia.cueVideoById(this._getMediaId()),this._playStateToggle(!0))):(this._videoOverlay.show(),this.wrapper.find(D+k+" > source").remove(),this.wrapper.find(D+k).attr("src",this._currentUrl()),this.options.autoPlay&&this.play())},_createToolbar:function(){var t,i,s=this.wrapper.find(D+v);0===s.length&&(this._toolbarClickHandler=x(this._toolbarClick,this),this.wrapper.append(U.toolBar),s=e(D+v),s.width(e(D+k).width()),this._toolBar=new S.ToolBar(s,{click:this._toolbarClickHandler,resizable:!1,items:[{template:U.slider},{type:"button",spriteCssClass:"k-icon k-font-icon k-i-play"},{template:U.toolBarTime},{type:"button",spriteCssClass:"k-icon k-font-icon k-i-volume-high"},{template:U.volumeSlider},{template:U.qualityDropDown},{type:"button",spriteCssClass:"k-icon k-font-icon k-i-fullscreen-enter"}]}),t=s.find('span[class*="k-i-volume"]'),this._volumeButton=t.parent("a"),i=s.find('span[class*="k-i-fullscreen"]'),this._fullscreenButton=i.parent("a"),this._volumeButton.attr("title",this.options.mute?this.options.messages.unmute:this.options.messages.mute),this._volumeButton.attr("aria-label",this.options.mute?this.options.messages.unmute:this.options.messages.mute),this._fullscreenButton.attr("title",this.options.messages.fullscreen),this._fullscreenButton.attr("aria-label",this.options.messages.fullscreen),s.width("auto"),this._currentTimeElement=s.find(".k-mediaplayer-currenttime"),this._durationElement=s.find(".k-mediaplayer-duration"),this._playButtonSpan=s.find('span[class*="k-i-play"]'),this._playButton=this._playButtonSpan.parent("a"),this.options.autoPlay&&this._playStateToggle(!0),e([this._volumeButton[0],s.find(".k-mediaplayer-volume").parent()[0],s.find(".k-mediaplayer-quality").parent()[0],this._fullscreenButton[0]]).wrapAll("<div class='k-align-right' />"),e(".k-button",s).addClass("k-button-bare"))},_createDropDown:function(){var e=this.wrapper.find(D+p),i=this.media();t===e.data("kendoDropDownList")&&(this._dropDownSelectHandler=x(this._dropDownSelect,this),this._dropDown=new S.DropDownList(e,{dataTextField:"quality",dataValueField:"url",popup:{position:"bottom",origin:"top",appendTo:this.wrapper},animation:{open:{effects:"slideIn:up",duration:1}},select:this._dropDownSelectHandler}),i&&V(i.source)&&(this._dropDown.setDataSource(i.source),this._dropDown.select(0)),this._dropDown.wrapper.addClass("k-button k-button-bare"),this._dropDown.wrapper.attr("title",this.options.messages.quality).hide(),this._dropDown.wrapper.find("span.k-i-arrow-s").removeClass("k-i-arrow-s").addClass("k-font-icon k-i-HD"),this._dropDown.list.addClass("k-quality-list"))},_dropDownSelect:function(e){this._currentIndex!==e.item.index()&&(this._currentIndex=e.item.index(),this._setPlayerUrl())},_toolbarClick:function(t){var i,s=e(t.target).children().first(),a=s.hasClass(c);this.media()&&((s.hasClass(c)||s.hasClass(y))&&(a?this.play():this.pause()),(s.hasClass(h)||s.hasClass(u))&&(this._isInFullScreen?(s.removeClass(u).addClass(h),this.fullScreen(!1)):(s.removeClass(h).addClass(u),this.fullScreen(!0))),(s.hasClass(d)||s.hasClass(m)||s.hasClass(_))&&(i=this.mute(),this.mute(!i)))},_sliderDragging:function(){this.media()&&(this._isDragging=!0)},_sliderDragChange:function(e){var t=this,i=e.sender,s=1e3*B;this.media()&&(t._sliderChangeFired=!0,t._isDragging=!1,!this.options.forwardSeek&&i.value()>this._seekBarLastPosition?setTimeout(function(){i.value(t._seekBarLastPosition)},1):this._youTubeVideo?t._ytmedia.seekTo(t._timeToSec(e.value-s)):t._media.currentTime=t._timeToSec(e.value-s),t.trigger(r),t._preventPlay=!0)},_changeVolumeButtonImage:function(e){var t=this._volumeButton,i=t.find("span"),s=i.attr("class");s=s.substring(0,s.lastIndexOf(" ")),0===e?(i.attr("class",s+" "+d),t.attr("title",this.options.messages.unmute),t.attr("aria-label",this.options.messages.unmute)):e>0&&e<51?(i.attr("class",s+" "+m),t.attr("title",this.options.messages.mute),t.attr("aria-label",this.options.messages.mute)):(i.attr("class",s+" "+_),t.attr("title",this.options.messages.mute),t.attr("aria-label",this.options.messages.mute))},_volumeDragging:function(e){this.media()&&(this.volume(e.value),this._changeVolumeButtonImage(e.value),this.trigger(o))},_volumeChange:function(e){this.media()&&(this.volume(e.value),this._changeVolumeButtonImage(e.value),this.trigger(o))},_mediaTimeUpdate:function(){var e=this._youTubeVideo?this._ytmedia.getCurrentTime():this._media.currentTime,t=this._msToTime(e);return this._currentTimeElement.text(i.toString(t,this._timeFormat)),this._isDragging||(this._seekBarLastPosition=1e3*(e+B),this._slider.value(this._seekBarLastPosition)),this.isPlaying()},_playStateToggle:function(e){t===e&&(e=this._playButtonSpan.is(D+c)),e?(this._playButtonSpan.removeClass(c).addClass(y),this._playButton.attr("title",this.options.messages.pause),this._playButton.attr("aria-label",this.options.messages.pause)):(this._playButtonSpan.removeClass(y).addClass(c),this._playButton.attr("title",this.options.messages.play),this._playButton.attr("aria-label",this.options.messages.play))},_mediaEnded:function(){this._playStateToggle(!1),this._currentTimeElement.text(i.toString(this._msToTime(0),this._timeFormat)),this._slider.value(1e3*(0+B)),this.trigger(s)},_mediaPlay:function(){this.trigger(n)},_mediaReady:function(){this.trigger(l)},_mediaDurationChange:function(){var e=this._msToTime(this._youTubeVideo?this._ytmedia.getDuration():this._media.duration);this._timeFormat=0===e.getHours()?F.shortTime:F.longTime,this._durationElement.text(i.toString(e,this._timeFormat)),this._slider.setOptions({min:P.getTime(),max:e.getTime()}),this._slider._distance=Math.round(this._slider.options.max-this._slider.options.min),this._slider._resize(),this._isFirstRun||(this._resetTime(),this._isFirstRun=!0)},_createYoutubePlayer:function(){this._mediaTimeUpdateHandler=x(this._mediaTimeUpdate,this),this._mediaDurationChangeHandler=x(this._mediaDurationChange,this),this.wrapper.prepend(U.youtubePlayer),this._ytPlayer=this.wrapper.find(D+C)[0],e(this._ytPlayer).css({width:this.wrapper.width(),height:this.wrapper.height()}),window.YT&&window.YT.Player?this._configurePlayer():(e.getScript("https://www.youtube.com/iframe_api"),this._youtubeApiReadyHandler=x(this._youtubeApiReady,this),window.onYouTubeIframeAPIReady=this._youtubeApiReadyHandler)},_poll:function(e,t,i,s){var a=this;return null!==a._timers[e]&&clearTimeout(a._timers[e]),a._timers[e]=setTimeout(function(s){return function n(){t.call(s)&&(a._timers[e]=setTimeout(n,i))}}(s),i)},_youtubeApiReady:function(){this._configurePlayer()},_configurePlayer:function(){var e,t={autoplay:+this.options.autoPlay,wmode:"transparent",controls:0,rel:0,showinfo:0};this._onYouTubePlayerReady=x(this._onYouTubePlayerReady,this),window.onYouTubePlayerReady=this._onYouTubePlayerReady,this._onPlayerStateChangeHandler=x(this._onPlayerStateChange,this),window.onPlayerStateChange=this._onPlayerStateChange,e=new window.YT.Player(this.wrapper.find(D+C)[0],{height:this.wrapper.height(),width:this.wrapper.width(),videoId:this._getMediaId(),playerVars:t,events:{onReady:this._onYouTubePlayerReady,onStateChange:this._onPlayerStateChangeHandler}})},_onYouTubePlayerReady:function(e){this._ytmedia=e.target,this._ytmedia.getIframe().style.width="100%",this._ytmedia.getIframe().style.height="100%",this._youTubeVideo=!0,this._mediaDurationChangeHandler(),this.options.autoPlay?(this._playStateToggle(!0),this._ytmedia.loadVideoById(this._getMediaId())):this._ytmedia.cueVideoById(this._getMediaId()),this.options.mute&&this.mute(!0),this.trigger(l)},_updateTitle:function(){this.titlebar().text(this.media().title||this.media().source)},_onPlayerStateChange:function(e){0===e.data?(this._slider.value(0),this._paused=!1,this._playStateToggle(!0),this.trigger(s),this.options.autoRepeat&&this.play()):1===e.data?(this._ytmedia.setVolume(this.volume()),this._sliderChangeFired?this._sliderChangeFired=!1:this._uiDisplay(!1),this.trigger(n),this._playStateToggle(!0),this._poll("progress",this._mediaTimeUpdate,500,this),this._paused=!1):2===e.data&&(this._paused||(this._uiDisplay(!0),this._playStateToggle(!1),this.trigger(a),this._paused=!0))},_getMediaId:function(){var e=this._currentUrl(),t=/^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&\?]*).*/,i=e.match(t);return i&&11===i[7].length&&(e=i[7]),e},_mouseClick:function(){this.isPaused()?this.play():this.pause()},_initializePlayer:function(){this._mouseMoveHandler||(this._mouseMoveHandler=x(this._mouseMove,this),this._mouseInHandler=x(this._mouseIn,this),this._mouseOutHandler=x(this._mouseOut,this),e(this.wrapper).on("mouseenter"+H,this._mouseInHandler).on("mouseleave"+H,this._mouseOutHandler).on("mousemove"+H,this._mouseMoveHandler)),!this._ytmedia&&this._youTubeVideo?this._createYoutubePlayer():this._media||this._youTubeVideo||this._createHtmlPlayer()},_createHtmlPlayer:function(){this._videoOverlay||(this._mouseClickHanlder=x(this._mouseClick,this),this.wrapper.append("<div class='"+b+"'></div>"),this._videoOverlay=this.wrapper.find(".k-mediaplayer-overlay").on("click"+H,this._mouseClickHanlder)),this._mediaTimeUpdateHandler=x(this._mediaTimeUpdate,this),this._mediaDurationChangeHandler=x(this._mediaDurationChange,this),this._mediaEndedHandler=x(this._mediaEnded,this),this._mediaCanPlayHandler=x(this._mediaReady,this),this._mediaPlayHandler=x(this._mediaPlay,this),this._videoOverlay.after(U.htmlPlayer),this._media=this.wrapper.find(D+k)[0],e(this._media).css({width:"100%",height:"100%"}),this.options.mute&&this.mute(!0),this._media.ontimeupdate=this._mediaTimeUpdateHandler,this._media.ondurationchange=this._mediaDurationChangeHandler,this._media.oncanplay=this._mediaCanPlayHandler,this._media.onplay=this._mediaPlayHandler,this._media.onended=this._mediaEndedHandler},_mouseIn:function(){this._uiDisplay(!0)},_mouseOut:function(){this._poll("mouseIdle",this._mouseIdle,3e3,this)},_mouseIdle:function(){return this._uiDisplay(!1),!1},_mouseMove:function(){this._titleBar.is(":animated")||this._toolBar.element.is(":animated")||this._slider.wrapper.is(":animated")||this._uiDisplay(!0),this._poll("mouseIdle",this._mouseIdle,3e3,this)},_uiDisplay:function(e){var t="slow",i=this._titleBar.add(this._toolBar.element).add(this._slider.wrapper);e?i.fadeIn(t):i.fadeOut(t)},setOptions:function(e){I.fn.setOptions.call(this,e)},destroy:function(){I.fn.destroy.call(this),this.isPaused()||this.pause(),this.element.off(H),this.element.find(D+b).off(H),this._timers=null,this._mouseMoveHandler=null,this._mouseOutHandler=null,this._mouseInHandler=null,this._mouseClickHanlder=null,this._keyDownHandler=null,this._fullscreenHandler=null,this._toolbarClickHandler=null,this._sliderDragChangeHandler=null,this._sliderDraggingHandler=null,this._volumeDraggingHandler=null,this._volumeChangeHandler=null,this._youtubeApiReadyHandler=null,this._onYouTubePlayerReady=null,this._onPlayerStateChangeHandler=null,this._dropDownSelectHandler=null,this._media.ontimeupdate=this._mediaTimeUpdateHandler=null,this._media.ondurationchange=this._mediaDurationChangeHandler=null,this._media.oncanplay=this._mediaCanPlayHandler=null,this._media.onplay=this._mediaPlayHandler=null,this._media.onended=this._mediaEndedHandler=null,this._youTubeVideo?this._ytmedia.destroy():(this._media.src="",this._media.remove()),this._mouseMoveTimer=null,clearTimeout(this._mouseMoveTimer),i.destroy(this.element)},seek:function(e){if(t===e)return 1e3*this._youTubeVideo?this._ytmedia.getCurrentTime():this._media?this._media.currentTime:0;var i=e/1e3;return this._youTubeVideo?i+3>=this._ytmedia.getDuration()|0?this._ytmedia.seekTo(this._ytmedia.getDuration()-3|0,!0):this._ytmedia.seekTo(i,!0):this._media.currentTime=i,this},play:function(){return this._youTubeVideo?this._ytmedia.playVideo():(this._uiDisplay(!1),this._media.play()),this._paused=!1,this._playStateToggle(!0),this},stop:function(){return this._youTubeVideo&&this._ytmedia?this._ytmedia.stopVideo():this._media&&!this._youTubeVideo&&(this._uiDisplay(!0),this._media.pause(),this._media.currentTime=0),this._paused=!0,this._playStateToggle(!1),this},pause:function(){return this._youTubeVideo?this._ytmedia.pauseVideo():(this._uiDisplay(!0),this._media.pause()),this._paused=!0,this._playStateToggle(!1),this.trigger(a),this},toolbar:function(){return this._toolBar},dropdown:function(){return this._dropDown},titlebar:function(){return this._titleBar},fullScreen:function(e){if(t===e)return this._isInFullScreen||!1;var i=this.element.get(0);e?(this._width=this.element.width(),this._height=this.element.height(),this.element.width("100%").height("100%").css({position:"fixed",top:0,left:0}),i.requestFullscreen?i.requestFullscreen():i.webkitRequestFullscreen?i.webkitRequestFullscreen():i.mozRequestFullScreen?i.mozRequestFullScreen():i.msRequestFullscreen&&i.msRequestFullscreen(),this._isInFullScreen=!0):(document.cancelFullscreen?document.cancelFullscreen():document.webkitCancelFullScreen?document.webkitCancelFullScreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msCancelFullscreen?document.msCancelFullscreen():document.exitFullscreen?document.exitFullscreen():document.msExitFullscreen&&document.msExitFullscreen(),this.element.css({position:"relative",top:null,left:null}),this.element.width(this._width),this.element.height(this._height),this._isInFullScreen=!1)},volume:function(e){return t===e?t!==this._volume?this._volume:this._volume=this.options.volume:(this._volume=e,this.mute(e<=0),this._youTubeVideo?this._ytmedia.setVolume(this._volume):this._media.volume=this._volume/100,this._volumeSlider.value(e),t)},mute:function(e){return t===e?this._youTubeVideo?this._ytmedia&&this._ytmedia.isMuted():this._media&&this._media.muted:(this._youTubeVideo?e?this._ytmedia.mute():this._ytmedia.unMute():this._media.muted=e,this._volumeSlider.value(e?0:this._media&&100*this._media.volume||this._ytmedia&&this._ytmedia.getVolume()),this.trigger(o),this._changeVolumeButtonImage(this._volumeSlider.value()),t)},isEnded:function(){return this._youTubeVideo?0===this._ytmedia.getPlayerState():this._media.ended},media:function(e){var i=this.dropdown();return t===e?t!==this._mediaData?this._mediaData:this._mediaData=this.options.media:(V(e.source)?(i.setDataSource(e.source),i.wrapper.show()):i.wrapper.hide(),this._mediaData=e,this._updateTitle(),this._setPlayerUrl(),t)},isPaused:function(){return this._paused},isPlaying:function(){return!this.isEnded()&&!this._paused},_aria:function(){this.wrapper.attr("role","region")},_navigatable:function(){this._fullscreenHandler=x(this._fullscreen,this),e(document).on("webkitfullscreenchange mozfullscreenchange fullscreenchange"+H,this._fullscreenHandler),this.options.navigatable&&(this.wrapper.attr("tabIndex",0),this._keyDownHandler=x(this._keyDown,this),this.wrapper.on("keydown"+H,this._keyDownHandler)),this._fullscreenHandler=x(this._fullscreen,this),e(document).on("webkitfullscreenchange mozfullscreenchange fullscreenchange"+H,this._fullscreenHandler)},_fullscreen:function(){var e=document.fullScreen||document.mozFullScreen||document.webkitIsFullScreen;this._uiDisplay(!0),this._slider.resize(),e||(this.wrapper.find('span[class*="k-i-fullscreen"]').removeClass(u).addClass(h),this.fullScreen(!1))},_keyDown:function(e){if(e.preventDefault(),e.keyCode===M.SPACEBAR&&(this.isPlaying()?this.pause():this.play()),e.keyCode===M.ENTER&&(this.wrapper.find('span[class*="k-i-fullscreen"]').removeClass(h).addClass(u),this.fullScreen(!0)),77===e.keyCode){var t=this.mute();this.mute(!t)}},_error:function(){},_progress:function(){}});S.plugin(q)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,i){(i||t)()});
//# sourceMappingURL=kendo.mediaplayer.min.js.map
