Use dummy player when the URL is not valid

develop
LEdoian 3 years ago
parent a3d73d9af9
commit df7b8a2ea2

@ -85,11 +85,12 @@ namespace QuickPlay
string filename = playerConfigUrl.Substring("file://".Length); string filename = playerConfigUrl.Substring("file://".Length);
var reader = new StreamReader(filename); var reader = new StreamReader(filename);
cfgProvider = new FileConfigurationProvider(reader); cfgProvider = new FileConfigurationProvider(reader);
} else if (playerConfigUrl == "default") { } else if (playerConfigUrl == "dummy") {
cfgProvider = new DummyConfigurationProvider(); cfgProvider = new DummyConfigurationProvider();
} else } else
{ {
throw new InvalidOperationException("Schema of player config URL not supported"); Android.Widget.Toast.MakeText(Android.App.Application.Context, "Schema of player config URL not supported, using dummy", Android.Widget.ToastLength.Short).Show();
cfgProvider = new DummyConfigurationProvider();
} }
PlayerConfiguration playercfg; PlayerConfiguration playercfg;
try try

Loading…
Cancel
Save