define(["playbackManager","itemHelper"],function(playbackManager,itemHelper){"use strict";function validatePlayback(options){var feature="playback";if(!options.item||"TvChannel"!==options.item.Type&&"Recording"!==options.item.Type||(feature="livetv"),"playback"===feature){var player=playbackManager.getCurrentPlayer();if(player&&!player.isLocalPlayer)return Promise.resolve()}return require(["registrationServices"]).then(function(deps){return deps[0].validateFeature(feature,options).then(function(result){result&&result.enableTimeLimit&&(stopAutoStopTimer(),autoStopTimeout=setTimeout(onAutoStopTimeout,63e3))})})}var autoStopTimeout;function onAutoStopTimeout(){stopAutoStopTimer(),playbackManager.stop()}function stopAutoStopTimer(){autoStopTimeout&&(clearTimeout(autoStopTimeout),autoStopTimeout=null)}function PlaybackValidation(){this.name="Playback validation",this.type="preplayintercept",this.id="playbackvalidation",this.order=-1}return PlaybackValidation.prototype.intercept=function(options){return!options.fullscreen||options.item&&itemHelper.isLocalItem(options.item)?Promise.resolve():validatePlayback(options)},PlaybackValidation});