| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181 |
- import request from '@/service/request'
- export const getStreams = () => {
- return request<RTS.STREAM.List[]>({
- url: '/api/streams',
- method: 'GET'
- })
- }
- export const getStreamsDetail = (streamPath: string) => {
- return request<RTS.STREAM.Detail[]>({
- url: `/api/stream?streamPath=${streamPath}`,
- method: 'GET'
- })
- }
- export const getSnap = (streamPath: string) => {
- return request<RTS.STREAM.Detail[]>({
- url: `/snap/${streamPath}`,
- method: 'GET'
- })
- }
- export const closeStream = (streamPath: string) => {
- return request<RTS.STREAM.Detail[]>({
- url: `/api/closestream?streamPath=${streamPath}`,
- method: 'GET'
- })
- }
- export const getPullList = () => {
- return request<RTS.PullStream.Detail[]>({
- url: '/api/list/pull',
- method: 'GET'
- })
- }
- export const stopPull = (url: string) => {
- return request<RTS.STREAM.Detail[]>({
- url: `/api/stoppull?url=${url}`,
- method: 'GET'
- })
- }
- export const createRtspPull = (params: {streamPath: string, target: string, save: number}) => {
- return request<RTS.STREAM.Detail[]>({
- url: '/rtsp/api/pull',
- method: 'GET',
- params
- })
- }
- export const createRtmpPull = (params: {streamPath: string, target: string, save: number}) => {
- return request<RTS.STREAM.Detail[]>({
- url: '/rtmp/api/pull',
- method: 'GET',
- params
- })
- }
- export const getPushList = () => {
- return request<RTS.PullStream.Detail[]>({
- url: '/api/list/push',
- method: 'GET'
- })
- }
- export const stopPush = (url: string) => {
- return request<RTS.STREAM.Detail[]>({
- url: `/api/stoppush?url=${url}`,
- method: 'GET'
- })
- }
- export const createRtspPush = (params: {streamPath: string, target: string, save: number}) => {
- return request<RTS.PullStream.Detail[]>({
- url: '/rtsp/api/push',
- method: 'GET',
- params
- })
- }
- export const createRtmpPush = (params: {streamPath: string, target: string, save: number}) => {
- return request<RTS.STREAM.Detail[]>({
- url: '/rtsp/api/push',
- method: 'GET',
- params
- })
- }
- /** 查看存储列表 */
- export const getRecordList = (type: 'mp4' | 'ts' | 'flv') => {
- return request<RTS.STREAM.Detail[]>({
- url: `/record/api/list?type=${type}`,
- method: 'GET'
- })
- }
- /** 正在存储的视频流 */
- export const getRecording = () => {
- return request<RTS.STREAM.Detail[]>({
- url: '/record/api/list/recording',
- method: 'GET'
- })
- }
- /** 开始存储 */
- export const postRecord = (params: {type: 'mp4' | 'ts' | 'flv', streamPath: string }) => {
- return request<RTS.STREAM.Detail[]>({
- url: '/record/api/start',
- method: 'GET',
- params
- })
- }
- /** 停止录制 */
- export const stopRecord = (id: string) => {
- return request<RTS.STREAM.Detail[]>({
- url: `/record/api/stop?id=${id}`,
- method: 'GET'
- })
- }
- /** 录制播放 */
- // url: `/record/${id}.${format}`,
- export const playRecord = (id: string, format: 'flv'| 'mp4' | 'm3u8' | 'h264'| 'h265') => {
- return request<RTS.STREAM.Detail[]>({
- url: `/record/${id}`,
- method: 'GET'
- })
- }
- /** 获取配置 RTSP */
- export const getConfig = (name: 'RTSP' | 'RTMP' | 'HLS' | 'HDL' | 'GB28181') => {
- return request<any>({
- url: `/api/getconfig?name=${name}`,
- method: 'GET'
- })
- }
- /** 保存配置 RTSP */
- export const postConfig = (name: 'RTSP' | 'RTMP' | 'HLS' | 'HDL' | 'GB28181', data: string) => {
- return request<any>({
- url: `/api/modifyconfig?name=${name}`,
- method: 'POST',
- data
- })
- }
- export const updateConfig = (name: 'RTSP' | 'RTMP' | 'HLS' | 'HDL' | 'GB28181') => {
- return request<string>({
- url: `/api/updateconfig?name=${name}`,
- method: 'GET'
- })
- }
- /** 系统监控 */
- export const getSummary = () => {
- return request<RTS.SUMMARY.Detail>({
- url: '/api/summary',
- method: 'GET'
- })
- }
- /** 系统监控 流 */
- export const getMonitorStream = (params: {time: string, streamPath: string}) => {
- return request<RTS.STREAM.Detail[]>({
- url: '/monitor/api/list/stream',
- method: 'GET',
- params
- })
- }
- /** 系统监控 轨道 */
- export const getMonitorTrack = (params: {time: string, streamPath: string}) => {
- return request<RTS.STREAM.Detail[]>({
- url: '/monitor/api/list/track?streamPath=xxxx',
- method: 'GET',
- params
- })
- }
|