define(["exports","./playbackmanager.js","./../../emby-apiclient/apiclient.js"],function(_exports,_playbackmanager,_apiclient){function validatePlayback(options){var feature="playback";if("playback"===(feature=!options.item||"TvChannel"!==options.item.Type&&"Recording"!==options.item.Type?feature:"livetv")){var player=_playbackmanager.default.getCurrentPlayer();if(player&&!player.isLocalPlayer)return Promise.resolve()}return function(feature,options){return Emby.importModule("./modules/registrationservices/registrationservices.js").then(function(registrationServices){return registrationServices.validateFeature(feature,options)})}(feature,options).then(function(result){result&&result.enableTimeLimit&&(stopAutoStopTimer(),autoStopTimeout=setTimeout(onAutoStopTimeout,63e3))})}var autoStopTimeout;function onAutoStopTimeout(){stopAutoStopTimer(),_playbackmanager.default.stop()}function stopAutoStopTimer(){autoStopTimeout&&(clearTimeout(autoStopTimeout),autoStopTimeout=null)}function PlaybackValidation(){this.name="Playback validation",this.type="preplayintercept",this.id="playbackvalidation",this.order=-1}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,PlaybackValidation.prototype.intercept=function(options){return!options.fullscreen||options.item&&_apiclient.default.isLocalItem(options.item)?Promise.resolve():validatePlayback(options)};_exports.default=PlaybackValidation});