Esempio n. 1
0
        private void lbChannels_SelectedIndexChanged(object sender, EventArgs e)
        {
            ChannelData selectedChannel = (ChannelData)lbChannels.SelectedItem;

            Process p = null;

            if (IsProcessOpen("vlc", ref p))
            {
                p.Kill();
            }
            p = new Process();
            p.StartInfo.FileName  = @"C:\Program Files\VideoLAN\VLC\vlc.exe";
            p.StartInfo.Arguments = selectedChannel.StreamUrl;
            p.Start();
        }
Esempio n. 2
0
        private void ProcessLine(string line1, string line2)
        {
            string      processingLine = line1;
            ChannelData data           = new ChannelData();

            // ID
            string[] separators = { "tvg-", "group-" };
            string[] subLines   = processingLine.Split(separators, StringSplitOptions.RemoveEmptyEntries);
            data.ID      = subLines[1].Substring(subLines[1].IndexOf("\"")).Replace("\"", "").Trim();
            data.Name    = subLines[2].Substring(subLines[2].IndexOf("\"")).Replace("\"", "").Trim();
            data.LogoURL = subLines[3].Substring(subLines[3].IndexOf("\"")).Replace("\"", "").Trim();

            string[] groupSplitted = subLines[4].Substring(subLines[4].IndexOf("\"")).Trim().Split(',');
            data.GroupTitle  = groupSplitted[0].Replace("\"", "");
            data.VisibleName = groupSplitted[1];
            data.StreamUrl   = line2;
            Channels.Add(data);
        }