Fix a rogue NetworkOnMainThreadException

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

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

Loading…
Cancel
Save