Refactor MediaRequestRemotePlayback function to handle end_time parameter
This commit is contained in:
parent
d302e599ce
commit
11b19333e1
@ -58,6 +58,7 @@ func (e *Package) MediaRequestAliveVideo(token int, camNo int64, Sid string, ser
|
||||
|
||||
// main server util
|
||||
func (e *Package) MediaRequestRemotePlayback(token int, serial string, session string, camNo int, date string, begin_time string, end_time string, serverId int) {
|
||||
if end_time == "" {
|
||||
e.Payload = map[string]any{
|
||||
"MODULE": "MEDIASTREAMMODEL",
|
||||
"OPERATION": "REQUESTREMOTEPLAYBACK",
|
||||
@ -67,13 +68,30 @@ func (e *Package) MediaRequestRemotePlayback(token int, serial string, session s
|
||||
"VIDEOTYPE": 2, // common files
|
||||
"CHANNEL": 1 << (camNo - 1),
|
||||
"STARTTIME": date + begin_time,
|
||||
// "ENDTIME": date + end_time,
|
||||
"IPANDPORT": ip + ":12092",
|
||||
"SERIAL": token,
|
||||
"PBST": 0,
|
||||
},
|
||||
"SESSION": session,
|
||||
}
|
||||
} else {
|
||||
e.Payload = map[string]any{
|
||||
"MODULE": "MEDIASTREAMMODEL",
|
||||
"OPERATION": "REQUESTREMOTEPLAYBACK",
|
||||
"PARAMETER": map[string]any{
|
||||
"STREAMNAME": "PLAYBACK" + "_" + fmt.Sprint(serial) + "_" + fmt.Sprint(camNo) + "_" + fmt.Sprint(serverId),
|
||||
"STREAMTYPE": 1, // main stream
|
||||
"VIDEOTYPE": 2, // common files
|
||||
"CHANNEL": 1 << (camNo - 1),
|
||||
"STARTTIME": date + begin_time,
|
||||
"ENDTIME": date + end_time,
|
||||
"IPANDPORT": ip + ":12092",
|
||||
"SERIAL": token,
|
||||
"PBST": 0,
|
||||
},
|
||||
"SESSION": session,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// main server util
|
||||
|
Loading…
Reference in New Issue
Block a user