angular.module("streama.videoPlayer",["LocalStorageModule","rzModule","streama.translations","ngSanitize"]),Number.prototype.clamp=function(e,i){return Math.min(Math.max(this,e),i)},angular.module("streama.videoPlayer").run(["$templateCache",function(e){e.put("streama-video-image.html","<img ng-if=\"video[type + '_image_src']\" ng-src=\"{{::video[type + '_image_src']}}\"/>\n<img ng-if=\"!video[type + '_image_src'] && video[type + '_path']\"\n     ng-src=\"https://image.tmdb.org/t/p/w{{size}}/{{::video[type + '_path']}}\"/>\n<img ng-if=\"!video[type + '_path'] && !video[type + '_image_src']\"\n     ng-src=\"{{$root.basePath}}assets/poster-not-found.png\"/>\n"),e.put("streama-video-player.desktop.html",'<div class="player-wrapper">\n  <div class="video-wrapper-inner"  ng-mousemove="showControls()">\n    <div>\n      <div class="volume-info" ng-show="volumeChanged">\n        {{volumeLevel * 10}}% Volume\n      </div>\n\n      <div class="volume-info" ng-show="currentTimeChanged">\n        <br>\n        <strong ng-show="currentTime">\n          <span>{{currentTime | streamaVideoTime}}</span>\n        </strong>\n        <span>{{videoDuration | streamaVideoTime}}</span>\n      </div>\n    </div>\n\n    <i class="ion-android-arrow-back player-back" ng-class="{\'visible\': controlsVisible}" ng-click="closeVideo()"></i>\n\n\n    <div class="spinner" ng-show="loading">\n      <div class="bounce1"></div>\n      <div class="bounce2"></div>\n      <div class="bounce3"></div>\n    </div>\n\n    <div class="overlay" ng-class="{\'visible\': overlayVisible}" ng-if="options.videoOverlayEnabled">\n      <div class="video-info">\n        <p>You\'re watching</p>\n\n        <h1>{{options.videoMetaTitle}}</h1>\n        <h3>{{options.videoMetaSubtitle}}</h3>\n        <p ng-if="!isMobile">{{options.videoMetaDescription}}</p>\n      </div>\n    </div>\n\n    <i ng-if="isMobile && !playing && canplay" class="play-button ion-ios-play" ng-click="pause();play()"></i>\n\n    <div class="player-controls-wrapper player-active no-select" ng-class="{\'visible\': controlsVisible}" ng-hide="loading && !initialPlay">\n\n      <div class="slider-ui-wrapper" ng-show="!volumeOpen">\n        <div class="scrupper-wrapper">\n          <rzslider rz-slider-model="currentTime" rz-slider-options="scrubber.options"></rzslider>\n        </div>\n\n        <!--<div id="playerDurationSlider" class="player-ui-slider" ui-slider="scrubberOptions" min="0" max="{{videoDuration}}" ng-model="currentTime"></div>-->\n        <div class="time-display">\n          <strong ng-show="currentTime">\n            <span>{{currentTime | streamaVideoTime}}</span>\n          </strong>\n          <span>{{videoDuration | streamaVideoTime}}</span>\n        </div>\n      </div>\n\n      <section class="player-control-bar no-select">\n\n        <div class="player-control-button player-play-pause play ion-play" ng-show="!playing" ng-click="play()"></div>\n\n        <div class="player-control-button player-play-pause play ion-pause" ng-show="playing" ng-click="pause()"></div>\n\n        <div class="volume-control player-control-button volume" ng-mouseleave="volumeOpen = false" ng-mouseenter="volumeOpen = true">\n          <i ng-class="{\n        \'ion-volume-mute\': volumeLevel == 0,\n        \'ion-volume-low\': volumeLevel > 0 && volumeLevel < 3,\n        \'ion-volume-medium\': volumeLevel >= 3 && volumeLevel < 6,\n        \'ion-volume-high\': volumeLevel >= 6\n        }" ng-click="playerVolumeToggle()"\n          ></i>\n\n          <div id="player-menu-volume" class="player-menu" ng-show="volumeOpen">\n            <div class="volume-menu-content">\n              <rzslider style="height: 120px;" rz-slider-model="volumeLevel" rz-slider-options="volume.options"></rzslider>\n            </div>\n          </div>\n        </div>\n\n\n        <div class="player-status">\n          <span class="player-status-main-title">{{options.videoMetaTitle}}</span>\n          <span>{{options.videoMetaSubtitle}}</span>\n        </div>\n\n        <div class="player-control-button player-next-episode ion-ios-skipforward" ng-if="options.showNextButton" ng-click="next()"></div>\n\n        <div class="player-control-button player-episode-selector" ng-if="options.showEpisodeBrowser">\n          <i class="ion-ios-browsers" ng-click="episodeBrowseOpen = !episodeBrowseOpen"></i>\n          <div id="player-menu-episode-selector" class="player-menu" ng-show="episodeBrowseOpen">\n            <div class="episode-selector-container">\n              <div class="episode-selector-slider" ng-class="{\'slide-left\': options.selectedEpisodes}">\n                <div class="season-list-container">\n                  <h2 class="seasons-title">{{options.videoMetaTitle}}</h2>\n                  <ul class="season-list">\n                    <li class="season" ng-click="toggleSelectEpisodes(episodes)"\n                        ng-repeat="(season, episodes) in options.episodeList">\n                      <span>{{\'VIDEO.SEASON\' | translate}} {{season}}</span>\n                    </li>\n                  </ul>\n                </div>\n              </div>\n\n              <div class="episode-selector-slider" ng-class="{\'slide-left\': options.selectedEpisodes}">\n                <div class="season-list-container">\n                  <h2 class="seasons-title" ng-click="toggleSelectEpisodes()">\n                    <span class="back-button"><i class="ion-chevron-left"></i></span>\n                    {{\'VIDEO.SEASON\' | translate}} {{options.selectedEpisodes[0].season_number}}\n                  </h2>\n                  <ul class="episode-list">\n                    <li class="episode" ng-repeat="episode in options.selectedEpisodes"\n                        ng-class="{\'current\': (episode.episode_number == options.currentEpisode.episode && episode.season_number == options.currentEpisode.season), \'no-files\': !episode.hasFile}" >\n                      <div class="flex-wrapper">\n                        <span class="episode-number">{{episode.episode_number | streamaPadnumber:2}}</span>\n                        <span class="episode-name" ng-click="visible = !visible">{{episode.name}}</span>\n                        <span class="episode-play" ng-if="episode.hasFile" ui-sref="player({videoId: episode.id})"><i class="ion-play"></i></span>\n                      </div>\n\n                      <div class="extra-episode-info" ng-if="visible || (episode.episode_number == video.episode_number && episode.season_number == video.season_number)">\n                        <div class="image-wrapper">\n                          <img ng-if="episode.still_path" ng-src="https://image.tmdb.org/t/p/w92/{{episode.still_path}}"/>\n                          <div ng-if="!episode.still_path" class="fallback-image"></div>\n                        </div>\n\n                        <p>{{episode.overview.length > 250 ? (episode.overview.substring(0, 250) + \'...\') : episode.overview}}</p>\n                      </div>\n                    </li>\n                  </ul>\n                </div>\n              </div>\n            </div>\n          </div>\n        </div>\n\n        <div class="player-control-button player-fill-screen ion-android-wifi" ng-if="options.showSocketSession" ng-click="createNewPlayerSession()"></div>\n\n        <div class="player-control-button player-fill-screen ion-android-textsms" ng-if="options.videoTrack" ng-class="{\'inactive\': !isTextTrackVisible}" ng-click="toggleTextTrack()"></div>\n\n        <div class="player-control-button player-fill-screen"\n             ng-click="fullScreen()" ng-class="{\'ion-arrow-shrink\': isFullScreen, \'ion-arrow-expand\': !isFullScreen}"></div>\n      </section>\n    </div>\n\n\n    <video ng-if="isInitialized" id="video" ng-src="{{options.videoSrc}}" type="{{options.videoType}}" ng-click="clickVideo()">\n      <track ng-if="options.videoTrack" ng-src="{{options.videoTrack}}" kind="subtitles" srclang="en" label="English">\n    </video>\n\n  </div>\n</div>\n\n\n'),e.put("streama-video-player.episodeSelector.html",'<div class="mobile-overlay-container mobile-episode-selector-container">\n  <div class="mobile-episode-selector-season-tabs">\n    <div class="mobile-episode-selector-season-tab" ng-class="{\'active\': season == options.selectedEpisodes[0].season_number}"\n         ng-repeat="(season, episodes) in options.episodeList" ng-click="toggleSelectEpisodes(episodes)">\n      <span>{{\'VIDEO.SEASON\' | translate}} {{season}}</span>\n    </div>\n  </div>\n\n  <div class="mobile-episode-selector-outer">\n    <div class="mobile-episode-selector-inner">\n      <div class="mobile-episode-box" ng-repeat="episode in options.selectedEpisodes | orderBy:\'episode_number\'" ng-class="{\'active\': episode.id == options.currentEpisode.id}">\n        <div class="image-wrapper">\n          <i ng-if="episode.id != options.currentEpisode.id" class="play-button ion-ios-play" ng-click="changeEpisode(episode)"></i>\n          <img ng-if="episode.still_path" ng-src="{{episode.still_path}}"/>\n          <div ng-if="!episode.still_path" class="fallback-image"></div>\n        </div>\n        <h3>\n          <span class="episode-number">{{episode.episode_number}}. </span>\n          <span class="episode-name" ng-click="visible = !visible">{{episode.name}}</span>\n\n          <span ng-if="episode.videoDuration" class="episode-duration">{{episode.videoDuration | videoDurationDisplay}}</span>\n        </h3>\n        <p class="episode-overview">{{episode.overview.length > 250 ? (episode.overview.substring(0, 250) + \'...\') : episode.overview}}</p>\n      </div>\n    </div>\n  </div>\n\n  \n</div>'),e.put("streama-video-player.html",'<div>\n  <pre>{{playerTemplate}}</pre>\n  <div ng-if="playerTemplate" ng-include="playerTemplate"></div>\n\n</div>\n\n'),e.put("streama-video-player.touch.html",'<div class="player-wrapper" ng-class="{\'mobile-controls-visible\': isMobileControlsVisible}">\n  <pre>{{options.videoStillImage}}</pre>\n  <div class="video-wrapper-inner" ng-style="getBackgroundStyle()" ng-click="toggleControls()" ng-mousemove="toggleCursor()">\n\n    <div ng-if="loading">\n      <i class="spinner ion-load-c" ></i>\n    </div>\n\n    <i ng-if="!playing && canplay" class="play-button ion-ios-play" ng-click="$event.stopPropagation();togglePlay()"></i>\n\n\n    <div class="next-video-overlay" ng-if="isNextVideoShowing">\n      <div class="row next-video-overlay-inner">\n        <div class="col-xs-4">\n          <streama-video-image video="options.nextVideo" type="poster" size="154"></streama-video-image>\n        </div>\n        <div class="col-xs-8">\n          <h4>Up next...</h4>\n          <h3>{{options.nextVideo.fullTitle}}</h3>\n          <p>{{options.nextVideo.overview}}</p>\n\n          <button class="play-button with-label" ng-click="next()"> <span class="play-label">play now</span> <i class="ion-ios-play"></i></button>\n        </div>\n      </div>\n    </div>\n\n    <div class="player-controls-mobile" ng-show="isMobileControlsVisible" >\n      <div class="player-controls-topbar">\n        <div class="player-controls-box player-control-button" ng-click="$event.stopPropagation(); closeVideo();">\n          <i class="ion-close-round"></i>\n        </div>\n        <div class="player-controls-stretch player-controls-metaTitle">\n          {{options.videoMetaTitle}}\n        </div>\n\n        <div class="player-controls-box player-control-button" ng-click="$event.stopPropagation(); toggleMobileOverlayBox(\'track\');">\n          <i class="ion-android-textsms"></i>\n        </div>\n\n        <div ng-if="options.showEpisodeBrowser" class="player-controls-box player-control-button" ng-click="$event.stopPropagation(); toggleMobileOverlayBox(\'episode\')">\n          <i class="ion-ios-browsers"></i>\n        </div>\n        <div ng-if="options.hasNextEpisode" class="player-controls-box player-control-button" ng-click="$event.stopPropagation(); next();">\n          <i class="ion-ios-skipforward"></i>\n        </div>\n\n      </div>\n\n      <div class="player-controls-bottombar" ng-if="initialPlay">\n        <div class="player-controls-box player-control-button" ng-click="$event.stopPropagation();togglePlay()">\n          <i class="player-play-pause play ion-play" ng-show="!playing"></i>\n          <i class="player-play-pause play ion-pause" ng-show="playing"></i>\n        </div>\n        <div class="player-controls-box player-control-button" ng-click="$event.stopPropagation();replay(30)">\n          <i class="icon-replay_30"></i>\n        </div>\n        <div class="player-controls-stretch">\n          <rzslider ng-if="scrubber.options" rz-slider-model="scrubber.model" rz-slider-options="scrubber.options"></rzslider>\n        </div>\n        <div class="player-controls-box">\n          <div class="time-display">\n            <strong class="current-time">{{scrubber.model | streamaVideoTime}} | </strong>{{videoDuration | streamaVideoTime}}\n          </div>\n        </div>\n      </div>\n    </div>\n\n    <div class="player-controls-mobile-overlay-box" ng-if="mobileOverlayBox.isVisble">\n      <i class="ion-close player-controls-mobile-overlay-box-close" ng-click="toggleMobileOverlayBox()"></i>\n\n      <div ng-include="\'streama-video-player.\' + mobileOverlayBox.type + \'Selector.html\'"></div>\n    </div>\n\n    <video ng-show="initialPlay" ng-if="isInitialized" id="video" ng-src="{{options.videoSrc | streamaTrustAs:\'resourceUrl\'}}" type="{{options.videoType}}"\n           ng-click="clickVideo()" class="subtitle-size-{{options.subtitleSize}}">\n      <track ng-repeat="subtitle in options.subtitles" ng-src="{{subtitle.src  | streamaTrustAs:\'resourceUrl\'}}" kind="subtitles" id="subtitle-{{subtitle.id}}"\n             srclang="{{subtitle.subtitleSrcLang}}" label="{{subtitle.subtitleLabel}}" src="{{subtitle.src  | streamaTrustAs:\'resourceUrl\'}}">\n    </video>\n\n  </div>\n</div>\n\n\n'),e.put("streama-video-player.trackSelector.html",'<div class="mobile-overlay-container mobile-track-selector-container">\n\n  <div class="row">\n    <div class="col-50">\n      <h2>{{\'VIDEO.SUBTITLES\' | translate}}</h2>\n      <ul class="track-selector-list">\n        <li class="track-selector-item" ng-class="{\'active\': !selectedSubtitleId}" ng-click="selectSubtitle()">\n          {{\'VIDEO.NO_SUBTITLE\' | translate}} &nbsp;\n\n          <i ng-if="!selectedSubtitleId" class="ion-checkmark"></i>\n        </li>\n        <li class="track-selector-item" ng-class="{\'active\': track.id == selectedSubtitleId}"\n            ng-repeat="track in options.subtitles" ng-click="selectSubtitle(track)">\n          {{track.subtitleLabel || track.originalFilename}}\n\n          <i ng-if="track.id == selectedSubtitleId" class="ion-checkmark"></i>\n        </li>\n      </ul>\n\n      <h2>{{\'VIDEO.SUBTITLE_SIZE\' | translate}}</h2>\n      <ul class="subtitle-size-picker">\n        <li class="subtitle-size-lg" ng-class="{\'active\': options.subtitleSize == \'lg\'}" ng-click="changeSubtitleSize(\'lg\')">A</li>\n        <li class="subtitle-size-md" ng-class="{\'active\': options.subtitleSize == \'md\'}" ng-click="changeSubtitleSize(\'md\')">A</li>\n        <li class="subtitle-size-sm" ng-class="{\'active\': options.subtitleSize == \'sm\'}" ng-click="changeSubtitleSize(\'sm\')">A</li>\n      </ul>\n    </div>\n    <div class="col-50">\n      <h2>{{\'VIDEO.VIDEO_FILES\' | translate}}</h2>\n      <ul class="track-selector-list">\n        <li class="track-selector-item" ng-class="{\'active\': isVideoFileSelected(track)}"\n            ng-repeat="track in options.videoFiles" ng-click="selectVideoFile(track)">\n          {{track.label || track.originalFilename}}\n\n\n          <i ng-if="isVideoFileSelected(track)" class="ion-checkmark"></i>\n        </li>\n      </ul>\n    </div>\n  </div>\n\n\n\n</div>\n')}]),angular.module("streama.videoPlayer").directive("streamaVideoImage",function(){return{restrict:"E",templateUrl:"streama-video-image.html",scope:{video:"=",type:"@",size:"@"},link:function(e,i,n){}}}),angular.module("streama.videoPlayer").directive("streamaVideoPlayer",["localStorageService","$timeout","$http","streamaVideoPlayerService","$filter",function(e,i,n,o,s){return{restrict:"AE",templateUrl:"streama-video-player.touch.html",scope:{options:"="},link:function(s,t,l){function a(){s.isInitialized=!0,t.addClass("nocursor"),s.options.isTouch||G(),o.initMousetrap(Z,s,Y,j),V(),R(),s.$on("$destroy",P),s.$on("$stateChangeStart",E),s.$on("$stateChangeSuccess",M),m(),i(function(){var e=t.find("video");e.bind("contextmenu",function(){return!1}),Z=e[0],Z.oncanplay=O,Z.onwaiting=I,Z.onplaying=D,Z.onerror=F,Z.ontimeupdate=z,Z.addEventListener("ended",L),c(u())})}function r(e){s.options.onEpisodeChange(e)}function c(i){_.forEach(Z.textTracks,function(e,n){i&&e.id==="subtitle-"+i.id?e.mode="showing":e.mode="hidden"}),s.options.onSubtitleSelect(i),s.selectedSubtitleId=_.get(i,"id"),e.set("selectedSubtitleLanguage",_.get(i,"subtitleSrcLang"))}function d(i){s.initialPlay=!1,s.options.customStartingTime=Z.currentTime,s.options.selectedVideoFile=i,s.options.videoSrc=i.src||i.externalLink,s.options.originalFilename=i.originalFilename,s.options.videoType=i.contentType,e.set("selectedVideoFile",i.label)}function p(e){return _.isEqualBy(s.options.selectedVideoFile,e,"id")}function u(){return _.find(s.options.subtitles,{id:s.options.currentSubtitle})}function v(){t.removeClass("nocursor"),i.cancel(K),i.cancel(W),s.controlsVisible=!0,s.overlayVisible=!1,K=i(function(){s.controlsVisible=!1,s.playing?t.addClass("nocursor"):W=i(function(){s.playing||(s.overlayVisible=!0)},5e3)},1e3)}function g(e){s.scrubber={model:0,options:{floor:0,ceil:e,step:1,hideLimitLabels:!0,hidePointerLabels:!0,showSelectionBar:!0,onStart:function(){te=!1},onEnd:function(e,i,n,o){Z.currentTime=i,s.scrubber.model=i,te=!0,s.options.onScrub(Z)}}}}function m(){s.volumeLevel=e.get("volumeLevel")||5,s.volume={options:{floor:0,ceil:10,step:.1,hideLimitLabels:!0,hidePointerLabels:!0,showSelectionBar:!0,vertical:!0,onChange:function(e,i,n,o){T(i)}}}}function b(){1==s.isFullScreen&&s.fullScreen(),P(),s.options.onClose()}function y(){i(function(){s.isMobileControlsVisible=!s.isMobileControlsVisible})}function f(){J=new Date,t.removeClass("nocursor"),i.cancel(ie),ie=i(function(){t.addClass("nocursor")},3e3)}function h(){s.options.onVideoClick()}function k(e){s.mobileOverlayBox.isVisble=!s.mobileOverlayBox.isVisble,s.mobileOverlayBox.type=e,s.mobileOverlayBox.isVisble?B():A()}function S(i){s.options.subtitleSize=i,e.set("subtitleSize",i)}function w(){var e,i=document;e=s.isMobile?Z:document.documentElement;var n=window.innerHeight==screen.height;n?(s.isFullScreen=!1,i.exitFullscreen?i.exitFullscreen():i.mozCancelFullScreen?i.mozCancelFullScreen():i.webkitExitFullscreen?i.webkitExitFullscreen():i.msExitFullscreen&&i.msExitFullscreen()):(s.isFullScreen=!0,e.requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullScreen?e.webkitRequestFullScreen():e.msRequestFullscreen&&e.msRequestFullscreen())}function T(i){var n=i/10;Z.volume=n,s.options.rememberVolumeSetting&&e.set("volumeLevel",i)}function x(){0==s.volumeLevel?s.volumeLevel=5:s.volumeLevel=0}function V(){s.$on("triggerVideoPlay",function(e,i){s.play(i)}),s.$on("triggerVideoPause",function(e,i){s.pause(i)}),s.$on("triggerVideoToggle",function(e,i){s.playing?s.pause(i):s.play(i)}),s.$on("triggerVideoTimeChange",function(e,i){Z.currentTime=i.currentPlayerTime,s.scrubber.model=i.currentPlayerTime,console.log("%c videoTimeChange","color: deeppink; font-weight: bold; text-shadow: 0 0 5px deeppink;")})}function E(){s.isStateChangeStarted=!0}function M(e,i){"player"!=i.name&&(s.isFullScreen=!0)&&s.fullScreen()}function P(){Mousetrap.reset(),console.log("destroy"),s.initialPlay&&Z.pause(),Z.src="",t.find("video").children("source").prop("src",""),t.find("video").remove().length=0}function z(e){if(te){if(_.set(s.scrubber,"model",Z.currentTime),C(),s.isMobileControlsVisible&&J){var i=((new Date).getTime()-J.getTime())/1e3;i>4&&y()}s.$apply(),oe&&(null==ne&&(ne=s.options.currentEpisode),ne.intro_start<this.currentTime&&this.currentTime<ne.intro_end&&(Z.currentTime=ne.intro_end))}}function C(){var e=s.options.outro_start;if(e)s.isNextVideoShowing=_.get(s.options,"nextVideo.id")&&Z.currentTime>e;else{var i=Z.duration-Z.currentTime;s.isNextVideoShowing=_.get(s.options,"nextVideo.id")&&i<le}}function L(){s.options.showNextButton&&s.options.onNext()}function F(){Z.duration||s.initialPlay||s.isStateChangeStarted||(console.error("Video Playback Error"),s.options.onError())}function D(){s.loading=!1,console.log("%c PLAYING","color: deeppink; font-weight: bold; text-shadow: 0 0 5px deeppink;")}function O(){s.initialPlay||(s.canplay=!0,console.log("%c onVideoCanPlay","color: deeppink; font-weight: bold; text-shadow: 0 0 5px deeppink;"),s.loading=!1,s.play(),s.videoDuration=Z.duration,g(Z.duration),Z.currentTime=s.options.customStartingTime||0,s.scrubber.model=Z.currentTime||0,s.initialPlay=!0,s.options.videoTrack&&(Z.textTracks[0].mode="hidden"))}function I(){s.loading=!0}function $(e){s.options.selectedEpisodes=e}function B(e){console.log("Activate PAUSE at time: "+Z.currentTime),Z.pause(),s.playing=!1,s.options.onPause(Z,e)}function N(){s.playing?B():A()}function A(e){console.log("Activate PLAY at time: "+Z.currentTime),Z.play(),s.playing=!0,s.options.onPlay(Z,e),s.overlayVisible=!1,s.isMobileControlsVisible&&i(function(){s.isMobileControlsVisible=!1},1e3)}function q(){s.options.onSocketSessionCreate()}function U(){s.isTextTrackVisible=!s.isTextTrackVisible,s.isTextTrackVisible?Z.textTracks[0].mode="showing":Z.textTracks[0].mode="hidden"}function j(e){s.volumeChanged=!0,i.cancel(X),s.volumeLevel+=e,s.volumeLevel=s.volumeLevel.clamp(0,10),s.$apply(),X=i(function(){s.volumeChanged=!1},1500)}function R(){s.isMobile=s.options.isMobile}function Y(){s.currentTimeChanged=!0,s.options.onTimeChange(Z.currentTime,s.videoDuration),i.cancel(ee),s.$apply(),ee=i(function(){s.currentTimeChanged=!1},1e4)}function G(){jQuery(t).mousewheel(function(e){e.deltaY>0?j(1):e.deltaY<0&&j(-1),s.showControls()})}function H(){return s.initialPlay?{}:{"background-image":"url("+s.options.videoStillImage+")"}}function Q(e){var i=Z.currentTime,n=i-e;n<0&&(n=0),Z.currentTime=n,s.scrubber.model=n}if(s.options=o.initOptions(s.options),!s.options)return void console.error("There was an error initializing the player. Please refer to the error log.");var Z,J,K,W,X,ee,ie,ne=null,oe=!0,se=s.options.videoSrc.toString(),te=!0,le=30;s.getBackgroundStyle=H,s.changeEpisode=r,s.selectSubtitle=c,s.selectVideoFile=d,s.isVideoFileSelected=p,s.showControls=v,s.toggleSelectEpisodes=$,s.createNewPlayerSession=q,s.toggleTextTrack=U,s.playerVolumeToggle=x,s.play=A,s.togglePlay=N,s.pause=B,s.closeVideo=b,s.toggleControls=y,s.toggleCursor=f,s.toggleMobileOverlayBox=k,s.clickVideo=h,s.fullScreen=w,s.changeSubtitleSize=S,s.replay=Q,s.next=s.options.onNext,s.isMobileControlsVisible=!0,s.isInitialized=!1,s.isNextVideoShowing=!1,s.loading=!0,s.initialPlay=!1,s.mobileOverlayBox={isVisble:!1,type:""},s.verticalSlider1={value:5,options:{floor:0,ceil:10,vertical:!0}},s.options.isExternalLink?a():n.head(se).success(function(){a()}).error(function(e,i){406==i&&s.options.onError("FILE_IN_FS_NOT_FOUND")})}}}]),angular.module("streama.videoPlayer").filter("streamaPadnumber",[function(){function e(e,i,n){return n=n||"0",e+="",e.length>=i?e:new Array(i-e.length+1).join(n)+e}return function(i,n){return e(i,n)}}]),angular.module("streama.videoPlayer").filter("streamaTrustAs",["$sce",function(e){return function(i,n){return e.trustAs(n,i)}}]),angular.module("streama.videoPlayer").filter("videoDurationDisplay",["$filter",function(e){return function(i){var n=new Date(1970,0,1).setSeconds(i);return e("date")(n,"mm")+" Min."}}]),angular.module("streama.videoPlayer").filter("streamaVideoTime",["$filter",function(e){return function(i){var n=new Date(1970,0,1).setSeconds(i);return i>=3600?e("date")(n,"hh:mm:ss"):e("date")(n,"mm:ss")}}]),angular.module("streama.videoPlayer").factory("streamaVideoPlayerService",["localStorageService","$timeout","$http",function(e,i,n){function o(){return{customStartingTime:0,isMobile:null,rememberVolumeSetting:!0,videoMetaTitle:"",videoMetaSubtitle:"",videoMetaDescription:"",videoStillImage:"",videoSrc:"",videoType:"",videoTrack:"",subtitles:[],videoFiles:[],videoOverlayEnabled:!0,showEpisodeBrowser:!1,hasNextEpisode:!1,showSocketSession:!0,episodeList:{},selectedEpisodes:null,subtitleSize:"md",currentEpisode:{},onSocketSessionCreate:angular.noop,onTimeChange:angular.noop,onError:angular.noop,onPlay:angular.noop,onPause:angular.noop,onClose:angular.noop,onNext:angular.noop,onScrub:angular.noop,onEpisodeChange:angular.noop,onVideoClick:angular.noop,onSubtitleSelect:angular.noop,isTouch:!1}}function s(e){if(!e.videoSrc)return console.error("Streama-Video-Player did not find options.src. exiting with Error FILE_MISSING"),e.onError("FILE_MISSING"),!0}function t(e){e=e||{},!e.selectedEpisodes&&e.showEpisodeBrowser&&e.currentEpisode&&e.episodeList&&(e.selectedEpisodes=e.episodeList[e.currentEpisode.season]),e.videoMetaTitle||(e.videoMetaTitle=e.videoSrc),e=angular.merge(o(),e);var i=s(e);if(!i)return void 0==e.isMobile&&(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent.substr(0,4))?e.isMobile=!0:e.isMobile=!1),e}function l(e,i,n,o){Mousetrap.bind("left",function(i){i.preventDefault(),n(),e.currentTime-=a},"keyup"),Mousetrap.bind("right",function(i){i.preventDefault(),n(),e.currentTime+=a},"keyup"),Mousetrap.bind("ctrl+right",function(i){i.preventDefault(),n(),e.currentTime+=r},"keyup"),Mousetrap.bind("ctrl+left",function(i){i.preventDefault(),n(),e.currentTime-=r},"keyup"),Mousetrap.bind("alt+enter",function(e){e.preventDefault(),i.fullScreen()}),Mousetrap.bind(["backspace","del"],function(e){e.preventDefault(),i.closeVideo()}),Mousetrap.bind("s",function(e){e.preventDefault(),i.toggleTextTrack()}),Mousetrap.bind("up",function(e){e.preventDefault(),o(1)}),Mousetrap.bind("down",function(e){e.preventDefault(),o(-1)}),Mousetrap.bind("m",function(e){e.preventDefault(),i.playerVolumeToggle(),i.showControls()}),Mousetrap.bind("e",function(e){e.preventDefault(),i.toggleSelectEpisodes(),i.showControls()}),Mousetrap.bind("space",function(){i.playing?i.pause():i.play(),i.$apply()})}var a=20,r=60;return{getDefaultOptions:o,initOptions:t,initMousetrap:l}}]);