Request history flow
Video playback: Users can play historical video streams according to the list of videos returned
Video download: Need to set the isDownload of the request parameter to true and call at the same timeGet the upload progress interfaceGet the upload progress of the device, and then call the video download interface to download the file to the local when it reaches 100
Video playback and record download cannot operate the same channel on the same device
Request parameter
field | type | required | desc |
---|---|---|---|
vehicleNo | string | Yes | Plat No. |
channelNo | integer | Yes | Channel number |
isSubCode | bool | No | Whether it is a substream |
startTime | integer | Yes | Start time,UTC timestamp |
endTime | integer | Yes | End time,UTC timestamp |
mediaType | integer | No | Media type 0: audio and video,1: audio,2: video |
storageType | integer | No | Storage type 1: primary storage,2 Dr Storage |
playType | integer | No | Playback mode 0; Normal playback; l: fast forward playback :2: key frame fast back; 3: key frame playback; 4: Single-frame upload |
speed | integer | No | Double speed 0: invalid, 1:1x, 2:2x, 3:4x, 4:8x, 5:16x |
isDownload | bool | No | Whether to download, if not download, do not need to generate mp4 |
Response Data
field | type | desc |
---|---|---|
zlmStreamID | string | Play stream ID |
zlmTalkStreamID | string | Intercom stream ID, which is used to push intercom streams |
rtmp | string | RTMP pull stream URL |
rtmps | string | RTMP encrypted pull URL |
rtsp | string | RTSP pull URL |
rtsps | string | RTSP encrypted pull URL |
httpFlv | string | HTTP-FLV pulls the URL |
httpFlvs | string | HTTP-FLV encrypts the pull URL |
wsFlv | string | websocket pulling URL |
wsFlvs | string | websocket encrypts the pull URL |
webRTC | string | webRTC Pulls the URL |
webRTCs | string | webRTC Encrypts the pull URL |
talkWebRTC | string | webRTC Encrypts the pull URL |
talkWebRTCs | string | Intercom push stream URL(encrypted) |
Exampleample
Request example
http://localhost:8080/web_api/v1/media/history_video?vehicleNo=13000000005&channelNo=1&isSubCode=true&startTime=1699026825&endTime=1699028383&mediaType=0&storageType=0&playType=0&speed=1&_t=1699065906071
http://localhost:8080/web_api/v1/media/history_video?vehicleNo=13000000005&channelNo=1&isSubCode=true&startTime=1699026825&endTime=1699028383&mediaType=0&storageType=0&playType=0&speed=1&_t=1699065906071
Response example
{
"hdr":{
"code":200
},
"data":{
"zlmStreamID":"7296322783548543480",
"zlmTalkStreamID":"",
"rtmp":"rtmp://localhost:7206/play/7296322783548543480",
"rtmps":"rtmps://localhost:7206/play/7296322783548543480",
"rtsp":"rtsp://localhost:7207/play/7296322783548543480",
"rtsps":"rtsps://localhost:7207/play/7296322783548543480",
"httpFlv":"http://localhost:7205/play/7296322783548543480.live.flv",
"httpFlvs":"https://localhost:443/play/7296322783548543480.live.flv",
"wsFlv":"ws://localhost:7205/play/7296322783548543480.live.flv",
"wsFlvs":"wss://localhost:443/play/7296322783548543480.live.flv",
"webRTC":"http://localhost:7205/index/api/webrtc?app=play&stream=7296322783548543480&type=play",
"webRTCs":"https://localhost:443/index/api/webrtc?app=play&stream=7296322783548543480&type=play",
"talkWebRTC":"",
"talkWebRTCs":""
}
}
{
"hdr":{
"code":200
},
"data":{
"zlmStreamID":"7296322783548543480",
"zlmTalkStreamID":"",
"rtmp":"rtmp://localhost:7206/play/7296322783548543480",
"rtmps":"rtmps://localhost:7206/play/7296322783548543480",
"rtsp":"rtsp://localhost:7207/play/7296322783548543480",
"rtsps":"rtsps://localhost:7207/play/7296322783548543480",
"httpFlv":"http://localhost:7205/play/7296322783548543480.live.flv",
"httpFlvs":"https://localhost:443/play/7296322783548543480.live.flv",
"wsFlv":"ws://localhost:7205/play/7296322783548543480.live.flv",
"wsFlvs":"wss://localhost:443/play/7296322783548543480.live.flv",
"webRTC":"http://localhost:7205/index/api/webrtc?app=play&stream=7296322783548543480&type=play",
"webRTCs":"https://localhost:443/index/api/webrtc?app=play&stream=7296322783548543480&type=play",
"talkWebRTC":"",
"talkWebRTCs":""
}
}
After success,how to play
If use H5 ,If you want it to be simple, you can directly use flvjs to play, and the user can query the usage method
Currently, webrtc play is being used here, with a delay about 700ms for public network testing. If needed, JSSDK can be provided in the future Xgplayer flv The usage document click to view