Skip to content

Commit 77ab841

Browse files
authored
Merge pull request #1532 from pipecat-ai/p2p_ios_demo
iOS demo for the p2p-webrtc video-transform example
2 parents 03b3635 + 3bbc751 commit 77ab841

34 files changed

+1910
-0
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Added
1111

12+
- Added a new iOS client option to the `SmallWebRTCTransport` **video-transform** example.
13+
1214
- Added new processors `ProducerProcessor` and `ConsumerProcessor`. The
1315
producer processor processes frames from the pipeline and decides whether the
1416
consumers should consume it or not. If so, the same frame that is received by
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/SimpleChatbot.xcodeproj/xcuserdata/
2+
/SimpleChatbot.xcodeproj/project.xcworkspace/xcuserdata/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# iOS implementation
2+
3+
Basic implementation using the [Pipecat iOS SDK](https://docs.pipecat.ai/client/ios/introduction).
4+
5+
## Prerequisites
6+
7+
1. Run the bot server. See the [server README](../../server).
8+
2. Install [Xcode](https://developer.apple.com/xcode/), and set up your device [to run your own applications](https://developer.apple.com/documentation/xcode/distributing-your-app-to-registered-devices).
9+
10+
## Running locally
11+
12+
1. Clone this repository locally.
13+
2. Open the SimpleChatbot.xcodeproj in Xcode.
14+
3. Tell Xcode to update its Package Dependencies by clicking File -> Packages -> Update to Latest Package Versions.
15+
4. Build the project.
16+
5. Run the project on your device.
17+
6. Connect to the URL you are testing.
18+

examples/p2p-webrtc/video-transform/client/ios/SimpleChatbot.xcodeproj/project.pbxproj

+727
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded</key>
6+
<false/>
7+
</dict>
8+
</plist>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"originHash" : "77cb3fee4071811f880e69dbcd5a8ba01711a73372960391d6366c4c3a0d36eb",
3+
"pins" : [
4+
{
5+
"identity" : "pipecat-client-ios",
6+
"kind" : "remoteSourceControl",
7+
"location" : "https://github.com/pipecat-ai/pipecat-client-ios.git",
8+
"state" : {
9+
"revision" : "992641fb5f7d1a794ecfc33babb5fe36e2a8ffdd",
10+
"version" : "0.3.5"
11+
}
12+
},
13+
{
14+
"identity" : "pipecat-client-ios-small-webrtc",
15+
"kind" : "remoteSourceControl",
16+
"location" : "https://github.com/pipecat-ai/pipecat-client-ios-small-webrtc",
17+
"state" : {
18+
"revision" : "a6e4516b1fcbed772ca97a9616dddc9329097958",
19+
"version" : "0.0.1"
20+
}
21+
},
22+
{
23+
"identity" : "webrtc",
24+
"kind" : "remoteSourceControl",
25+
"location" : "https://github.com/stasel/WebRTC",
26+
"state" : {
27+
"revision" : "5b2eb61cace7d62726b29a38b768b07d6bc55c45",
28+
"version" : "134.0.0"
29+
}
30+
}
31+
],
32+
"version" : 3
33+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1540"
4+
version = "1.7">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES"
8+
buildArchitectures = "Automatic">
9+
<BuildActionEntries>
10+
<BuildActionEntry
11+
buildForTesting = "YES"
12+
buildForRunning = "YES"
13+
buildForProfiling = "YES"
14+
buildForArchiving = "YES"
15+
buildForAnalyzing = "YES">
16+
<BuildableReference
17+
BuildableIdentifier = "primary"
18+
BlueprintIdentifier = "90031FA22C616EE700408370"
19+
BuildableName = "SimpleChatbot.app"
20+
BlueprintName = "SimpleChatbot"
21+
ReferencedContainer = "container:SimpleChatbot.xcodeproj">
22+
</BuildableReference>
23+
</BuildActionEntry>
24+
</BuildActionEntries>
25+
</BuildAction>
26+
<TestAction
27+
buildConfiguration = "Debug"
28+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
29+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
30+
shouldUseLaunchSchemeArgsEnv = "YES"
31+
shouldAutocreateTestPlan = "YES">
32+
</TestAction>
33+
<LaunchAction
34+
buildConfiguration = "Debug"
35+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
36+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
37+
launchStyle = "0"
38+
useCustomWorkingDirectory = "NO"
39+
ignoresPersistentStateOnLaunch = "NO"
40+
debugDocumentVersioning = "YES"
41+
debugServiceExtension = "internal"
42+
allowLocationSimulation = "YES">
43+
<BuildableProductRunnable
44+
runnableDebuggingMode = "0">
45+
<BuildableReference
46+
BuildableIdentifier = "primary"
47+
BlueprintIdentifier = "90031FA22C616EE700408370"
48+
BuildableName = "SimpleChatbot.app"
49+
BlueprintName = "SimpleChatbot"
50+
ReferencedContainer = "container:SimpleChatbot.xcodeproj">
51+
</BuildableReference>
52+
</BuildableProductRunnable>
53+
</LaunchAction>
54+
<ProfileAction
55+
buildConfiguration = "Release"
56+
shouldUseLaunchSchemeArgsEnv = "YES"
57+
savedToolIdentifier = ""
58+
useCustomWorkingDirectory = "NO"
59+
debugDocumentVersioning = "YES">
60+
<BuildableProductRunnable
61+
runnableDebuggingMode = "0">
62+
<BuildableReference
63+
BuildableIdentifier = "primary"
64+
BlueprintIdentifier = "90031FA22C616EE700408370"
65+
BuildableName = "SimpleChatbot.app"
66+
BlueprintName = "SimpleChatbot"
67+
ReferencedContainer = "container:SimpleChatbot.xcodeproj">
68+
</BuildableReference>
69+
</BuildableProductRunnable>
70+
</ProfileAction>
71+
<AnalyzeAction
72+
buildConfiguration = "Debug">
73+
</AnalyzeAction>
74+
<ArchiveAction
75+
buildConfiguration = "Release"
76+
revealArchiveInOrganizer = "YES">
77+
</ArchiveAction>
78+
</Scheme>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "appstore.png",
5+
"idiom" : "universal",
6+
"platform" : "ios",
7+
"size" : "1024x1024"
8+
}
9+
],
10+
"info" : {
11+
"author" : "xcode",
12+
"version" : 1
13+
}
14+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"info" : {
3+
"author" : "xcode",
4+
"version" : 1
5+
}
6+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "Square Black.svg",
5+
"idiom" : "universal",
6+
"scale" : "1x"
7+
},
8+
{
9+
"idiom" : "universal",
10+
"scale" : "2x"
11+
},
12+
{
13+
"idiom" : "universal",
14+
"scale" : "3x"
15+
}
16+
],
17+
"info" : {
18+
"author" : "xcode",
19+
"version" : 1
20+
}
21+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "vision.svg",
5+
"idiom" : "universal",
6+
"scale" : "1x"
7+
},
8+
{
9+
"idiom" : "universal",
10+
"scale" : "2x"
11+
},
12+
{
13+
"idiom" : "universal",
14+
"scale" : "3x"
15+
}
16+
],
17+
"info" : {
18+
"author" : "xcode",
19+
"version" : 1
20+
}
21+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>UIBackgroundModes</key>
6+
<array>
7+
<string>voip</string>
8+
</array>
9+
<key>NSCameraUsageDescription</key>
10+
<string>Camera is necessary for transmitting video in a call</string>
11+
<key>NSMicrophoneUsageDescription</key>
12+
<string>Microphone is necessary for transmitting audio in a call</string>
13+
<key>NSAppTransportSecurity</key>
14+
<dict>
15+
<key>NSAllowsLocalNetworking</key>
16+
<true/>
17+
</dict>
18+
</dict>
19+
</plist>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"info" : {
3+
"author" : "xcode",
4+
"version" : 1
5+
}
6+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import SwiftUI
2+
3+
@main
4+
struct SimpleChatbotApp: App {
5+
6+
@StateObject var callContainerModel = CallContainerModel()
7+
8+
var body: some Scene {
9+
WindowGroup {
10+
if (!callContainerModel.isInCall) {
11+
PreJoinView().environmentObject(callContainerModel)
12+
} else {
13+
MeetingView().environmentObject(callContainerModel)
14+
}
15+
}
16+
}
17+
18+
}

0 commit comments

Comments
 (0)