Skip to content

Commit

Permalink
added stop push and fix body interface{}
Browse files Browse the repository at this point in the history
  • Loading branch information
Allan-Nava authored Jan 25, 2023
1 parent 7cfe946 commit c5035f7
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
4 changes: 3 additions & 1 deletion ovenmedia/ovenmedia.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ type IOvenMediaClient interface {
CreateVirtualHost(name string) (*ResponseVirtualHost, error)
GetAllVirtualHosts() (*ResponseVirtualList, error)
// Push
StartPush(vHost string, appName string) (*resty.Response, error)
StartPush(vHost string, appName string, body interface{}) (*resty.Response, error)
StopPush(vHost string, appName string, body interface{}) (*resty.Response, error)
// Recording
}

func (o *OvenMedia) HealthCheck() error {
Expand Down
14 changes: 13 additions & 1 deletion ovenmedia/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,24 @@ import (
)

// POST http://1.2.3.4:8081/v1/vhosts/default/apps/app:startPush
func (o *OvenMedia) StartPush(vHost string, appName string) (*resty.Response, error) {
func (o *OvenMedia) StartPush(vHost string, appName string, body interface{}) (*resty.Response, error) {
//
//
resp, err := o.RestyPost(GET_VHOSTS_PUSH_BY_NAME(vHost, appName), nil)
if err != nil {
return nil, err
}
fmt.Println("resp", resp)
return resp, nil
}


func (o *OvenMedia) StopPush(vHost string, appName string,body interface{}) (*resty.Response, error)
//
resp, err := o.RestyPost(V1_HOSTS_STOP_PUSH_NAME(vHost, appName), body)
if err != nil {
return nil, err
}
fmt.Println("resp", resp)
return resp, nil
}
16 changes: 16 additions & 0 deletions ovenmedia/recording.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package ovenmedia

/*
{
"id": "custom_id",
"stream": {
"name": "stream_o",
"tracks": [ 100, 200 ]
},
"filePath" : "/path/to/save/recorded/file_${Sequence}.ts",
"infoPath" : "/path/to/save/information/file.xml",
"interval" : 60000, # Split it every 60 seconds
"schedule" : "0 0 1" # Split it at second 0, minute 0, every hours.
"segmentationRule" : "continuity"
}*/

0 comments on commit c5035f7

Please sign in to comment.