mirror of
https://github.com/langhuihui/monibuca.git
synced 2025-10-18 18:54:33 +08:00
15 lines
443 B
Go
15 lines
443 B
Go
package plugin_rtmp
|
|
|
|
import (
|
|
"context"
|
|
gpb "m7s.live/m7s/v5/pb"
|
|
"m7s.live/m7s/v5/plugin/rtmp/pb"
|
|
rtmp "m7s.live/m7s/v5/plugin/rtmp/pkg"
|
|
)
|
|
|
|
func (r *RTMPPlugin) PushOut(ctx context.Context, req *pb.PushRequest) (res *gpb.SuccessResponse, err error) {
|
|
pusher := rtmp.NewPusher()
|
|
err = r.Server.AddPushTask(pusher.GetPushContext().Init(pusher, &r.Plugin, req.StreamPath, req.RemoteURL)).WaitStarted()
|
|
return &gpb.SuccessResponse{}, err
|
|
}
|