/// <summary>
        /// Initializes a new instance of the <see cref="ApplicationConfiguration" /> class.
        /// </summary>
        public ApplicationConfiguration()
            : base()
        {
            ServerAddress = "http://localhost:8096";
            AutoLoginConfiguration = new AutoLoginConfiguration();

            EnableBackdrops = true;
            MediaPlayers = new PlayerConfiguration[] { };

            InternalPlayerConfiguration = new InternalPlayerConfiguration();

            MaxStreamingBitrate = 8000000;
        }
Exemple #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ApplicationConfiguration" /> class.
        /// </summary>
        public ApplicationConfiguration()
            : base()
        {
            ServerAddress          = "http://localhost:8096";
            AutoLoginConfiguration = new AutoLoginConfiguration();

            EnableBackdrops = true;
            MediaPlayers    = new PlayerConfiguration[] { };

            InternalPlayerConfiguration = new InternalPlayerConfiguration();

            MaxStreamingBitrate = 3000000;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="ApplicationConfiguration" /> class.
        /// </summary>
        public ApplicationConfiguration()
            : base()
        {
            ServerHostName = "localhost";
            ServerApiPort = 8096;
            AutoLoginConfiguration = new AutoLoginConfiguration();

            EnableBackdrops = true;
            MediaPlayers = new PlayerConfiguration[] { };

            InternalPlayerConfiguration = new InternalPlayerConfiguration();
        }
        public async Task ValidateSavedLogin(AutoLoginConfiguration configuration)
        {
            if (string.IsNullOrEmpty(configuration.AccessToken) ||
                string.IsNullOrEmpty(configuration.ServerId) ||
                string.IsNullOrEmpty(configuration.UserId))
            {
                _apiClient.ClearAuthenticationInfo();

                throw new UnauthorizedAccessException();
            }

            _apiClient.SetAuthenticationInfo(configuration.AccessToken, configuration.UserId);

            try
            {
                CurrentUser = await _apiClient.GetUserAsync(configuration.UserId);
            }
            catch (Exception ex)
            {
                _apiClient.ClearAuthenticationInfo();

                throw;
            }

            await AfterLogin();
        }