mirror of
https://github.com/langhuihui/monibuca.git
synced 2025-10-21 22:19:26 +08:00
46 lines
667 B
Go
46 lines
667 B
Go
package webrtc
|
|
|
|
import (
|
|
"m7s.live/v5"
|
|
"m7s.live/v5/pkg/config"
|
|
)
|
|
|
|
const (
|
|
DIRECTION_PULL = "pull"
|
|
DIRECTION_PUSH = "push"
|
|
)
|
|
|
|
type PullRequest struct {
|
|
Tracks []TrackInfo `json:"tracks"`
|
|
}
|
|
|
|
type Client struct {
|
|
MultipleConnection
|
|
pullCtx m7s.PullJob
|
|
pushCtx m7s.PushJob
|
|
direction string
|
|
appId string
|
|
token string
|
|
apiBase string
|
|
}
|
|
|
|
func (c *Client) GetPullJob() *m7s.PullJob {
|
|
return &c.pullCtx
|
|
}
|
|
|
|
func (c *Client) GetPushJob() *m7s.PushJob {
|
|
return &c.pushCtx
|
|
}
|
|
|
|
func NewPuller(config.Pull) m7s.IPuller {
|
|
return &Client{
|
|
direction: DIRECTION_PULL,
|
|
}
|
|
}
|
|
|
|
func NewPusher() m7s.IPusher {
|
|
return &Client{
|
|
direction: DIRECTION_PUSH,
|
|
}
|
|
}
|