mirror of
https://gitlab.crans.org/nounous/ghostream.git
synced 2025-06-30 07:41:09 +02:00
Use messaging in web package
This commit is contained in:
@ -11,6 +11,7 @@ import (
|
||||
|
||||
"github.com/markbates/pkger"
|
||||
"github.com/pion/webrtc/v3"
|
||||
"gitlab.crans.org/nounous/ghostream/stream"
|
||||
)
|
||||
|
||||
// Options holds web package configuration
|
||||
@ -41,6 +42,9 @@ var (
|
||||
|
||||
// Preload templates
|
||||
templates *template.Template
|
||||
|
||||
// Streams to get statistics
|
||||
streams map[string]stream.Stream
|
||||
)
|
||||
|
||||
// Load templates with pkger
|
||||
@ -74,10 +78,11 @@ func loadTemplates() error {
|
||||
}
|
||||
|
||||
// Serve HTTP server
|
||||
func Serve(rSdpChan chan struct {
|
||||
func Serve(s map[string]stream.Stream, rSdpChan chan struct {
|
||||
StreamID string
|
||||
RemoteDescription webrtc.SessionDescription
|
||||
}, lSdpChan chan webrtc.SessionDescription, c *Options) {
|
||||
streams = s
|
||||
remoteSdpChan = rSdpChan
|
||||
localSdpChan = lSdpChan
|
||||
cfg = c
|
||||
|
Reference in New Issue
Block a user