Fix a rogue NetworkOnMainThreadException

For some strange reason it has never happened before.
develop
LEdoian 3 years ago
parent 3b42ac5d77
commit 65cbdf4a93

@ -187,11 +187,14 @@ namespace QuickPlay
configUrl = url; configUrl = url;
} }
public async Task<PlayerConfiguration> GetConfigurationAsync() public async Task<PlayerConfiguration> GetConfigurationAsync()
{
return await Task.Run(async () =>
{ {
var client = new HttpClient(); var client = new HttpClient();
var resp = await client.GetStreamAsync(configUrl); var resp = await client.GetStreamAsync(configUrl);
var sr = new StreamReader(resp); var sr = new StreamReader(resp);
return PlayerConfiguration.FromFile(sr); return PlayerConfiguration.FromFile(sr);
});
} }
} }

Loading…
Cancel
Save