Skip to main content

Overview

Introduction

The StreamVideo SDK provides UI components to facilitate the integration of video capabilities into your apps. You can either use our out-of-the-box solution (and customize theming and some views), or completely build your own UI, while reusing our lower-level components whenever you see them fit.

The UI components are provided in SwiftUI. If you use UIKit, we also provide UIKit wrappers, that can make it easier for you to integrate video in UIKit-based apps.

StreamVideoUI object

The UI SDK provides a context provider object that allows simple access to functionalities exposed by the SDK, such as branding, presentation logic, icons, and the low-level video client.

The StreamVideoUI object can be initialized in two ways. The first way is to implicitly create the low-level client StreamVideo, by only creating the StreamVideoUI object.

let streamVideoUI = StreamVideoUI(
apiKey: "your_api_key",
user: user.userInfo,
token: user.token,
tokenProvider: { result in
result(.success(user.token))
}
)

The other option is to first create the StreamVideo client (in case you want to keep an instance of it), and use that one to create the StreamVideoUI object.

let streamVideo = StreamVideo(
apiKey: "your_api_key",
user: user.userInfo,
token: user.token,
tokenProvider: { result in
result(.success(user.token))
}
)
let streamVideoUI = StreamVideoUI(streamVideo: streamVideo)
tip

It's important to initialize the client early in your app's lifecycle, and as soon as your user is logged in. If you try to display a view without the StreamVideoUI object being created, you will receive a crash.

Customization options

Appearance

When you create the StreamVideoUI object, you can optionally provide your custom version of the Appearance class, which will allow you to customize things like fonts, colors, icons, and sounds used in the SDK.

Find more details on how to do this on this page.

Changing Views

Apart from the basic theming customizations, you can also swap certain views, with your implementation. You can find more details on how to do that on this page.

Did you find this page helpful?