private string GetChannelPlayList(MediaStream remoteControl, Configuration config, int transcoderId, int channelId) { StringBuilder builder = new StringBuilder(); foreach (Channel channel in remoteControl.GetChannels()) { // show all channels, except when channelId is given if (channelId != 0 && channel.IdChannel != channelId) continue; foreach (Transcoder transcoder in remoteControl.GetTranscoders()) { // show all transcoders, except when transcoderId is given if (transcoderId != 0 && transcoder.Id != transcoderId) continue; string name = channel.Name + (transcoderId == 0 ? " (" + transcoder.Name + ")" : ""); string streamurl = remoteControl.GetTranscodedTvStreamUrl(channel.IdChannel, config.Username, config.Password, transcoder.Id); WriteEntry(builder, name, streamurl); } } return builder.ToString(); }
private string GetRecordingPlayList(MediaStream remoteControl, Configuration config, int transcoderId, int recordingId) { StringBuilder builder = new StringBuilder(); foreach (Recording rec in remoteControl.GetRecordings()) { if (recordingId != 0 && rec.Id != recordingId) continue; foreach (Transcoder transcoder in remoteControl.GetTranscoders()) { // show all transcoders, except when transcoderId is given if (transcoderId != 0 && transcoder.Id != transcoderId) continue; string name = rec.Title + " (" + rec.StartTime.ToShortDateString() + " " + rec.StartTime.ToShortTimeString() + (transcoderId == 0 ? ", " + transcoder.Name + ")" : ")"); string streamurl = remoteControl.GetTranscodedRecordingStreamUrl(rec.Id, config.Username, config.Password, transcoder.Id); WriteEntry(builder, name, streamurl); } } return builder.ToString(); }
private void SetupRecordingTable(MediaStream remoteControl, Configuration config) { // header TableHeaderRow hrow = new TableHeaderRow(); TableHeaderCell dcell = new TableHeaderCell(); dcell.Text = "Date"; hrow.Cells.Add(dcell); TableHeaderCell tcell = new TableHeaderCell(); tcell.Text = "Title"; hrow.Cells.Add(tcell); foreach (Transcoder transcoder in remoteControl.GetTranscoders()) { TableHeaderCell ccell = new TableHeaderCell(); ccell.Text = transcoder.Name.Replace(",", ",<br />"); hrow.Cells.Add(ccell); } RecordingTable.Rows.Add(hrow); foreach (Recording rec in remoteControl.GetRecordings()) { // base cells TableRow row = new TableRow(); TableCell date = new TableCell(); date.Text = rec.StartTime.ToShortDateString() + " " + rec.StartTime.ToShortTimeString(); row.Cells.Add(date); TableCell title = new TableCell(); title.Text = rec.Title; row.Cells.Add(title); // all transcoders foreach (Transcoder transcoder in remoteControl.GetTranscoders()) { TableCell item = new TableCell(); item.Text = createCellContents(remoteControl.GetTranscodedRecordingStreamUrl(rec.Id, config.Username, config.Password, transcoder.Id), "recording", rec.Id.ToString(), transcoder); row.Cells.Add(item); } RecordingTable.Rows.Add(row); } }
private void SetupStreamTable(MediaStream remoteControl, Configuration config) { // header row TableHeaderRow hrow = new TableHeaderRow(); TableHeaderCell cell = new TableHeaderCell(); cell.Text = "Channel"; hrow.Cells.Add(cell); foreach (Transcoder transcoder in remoteControl.GetTranscoders()) { TableHeaderCell tcell = new TableHeaderCell(); tcell.Text = transcoder.Name.Replace(",", ",<br />"); hrow.Cells.Add(tcell); } StreamTable.Rows.Add(hrow); // link to the playlist TableRow prow = new TableRow(); prow.Cells.Add(new TableCell()); foreach (Transcoder transcoder in remoteControl.GetTranscoders()) { TableCell pcell = new TableCell(); HyperLink link = new HyperLink(); link.NavigateUrl = "Playlist.aspx?transcoder=" + transcoder.Id.ToString(); link.Text = "Playlist"; pcell.Controls.Add(link); prow.Cells.Add(pcell); } StreamTable.Rows.Add(prow); foreach (Channel channel in remoteControl.GetChannels()) { // channel name header cell TableRow row = new TableRow(); TableCell title = new TableCell(); title.Text = channel.DisplayName; row.Cells.Add(title); // all transcoders foreach (Transcoder transcoder in remoteControl.GetTranscoders()) { TableCell item = new TableCell(); item.Text = createCellContents(remoteControl.GetTranscodedTvStreamUrl(channel.IdChannel, config.Username, config.Password, transcoder.Id), "channel", channel.IdChannel.ToString(), transcoder); row.Cells.Add(item); } StreamTable.Rows.Add(row); } }