Minor cleanup, updated docs to reflect Swift (#428)
This commit is contained in:
@@ -8,8 +8,8 @@ LiveKit is written in Go, using the awesome [Pion WebRTC](https://github.com/pio
|
|||||||
## Features
|
## Features
|
||||||
|
|
||||||
- Scalable, distributed WebRTC SFU (Selective Forwarding Unit)
|
- Scalable, distributed WebRTC SFU (Selective Forwarding Unit)
|
||||||
- Modern, full-featured [client SDKs](https://docs.livekit.io/references/client-sdks/) for JS, React, iOS, Android, and
|
- Modern, full-featured [client SDKs](https://docs.livekit.io/references/client-sdks/) for JS, React, iOS, Android,
|
||||||
Flutter
|
Flutter, and Mac
|
||||||
- Built for production - JWT authentication and [server APIs](https://docs.livekit.io/guides/server-api)
|
- Built for production - JWT authentication and [server APIs](https://docs.livekit.io/guides/server-api)
|
||||||
- Robust networking & connectivity. UDP/TCP/TURN
|
- Robust networking & connectivity. UDP/TCP/TURN
|
||||||
- Easy to deploy - single binary, docker & kubernetes
|
- Easy to deploy - single binary, docker & kubernetes
|
||||||
@@ -30,7 +30,7 @@ Client SDKs:
|
|||||||
|
|
||||||
- [Javascript](https://github.com/livekit/client-sdk-js) ([docs](https://docs.livekit.io/client-sdk-js/))
|
- [Javascript](https://github.com/livekit/client-sdk-js) ([docs](https://docs.livekit.io/client-sdk-js/))
|
||||||
- [React](https://github.com/livekit/livekit-react)
|
- [React](https://github.com/livekit/livekit-react)
|
||||||
- [iOS - Swift](https://github.com/livekit/client-sdk-ios) ([docs](https://docs.livekit.io/client-sdk-ios/))
|
- [iOS & MacOS - Swift](https://github.com/livekit/client-sdk-swift) ([docs](https://docs.livekit.io/client-sdk-swift/))
|
||||||
- [Android - Kotlin](https://github.com/livekit/client-sdk-android) ([docs](https://docs.livekit.io/client-sdk-android/))
|
- [Android - Kotlin](https://github.com/livekit/client-sdk-android) ([docs](https://docs.livekit.io/client-sdk-android/))
|
||||||
- [Flutter](https://github.com/livekit/client-sdk-flutter) ([docs](https://docs.livekit.io/client-sdk-flutter/))
|
- [Flutter](https://github.com/livekit/client-sdk-flutter) ([docs](https://docs.livekit.io/client-sdk-flutter/))
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"sync"
|
"sync"
|
||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/livekit/protocol/livekit"
|
"github.com/livekit/protocol/livekit"
|
||||||
"github.com/livekit/protocol/logger"
|
"github.com/livekit/protocol/logger"
|
||||||
@@ -18,10 +17,6 @@ import (
|
|||||||
"github.com/livekit/livekit-server/pkg/telemetry"
|
"github.com/livekit/livekit-server/pkg/telemetry"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
|
||||||
connectionQualityUpdateInterval = 5 * time.Second
|
|
||||||
)
|
|
||||||
|
|
||||||
// MediaTrack represents a WebRTC track that needs to be forwarded
|
// MediaTrack represents a WebRTC track that needs to be forwarded
|
||||||
// Implements MediaTrack and PublishedTrack interface
|
// Implements MediaTrack and PublishedTrack interface
|
||||||
type MediaTrack struct {
|
type MediaTrack struct {
|
||||||
@@ -58,7 +53,7 @@ type MediaTrackParams struct {
|
|||||||
Logger logger.Logger
|
Logger logger.Logger
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewMediaTrack(track *webrtc.TrackRemote, params MediaTrackParams) *MediaTrack {
|
func NewMediaTrack(params MediaTrackParams) *MediaTrack {
|
||||||
t := &MediaTrack{
|
t := &MediaTrack{
|
||||||
params: params,
|
params: params,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/livekit/protocol/livekit"
|
"github.com/livekit/protocol/livekit"
|
||||||
"github.com/pion/webrtc/v3"
|
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -21,7 +20,7 @@ func TestTrackInfo(t *testing.T) {
|
|||||||
Muted: true,
|
Muted: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
mt := NewMediaTrack(&webrtc.TrackRemote{}, MediaTrackParams{
|
mt := NewMediaTrack(MediaTrackParams{
|
||||||
TrackInfo: &ti,
|
TrackInfo: &ti,
|
||||||
})
|
})
|
||||||
outInfo := mt.ToProto()
|
outInfo := mt.ToProto()
|
||||||
@@ -43,7 +42,7 @@ func TestTrackInfo(t *testing.T) {
|
|||||||
|
|
||||||
func TestGetQualityForDimension(t *testing.T) {
|
func TestGetQualityForDimension(t *testing.T) {
|
||||||
t.Run("landscape source", func(t *testing.T) {
|
t.Run("landscape source", func(t *testing.T) {
|
||||||
mt := NewMediaTrack(&webrtc.TrackRemote{}, MediaTrackParams{TrackInfo: &livekit.TrackInfo{
|
mt := NewMediaTrack(MediaTrackParams{TrackInfo: &livekit.TrackInfo{
|
||||||
Type: livekit.TrackType_VIDEO,
|
Type: livekit.TrackType_VIDEO,
|
||||||
Width: 1080,
|
Width: 1080,
|
||||||
Height: 720,
|
Height: 720,
|
||||||
@@ -57,7 +56,7 @@ func TestGetQualityForDimension(t *testing.T) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
t.Run("portrait source", func(t *testing.T) {
|
t.Run("portrait source", func(t *testing.T) {
|
||||||
mt := NewMediaTrack(&webrtc.TrackRemote{}, MediaTrackParams{TrackInfo: &livekit.TrackInfo{
|
mt := NewMediaTrack(MediaTrackParams{TrackInfo: &livekit.TrackInfo{
|
||||||
Type: livekit.TrackType_VIDEO,
|
Type: livekit.TrackType_VIDEO,
|
||||||
Width: 540,
|
Width: 540,
|
||||||
Height: 960,
|
Height: 960,
|
||||||
@@ -70,7 +69,7 @@ func TestGetQualityForDimension(t *testing.T) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
t.Run("layers provided", func(t *testing.T) {
|
t.Run("layers provided", func(t *testing.T) {
|
||||||
mt := NewMediaTrack(&webrtc.TrackRemote{}, MediaTrackParams{TrackInfo: &livekit.TrackInfo{
|
mt := NewMediaTrack(MediaTrackParams{TrackInfo: &livekit.TrackInfo{
|
||||||
Type: livekit.TrackType_VIDEO,
|
Type: livekit.TrackType_VIDEO,
|
||||||
Width: 1080,
|
Width: 1080,
|
||||||
Height: 720,
|
Height: 720,
|
||||||
@@ -102,7 +101,7 @@ func TestGetQualityForDimension(t *testing.T) {
|
|||||||
|
|
||||||
func TestSubscribedMaxQuality(t *testing.T) {
|
func TestSubscribedMaxQuality(t *testing.T) {
|
||||||
t.Run("subscribers muted", func(t *testing.T) {
|
t.Run("subscribers muted", func(t *testing.T) {
|
||||||
mt := NewMediaTrack(&webrtc.TrackRemote{}, MediaTrackParams{TrackInfo: &livekit.TrackInfo{
|
mt := NewMediaTrack(MediaTrackParams{TrackInfo: &livekit.TrackInfo{
|
||||||
Sid: "v1",
|
Sid: "v1",
|
||||||
Type: livekit.TrackType_VIDEO,
|
Type: livekit.TrackType_VIDEO,
|
||||||
Width: 1080,
|
Width: 1080,
|
||||||
@@ -149,7 +148,7 @@ func TestSubscribedMaxQuality(t *testing.T) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
t.Run("subscribers max quality", func(t *testing.T) {
|
t.Run("subscribers max quality", func(t *testing.T) {
|
||||||
mt := NewMediaTrack(&webrtc.TrackRemote{}, MediaTrackParams{TrackInfo: &livekit.TrackInfo{
|
mt := NewMediaTrack(MediaTrackParams{TrackInfo: &livekit.TrackInfo{
|
||||||
Sid: "v1",
|
Sid: "v1",
|
||||||
Type: livekit.TrackType_VIDEO,
|
Type: livekit.TrackType_VIDEO,
|
||||||
Width: 1080,
|
Width: 1080,
|
||||||
|
|||||||
@@ -1432,7 +1432,7 @@ func (p *ParticipantImpl) mediaTrackReceived(track *webrtc.TrackRemote, rtpRecei
|
|||||||
}
|
}
|
||||||
ti.Mid = mid
|
ti.Mid = mid
|
||||||
|
|
||||||
mt = NewMediaTrack(track, MediaTrackParams{
|
mt = NewMediaTrack(MediaTrackParams{
|
||||||
TrackInfo: ti,
|
TrackInfo: ti,
|
||||||
SignalCid: signalCid,
|
SignalCid: signalCid,
|
||||||
SdpCid: track.ID(),
|
SdpCid: track.ID(),
|
||||||
|
|||||||
Reference in New Issue
Block a user