我使用ijkplayer在我的ios应用中播放实时视频。
以下是播放器初始化的代码
try
{
//DataTable dtTemp = (DataTable)ViewState["Information"];
DataTable dtDistinctRecords = dtTemp.DefaultView.ToTable(true, "prod_line");
DataTable dtStudentName = dtTemp.DefaultView.ToTable(true, "request_date");
DataTable a = new DataTable();
DataTable dtStudent = new DataTable();
dtStudent.Columns.Add("request_date");
foreach (DataRow rows in dtDistinctRecords.Rows)
{
dtStudent.Columns.Add(rows["prod_line"].ToString());
}
foreach (DataRow row in dtStudentName.Rows)
{
DataRow dr = dtStudent.NewRow();
dr["request_date"] = row["request_date"];
DataView dv = new DataView(dtTemp);
dv.RowFilter = "request_date='" + row["request_date"] + "'";
DataTable dtStudentdtl = dv.ToTable();
for (int i = 0; i < dtStudentdtl.Rows.Count; i++)
{
string colValue = dtStudentdtl.Rows[i]["jo_no"].ToString();
string colValue2 = dtStudentdtl.Rows[i]["qty"].ToString();
string colValue3 = dtStudentdtl.Rows[i]["need_by_date"].ToString();
string colValue4 = dtStudentdtl.Rows[i]["process_id"].ToString();
dr[dtStudentdtl.Rows[i]["prod_line"].ToString()] = "Job Order: " + colValue + " Quantity: " + colValue2 + " Need by Date: " + colValue3 + " Status: " + colValue4;
var joinedWords = string.Join(" ", dtStudent);
}
dtStudent.Rows.InsertAt(dr, dtStudent.Rows.Count);
}
GridView1.CellPadding = 10;
GridView1.DataSource = dtStudent;
GridView1.DataBind();
GridView_Row_Merger(GridView1);
con.Close();
}
catch (Exception ex)
{
Response.Write(ex.Message);
}
问题是我使用 let options = IJKFFOptions.byDefault()
let streamUrl:String = "http://xxxxxxxxx.com/test/7777.flv"
let player = IJKFFMoviePlayerController(contentURLString: streamUrl, with: options)
let autoresize = UIViewAutoresizing.flexibleWidth.rawValue | UIViewAutoresizing.flexibleHeight.rawValue
player?.view.autoresizingMask = UIViewAutoresizing(rawValue: autoresize)
player?.view.frame = CGRect(x: 0, y: 0, width: 1, height: 1)
let gesture = UITapGestureRecognizer(target: self, action: #selector(self.compressExpand(_:)))
player?.view.addGestureRecognizer(gesture)
player?.view.backgroundColor = UIColor.black
player?.scalingMode = .aspectFit
player?.shouldAutoplay = false
self.player = player
self.player.shouldShowHudView = true
self.player.setPlayerOptionIntValue(1000, forKey: "max_cached_duration")
恢复播放器已有一段时间了。然后我使用player.pause()
继续播放。实时视频然后从暂停的帧播放,我想要的是从最新或最新的帧恢复视频。
答案 0 :(得分:0)
您可以释放播放器,然后重新启动它。这应该从最新的框架播放演示。这可能不是最佳解决方案。