A SwiftUI framework which makes it easy to integrate Video Call and Chat within a few lines of code.

Related tags

Video iStream
Overview

Welcome to iStream!

This SwiftUI Framework allows you to add Video Call and Chat to your project within a few lines of code. To use this Framework, you'll need an iOS 15 project. Currently, only Azure Communication Services with a AWS Amplify S3 storage is supported by the framework, but in the future other options are planned.

Installation

To use the framework via Cocoapods, add the following line to your Podfile:


pod iStream, "~> 0.2.0"

Prerequisites

To use the Video Call and Chat feature, you have to create an Azure Communication Services resource. All information you need for the setup can be found here.

Video Call

For the Video Call feature, you'll also need an active Azure Notification Hub resource, which will be used to send and receive push notifications. For the ANH resource you'll need an active Apple Developer Program profile. All infos for the ANH resource can be found here

Note: Make sure to use option 2 with a .p8-Certificate, since only token based authentication will work for the push notifications.

Chat

For the Chat feature, you'll need an active AWS subscription, so the cloud storage for files can be configured. To setup Amplify for your app, follow these instructions:

  1. Navigate in your Xcode project

  2. Configure amplify for your project with:


amplify init

  1. Follow the instructions for the initialization

  2. Add storage to your project with:


amplify add storage

  1. Follow the instructions

  2. After the storage is setup push the changes to the cloud with:


amplify push

  1. Done!

Usage

Video Call

First, import the framework module inside your <YourApp>App.swift:


import iStream

Declare and initialize the CallingViewModel in your <YourApp>App.swift with the following code piece:


@StateObject var callingViewModel: CallingViewModel = CallingViewModel(callingModel: AzureCallingModel())

Then add the viewmodel as an environment object on your root view:


.environmentObject(self.callingViewModel)

After the Viewmodel is initialized, you have to setup the Viewmodel with the initCallingViewModel(identifier:displayName:token:) function. To generate an identifier and a token for the ACS resource, you can use the Azure plattform or implement an own server. Infos about implementing an own server can the found here.

After your viewmodel is initialized, you're ready to make some Video Calls. To start a call, use the self.callingViewModel.startCall(identifier:) function of the CallingViewModel, where identifiershould be an existing identifier from your ACS resource. The property presentCallView: Bool in CallingViewModel is set to true when a call successfully started. With this info, you can use the CallView view, to display the UI. If you want to add custom buttons in the CallView, you can add them in the initializer. Alternative you can implement own Views to display the UI by using the CallingViewModel instance.

Note: The CallView should get the viewmodel passed as an environmentObject with .environmentObject(self.callingViewModel).

Chat

To use the Chat feature, import the framework module in your <YourApp>App.swift file:


import iStream

After that, declare and initialize the ChatViewModel...


@StateObject var chatViewModel: ChatViewModel = ChatViewModel(chatModel: AzureChatModel())

... and pass it ass an environmentObject on your root view:


.environmentObject(self.chatViewModel)

To use the Viewmodel, initialize the chat feature with the self.chatViewModel.initChatViewModel(identifier:displayName:endpoint:token:) function. To generate an identifier and a token for the ACS resource, you can use the Azure plattform or implement an own server. Infos about implementing an own server can the found here. The endpoint parameter is the Endpoint from your ACS resource, which can be found under Settings > Keys in your resource infos in Azure portal.

After your viewmodel is setup, you can use the self.chatViewModel.startChat(with:partnerDisplayName:) function, where identifiershould be an existing identifier from your ACS resource. The chatIsSetup: Bool property is set to true when the chat view can be displayed. You can use this info to show the ChatView, to display the UI. If you want to add a custom message view, you can add it in the initializer. Alternative you can implement own Views to display the UI by using the ChatViewModel instance.

Note: The ChatView should get the viewmodel passed as an environmentObject with .environmentObject(self.chatViewModel).

You might also like...
A high-performance, flexible, and easy-to-use Video compressor library written by Swift.

FYVideoCompressor A high-performance, flexible and easy to use Video compressor library written by Swift. Using hardware-accelerator APIs in AVFoundat

High-performance and flexible video editing and effects framework, based on AVFoundation and Metal.
High-performance and flexible video editing and effects framework, based on AVFoundation and Metal.

High-performance and flexible video editing and effects framework, based on AVFoundation and Metal.

YHPlayer - An easy-to-use video player based on swift language
YHPlayer - An easy-to-use video player based on swift language

YHPlayer An easy-to-use video player based on swift language Features Plays loca

Swift Package used for video where I demonstrate how to extract a package to a local framework and modify it.
Swift Package used for video where I demonstrate how to extract a package to a local framework and modify it.

SegmentedPicker NOTE: This sample code is taken from the article by Frank Jia in his article titled Build a Custom iOS Segmented Control With SwiftUI

โ€‹ This framework allows developers to quickly manipulate audio and video splicing operations.

MTrack This framework allows developers to quickly manipulate audio and video splicing operations.We welcome your feedback in issues and pull requests

๐Ÿ“น Framework to Play a Video in the Background of any UIView
๐Ÿ“น Framework to Play a Video in the Background of any UIView

SwiftVideoBackground is an easy to use Swift framework that provides the ability to play a video on any UIView. This provides a beautiful UI for login

๐Ÿ“ฝ A video player for SwiftUI, support for caching, preload and custom control view.
๐Ÿ“ฝ A video player for SwiftUI, support for caching, preload and custom control view.

Features QuickStart Advances Installation Requirements License Demo Clone or download the project. In the terminal, run swift package resolve. Open Vi

Pretty iOS mobile screens + AVPlayer video view โ€“โ€“โ€“ made in SwiftUI
Pretty iOS mobile screens + AVPlayer video view โ€“โ€“โ€“ made in SwiftUI

UrbanVillageProjectScreens Recreated UI screens from the conceptual Urban Village Project. Read more about the project here. Please open an issue if y

VideoBackgroundSwiftUI - Video Background loop made with SwiftUI
VideoBackgroundSwiftUI - Video Background loop made with SwiftUI

VideoBackgroundSwiftUI (Updated) Video Background loop made with SwiftUI Video N

Owner
iOS Developer
null
Video mp4 record save display - How to Take , Save and Display a .mp4 Video

Technicalisto How to Take , Save and Display a .mp4 Video Add your design with v

Aya Baghdadi 2 Aug 7, 2022
A fully functional short video app project.Record a six secends video while playing prank sounds.

prankPro A fully functional short video app project How to Install 1. use coconapod to init your xcode environment. 2. change the app-keys in `applica

huijimuhe 258 Jun 19, 2022
JDVideoKit - You can easily transfer your video into Three common video type.

JDVideoKit Introduction You can easily transfer your video into Three common video type. You can use set up camera easily. Installation pod 'JDVideoK

้ƒญไป‹้จต 24 Sep 9, 2021
A Swift library to upload video files to api.video platform.

api.video IOS video uploader api.video is the video infrastructure for product builders. Lightning fast video APIs for integrating, scaling, and manag

api.video 7 Dec 9, 2022
api.video is the video infrastructure for product builders

api.video is the video infrastructure for product builders. Lightning fast video APIs for integrating, scaling, and managing on-demand & low latency live streaming features in your app.

api.video 4 Jun 27, 2022
A video composition framework build on top of AVFoundation. It's simple to use and easy to extend.

A high-level video composition framework build on top of AVFoundation. It's simple to use and easy to extend. Use it and make life easier if you are implementing video composition feature.

VideoFlint 1.4k Dec 25, 2022
Official SwiftUI SDK for Stream Chat.

SwiftUI - Currently in Development ?? The SwiftUI SDK is built on top of the StreamChat framework and it's a SwiftUI alternative to the StreamChatUI S

Stream 136 Dec 23, 2022
A video decoder built on ffmpeg which allows libpag to use ffmpeg as its software decoder for h264 decoding.

ffavc ffavc is a video decoder built on ffmpeg which allows libpag to use ffmpeg as its software decoder for h264 decoding. Build ffmpeg First, make s

Portable Animated Graphics 8 Nov 24, 2022
Integrate Pianobar with the Now Playing feature of macOS

PianobarNowPlayable - Integrate Pianobar with the Now Playing feature of macOS Ever wanted to control Pianobar like you do most other music applicatio

Dominic 4 Aug 30, 2022
Valorem-demo - Demonstration code and video of Valorem, a bespoke portfolio recommendation platform to be created as an iOS mobile app.

valorem-demo Demonstration code of Valorem, a bespoke portfolio recommendation platform to be created as an iOS mobile app. The included code demonstr

Marcus Deans 1 Mar 4, 2022