|
|
|
@ -75,8 +75,19 @@ namespace QuickPlay
|
|
|
|
|
};
|
|
|
|
|
public PlayerConfiguration GetPlayerConfig()
|
|
|
|
|
{
|
|
|
|
|
// TODO: decide sensibly
|
|
|
|
|
var cfgProvider = new HttpConfigurationProvider(playerConfigUrl);
|
|
|
|
|
IPlayerConfigurationProvider cfgProvider;
|
|
|
|
|
if (playerConfigUrl.StartsWith("http:") || playerConfigUrl.StartsWith("https:"))
|
|
|
|
|
{
|
|
|
|
|
cfgProvider = new HttpConfigurationProvider(playerConfigUrl);
|
|
|
|
|
} else if (playerConfigUrl.StartsWith("file://"))
|
|
|
|
|
{
|
|
|
|
|
string filename = playerConfigUrl.Substring("file://".Length);
|
|
|
|
|
var reader = new StreamReader(filename);
|
|
|
|
|
cfgProvider = new FileConfigurationProvider(reader);
|
|
|
|
|
} else
|
|
|
|
|
{
|
|
|
|
|
throw new InvalidOperationException("Schema of player config URL not supported");
|
|
|
|
|
}
|
|
|
|
|
return cfgProvider.GetConfigurationAsync().Result; // Bad code, but hopefully we dont hang.
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|