mirror of
https://github.com/strukturag/nextcloud-spreed-signaling
synced 2024-05-03 06:13:17 +02:00
Merge pull request #221 from danxuliu/fix-media-type-not-updated-after-publisher-renegotiations
Fix mediaType not updated after publisher renegotiations
This commit is contained in:
commit
156a8a2086
|
@ -895,6 +895,8 @@ func (s *ClientSession) GetOrCreatePublisher(ctx context.Context, mcu Mcu, strea
|
|||
s.publishers[streamType] = publisher
|
||||
}
|
||||
log.Printf("Publishing %s as %s for session %s", streamType, publisher.Id(), s.PublicId())
|
||||
} else {
|
||||
publisher.SetMedia(mediaTypes)
|
||||
}
|
||||
|
||||
return publisher, nil
|
||||
|
|
|
@ -90,6 +90,7 @@ type McuPublisher interface {
|
|||
McuClient
|
||||
|
||||
HasMedia(MediaType) bool
|
||||
SetMedia(MediaType)
|
||||
}
|
||||
|
||||
type McuSubscriber interface {
|
||||
|
|
|
@ -883,6 +883,10 @@ func (p *mcuJanusPublisher) HasMedia(mt MediaType) bool {
|
|||
return (p.mediaTypes & mt) == mt
|
||||
}
|
||||
|
||||
func (p *mcuJanusPublisher) SetMedia(mt MediaType) {
|
||||
p.mediaTypes = mt
|
||||
}
|
||||
|
||||
func (p *mcuJanusPublisher) NotifyReconnected() {
|
||||
ctx := context.TODO()
|
||||
handle, session, roomId, err := p.mcu.getOrCreatePublisherHandle(ctx, p.id, p.streamType, p.bitrate)
|
||||
|
|
|
@ -144,6 +144,11 @@ func (p *mcuProxyPublisher) HasMedia(mt MediaType) bool {
|
|||
return (p.mediaTypes & mt) == mt
|
||||
}
|
||||
|
||||
func (p *mcuProxyPublisher) SetMedia(mt MediaType) {
|
||||
// TODO: Also update mediaTypes on proxy.
|
||||
p.mediaTypes = mt
|
||||
}
|
||||
|
||||
func (p *mcuProxyPublisher) NotifyClosed() {
|
||||
p.listener.PublisherClosed(p)
|
||||
p.conn.removePublisher(p)
|
||||
|
|
|
@ -153,6 +153,10 @@ func (p *TestMCUPublisher) HasMedia(mt MediaType) bool {
|
|||
return (p.mediaTypes & mt) == mt
|
||||
}
|
||||
|
||||
func (p *TestMCUPublisher) SetMedia(mt MediaType) {
|
||||
p.mediaTypes = mt
|
||||
}
|
||||
|
||||
func (p *TestMCUPublisher) SendMessage(ctx context.Context, message *MessageClientMessage, data *MessageClientMessageData, callback func(error, map[string]interface{})) {
|
||||
go func() {
|
||||
if p.isClosed() {
|
||||
|
|
Loading…
Reference in a new issue