|
|
@@ -0,0 +1,164 @@
|
|
|
+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.STREAM.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.STREAM.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.STREAM.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?type=flv&streamPath=live/rtc',
|
|
|
+ method: 'GET',
|
|
|
+ params
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+/** 停止录制 */
|
|
|
+export const stopRecord = (id: string) => {
|
|
|
+ return request<RTS.STREAM.Detail[]>({
|
|
|
+ url: '/record/api/stop?id=xxx',
|
|
|
+ method: 'GET'
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+/** 录制播放 */
|
|
|
+export const playRecord = (streamPath: 'flv'| 'mp4' | 'm3u8' | 'h264'| 'h265') => {
|
|
|
+ return request<RTS.STREAM.Detail[]>({
|
|
|
+ url: `/record/.${streamPath}`,
|
|
|
+ method: 'GET'
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+/** 获取配置 RTSP */
|
|
|
+export const getConfig = (name: 'RTSP' | 'RTMP' | 'HLS' | 'HDL' | 'GB28181') => {
|
|
|
+ return request<RTS.STREAM.Detail[]>({
|
|
|
+ url: `/api/getconfig?name=${name}`,
|
|
|
+ method: 'GET'
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+/** 系统监控 */
|
|
|
+export const getSummary = () => {
|
|
|
+ return request<RTS.STREAM.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
|
|
|
+ })
|
|
|
+}
|