|
|
@ -75,8 +75,19 @@ namespace QuickPlay
|
|
|
|
};
|
|
|
|
};
|
|
|
|
public PlayerConfiguration GetPlayerConfig()
|
|
|
|
public PlayerConfiguration GetPlayerConfig()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// TODO: decide sensibly
|
|
|
|
IPlayerConfigurationProvider cfgProvider;
|
|
|
|
var cfgProvider = new HttpConfigurationProvider(playerConfigUrl);
|
|
|
|
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.
|
|
|
|
return cfgProvider.GetConfigurationAsync().Result; // Bad code, but hopefully we dont hang.
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|