Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrBadRequest = errors.New("ErrBadRequest")
View Source
var ErrHLS = errors.New("ErrHLS")
View Source
var ErrNotFound = errors.New("ErrNotFound")
View Source
var ErrRTMP = errors.New("ErrRTMP")
View Source
var ErrTimeout = errors.New("ErrTimeout")
View Source
var PlaylistWaittime = 6 * time.Second
Functions ¶
This section is empty.
Types ¶
type VidPlayer ¶
type VidPlayer struct { RtmpServer *joy4rtmp.Server VodPath string // contains filtered or unexported fields }
VidPlayer is the module that handles playing video. For now we only support RTMP and HLS play.
func NewVidPlayer ¶
NewVidPlayer creates a new video player
func (*VidPlayer) HandleHLSPlay ¶
func (s *VidPlayer) HandleHLSPlay( getMasterPlaylist func(url *url.URL) (*m3u8.MasterPlaylist, error), getMediaPlaylist func(url *url.URL) (*m3u8.MediaPlaylist, error), getSegment func(url *url.URL) ([]byte, error))
HandleHLSPlay is the handler when there is a HLS video request. It supports both VOD and live streaming.
func (*VidPlayer) HandleRTMPPlay ¶
func (s *VidPlayer) HandleRTMPPlay(getStream func(url *url.URL) (stream.RTMPVideoStream, error)) error
HandleRTMPPlay is the handler when there is a RTMP request for a video. The source should write into the MuxCloser. The easiest way is through avutil.Copy.
Click to show internal directories.
Click to hide internal directories.