public static string YouTubeApiKey() { string KEY = "YouTubeApiKey"; string youtubeApiKey = ConfigurationManager.AppSettings[KEY]; if (string.IsNullOrEmpty(youtubeApiKey)) { return Environment.GetEnvironmentVariable(KEY); } return youtubeApiKey; } }
public YouTubeTrackProvider() { youtubeService = new YouTubeService(new BaseClientService.Initializer { ApiKey = Constants.YouTubeApiKey(), ApplicationName = Constants.YoutubeApplicationName }); }