mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
member profile can share media.
This commit is contained in:
parent
b653856994
commit
670e0ee17d
@ -62,6 +62,7 @@ func (h *MembersHandler) membersCreate(w http.ResponseWriter, r *http.Request) e
|
|||||||
CanConnect: true,
|
CanConnect: true,
|
||||||
CanWatch: true,
|
CanWatch: true,
|
||||||
CanHost: true,
|
CanHost: true,
|
||||||
|
CanShareMedia: true,
|
||||||
CanAccessClipboard: true,
|
CanAccessClipboard: true,
|
||||||
SendsInactiveCursor: true,
|
SendsInactiveCursor: true,
|
||||||
CanSeeInactiveCursors: true,
|
CanSeeInactiveCursors: true,
|
||||||
|
@ -14,6 +14,7 @@ func New() types.MemberProvider {
|
|||||||
CanConnect: true,
|
CanConnect: true,
|
||||||
CanWatch: true,
|
CanWatch: true,
|
||||||
CanHost: true,
|
CanHost: true,
|
||||||
|
CanShareMedia: true,
|
||||||
CanAccessClipboard: true,
|
CanAccessClipboard: true,
|
||||||
SendsInactiveCursor: true,
|
SendsInactiveCursor: true,
|
||||||
CanSeeInactiveCursors: true,
|
CanSeeInactiveCursors: true,
|
||||||
|
@ -28,6 +28,7 @@ func (provider *MemberProviderCtx) Connect() error {
|
|||||||
CanConnect: true,
|
CanConnect: true,
|
||||||
CanWatch: true,
|
CanWatch: true,
|
||||||
CanHost: true,
|
CanHost: true,
|
||||||
|
CanShareMedia: true,
|
||||||
CanAccessClipboard: true,
|
CanAccessClipboard: true,
|
||||||
SendsInactiveCursor: true,
|
SendsInactiveCursor: true,
|
||||||
CanSeeInactiveCursors: true,
|
CanSeeInactiveCursors: true,
|
||||||
@ -43,6 +44,7 @@ func (provider *MemberProviderCtx) Connect() error {
|
|||||||
CanConnect: true,
|
CanConnect: true,
|
||||||
CanWatch: true,
|
CanWatch: true,
|
||||||
CanHost: true,
|
CanHost: true,
|
||||||
|
CanShareMedia: true,
|
||||||
CanAccessClipboard: true,
|
CanAccessClipboard: true,
|
||||||
SendsInactiveCursor: true,
|
SendsInactiveCursor: true,
|
||||||
CanSeeInactiveCursors: false,
|
CanSeeInactiveCursors: false,
|
||||||
|
@ -15,6 +15,7 @@ type MemberProfile struct {
|
|||||||
CanConnect bool `json:"can_connect"`
|
CanConnect bool `json:"can_connect"`
|
||||||
CanWatch bool `json:"can_watch"`
|
CanWatch bool `json:"can_watch"`
|
||||||
CanHost bool `json:"can_host"`
|
CanHost bool `json:"can_host"`
|
||||||
|
CanShareMedia bool `json:"can_share_media"`
|
||||||
CanAccessClipboard bool `json:"can_access_clipboard"`
|
CanAccessClipboard bool `json:"can_access_clipboard"`
|
||||||
SendsInactiveCursor bool `json:"sends_inactive_cursor"`
|
SendsInactiveCursor bool `json:"sends_inactive_cursor"`
|
||||||
CanSeeInactiveCursors bool `json:"can_see_inactive_cursors"`
|
CanSeeInactiveCursors bool `json:"can_see_inactive_cursors"`
|
||||||
|
@ -157,12 +157,18 @@ func (manager *WebRTCManagerCtx) CreatePeer(session types.Session, videoID strin
|
|||||||
}
|
}
|
||||||
|
|
||||||
connection.OnTrack(func(track *webrtc.TrackRemote, receiver *webrtc.RTPReceiver) {
|
connection.OnTrack(func(track *webrtc.TrackRemote, receiver *webrtc.RTPReceiver) {
|
||||||
|
if !session.Profile().CanShareMedia {
|
||||||
|
logger.Warn().
|
||||||
|
Str("kind", track.Kind().String()).
|
||||||
|
Msgf("got track but share media is disabled for this session")
|
||||||
|
|
||||||
|
receiver.Stop()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
logger.Info().
|
logger.Info().
|
||||||
Str("stream-id", track.StreamID()).
|
Str("kind", track.Kind().String()).
|
||||||
Str("id", track.ID()).
|
|
||||||
Str("rid", track.RID()).
|
|
||||||
Str("mime", track.Codec().RTPCodecCapability.MimeType).
|
Str("mime", track.Codec().RTPCodecCapability.MimeType).
|
||||||
Uint8("payload-type", uint8(track.PayloadType())).
|
|
||||||
Msgf("received new track")
|
Msgf("received new track")
|
||||||
|
|
||||||
// parse codec
|
// parse codec
|
||||||
@ -186,7 +192,6 @@ func (manager *WebRTCManagerCtx) CreatePeer(session types.Session, videoID strin
|
|||||||
logger.Err(err).Msg("failed to start pipeline")
|
logger.Err(err).Msg("failed to start pipeline")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
defer srcManager.Stop() // TODO: Ensure no new publisher took over.
|
|
||||||
|
|
||||||
// Send a PLI on an interval so that the publisher is pushing a keyframe every rtcpPLIInterval
|
// Send a PLI on an interval so that the publisher is pushing a keyframe every rtcpPLIInterval
|
||||||
ticker := time.NewTicker(time.Second * 3)
|
ticker := time.NewTicker(time.Second * 3)
|
||||||
@ -212,7 +217,9 @@ func (manager *WebRTCManagerCtx) CreatePeer(session types.Session, videoID strin
|
|||||||
srcManager.Push(buf[:i])
|
srcManager.Push(buf[:i])
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.Warn().Msg("src manager stream connection died")
|
logger.Warn().Msg("src manager stream connection died, stopping")
|
||||||
|
srcManager.Stop()
|
||||||
|
logger.Warn().Msg("src manager stream stopped!!!!!!!!!!!!!!!")
|
||||||
})
|
})
|
||||||
|
|
||||||
connection.OnDataChannel(func(dc *webrtc.DataChannel) {
|
connection.OnDataChannel(func(dc *webrtc.DataChannel) {
|
||||||
|
Loading…
Reference in New Issue
Block a user