public void InitStream(InputStream onlineSource) { _stream = onlineSource; }
public void InitOnline(InputStreamPlayer player, Dictionary<string, string> properties) { var videoSettings = ServiceRegistration.Get<ISettingsManager>().Load<VideoSettings>(); var regionSettings = ServiceRegistration.Get<ISettingsManager>().Load<RegionSettings>(); CultureInfo culture = CultureInfo.CurrentUICulture; try { if (!string.IsNullOrEmpty(regionSettings.Culture)) culture = CultureInfo.CreateSpecificCulture(regionSettings.Culture); } catch { } // Prefer video in screen resolution var height = SkinContext.CurrentDisplayMode.Height; var width = SkinContext.CurrentDisplayMode.Width; InputStream.StreamPreferences preferences = new InputStream.StreamPreferences { Width = width, Height = height, ThreeLetterLangCode = culture.ThreeLetterISOLanguageName, PreferMultiChannel = videoSettings.PreferMultiChannelAudio }; InputStream onlineSource = new InputStream(properties["inputstream.streamurl"], properties, preferences); // Subtitle support depends on "files". string fakeFilename; if (properties.TryGetValue("fakefilename", out fakeFilename)) onlineSource.FakeFilename = fakeFilename; foreach (string subKey in properties.Keys.Where(k => k.StartsWith("subtitle"))) onlineSource.SubtitlePaths.Add(properties[subKey]); player.InitStream(onlineSource); }