Skip to content

Commit

Permalink
Merge pull request #42 from tada-team/feat-video-calls
Browse files Browse the repository at this point in the history
feat(video_calls): add structures for support video calls with back compatibility
  • Loading branch information
WCStudio2017 authored Oct 22, 2021
2 parents dd7b742 + dc11390 commit 109f890
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
v.1.49.2
- feat(video_calls): add structures for support video calls with back compatibility

v.1.49.1
- chore(features): add omitempty tag for FileExtensions fields in Features struct

Expand Down
3 changes: 3 additions & 0 deletions call_event.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ type CallOnliner struct {
// Microphone muted. Computed from devices muted states
Muted bool `json:"muted"`

// Video state
EnabledVideo bool `json:"enabled_video,omitempty"`

// Member devices, strictly one for now
Devices []CallDevice `json:"devices"`
}
Expand Down
10 changes: 10 additions & 0 deletions client_call_offer.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,21 @@ type clientCallOfferParams struct {
Jid JID `json:"jid"`

// Mute state
// Deprecated: use EnabledAudio
Muted bool `json:"muted"`

// Is trickle mode enabled
Trickle bool `json:"trickle"`

// SDP (session description protocol) data
Sdp string `json:"sdp"`

// CallType is a type of call("audio" - audio room, "video" - video room). default = "audio"
CallType string `json:"call_type,omitempty"`

// Audio state
EnabledAudio bool `json:"enabled_audio,omitempty"`

// Video state
EnabledVideo bool `json:"enabled_video,omitempty"`
}
18 changes: 18 additions & 0 deletions client_call_video.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package tdproto

// Change video state in call
type ClientCallVideo struct {
BaseEvent
Params clientCallVideoParams `json:"params"`
}

func (p ClientCallVideo) GetName() string { return "client.call.video" }

// Params of the client.call.video event
type clientCallVideoParams struct {
// Chat or contact id
Jid JID `json:"jid"`

// Enable video state
Enabled bool `json:"enabled"`
}
3 changes: 3 additions & 0 deletions server_call_buzz.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,7 @@ type serverCallBuzzParams struct {

// Deprecated
Team string `json:"team"`

// CallType is a type of call("audio" - audio room, "video" - video room)
CallType string `json:"call_type,omitempty"`
}
3 changes: 3 additions & 0 deletions server_online.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,7 @@ type OnlineCall struct {

// Number participants in call
OnlineCount int `json:"online_count,omitempty"`

// CallType is a type of call("audio" - audio room, "video" - video room)
CallType string `json:"call_type,omitempty"`
}

0 comments on commit 109f890

Please sign in to comment.