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); } }