GetStream / stream-video-swift

SwiftUI Video SDK ➡️ Stream Video 📹
https://getstream.io/video/sdk/ios/
Other
118 stars 21 forks source link
audio-calls ios ios-sdk live-streaming real-time-communication sdk stream-video swiftui swiftui-components swiftui-framework swiftui-video uikit video video-api video-application video-calling video-communication video-sdk voice-messages

StreamVideo iOS

StreamVideo StreamVideoSwiftUI StreamVideoUIKit StreamWebRTC

Stream Video for iOS Header image

This is the official iOS SDK for StreamVideo, a platform for building apps with video and audio calling support. The repository includes a low-level SDK and a set of reusable UI components, available in both UIKit and SwiftUI.

What is Stream?

Stream allows developers to rapidly deploy scalable feeds, chat messaging and video with an industry leading 99.999% uptime SLA guarantee.

With Stream's video components, you can use our SDK to build in-app video calling, audio rooms, audio calls, or live streaming. The best place to get started is with our tutorials:

Stream provides UI components and state handling that make it easy to build video calling for your app. All calls run on Stream's network of edge servers around the world, ensuring optimal latency and reliability.

👩‍💻 Free for Makers 👨‍💻

Stream is free for most side and hobby projects. To qualify, your project/company needs to have < 5 team members and < $10k in monthly revenue. Makers get $100 in monthly credit for video for free.

💡Supported Features💡

Here are some of the features we support:

Check our docs to get more details about the supported features and integration guides.

Repo Overview 😎

This repository contains the following parts:

Main Principles

Low-Level Client

The low-level client is used for establishing audio and video calls. It integrates with Stream's backend infrastructure, and implements the WebRTC protocol.

Here are the most important components that the low-level client provides:

StreamVideo

This is the main object for interfacing with the low-level client. It needs to be initialized with an API key and a user/token, before the SDK can be used.

let streamVideo = StreamVideo(
    apiKey: "key1",
    user: user.userInfo,
    token: user.token,
    videoConfig: VideoConfig(),
    tokenProvider: { result in
      yourNetworkService.loadToken(completion: result)
    }
)

Call

The Call class provides all the information about the call, such as its participants, whether the call is being recorded, etc. It also provides methods to perform standard actions available during a call, such as muting/unmuting users, sending reactions, changing the camera input, granting permissions, recording, etc.

You can create a new Call via the StreamVideo's method func call(callType: String, callId: String, members: [Member]).

SwiftUI SDK

The SwiftUI SDK provides out of the box UI components, ready to be used in your app.

The simplest way to add calling support to your hosting view is to attach the CallModifier:

struct CallView: View {

    @StateObject var viewModel: CallViewModel

    init() {
        _viewModel = StateObject(wrappedValue: CallViewModel())
    }

    var body: some View {
        HomeView(viewModel: viewModel)
            .modifier(CallModifier(viewModel: viewModel))
    }
}

You can customize the look and feel of the screens presented in the calling flow, by implementing the corresponding methods in our ViewFactory.

Most of our components are public, so you can use them as building blocks if you want to build your custom UI.

All the texts, images, fonts and sounds used in the SDK are configurable via our Appearance class, to help you brand the views to be inline with your hosting app.

UIKit SDK

The UIKit SDK provides UIKit wrappers around the SwiftUI views. Its main integration point is the CallViewController which you can easily push in your navigation stack, or add as a modal screen.

private func didTapStartButton() {
    let next = CallViewController.make(with: callViewModel)
    next.modalPresentationStyle = .fullScreen
    next.startCall(
            callType: "default",
            callId: callId,
            members: members
        )
    self.navigationController?.present(next, animated: true)
}

The CallViewController is created with a CallViewModel - the same one used in our SwiftUI SDK.

At the moment, all the customizations in the UIKit SDK, need to be done in SwiftUI.

Roadmap

Video roadmap and changelog is available here.

0.2 milestone

0.3 milestone

0.4 milestone

0.5.0 milestone

1.0.0 milestone - April

1.1.0 milestone - June

After 1.1