├── AcceleratorSample ├── Podfile ├── AcceleratorSample │ ├── Assets.xcassets │ │ ├── mic.imageset │ │ │ ├── mic.png │ │ │ ├── mic@2x.png │ │ │ ├── mic@3x.png │ │ │ └── Contents.json │ │ ├── audio.imageset │ │ │ ├── audio.png │ │ │ ├── audio@2x.png │ │ │ ├── audio@3x.png │ │ │ └── Contents.json │ │ ├── hangUp.imageset │ │ │ ├── hangUp.png │ │ │ ├── hangUp@2x.png │ │ │ ├── hangUp@3x.png │ │ │ └── Contents.json │ │ ├── message.imageset │ │ │ ├── message.png │ │ │ ├── message@2x.png │ │ │ ├── message@3x.png │ │ │ └── Contents.json │ │ ├── video.imageset │ │ │ ├── videoIcon.png │ │ │ ├── videoIcon@2x.png │ │ │ ├── videoIcon@3x.png │ │ │ └── Contents.json │ │ ├── noAudio.imageset │ │ │ ├── noSoundCopy.png │ │ │ ├── noSoundCopy@2x.png │ │ │ ├── noSoundCopy@3x.png │ │ │ └── Contents.json │ │ ├── noVideo.imageset │ │ │ ├── noVideoIcon.png │ │ │ ├── noVideoIcon@2x.png │ │ │ ├── noVideoIcon@3x.png │ │ │ └── Contents.json │ │ ├── startCall.imageset │ │ │ ├── startCall.png │ │ │ ├── startCall@2x.png │ │ │ ├── startCall@3x.png │ │ │ └── Contents.json │ │ ├── closeXWhite.imageset │ │ │ ├── closeXWhite.png │ │ │ ├── closeXWhite@2x.png │ │ │ ├── closeXWhite@3x.png │ │ │ └── Contents.json │ │ ├── screenshare.imageset │ │ │ ├── screenshare.png │ │ │ ├── screenshare@2x.png │ │ │ ├── screenshare@3x.png │ │ │ └── Contents.json │ │ ├── mutedMic.imageset │ │ │ ├── mutedMicLineCopy.png │ │ │ ├── mutedMicLineCopy@2x.png │ │ │ ├── mutedMicLineCopy@3x.png │ │ │ └── Contents.json │ │ ├── reverse cameras.imageset │ │ │ ├── reverse cameras.png │ │ │ ├── reverse cameras@2x.png │ │ │ ├── reverse cameras@3x.png │ │ │ └── Contents.json │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── MainViewController.h │ ├── TextChatTableViewController.h │ ├── ScreenShareViewController.h │ ├── main.m │ ├── AppDelegate.h │ ├── MainView.h │ ├── AppDelegate.m │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── Info.plist │ ├── TextChatTableViewController.m │ ├── MainView.m │ ├── ScreenShareViewController.m │ └── MainViewController.m ├── AcceleratorSampleApp.xcodeproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata ├── AcceleratorSampleApp.xcworkspace │ ├── xcshareddata │ │ └── IDEWorkspaceChecks.plist │ └── contents.xcworkspacedata ├── Podfile.lock ├── AcceleratorSampleTests │ ├── Info.plist │ └── AcceleratorSampleTests.m ├── AcceleratorSampleUITests │ ├── Info.plist │ └── AcceleratorSampleUITests.m └── .gitignore ├── AcceleratorSampleApp-Swift ├── Podfile ├── AcceleratorSampleApp-Swift │ ├── Assets.xcassets │ │ ├── mic.imageset │ │ │ ├── mic.png │ │ │ ├── mic@2x.png │ │ │ ├── mic@3x.png │ │ │ └── Contents.json │ │ ├── audio.imageset │ │ │ ├── audio.png │ │ │ ├── audio@2x.png │ │ │ ├── audio@3x.png │ │ │ └── Contents.json │ │ ├── hangUp.imageset │ │ │ ├── hangUp.png │ │ │ ├── hangUp@2x.png │ │ │ ├── hangUp@3x.png │ │ │ └── Contents.json │ │ ├── message.imageset │ │ │ ├── message.png │ │ │ ├── message@2x.png │ │ │ ├── message@3x.png │ │ │ └── Contents.json │ │ ├── video.imageset │ │ │ ├── videoIcon.png │ │ │ ├── videoIcon@2x.png │ │ │ ├── videoIcon@3x.png │ │ │ └── Contents.json │ │ ├── noAudio.imageset │ │ │ ├── noSoundCopy.png │ │ │ ├── noSoundCopy@2x.png │ │ │ ├── noSoundCopy@3x.png │ │ │ └── Contents.json │ │ ├── noVideo.imageset │ │ │ ├── noVideoIcon.png │ │ │ ├── noVideoIcon@2x.png │ │ │ ├── noVideoIcon@3x.png │ │ │ └── Contents.json │ │ ├── startCall.imageset │ │ │ ├── startCall.png │ │ │ ├── startCall@2x.png │ │ │ ├── startCall@3x.png │ │ │ └── Contents.json │ │ ├── closeXWhite.imageset │ │ │ ├── closeXWhite.png │ │ │ ├── closeXWhite@2x.png │ │ │ ├── closeXWhite@3x.png │ │ │ └── Contents.json │ │ ├── screenshare.imageset │ │ │ ├── screenshare.png │ │ │ ├── screenshare@2x.png │ │ │ ├── screenshare@3x.png │ │ │ └── Contents.json │ │ ├── mutedMic.imageset │ │ │ ├── mutedMicLineCopy.png │ │ │ ├── mutedMicLineCopy@2x.png │ │ │ ├── mutedMicLineCopy@3x.png │ │ │ └── Contents.json │ │ ├── reverse cameras.imageset │ │ │ ├── reverse cameras.png │ │ │ ├── reverse cameras@2x.png │ │ │ ├── reverse cameras@3x.png │ │ │ └── Contents.json │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── AcceleratorSampleApp-Swift-Bridging-Header.h │ ├── AppDelegate.swift │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── Info.plist │ ├── TextChatTableViewController.swift │ ├── ScreenShareViewController.swift │ ├── MainView.swift │ └── MainViewController.swift ├── AcceleratorSampleApp-Swift.xcodeproj │ └── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── AcceleratorSampleApp-Swift.xcworkspace │ ├── xcshareddata │ │ └── IDEWorkspaceChecks.plist │ └── contents.xcworkspacedata ├── Podfile.lock ├── AcceleratorSampleApp-SwiftTests │ ├── Info.plist │ └── AcceleratorSampleApp_SwiftTests.swift ├── AcceleratorSampleApp-SwiftUITests │ ├── Info.plist │ └── AcceleratorSampleApp_SwiftUITests.swift └── .gitignore ├── .github ├── PULL_REQUEST_TEMPLATE.md ├── workflows │ └── metrics.yml └── ISSUE_TEMPLATE.md ├── LICENSE ├── CONTRIBUTING.md ├── CODE_OF_CONDUCT.md └── README.md /AcceleratorSample/Podfile: -------------------------------------------------------------------------------- 1 | platform :ios, '12.0' 2 | 3 | target 'AcceleratorSampleApp' do 4 | pod 'OTAcceleratorCore', '~> 4.0.0' 5 | end 6 | -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/Podfile: -------------------------------------------------------------------------------- 1 | platform :ios, '11.0' 2 | 3 | target 'AcceleratorSampleApp-Swift' do 4 | pod 'OTAcceleratorCore', '~> 4.0.0' 5 | end 6 | -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSample/Assets.xcassets/mic.imageset/mic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSample/AcceleratorSample/Assets.xcassets/mic.imageset/mic.png -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSample/Assets.xcassets/audio.imageset/audio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSample/AcceleratorSample/Assets.xcassets/audio.imageset/audio.png -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSample/Assets.xcassets/mic.imageset/mic@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSample/AcceleratorSample/Assets.xcassets/mic.imageset/mic@2x.png -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSample/Assets.xcassets/mic.imageset/mic@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSample/AcceleratorSample/Assets.xcassets/mic.imageset/mic@3x.png -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSample/Assets.xcassets/hangUp.imageset/hangUp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSample/AcceleratorSample/Assets.xcassets/hangUp.imageset/hangUp.png -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSample/Assets.xcassets/audio.imageset/audio@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSample/AcceleratorSample/Assets.xcassets/audio.imageset/audio@2x.png -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSample/Assets.xcassets/audio.imageset/audio@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSample/AcceleratorSample/Assets.xcassets/audio.imageset/audio@3x.png -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSample/Assets.xcassets/hangUp.imageset/hangUp@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSample/AcceleratorSample/Assets.xcassets/hangUp.imageset/hangUp@2x.png -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSample/Assets.xcassets/hangUp.imageset/hangUp@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSample/AcceleratorSample/Assets.xcassets/hangUp.imageset/hangUp@3x.png -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSample/Assets.xcassets/message.imageset/message.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSample/AcceleratorSample/Assets.xcassets/message.imageset/message.png -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSample/Assets.xcassets/video.imageset/videoIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSample/AcceleratorSample/Assets.xcassets/video.imageset/videoIcon.png -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSample/Assets.xcassets/message.imageset/message@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSample/AcceleratorSample/Assets.xcassets/message.imageset/message@2x.png -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSample/Assets.xcassets/message.imageset/message@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSample/AcceleratorSample/Assets.xcassets/message.imageset/message@3x.png -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSample/Assets.xcassets/video.imageset/videoIcon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSample/AcceleratorSample/Assets.xcassets/video.imageset/videoIcon@2x.png -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSample/Assets.xcassets/video.imageset/videoIcon@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSample/AcceleratorSample/Assets.xcassets/video.imageset/videoIcon@3x.png -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSample/Assets.xcassets/noAudio.imageset/noSoundCopy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSample/AcceleratorSample/Assets.xcassets/noAudio.imageset/noSoundCopy.png -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSample/Assets.xcassets/noVideo.imageset/noVideoIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSample/AcceleratorSample/Assets.xcassets/noVideo.imageset/noVideoIcon.png -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSample/Assets.xcassets/startCall.imageset/startCall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSample/AcceleratorSample/Assets.xcassets/startCall.imageset/startCall.png -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSample/Assets.xcassets/closeXWhite.imageset/closeXWhite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSample/AcceleratorSample/Assets.xcassets/closeXWhite.imageset/closeXWhite.png -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSample/Assets.xcassets/noAudio.imageset/noSoundCopy@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSample/AcceleratorSample/Assets.xcassets/noAudio.imageset/noSoundCopy@2x.png -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSample/Assets.xcassets/noAudio.imageset/noSoundCopy@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSample/AcceleratorSample/Assets.xcassets/noAudio.imageset/noSoundCopy@3x.png -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSample/Assets.xcassets/noVideo.imageset/noVideoIcon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSample/AcceleratorSample/Assets.xcassets/noVideo.imageset/noVideoIcon@2x.png -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSample/Assets.xcassets/noVideo.imageset/noVideoIcon@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSample/AcceleratorSample/Assets.xcassets/noVideo.imageset/noVideoIcon@3x.png -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSample/Assets.xcassets/screenshare.imageset/screenshare.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSample/AcceleratorSample/Assets.xcassets/screenshare.imageset/screenshare.png -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSample/Assets.xcassets/startCall.imageset/startCall@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSample/AcceleratorSample/Assets.xcassets/startCall.imageset/startCall@2x.png -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSample/Assets.xcassets/startCall.imageset/startCall@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSample/AcceleratorSample/Assets.xcassets/startCall.imageset/startCall@3x.png -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSample/Assets.xcassets/closeXWhite.imageset/closeXWhite@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSample/AcceleratorSample/Assets.xcassets/closeXWhite.imageset/closeXWhite@2x.png -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSample/Assets.xcassets/closeXWhite.imageset/closeXWhite@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSample/AcceleratorSample/Assets.xcassets/closeXWhite.imageset/closeXWhite@3x.png -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSample/Assets.xcassets/mutedMic.imageset/mutedMicLineCopy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSample/AcceleratorSample/Assets.xcassets/mutedMic.imageset/mutedMicLineCopy.png -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSample/Assets.xcassets/screenshare.imageset/screenshare@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSample/AcceleratorSample/Assets.xcassets/screenshare.imageset/screenshare@2x.png -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSample/Assets.xcassets/screenshare.imageset/screenshare@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSample/AcceleratorSample/Assets.xcassets/screenshare.imageset/screenshare@3x.png -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/mic.imageset/mic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/mic.imageset/mic.png -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSample/Assets.xcassets/mutedMic.imageset/mutedMicLineCopy@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSample/AcceleratorSample/Assets.xcassets/mutedMic.imageset/mutedMicLineCopy@2x.png -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSample/Assets.xcassets/mutedMic.imageset/mutedMicLineCopy@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSample/AcceleratorSample/Assets.xcassets/mutedMic.imageset/mutedMicLineCopy@3x.png -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/mic.imageset/mic@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/mic.imageset/mic@2x.png -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/mic.imageset/mic@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/mic.imageset/mic@3x.png -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSample/Assets.xcassets/reverse cameras.imageset/reverse cameras.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSample/AcceleratorSample/Assets.xcassets/reverse cameras.imageset/reverse cameras.png -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/audio.imageset/audio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/audio.imageset/audio.png -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/hangUp.imageset/hangUp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/hangUp.imageset/hangUp.png -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/audio.imageset/audio@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/audio.imageset/audio@2x.png -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/audio.imageset/audio@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/audio.imageset/audio@3x.png -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/message.imageset/message.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/message.imageset/message.png -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/video.imageset/videoIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/video.imageset/videoIcon.png -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSample/Assets.xcassets/reverse cameras.imageset/reverse cameras@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSample/AcceleratorSample/Assets.xcassets/reverse cameras.imageset/reverse cameras@2x.png -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSample/Assets.xcassets/reverse cameras.imageset/reverse cameras@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSample/AcceleratorSample/Assets.xcassets/reverse cameras.imageset/reverse cameras@3x.png -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/hangUp.imageset/hangUp@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/hangUp.imageset/hangUp@2x.png -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/hangUp.imageset/hangUp@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/hangUp.imageset/hangUp@3x.png -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/message.imageset/message@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/message.imageset/message@2x.png -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/message.imageset/message@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/message.imageset/message@3x.png -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/video.imageset/videoIcon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/video.imageset/videoIcon@2x.png -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/video.imageset/videoIcon@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/video.imageset/videoIcon@3x.png -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/noAudio.imageset/noSoundCopy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/noAudio.imageset/noSoundCopy.png -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/noVideo.imageset/noVideoIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/noVideo.imageset/noVideoIcon.png -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/startCall.imageset/startCall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/startCall.imageset/startCall.png -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSample/MainViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MainViewController.h 3 | // 4 | // Copyright © 2017 Tokbox, Inc. All rights reserved. 5 | // 6 | 7 | #import 8 | 9 | @interface MainViewController : UIViewController 10 | 11 | @end 12 | -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSampleApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/closeXWhite.imageset/closeXWhite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/closeXWhite.imageset/closeXWhite.png -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/noAudio.imageset/noSoundCopy@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/noAudio.imageset/noSoundCopy@2x.png -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/noAudio.imageset/noSoundCopy@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/noAudio.imageset/noSoundCopy@3x.png -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/noVideo.imageset/noVideoIcon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/noVideo.imageset/noVideoIcon@2x.png -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/noVideo.imageset/noVideoIcon@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/noVideo.imageset/noVideoIcon@3x.png -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/screenshare.imageset/screenshare.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/screenshare.imageset/screenshare.png -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/startCall.imageset/startCall@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/startCall.imageset/startCall@2x.png -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/startCall.imageset/startCall@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/startCall.imageset/startCall@3x.png -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/mutedMic.imageset/mutedMicLineCopy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/mutedMic.imageset/mutedMicLineCopy.png -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## Pull request checklist 2 | 3 | - [ ] All tests pass. Demo project builds and runs. 4 | - [ ] I have resolved any merge conflicts. Confirmation: ____ 5 | 6 | #### This fixes issue #___. 7 | 8 | ## What's in this pull request? 9 | 10 | >... 11 | -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/closeXWhite.imageset/closeXWhite@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/closeXWhite.imageset/closeXWhite@2x.png -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/closeXWhite.imageset/closeXWhite@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/closeXWhite.imageset/closeXWhite@3x.png -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/mutedMic.imageset/mutedMicLineCopy@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/mutedMic.imageset/mutedMicLineCopy@2x.png -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/mutedMic.imageset/mutedMicLineCopy@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/mutedMic.imageset/mutedMicLineCopy@3x.png -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/screenshare.imageset/screenshare@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/screenshare.imageset/screenshare@2x.png -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/screenshare.imageset/screenshare@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/screenshare.imageset/screenshare@3x.png -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/reverse cameras.imageset/reverse cameras.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/reverse cameras.imageset/reverse cameras.png -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/reverse cameras.imageset/reverse cameras@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/reverse cameras.imageset/reverse cameras@2x.png -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/reverse cameras.imageset/reverse cameras@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/accelerator-sample-apps-ios/HEAD/AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/reverse cameras.imageset/reverse cameras@3x.png -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSample/TextChatTableViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // DefaultTextChatTableViewController.h 3 | // 4 | // Copyright © 2017 Tokbox, Inc. All rights reserved. 5 | // 6 | 7 | #import "OTTextChatViewController.h" 8 | 9 | @interface TextChatTableViewController : OTTextChatViewController 10 | 11 | @end 12 | 13 | -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSample/ScreenShareViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ScreenShareViewController.h 3 | // 4 | // Copyright © 2017 Tokbox, Inc. All rights reserved. 5 | // 6 | 7 | #import 8 | 9 | @interface ScreenShareViewController : UIViewController 10 | @property (nonatomic) UIImage *sharingImage; 11 | @end 12 | -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSampleApp.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSampleApp.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | // 2 | // Use this file to import your target's public headers that you would like to expose to Swift. 3 | // 4 | 5 | #import "OTAcceleratorSession.h" 6 | #import "OTMultiPartyCommunicator.h" 7 | #import "OTTextChat.h" 8 | #import "OTTextChatViewController.h" 9 | #import "OTAnnotator.h" 10 | #import 11 | -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSample/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // AcceleratorSample 4 | // 5 | // Created by Xi Huang on 3/3/17. 6 | // Copyright © 2017 Tokbox, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSample/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // 4 | // Copyright © 2017 Tokbox, Inc. All rights reserved. 5 | // 6 | 7 | #import 8 | 9 | @class OTAcceleratorSession; 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @property (nonatomic, strong, readonly) OTAcceleratorSession* acceleratorSession; 16 | 17 | @end 18 | 19 | -------------------------------------------------------------------------------- /.github/workflows/metrics.yml: -------------------------------------------------------------------------------- 1 | name: Aggregit 2 | 3 | on: 4 | schedule: 5 | - cron: "0 0 * * *" 6 | 7 | jobs: 8 | recordMetrics: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: michaeljolley/aggregit@v1 12 | with: 13 | githubToken: ${{ secrets.GITHUB_TOKEN }} 14 | project_id: ${{ secrets.project_id }} 15 | private_key: ${{ secrets.private_key }} 16 | client_email: ${{ secrets.client_email }} 17 | firebaseDbUrl: ${{ secrets.firebaseDbUrl }} 18 | -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSample/Assets.xcassets/mic.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "mic.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "mic@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "mic@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSample/Assets.xcassets/audio.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "audio.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "audio@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "audio@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSample/Assets.xcassets/hangUp.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "hangUp.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "hangUp@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "hangUp@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSample/Assets.xcassets/message.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "message.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "message@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "message@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/mic.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "mic.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "mic@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "mic@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSample/Assets.xcassets/video.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "videoIcon.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "videoIcon@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "videoIcon@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSample/Assets.xcassets/noAudio.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "noSoundCopy.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "noSoundCopy@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "noSoundCopy@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSample/Assets.xcassets/noVideo.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "noVideoIcon.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "noVideoIcon@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "noVideoIcon@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSample/Assets.xcassets/startCall.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "startCall.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "startCall@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "startCall@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/audio.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "audio.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "audio@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "audio@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSample/Assets.xcassets/screenshare.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "screenshare.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "screenshare@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "screenshare@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/hangUp.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "hangUp.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "hangUp@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "hangUp@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSample/Assets.xcassets/closeXWhite.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "closeXWhite.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "closeXWhite@2x.png" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x", 16 | "filename" : "closeXWhite@3x.png" 17 | } 18 | ], 19 | "info" : { 20 | "author" : "zeplin", 21 | "version" : "1" 22 | } 23 | } -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/message.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "message.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "message@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "message@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/video.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "videoIcon.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "videoIcon@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "videoIcon@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/startCall.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "startCall.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "startCall@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "startCall@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSample/Assets.xcassets/mutedMic.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "mutedMicLineCopy.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "mutedMicLineCopy@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "mutedMicLineCopy@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSample/Assets.xcassets/reverse cameras.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "reverse cameras.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "reverse cameras@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "reverse cameras@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/noAudio.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "noSoundCopy.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "noSoundCopy@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "noSoundCopy@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/noVideo.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "noVideoIcon.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "noVideoIcon@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "noVideoIcon@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/closeXWhite.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "closeXWhite.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "closeXWhite@2x.png" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x", 16 | "filename" : "closeXWhite@3x.png" 17 | } 18 | ], 19 | "info" : { 20 | "author" : "zeplin", 21 | "version" : "1" 22 | } 23 | } -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/screenshare.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "screenshare.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "screenshare@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "screenshare@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/mutedMic.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "mutedMicLineCopy.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "mutedMicLineCopy@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "mutedMicLineCopy@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/reverse cameras.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "reverse cameras.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "reverse cameras@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "reverse cameras@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // 4 | // Copyright © 2017 Tokbox, Inc. All rights reserved. 5 | // 6 | 7 | import UIKit 8 | 9 | @UIApplicationMain 10 | class AppDelegate: UIResponder, UIApplicationDelegate { 11 | 12 | var window: UIWindow? 13 | private(set) var session: OTAcceleratorSession? 14 | 15 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { 16 | session = OTAcceleratorSession(openTokApiKey: <#T##String!#>, sessionId: <#T##String!#>, token: <#T##String!#>) 17 | return true 18 | } 19 | } 20 | 21 | -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSample/MainView.h: -------------------------------------------------------------------------------- 1 | // 2 | // MainView.h 3 | // 4 | // Copyright © 2017 Tokbox, Inc. All rights reserved. 5 | // 6 | 7 | #import 8 | #import "OTMultiPartyCommunicator.h" 9 | 10 | @interface MainView : UIView 11 | 12 | @property (readonly, weak, nonatomic) UIButton *screenShareButton; 13 | 14 | // publisher view 15 | - (void)addPublisherView:(UIView *)publisherView; 16 | - (void)updateSubscriberViews:(NSArray *)subscriberViews 17 | publisherView:(UIView *)publisherView; 18 | 19 | - (void)connectCallHolder:(BOOL)connected; 20 | - (void)updatePublisherAudio:(BOOL)connected; 21 | - (void)updatePublisherVideo:(BOOL)connected; 22 | - (void)enableControlButtonsForCall:(BOOL)enabled; 23 | - (void)resetAllControl; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /AcceleratorSample/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - OpenTok (2.18.1) 3 | - OTAcceleratorCore (4.0.0): 4 | - OpenTok (= 2.18.1) 5 | - OTKAnalytics (= 2.1.2) 6 | - SVProgressHUD (= 2.2.5) 7 | - OTKAnalytics (2.1.2) 8 | - SVProgressHUD (2.2.5) 9 | 10 | DEPENDENCIES: 11 | - OTAcceleratorCore (~> 4.0.0) 12 | 13 | SPEC REPOS: 14 | trunk: 15 | - OpenTok 16 | - OTAcceleratorCore 17 | - OTKAnalytics 18 | - SVProgressHUD 19 | 20 | SPEC CHECKSUMS: 21 | OpenTok: 2a816f5d77fbf2e2ebb5aec841bd21fb7dc7737b 22 | OTAcceleratorCore: 95938e0ac0e22a6efee85a8bac8b79fbfa6f8b88 23 | OTKAnalytics: 2de2f8971b5af7f313882ada0b1eae25104296f4 24 | SVProgressHUD: 1428aafac632c1f86f62aa4243ec12008d7a51d6 25 | 26 | PODFILE CHECKSUM: 8c9e2fe6d4f6ea76b329ed0529d72fb1e008cac4 27 | 28 | COCOAPODS: 1.11.3 29 | -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSampleTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSampleUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - OpenTok (2.18.1) 3 | - OTAcceleratorCore (4.0.0): 4 | - OpenTok (= 2.18.1) 5 | - OTKAnalytics (= 2.1.2) 6 | - SVProgressHUD (= 2.2.5) 7 | - OTKAnalytics (2.1.2) 8 | - SVProgressHUD (2.2.5) 9 | 10 | DEPENDENCIES: 11 | - OTAcceleratorCore (~> 4.0.0) 12 | 13 | SPEC REPOS: 14 | trunk: 15 | - OpenTok 16 | - OTAcceleratorCore 17 | - OTKAnalytics 18 | - SVProgressHUD 19 | 20 | SPEC CHECKSUMS: 21 | OpenTok: 2a816f5d77fbf2e2ebb5aec841bd21fb7dc7737b 22 | OTAcceleratorCore: 95938e0ac0e22a6efee85a8bac8b79fbfa6f8b88 23 | OTKAnalytics: 2de2f8971b5af7f313882ada0b1eae25104296f4 24 | SVProgressHUD: 1428aafac632c1f86f62aa4243ec12008d7a51d6 25 | 26 | PODFILE CHECKSUM: 560015159ac3553b397a1dd0fd88ef8bef9832b6 27 | 28 | COCOAPODS: 1.11.3 29 | -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/AcceleratorSampleApp-SwiftTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/AcceleratorSampleApp-SwiftUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSample/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // 4 | // Copyright © 2017 Tokbox, Inc. All rights reserved. 5 | // 6 | 7 | #import "AppDelegate.h" 8 | #import "OTAcceleratorSession.h" 9 | 10 | @interface AppDelegate () 11 | @property (nonatomic, strong) OTAcceleratorSession* acceleratorSession; 12 | @end 13 | 14 | @implementation AppDelegate 15 | 16 | 17 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 18 | // Override point for customization after application launch. 19 | self.acceleratorSession = [[OTAcceleratorSession alloc] initWithOpenTokApiKey:<#apikey#> 20 | sessionId:<#sessionid#> 21 | token:<#token#>]; 22 | return YES; 23 | } 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## New issue checklist 2 | 3 | 4 | - [ ] I have read all of the [`README`](https://github.com/opentok/accelerator-core-ios/blob/master/README.md) 5 | - [ ] I have searched [existing issues](https://github.com/opentok/accelerator-core-ios/issues?q=is%3Aissue+sort%3Acreated-desc) and **this is not a duplicate**. 6 | 7 | ### General information 8 | 9 | - Library version(s): 10 | - iOS/Android/Browser version(s): 11 | - Devices/Simulators/Machine affected: 12 | - Reproducible in the demo project? (Yes/No): 13 | - Related issues: 14 | 15 | ## Bug report 16 | 17 | #### Expected behavior 18 | 19 | > ... 20 | 21 | #### Actual behavior 22 | 23 | > ... 24 | 25 | #### Steps to reproduce 26 | 27 | > ... 28 | 29 | #### Crash log? Screenshots? Videos? Sample project? 30 | 31 | >... 32 | 33 | ## Question or Feature Request 34 | 35 | > ... 36 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 OpenTok 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSampleTests/AcceleratorSampleTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // AcceleratorSampleTests.m 3 | // AcceleratorSampleTests 4 | // 5 | // Created by Xi Huang on 3/3/17. 6 | // Copyright © 2017 Tokbox, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AcceleratorSampleTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation AcceleratorSampleTests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | // Put setup code here. This method is called before the invocation of each test method in the class. 20 | } 21 | 22 | - (void)tearDown { 23 | // Put teardown code here. This method is called after the invocation of each test method in the class. 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample { 28 | // This is an example of a functional test case. 29 | // Use XCTAssert and related functions to verify your tests produce the correct results. 30 | } 31 | 32 | - (void)testPerformanceExample { 33 | // This is an example of a performance test case. 34 | [self measureBlock:^{ 35 | // Put the code you want to measure the time of here. 36 | }]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/AcceleratorSampleApp-SwiftTests/AcceleratorSampleApp_SwiftTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AcceleratorSampleApp_SwiftTests.swift 3 | // AcceleratorSampleApp-SwiftTests 4 | // 5 | // Created by Xi Huang on 3/9/17. 6 | // Copyright © 2017 Tokbox, Inc. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import AcceleratorSampleApp_Swift 11 | 12 | class AcceleratorSampleApp_SwiftTests: XCTestCase { 13 | 14 | override func setUp() { 15 | super.setUp() 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | } 18 | 19 | override func tearDown() { 20 | // Put teardown code here. This method is called after the invocation of each test method in the class. 21 | super.tearDown() 22 | } 23 | 24 | func testExample() { 25 | // This is an example of a functional test case. 26 | // Use XCTAssert and related functions to verify your tests produce the correct results. 27 | } 28 | 29 | func testPerformanceExample() { 30 | // This is an example of a performance test case. 31 | self.measure { 32 | // Put the code you want to measure the time of here. 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSampleUITests/AcceleratorSampleUITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // AcceleratorSampleUITests.m 3 | // AcceleratorSampleUITests 4 | // 5 | // Created by Xi Huang on 3/3/17. 6 | // Copyright © 2017 Tokbox, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AcceleratorSampleUITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation AcceleratorSampleUITests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | 22 | // In UI tests it is usually best to stop immediately when a failure occurs. 23 | self.continueAfterFailure = NO; 24 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 25 | [[[XCUIApplication alloc] init] launch]; 26 | 27 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 28 | } 29 | 30 | - (void)tearDown { 31 | // Put teardown code here. This method is called after the invocation of each test method in the class. 32 | [super tearDown]; 33 | } 34 | 35 | - (void)testExample { 36 | // Use recording to get started writing UI tests. 37 | // Use XCTAssert and related functions to verify your tests produce the correct results. 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/AcceleratorSampleApp-SwiftUITests/AcceleratorSampleApp_SwiftUITests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AcceleratorSampleApp_SwiftUITests.swift 3 | // AcceleratorSampleApp-SwiftUITests 4 | // 5 | // Created by Xi Huang on 3/9/17. 6 | // Copyright © 2017 Tokbox, Inc. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | 11 | class AcceleratorSampleApp_SwiftUITests: XCTestCase { 12 | 13 | override func setUp() { 14 | super.setUp() 15 | 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | 18 | // In UI tests it is usually best to stop immediately when a failure occurs. 19 | continueAfterFailure = false 20 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 21 | XCUIApplication().launch() 22 | 23 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 24 | } 25 | 26 | override func tearDown() { 27 | // Put teardown code here. This method is called after the invocation of each test method in the class. 28 | super.tearDown() 29 | } 30 | 31 | func testExample() { 32 | // Use recording to get started writing UI tests. 33 | // Use XCTAssert and related functions to verify your tests produce the correct results. 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /AcceleratorSample/.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xcuserstate 23 | 24 | ## Obj-C/Swift specific 25 | *.hmap 26 | *.ipa 27 | *.dSYM.zip 28 | *.dSYM 29 | 30 | # CocoaPods 31 | # 32 | # We recommend against adding the Pods directory to your .gitignore. However 33 | # you should judge for yourself, the pros and cons are mentioned at: 34 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 35 | # 36 | Pods/ 37 | 38 | # Carthage 39 | # 40 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 41 | # Carthage/Checkouts 42 | 43 | Carthage/Build 44 | 45 | # fastlane 46 | # 47 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 48 | # screenshots whenever they are needed. 49 | # For more information about the recommended setup visit: 50 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 51 | 52 | fastlane/report.xml 53 | fastlane/screenshots 54 | 55 | #Code Injection 56 | # 57 | # After new code Injection tools there's a generated folder /iOSInjectionProject 58 | # https://github.com/johnno1962/injectionforxcode 59 | 60 | iOSInjectionProject/ 61 | -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xcuserstate 23 | 24 | ## Obj-C/Swift specific 25 | *.hmap 26 | *.ipa 27 | *.dSYM.zip 28 | *.dSYM 29 | 30 | # CocoaPods 31 | # 32 | # We recommend against adding the Pods directory to your .gitignore. However 33 | # you should judge for yourself, the pros and cons are mentioned at: 34 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 35 | # 36 | Pods/ 37 | 38 | # Carthage 39 | # 40 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 41 | # Carthage/Checkouts 42 | 43 | Carthage/Build 44 | 45 | # fastlane 46 | # 47 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 48 | # screenshots whenever they are needed. 49 | # For more information about the recommended setup visit: 50 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 51 | 52 | fastlane/report.xml 53 | fastlane/screenshots 54 | 55 | #Code Injection 56 | # 57 | # After new code Injection tools there's a generated folder /iOSInjectionProject 58 | # https://github.com/johnno1962/injectionforxcode 59 | 60 | iOSInjectionProject/ 61 | -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSample/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSample/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | NSCameraUsageDescription 24 | $(PRODUCT_NAME) uses camera 25 | NSMicrophoneUsageDescription 26 | $(PRODUCT_NAME) uses microphone 27 | NSPhotoLibraryUsageDescription 28 | $(PRODUCT_NAME) uses photo library 29 | UILaunchStoryboardName 30 | LaunchScreen 31 | UIMainStoryboardFile 32 | Main 33 | UIRequiredDeviceCapabilities 34 | 35 | armv7 36 | 37 | UIStatusBarHidden 38 | 39 | UISupportedInterfaceOrientations 40 | 41 | UIInterfaceOrientationPortrait 42 | 43 | UISupportedInterfaceOrientations~ipad 44 | 45 | UIInterfaceOrientationPortrait 46 | UIInterfaceOrientationPortraitUpsideDown 47 | UIInterfaceOrientationLandscapeLeft 48 | UIInterfaceOrientationLandscapeRight 49 | 50 | UIViewControllerBasedStatusBarAppearance 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | NSCameraUsageDescription 24 | $(PRODUCT_NAME) uses camera 25 | NSMicrophoneUsageDescription 26 | $(PRODUCT_NAME) uses microphone 27 | NSPhotoLibraryUsageDescription 28 | $(PRODUCT_NAME) uses photo library 29 | UILaunchStoryboardName 30 | LaunchScreen 31 | UIMainStoryboardFile 32 | Main 33 | UIRequiredDeviceCapabilities 34 | 35 | armv7 36 | 37 | UIStatusBarHidden 38 | 39 | UISupportedInterfaceOrientations 40 | 41 | UIInterfaceOrientationPortrait 42 | 43 | UISupportedInterfaceOrientations~ipad 44 | 45 | UIInterfaceOrientationPortrait 46 | UIInterfaceOrientationPortraitUpsideDown 47 | UIInterfaceOrientationLandscapeLeft 48 | UIInterfaceOrientationLandscapeRight 49 | 50 | UIViewControllerBasedStatusBarAppearance 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSample/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | } 88 | ], 89 | "info" : { 90 | "version" : 1, 91 | "author" : "xcode" 92 | } 93 | } -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | } 88 | ], 89 | "info" : { 90 | "version" : 1, 91 | "author" : "xcode" 92 | } 93 | } -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing Guidelines 2 | 3 | For anyone looking to get involved to this project, we are glad to hear from you. Here are a few types of contributions 4 | that we would be interested in hearing about. 5 | 6 | - Bug fixes 7 | - If you find a bug, please first report it using Github Issues. 8 | - Issues that have already been identified as a bug will be labelled `bug`. 9 | - If you'd like to submit a fix for a bug, send a Pull Request from your own fork and mention the Issue number. 10 | - Include a test that isolates the bug and verifies that it was fixed. 11 | - New Features 12 | - If you'd like to accomplish something in the library that it doesn't already do, describe the problem in a new Github Issue. 13 | - Issues that have been identified as a feature request will be labelled `enhancement`. 14 | - If you'd like to implement the new feature, please wait for feedback from the project maintainers before spending too much time writing the code. In some cases, `enhancement`s may not align well with the project objectives at the time. 15 | - Tests, Documentation, Miscellaneous 16 | - If you think the test coverage could be improved, the documentation could be clearer, you've got an alternative implementation of something that may have more advantages, or any other change we would still be glad hear about it. 17 | - If its a trivial change, go ahead and send a Pull Request with the changes you have in mind 18 | - If not, open a Github Issue to discuss the idea first. 19 | 20 | ## Requirements 21 | 22 | For a contribution to be accepted: 23 | 24 | - The test suite must be complete and pass 25 | - Code must follow existing styling conventions 26 | - Commit messages must be descriptive. Related issues should be mentioned by number. 27 | 28 | If the contribution doesn't meet these criteria, a maintainer will discuss it with you on the Issue. You can still continue to add more commits to the branch you have sent the Pull Request from. 29 | 30 | ## How To 31 | 32 | 1. Fork this repository on GitHub. 33 | 1. Clone/fetch your fork to your local development machine. 34 | 1. Create a new branch (e.g. `issue-12`, `feat.add_foo`, etc) and check it out. 35 | 1. Make your changes and commit them. (Did the tests pass?) 36 | 1. Push your new branch to your fork. (e.g. `git push myname issue-12`) 37 | 1. Open a Pull Request from your new branch to the original fork's `master` branch. 38 | -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/TextChatTableViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TextChatTableViewController.swift 3 | // 4 | // Copyright © 2017 Tokbox, Inc. All rights reserved. 5 | // 6 | 7 | import UIKit 8 | 9 | class TextChatTableViewController: OTTextChatViewController { 10 | 11 | var textChat: OTTextChat? 12 | var textMessages = [OTTextMessage]() 13 | 14 | override func viewDidLoad() { 15 | super.viewDidLoad() 16 | 17 | textChat = OTTextChat() 18 | textChat?.dataSource = self 19 | textChat?.alias = "Toxboxer" 20 | 21 | textChatNavigationBar.topItem?.title = textChat?.alias 22 | tableView.textChatTableViewDelegate = self 23 | tableView.separatorStyle = .none 24 | textChatInputView.textField.delegate = self 25 | 26 | textChat?.connect(handler: { (signal, connection, error) in 27 | 28 | guard error == nil else { 29 | SVProgressHUD.showError(withStatus: error!.localizedDescription) 30 | return 31 | } 32 | 33 | if signal == .didConnect { 34 | print("Text Chat starts") 35 | } 36 | else if signal == .didDisconnect { 37 | print("Text Chat stops") 38 | } 39 | 40 | }) { [unowned self](signal, message, error) in 41 | 42 | guard error == nil, let message = message else { 43 | SVProgressHUD.showError(withStatus: error!.localizedDescription) 44 | return 45 | } 46 | 47 | self.textMessages.append(message) 48 | self.tableView.reloadData() 49 | self.textChatInputView.textField.text = nil 50 | self.scrollTextChatTableViewToBottom() 51 | } 52 | 53 | textChatInputView.sendButton.addTarget(self, action: #selector(sendTextMessage), for: .touchUpInside) 54 | } 55 | 56 | @objc func sendTextMessage() { 57 | textChat?.sendMessage(textChatInputView.textField.text) 58 | } 59 | } 60 | 61 | extension TextChatTableViewController: OTTextChatDataSource { 62 | public func session(of textChat: OTTextChat!) -> OTAcceleratorSession! { 63 | return (UIApplication.shared.delegate as? AppDelegate)?.session 64 | } 65 | } 66 | 67 | extension TextChatTableViewController: OTTextChatTableViewDataSource { 68 | 69 | func type(of tableView: OTTextChatTableView!) -> OTTextChatViewType { 70 | return .default 71 | } 72 | 73 | public func textChatTableView(_ tableView: OTTextChatTableView!, numberOfRowsInSection section: Int) -> Int { 74 | return textMessages.count 75 | } 76 | 77 | func textChatTableView(_ tableView: OTTextChatTableView!, textMessageItemAt indexPath: IndexPath!) -> OTTextMessage! { 78 | return textMessages[indexPath.row] 79 | } 80 | 81 | func textChatTableView(_ tableView: OTTextChatTableView!, cellForRowAt indexPath: IndexPath!) -> UITableViewCell! { 82 | return nil 83 | } 84 | } 85 | 86 | extension TextChatTableViewController: UITextFieldDelegate { 87 | public func textFieldShouldReturn(_ textField: UITextField) -> Bool { 88 | sendTextMessage() 89 | return true 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSample/TextChatTableViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // DefaultTextChatTableViewController.m 3 | // 4 | // Copyright © 2017 Tokbox, Inc. All rights reserved. 5 | // 6 | 7 | #import "TextChatTableViewController.h" 8 | #import "OTTextChat.h" 9 | 10 | #import "AppDelegate.h" 11 | 12 | @interface TextChatTableViewController () 13 | @property (nonatomic) OTTextChat *textChat; 14 | @property (nonatomic) NSMutableArray *textMessages; 15 | @end 16 | 17 | @implementation TextChatTableViewController 18 | 19 | - (void)viewDidLoad { 20 | [super viewDidLoad]; 21 | 22 | self.textChat = [[OTTextChat alloc] init]; 23 | self.textChat.dataSource = self; 24 | self.textChat.alias = @"Tokboxer"; 25 | self.textMessages = [[NSMutableArray alloc] init]; 26 | 27 | self.textChatNavigationBar.topItem.title = self.textChat.alias; 28 | self.tableView.textChatTableViewDelegate = self; 29 | self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone; 30 | self.textChatInputView.textField.delegate = self; 31 | 32 | __weak TextChatTableViewController *weakSelf = self; 33 | [self.textChat connectWithHandler:^(OTTextChatConnectionEventSignal signal, OTConnection *connection, NSError *error) { 34 | if (signal == OTTextChatConnectionEventSignalDidConnect) { 35 | NSLog(@"Text Chat starts"); 36 | } 37 | else if (signal == OTTextChatConnectionEventSignalDidDisconnect) { 38 | NSLog(@"Text Chat stops"); 39 | } 40 | } messageHandler:^(OTTextChatMessageEventSignal signal, OTTextMessage *message, NSError *error) { 41 | 42 | if (signal == OTTextChatMessageEventSignalDidSendMessage || signal == OTTextChatMessageEventSignalDidReceiveMessage) { 43 | 44 | if (!error) { 45 | [weakSelf.textMessages addObject:message]; 46 | [weakSelf.tableView reloadData]; 47 | weakSelf.textChatInputView.textField.text = nil; 48 | [weakSelf scrollTextChatTableViewToBottom]; 49 | } 50 | } 51 | }]; 52 | 53 | [self.textChatInputView.sendButton addTarget:self action:@selector(sendTextMessage) forControlEvents:UIControlEventTouchUpInside]; 54 | } 55 | 56 | - (void)sendTextMessage { 57 | [self.textChat sendMessage:self.textChatInputView.textField.text]; 58 | } 59 | 60 | #pragma mark - OTTextChatTableViewDataSource 61 | - (OTTextChatViewType)typeOfTextChatTableView:(OTTextChatTableView *)tableView { 62 | 63 | return OTTextChatViewTypeDefault; 64 | } 65 | 66 | - (NSInteger)textChatTableView:(OTTextChatTableView *)tableView 67 | numberOfRowsInSection:(NSInteger)section { 68 | 69 | return self.textMessages.count; 70 | } 71 | 72 | - (OTTextMessage *)textChatTableView:(OTTextChatTableView *)tableView 73 | textMessageItemAtIndexPath:(NSIndexPath *)indexPath { 74 | return self.textMessages[indexPath.row]; 75 | } 76 | 77 | - (UITableViewCell *)textChatTableView:(OTTextChatTableView *)tableView 78 | cellForRowAtIndexPath:(NSIndexPath *)indexPath { 79 | 80 | return nil; 81 | } 82 | 83 | #pragma mark - UITextFieldDelegate 84 | 85 | - (BOOL)textFieldShouldReturn:(UITextField *)textField { 86 | [self sendTextMessage]; 87 | return YES; 88 | } 89 | 90 | #pragma mark - OTTextChatDataSource 91 | - (OTAcceleratorSession *)sessionOfOTTextChat:(OTTextChat *)textChat { 92 | AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate]; 93 | return appDelegate.acceleratorSession; 94 | } 95 | 96 | @end 97 | -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/ScreenShareViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ScreenShareViewController.swift 3 | // 4 | // Copyright © 2017 Tokbox, Inc. All rights reserved. 5 | // 6 | 7 | import UIKit 8 | 9 | class ScreenShareViewController: UIViewController { 10 | 11 | public var sharingImage: UIImage? 12 | 13 | @IBOutlet weak var extiButton: UIButton! 14 | @IBOutlet weak var imageView: UIImageView! 15 | @IBOutlet weak var annotationView: UIView! 16 | @IBOutlet weak var annotationToolbarView: UIView! 17 | 18 | var multipartyScreenSharer: OTMultiPartyCommunicator? 19 | var annotator: OTAnnotator? 20 | 21 | override func viewDidLoad() { 22 | super.viewDidLoad() 23 | styleUI() 24 | } 25 | 26 | override func viewDidAppear(_ animated: Bool) { 27 | super.viewDidAppear(animated) 28 | imageView.image = sharingImage 29 | startScreenSharing() 30 | } 31 | 32 | override func viewDidDisappear(_ animated: Bool) { 33 | super.viewDidDisappear(animated) 34 | 35 | let _ = multipartyScreenSharer?.disconnect() 36 | multipartyScreenSharer = nil 37 | annotator?.annotationScrollView.removeFromSuperview() 38 | annotator?.annotationScrollView.annotationView.removeFromSuperview() 39 | let _ = annotator?.disconnect() 40 | annotator = nil 41 | } 42 | 43 | fileprivate func styleUI() { 44 | extiButton.layer.cornerRadius = extiButton.bounds.width / 2 45 | } 46 | 47 | fileprivate func startScreenSharing() { 48 | multipartyScreenSharer = OTMultiPartyCommunicator.init(view: annotationView) 49 | multipartyScreenSharer?.dataSource = self 50 | 51 | // publishOnly here is to avoid subscripting to those who already subscribed 52 | multipartyScreenSharer?.isPublishOnly = true 53 | 54 | multipartyScreenSharer?.connect { 55 | [unowned self](signal, remote, error) in 56 | 57 | guard error == nil else { 58 | self.dismiss(animated: true) { 59 | SVProgressHUD.showError(withStatus: error!.localizedDescription) 60 | } 61 | return 62 | } 63 | 64 | if signal == .publisherCreated { 65 | self.multipartyScreenSharer?.isPublishAudio = false 66 | self.startAnnotation() 67 | } 68 | } 69 | } 70 | 71 | fileprivate func startAnnotation() { 72 | annotator = OTAnnotator() 73 | annotator?.dataSource = self 74 | annotator?.connect { 75 | [unowned self] (signal, error) in 76 | 77 | guard error == nil else { 78 | self.dismiss(animated: true) { 79 | SVProgressHUD.showError(withStatus: error!.localizedDescription) 80 | } 81 | return 82 | } 83 | 84 | if signal == .sessionDidConnect { 85 | self.annotator?.annotationScrollView.initializeToolbarView() 86 | 87 | guard let annotator = self.annotator, 88 | let toolbarView = annotator.annotationScrollView.toolbarView else { 89 | print("Error on launching annotation") 90 | return 91 | } 92 | 93 | // using frame and self.view to contain toolbarView is for having more space to interact with color picker 94 | 95 | toolbarView.toolbarViewDataSource = self 96 | toolbarView.frame = self.annotationToolbarView.frame 97 | self.view.addSubview(toolbarView) 98 | 99 | annotator.annotationScrollView.frame = self.annotationView.bounds; 100 | annotator.annotationScrollView.scrollView.contentSize = CGSize(width: CGFloat(annotator.annotationScrollView.bounds.width), height: CGFloat(annotator.annotationScrollView.bounds.height)) 101 | self.annotationView.addSubview(annotator.annotationScrollView) 102 | 103 | annotator.annotationScrollView.isAnnotatable = false 104 | } 105 | } 106 | } 107 | 108 | 109 | @IBAction func exitButtonPressed(_ sender: Any) { 110 | dismiss(animated: true, completion: nil) 111 | } 112 | } 113 | 114 | extension ScreenShareViewController: OTMultiPartyCommunicatorDataSource { 115 | func session(of multiPartyCommunicator: OTMultiPartyCommunicator!) -> OTAcceleratorSession! { 116 | return (UIApplication.shared.delegate as? AppDelegate)?.session 117 | } 118 | } 119 | 120 | extension ScreenShareViewController: OTAnnotatorDataSource { 121 | func session(of annotator: OTAnnotator!) -> OTAcceleratorSession! { 122 | return (UIApplication.shared.delegate as? AppDelegate)?.session 123 | } 124 | } 125 | 126 | extension ScreenShareViewController: OTAnnotationToolbarViewDataSource { 127 | func annotationToolbarViewForRootView(forScreenShot toolbarView: OTAnnotationToolbarView!) -> UIView! { 128 | return annotationView 129 | } 130 | } 131 | -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSample/MainView.m: -------------------------------------------------------------------------------- 1 | // 2 | // MainView.m 3 | // 4 | // Copyright © 2017 Tokbox, Inc. All rights reserved. 5 | // 6 | 7 | #import "MainView.h" 8 | 9 | @interface ControlButton: UIButton 10 | 11 | @end 12 | 13 | @implementation ControlButton 14 | 15 | - (void)layoutSubviews { 16 | [super layoutSubviews]; 17 | 18 | self.layer.cornerRadius = self.bounds.size.width / 2; 19 | self.layer.borderWidth = 1; 20 | self.layer.borderColor = [UIColor whiteColor].CGColor; 21 | } 22 | 23 | @end 24 | 25 | @interface MainView() 26 | 27 | // 3 action buttons at the bottom of the view 28 | @property (weak, nonatomic) IBOutlet UIButton *callButton; 29 | @property (weak, nonatomic) IBOutlet ControlButton *publisherVideoButton; 30 | @property (weak, nonatomic) IBOutlet ControlButton *publisherAudioButton; 31 | @property (weak, nonatomic) IBOutlet ControlButton *messageButton; 32 | @property (weak, nonatomic) IBOutlet ControlButton *screenShareButton; 33 | @property (weak, nonatomic) IBOutlet UIView *holderView; 34 | @end 35 | 36 | @implementation MainView 37 | 38 | - (void)awakeFromNib { 39 | [super awakeFromNib]; 40 | 41 | self.callButton.enabled = YES; 42 | self.callButton.layer.cornerRadius = self.callButton.bounds.size.width / 2; 43 | } 44 | 45 | #pragma mark - publisher view 46 | - (void)addPublisherView:(UIView *)publisherView { 47 | publisherView.layer.backgroundColor = [UIColor grayColor].CGColor; 48 | publisherView.frame = self.frame; 49 | [self.holderView addSubview:publisherView]; 50 | } 51 | 52 | - (void)connectCallHolder:(BOOL)connected { 53 | [self.callButton setImage:connected ? [UIImage imageNamed:@"hangUp"] : [UIImage imageNamed:@"startCall"] forState:UIControlStateNormal]; 54 | self.callButton.layer.backgroundColor = connected ? [UIColor colorWithRed:(205/255.0) green:(32/255.0) blue:(40/255.0) alpha:1.0].CGColor : [UIColor colorWithRed:(106/255.0) green:(173/255.0) blue:(191/255.0) alpha:1.0].CGColor; 55 | } 56 | 57 | - (void)updatePublisherAudio:(BOOL)connected { 58 | [self.publisherAudioButton setImage:connected ? [UIImage imageNamed:@"mic"] : [UIImage imageNamed:@"mutedMic"] forState:UIControlStateNormal]; 59 | } 60 | 61 | - (void)updatePublisherVideo:(BOOL)connected { 62 | [self.publisherVideoButton setImage:connected ? [UIImage imageNamed:@"video"] : [UIImage imageNamed:@"noVideo"] forState:UIControlStateNormal]; 63 | } 64 | 65 | - (void)updateSubscriberViews:(NSArray *)subscriberViews 66 | publisherView:(UIView *)publisherView { 67 | 68 | for (UIView *view in self.holderView.subviews) { 69 | [view removeFromSuperview]; 70 | } 71 | 72 | if (subscriberViews.count == 0) { 73 | [self addPublisherView:publisherView]; 74 | return; 75 | } 76 | 77 | if (subscriberViews.count == 1) { 78 | [self addPublisherView:publisherView]; 79 | OTMultiPartyRemote *remote = [subscriberViews lastObject]; 80 | remote.subscriberView.frame = CGRectMake(0, 0, self.bounds.size.width, self.bounds.size.height / 2); 81 | [self.holderView addSubview:remote.subscriberView]; 82 | return; 83 | } 84 | 85 | CGFloat height, subscriberWidth, publisherWidth; 86 | height = self.bounds.size.height / (subscriberViews.count / 2 + 1); 87 | subscriberWidth = subscriberViews.count + 1 > 2 ? self.bounds.size.width / 2 : self.bounds.size.width; 88 | publisherWidth = (subscriberViews.count + 1) % 2 == 0 ? self.bounds.size.width / 2 : self.bounds.size.width; 89 | 90 | CGFloat x = 0, y = 0; 91 | for (int i = 0; i < subscriberViews.count; i++) { 92 | 93 | OTMultiPartyRemote *remote = subscriberViews[i]; 94 | remote.subscriberView.frame = CGRectMake(x, y, subscriberWidth, height); 95 | 96 | // this will position and audio/video controls 97 | remote.subscriberView.controlView.backgroundColor = [UIColor blackColor]; 98 | remote.subscriberView.controlView.isVerticalAlignment = YES; 99 | remote.subscriberView.controlView.frame = CGRectMake(10, 10, CGRectGetWidth(remote.subscriberView.bounds) * 0.2, CGRectGetHeight(remote.subscriberView.bounds) * 0.3); 100 | 101 | [self.holderView addSubview:remote.subscriberView]; 102 | 103 | // update x and y value for the next subscriber view 104 | if ((i + 1) % 2 == 0) { 105 | x = 0; 106 | } 107 | else { 108 | x = subscriberWidth; 109 | } 110 | y = (i + 1) / 2 * height; 111 | } 112 | 113 | [self addPublisherView:publisherView]; 114 | if (subscriberWidth != publisherWidth) { 115 | // publisher is at the bottom 116 | publisherView.frame = CGRectMake(0, y, publisherWidth, height); 117 | } 118 | else { 119 | // publisher is at the bottom right 120 | publisherView.frame = CGRectMake(self.bounds.size.width / 2, y, publisherWidth, height); 121 | } 122 | 123 | } 124 | 125 | #pragma mark - other controls 126 | - (void)enableControlButtonsForCall:(BOOL)enabled { 127 | [self.publisherVideoButton setEnabled:enabled]; 128 | [self.publisherAudioButton setEnabled:enabled]; 129 | [self.messageButton setEnabled:enabled]; 130 | [self.screenShareButton setEnabled:enabled]; 131 | } 132 | 133 | - (void)resetAllControl { 134 | [self connectCallHolder:NO]; 135 | [self updatePublisherAudio:YES]; 136 | [self updatePublisherVideo:YES]; 137 | [self enableControlButtonsForCall:NO]; 138 | } 139 | 140 | @end 141 | -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/MainView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MainView.swift 3 | // 4 | // Copyright © 2017 Tokbox, Inc. All rights reserved. 5 | // 6 | 7 | import UIKit 8 | 9 | class ControlButton: UIButton { 10 | 11 | override func layoutSubviews() { 12 | super.layoutSubviews() 13 | layer.cornerRadius = bounds.size.width / 2 14 | layer.borderWidth = 1 15 | layer.borderColor = UIColor.white.cgColor 16 | } 17 | } 18 | 19 | class MainView: UIView { 20 | 21 | @IBOutlet fileprivate weak var holderView: UIView! 22 | @IBOutlet fileprivate weak var callButton: UIButton! 23 | @IBOutlet fileprivate weak var publisherVideoButton: ControlButton! 24 | @IBOutlet fileprivate weak var publisherAudioButton: ControlButton! 25 | @IBOutlet fileprivate weak var messageButton: ControlButton! 26 | @IBOutlet weak var screenShareButton: ControlButton! 27 | 28 | override func awakeFromNib() { 29 | super.awakeFromNib() 30 | 31 | callButton.isEnabled = true 32 | callButton.layer.cornerRadius = callButton.bounds.width / 2 33 | } 34 | 35 | func addPublisherView(_ publisherView: UIView) { 36 | publisherView.layer.backgroundColor = UIColor.gray.cgColor 37 | publisherView.frame = frame 38 | holderView.addSubview(publisherView) 39 | } 40 | 41 | func connectCallHolder(connected: Bool) { 42 | callButton.setImage(connected ? #imageLiteral(resourceName: "hangUp") : #imageLiteral(resourceName: "startCall"), for: .normal) 43 | callButton.layer.backgroundColor = connected ? UIColor(red: 205/255.0, green: 32/255.0, blue: 40/255.0, alpha: 1.0).cgColor : UIColor(red: 106/255.0, green: 173/255.0, blue: 191/255.0, alpha: 1.0).cgColor 44 | } 45 | 46 | func updatePublisherAudio(connected: Bool) { 47 | publisherAudioButton.setImage(connected ? #imageLiteral(resourceName: "mic") : #imageLiteral(resourceName: "mutedMic"), for: .normal) 48 | } 49 | 50 | func updateSubscriberViews(_ subscriberViews:[OTMultiPartyRemote], publisherView: UIView?) { 51 | for view in holderView.subviews { 52 | view.removeFromSuperview() 53 | } 54 | 55 | guard let publisherView = publisherView else {return} 56 | 57 | if subscriberViews.count == 0 { 58 | addPublisherView(publisherView) 59 | return 60 | } 61 | 62 | if subscriberViews.count == 1 { 63 | addPublisherView(publisherView) 64 | guard let remote = subscriberViews.last else {return} 65 | remote.subscriberView.frame = CGRect(x: 0, y: 0, width: bounds.size.width, height: bounds.size.height / 2) 66 | holderView.addSubview(remote.subscriberView) 67 | return 68 | } 69 | 70 | var height, subscriberWidth, publisherWidth: CGFloat 71 | height = bounds.size.height / (CGFloat(subscriberViews.count / 2) + 1) 72 | subscriberWidth = subscriberViews.count + 1 > 2 ? bounds.size.width / 2 : bounds.size.width 73 | publisherWidth = (subscriberViews.count + 1) % 2 == 0 ? bounds.size.width / 2 : bounds.size.width 74 | 75 | var x: CGFloat = 0.0, y: CGFloat = 0.0 76 | var i = 0 77 | repeat { 78 | 79 | let remote = subscriberViews[i] 80 | remote.subscriberView.frame = CGRect(x: x, y: y, width: subscriberWidth, height: height) 81 | 82 | // this will position and audio/video controls 83 | remote.subscriberView.controlView.backgroundColor = UIColor.black 84 | remote.subscriberView.controlView.isVerticalAlignment = true 85 | remote.subscriberView.controlView.frame = CGRect(x: 10, y: 10, width: remote.subscriberView.bounds.width * 0.2, height: remote.subscriberView.bounds.height * 0.3) 86 | 87 | holderView.addSubview(remote.subscriberView) 88 | 89 | // update x and y value for the next subscriber view 90 | if (i + 1) % 2 == 0 { 91 | x = 0 92 | } 93 | else { 94 | x = subscriberWidth 95 | } 96 | y = CGFloat((i + 1) / 2) * height 97 | 98 | // update index 99 | i += 1 100 | } while i < subscriberViews.count 101 | 102 | 103 | addPublisherView(publisherView) 104 | if subscriberWidth != publisherWidth { 105 | // publisher is at the bottom 106 | publisherView.frame = CGRect(x: 0, y: y, width: publisherWidth, height: height); 107 | } 108 | else { 109 | // publisher is at the bottom right 110 | publisherView.frame = CGRect(x: bounds.size.width / 2, y: y, width: publisherWidth, height: height); 111 | } 112 | } 113 | 114 | func updatePublisherVideo(connected: Bool) { 115 | publisherVideoButton.setImage(connected ? #imageLiteral(resourceName: "video") : #imageLiteral(resourceName: "noVideo"), for: .normal) 116 | } 117 | 118 | func enableControlButtonsForCall(enabled: Bool) { 119 | publisherVideoButton.isEnabled = enabled 120 | publisherAudioButton.isEnabled = enabled 121 | messageButton.isEnabled = enabled 122 | screenShareButton.isEnabled = enabled 123 | } 124 | 125 | func resetAllControl() { 126 | connectCallHolder(connected: false) 127 | updatePublisherAudio(connected: true) 128 | updatePublisherVideo(connected: true) 129 | enableControlButtonsForCall(enabled: false) 130 | } 131 | } 132 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | We as members, contributors, and leaders pledge to make participation in our 6 | community a harassment-free experience for everyone, regardless of age, body 7 | size, visible or invisible disability, ethnicity, sex characteristics, gender 8 | identity and expression, level of experience, education, socio-economic status, 9 | nationality, personal appearance, race, religion, or sexual identity 10 | and orientation. 11 | 12 | We pledge to act and interact in ways that contribute to an open, welcoming, 13 | diverse, inclusive, and healthy community. 14 | 15 | ## Our Standards 16 | 17 | Examples of behavior that contributes to a positive environment for our 18 | community include: 19 | 20 | - Demonstrating empathy and kindness toward other people 21 | - Being respectful of differing opinions, viewpoints, and experiences 22 | - Giving and gracefully accepting constructive feedback 23 | - Accepting responsibility and apologizing to those affected by our mistakes, 24 | and learning from the experience 25 | - Focusing on what is best not just for us as individuals, but for the 26 | overall community 27 | 28 | Examples of unacceptable behavior include: 29 | 30 | - The use of sexualized language or imagery, and sexual attention or 31 | advances of any kind 32 | - Trolling, insulting or derogatory comments, and personal or political attacks 33 | - Public or private harassment 34 | - Publishing others' private information, such as a physical or email 35 | address, without their explicit permission 36 | - Other conduct which could reasonably be considered inappropriate in a 37 | professional setting 38 | 39 | ## Enforcement Responsibilities 40 | 41 | Community leaders are responsible for clarifying and enforcing our standards of 42 | acceptable behavior and will take appropriate and fair corrective action in 43 | response to any behavior that they deem inappropriate, threatening, offensive, 44 | or harmful. 45 | 46 | Community leaders have the right and responsibility to remove, edit, or reject 47 | comments, commits, code, wiki edits, issues, and other contributions that are 48 | not aligned to this Code of Conduct, and will communicate reasons for moderation 49 | decisions when appropriate. 50 | 51 | ## Scope 52 | 53 | This Code of Conduct applies within all community spaces, and also applies when 54 | an individual is officially representing the community in public spaces. 55 | Examples of representing our community include using an official e-mail address, 56 | posting via an official social media account, or acting as an appointed 57 | representative at an online or offline event. 58 | 59 | ## Enforcement 60 | 61 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 62 | reported to the community leaders responsible for enforcement at 63 | devrel@vonage.com. 64 | All complaints will be reviewed and investigated promptly and fairly. 65 | 66 | All community leaders are obligated to respect the privacy and security of the 67 | reporter of any incident. 68 | 69 | ## Enforcement Guidelines 70 | 71 | Community leaders will follow these Community Impact Guidelines in determining 72 | the consequences for any action they deem in violation of this Code of Conduct: 73 | 74 | ### 1. Correction 75 | 76 | **Community Impact**: Use of inappropriate language or other behavior deemed 77 | unprofessional or unwelcome in the community. 78 | 79 | **Consequence**: A private, written warning from community leaders, providing 80 | clarity around the nature of the violation and an explanation of why the 81 | behavior was inappropriate. A public apology may be requested. 82 | 83 | ### 2. Warning 84 | 85 | **Community Impact**: A violation through a single incident or series 86 | of actions. 87 | 88 | **Consequence**: A warning with consequences for continued behavior. No 89 | interaction with the people involved, including unsolicited interaction with 90 | those enforcing the Code of Conduct, for a specified period of time. This 91 | includes avoiding interactions in community spaces as well as external channels 92 | like social media. Violating these terms may lead to a temporary or 93 | permanent ban. 94 | 95 | ### 3. Temporary Ban 96 | 97 | **Community Impact**: A serious violation of community standards, including 98 | sustained inappropriate behavior. 99 | 100 | **Consequence**: A temporary ban from any sort of interaction or public 101 | communication with the community for a specified period of time. No public or 102 | private interaction with the people involved, including unsolicited interaction 103 | with those enforcing the Code of Conduct, is allowed during this period. 104 | Violating these terms may lead to a permanent ban. 105 | 106 | ### 4. Permanent Ban 107 | 108 | **Community Impact**: Demonstrating a pattern of violation of community 109 | standards, including sustained inappropriate behavior, harassment of an 110 | individual, or aggression toward or disparagement of classes of individuals. 111 | 112 | **Consequence**: A permanent ban from any sort of public interaction within 113 | the community. 114 | 115 | ## Attribution 116 | 117 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], 118 | version 2.0, available at 119 | https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. 120 | 121 | Community Impact Guidelines were inspired by [Mozilla's code of conduct 122 | enforcement ladder](https://github.com/mozilla/diversity). 123 | 124 | [homepage]: https://www.contributor-covenant.org 125 | 126 | For answers to common questions about this code of conduct, see the FAQ at 127 | https://www.contributor-covenant.org/faq. Translations are available at 128 | https://www.contributor-covenant.org/translations. -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSample/ScreenShareViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ScreenShareViewController.m 3 | // 4 | // Copyright © 2017 Tokbox, Inc. All rights reserved. 5 | // 6 | 7 | #import "ScreenShareViewController.h" 8 | 9 | #import "AppDelegate.h" 10 | 11 | #import "OTAnnotator.h" 12 | #import "OTMultiPartyCommunicator.h" 13 | 14 | #import 15 | 16 | @interface ScreenShareViewController () 17 | 18 | @property (weak, nonatomic) IBOutlet UIButton *extiButton; 19 | @property (weak, nonatomic) IBOutlet UIImageView *imageView; 20 | @property (weak, nonatomic) IBOutlet UIView *annotationView; 21 | @property (weak, nonatomic) IBOutlet UIView *annotationToolbarView; 22 | 23 | @property (nonatomic) OTMultiPartyCommunicator *multipartyScreenSharer; 24 | @property (nonatomic) OTAnnotator *annotator; 25 | 26 | @end 27 | 28 | @implementation ScreenShareViewController 29 | 30 | - (void)viewDidLoad { 31 | [super viewDidLoad]; 32 | [self styleUI]; 33 | } 34 | 35 | - (void)viewDidAppear:(BOOL)animated { 36 | [super viewDidAppear:animated]; 37 | self.imageView.image = _sharingImage; 38 | [self startScreenSharing]; 39 | } 40 | 41 | - (void)viewDidLayoutSubviews { 42 | [super viewDidLayoutSubviews]; 43 | 44 | if (self.annotator) { 45 | self.annotator.annotationScrollView.frame = self.annotationView.bounds; 46 | self.annotator.annotationScrollView.scrollView.contentSize = CGSizeMake(CGRectGetWidth(self.annotator.annotationScrollView.bounds), CGRectGetHeight(self.annotator.annotationScrollView.bounds)); 47 | } 48 | 49 | if (self.annotator.annotationScrollView.toolbarView) { 50 | self.annotator.annotationScrollView.toolbarView.frame = self.annotationToolbarView.frame; 51 | } 52 | } 53 | 54 | - (void)viewWillDisappear:(BOOL)animated { 55 | [super viewWillDisappear:animated]; 56 | 57 | [self.multipartyScreenSharer disconnect]; 58 | self.multipartyScreenSharer = nil; 59 | [self.annotator.annotationScrollView removeFromSuperview]; 60 | [self.annotator.annotationScrollView.annotationView removeFromSuperview]; 61 | [self.annotator disconnect]; 62 | self.annotator = nil; 63 | } 64 | 65 | - (void)styleUI { 66 | self.extiButton.layer.cornerRadius = CGRectGetWidth(self.extiButton.bounds) / 2; 67 | } 68 | 69 | - (void)startScreenSharing { 70 | self.multipartyScreenSharer = [[OTMultiPartyCommunicator alloc] initWithView:self.annotationView]; 71 | self.multipartyScreenSharer.dataSource = self; 72 | 73 | // publishOnly here is to avoid subscripting to those who already subscribed 74 | self.multipartyScreenSharer.publishOnly = YES; 75 | 76 | __weak ScreenShareViewController *weakSelf = self; 77 | [self.multipartyScreenSharer connectWithHandler:^(OTCommunicationSignal signal, OTMultiPartyRemote *subscriber, NSError *error) { 78 | 79 | if (error) { 80 | [weakSelf dismissViewControllerAnimated:YES completion:^(){ 81 | [SVProgressHUD showErrorWithStatus:error.localizedDescription]; 82 | }]; 83 | return; 84 | } 85 | 86 | if (signal == OTPublisherCreated) { 87 | 88 | weakSelf.multipartyScreenSharer.publishAudio = NO; 89 | [weakSelf startAnnotation]; 90 | } 91 | }]; 92 | } 93 | 94 | - (void)startAnnotation { 95 | self.annotator = [[OTAnnotator alloc] init]; 96 | self.annotator.dataSource = self; 97 | __weak ScreenShareViewController *weakSelf = self; 98 | [self.annotator connectWithCompletionHandler:^(OTAnnotationSignal signal, NSError *error) { 99 | if (error) { 100 | [weakSelf dismissViewControllerAnimated:YES completion:^(){ 101 | [SVProgressHUD showErrorWithStatus:error.localizedDescription]; 102 | }]; 103 | return; 104 | } 105 | 106 | if (signal == OTAnnotationSessionDidConnect) { 107 | 108 | // using frame and self.view to contain toolbarView is for having more space to interact with color picker 109 | [weakSelf.annotator.annotationScrollView initializeToolbarView]; 110 | weakSelf.annotator.annotationScrollView.toolbarView.toolbarViewDataSource = self; 111 | weakSelf.annotator.annotationScrollView.toolbarView.frame = weakSelf.annotationToolbarView.frame; 112 | [weakSelf.view addSubview:weakSelf.annotator.annotationScrollView.toolbarView]; 113 | 114 | weakSelf.annotator.annotationScrollView.frame = weakSelf.annotationView.bounds; 115 | weakSelf.annotator.annotationScrollView.scrollView.contentSize = CGSizeMake(CGRectGetWidth(weakSelf.annotator.annotationScrollView.bounds), CGRectGetHeight(weakSelf.annotator.annotationScrollView.bounds)); 116 | [weakSelf.annotationView addSubview:weakSelf.annotator.annotationScrollView]; 117 | 118 | weakSelf.annotator.annotationScrollView.annotatable = NO; 119 | } 120 | }]; 121 | } 122 | 123 | - (IBAction)exitButtonPressed:(id)sender { 124 | [self dismissViewControllerAnimated:YES completion:nil]; 125 | } 126 | 127 | - (OTAcceleratorSession *)sessionOfOTAnnotator:(OTAnnotator *)annotator { 128 | AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate]; 129 | return appDelegate.acceleratorSession; 130 | } 131 | 132 | - (OTAcceleratorSession *)sessionOfOTMultiPartyCommunicator:(OTMultiPartyCommunicator *)multiPartyCommunicator { 133 | AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate]; 134 | return appDelegate.acceleratorSession; 135 | } 136 | 137 | - (UIView *)annotationToolbarViewForRootViewForScreenShot:(OTAnnotationToolbarView *)toolbarView { 138 | return self.annotationView; 139 | } 140 | 141 | @end 142 | -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/MainViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MainViewController.swift 3 | // 4 | // Copyright © 2017 Tokbox, Inc. All rights reserved. 5 | // 6 | 7 | import Foundation 8 | 9 | class MainViewController: UIViewController { 10 | 11 | fileprivate var mainView: MainView { 12 | return self.view as! MainView 13 | } 14 | 15 | fileprivate var subscribers = [OTMultiPartyRemote]() 16 | fileprivate var multipartyCommunicator: OTMultiPartyCommunicator? 17 | 18 | var selectedImage: UIImage? 19 | lazy fileprivate var screenShareMenuAlertController: UIAlertController = { 20 | 21 | let screenShareMenuAlertController = UIAlertController.init(title: nil, message: "Please choose the content you want to share", preferredStyle: .actionSheet) 22 | 23 | screenShareMenuAlertController.addAction(UIAlertAction.init(title: "Camera Roll", style: .default) { 24 | [unowned self] (action) in 25 | 26 | let imagePickerViewController = UIImagePickerController() 27 | imagePickerViewController.delegate = self 28 | imagePickerViewController.sourceType = .photoLibrary 29 | self.present(imagePickerViewController, animated: true, completion: nil) 30 | }) 31 | 32 | screenShareMenuAlertController.addAction(UIAlertAction.init(title: "Cancel", style: .destructive) { 33 | [unowned self] (action) in 34 | 35 | screenShareMenuAlertController.dismiss(animated: true, completion: nil) 36 | }) 37 | 38 | return screenShareMenuAlertController 39 | }() 40 | 41 | @IBAction func callButtonPressed(_ sender: Any) { 42 | 43 | guard let multipartyCommunicator = multipartyCommunicator else {return} 44 | 45 | if !multipartyCommunicator.isCallEnabled { 46 | 47 | // start call 48 | SVProgressHUD.show() 49 | multipartyCommunicator.connect { 50 | [unowned self] (signal, remote, error) in 51 | 52 | guard error == nil else { 53 | SVProgressHUD.showError(withStatus: error!.localizedDescription) 54 | return 55 | } 56 | self.handleCommunicationSignal(signal, remote: remote) 57 | } 58 | } 59 | else { 60 | 61 | // end call 62 | SVProgressHUD.dismiss() 63 | multipartyCommunicator.disconnect() 64 | mainView.resetAllControl() 65 | subscribers.removeAll() 66 | } 67 | } 68 | 69 | @IBAction func publisherAudioButtonPressed(_ sender: Any) { 70 | multipartyCommunicator!.isPublishAudio = !multipartyCommunicator!.isPublishAudio 71 | mainView.updatePublisherAudio(connected: multipartyCommunicator!.isPublishAudio) 72 | } 73 | 74 | @IBAction func publisherVideoButtonPressed(_ sender: Any) { 75 | multipartyCommunicator!.isPublishVideo = !multipartyCommunicator!.isPublishVideo 76 | mainView.updatePublisherVideo(connected: multipartyCommunicator!.isPublishVideo) 77 | } 78 | 79 | @IBAction func textMessageButtonPressed(_ sender: Any) { 80 | present(TextChatTableViewController(), animated: true, completion: nil) 81 | } 82 | 83 | @IBAction func screenShareButtonPressed(_ sender: Any) { 84 | if UIDevice.current.userInterfaceIdiom == .phone { 85 | // handle iphone 86 | present(screenShareMenuAlertController, animated: true, completion: nil) 87 | } 88 | else { 89 | // handle ipad 90 | screenShareMenuAlertController.modalPresentationStyle = .popover 91 | screenShareMenuAlertController.popoverPresentationController?.sourceView = mainView.screenShareButton 92 | screenShareMenuAlertController.popoverPresentationController?.sourceRect = mainView.screenShareButton.bounds 93 | present(screenShareMenuAlertController, animated: true, completion: nil) 94 | } 95 | } 96 | 97 | override func viewDidLoad() { 98 | super.viewDidLoad() 99 | multipartyCommunicator = OTMultiPartyCommunicator.init() 100 | multipartyCommunicator!.dataSource = self 101 | } 102 | 103 | override func viewDidLayoutSubviews() { 104 | super.viewDidLayoutSubviews() 105 | mainView.updateSubscriberViews(subscribers, publisherView: multipartyCommunicator?.publisherView) 106 | } 107 | 108 | fileprivate func handleCommunicationSignal(_ signal: OTCommunicationSignal, remote: OTMultiPartyRemote?) { 109 | switch signal { 110 | case .publisherCreated: // join a call 111 | 112 | guard let multipartyCommunicator = multipartyCommunicator else {break} 113 | SVProgressHUD.dismiss() 114 | multipartyCommunicator.publisherView.showAudioVideoControl = false 115 | mainView.enableControlButtonsForCall(enabled: true) 116 | mainView.connectCallHolder(connected: multipartyCommunicator.isCallEnabled) 117 | mainView.addPublisherView(multipartyCommunicator.publisherView) 118 | 119 | case .subscriberReady: // one participant joins 120 | SVProgressHUD.dismiss() 121 | if let remote = remote, subscribers.firstIndex(of: remote) == nil { 122 | subscribers.append(remote) 123 | mainView.updateSubscriberViews(subscribers, publisherView: multipartyCommunicator?.publisherView) 124 | } 125 | 126 | case .subscriberDestroyed: // one participant leaves 127 | if let remote = remote, let index = subscribers.firstIndex(of: remote) { 128 | subscribers.remove(at: index) 129 | mainView.updateSubscriberViews(subscribers, publisherView: multipartyCommunicator?.publisherView) 130 | } 131 | 132 | case .sessionDidBeginReconnecting, .subscriberCreated: 133 | SVProgressHUD.show() 134 | 135 | case .sessionDidReconnect: 136 | SVProgressHUD.dismiss() 137 | 138 | case .subscriberVideoDisableWarningLifted: 139 | remote?.isSubscribeToVideo = true 140 | 141 | case .subscriberVideoDisableWarning: 142 | remote?.isSubscribeToVideo = false 143 | 144 | default:break 145 | } 146 | } 147 | } 148 | 149 | // MARK: - OTMultiPartyCommunicatorDataSource 150 | extension MainViewController: OTMultiPartyCommunicatorDataSource { 151 | func session(of multiPartyCommunicator: OTMultiPartyCommunicator!) -> OTAcceleratorSession! { 152 | return (UIApplication.shared.delegate as? AppDelegate)?.session 153 | } 154 | } 155 | 156 | // MARK: - UIImagePickerControllerDelegate, UINavigationControllerDelegate 157 | extension MainViewController: UIImagePickerControllerDelegate, UINavigationControllerDelegate { 158 | 159 | override func prepare(for segue: UIStoryboardSegue, sender: Any?) { 160 | 161 | guard let screenSharingVC = segue.destination as? ScreenShareViewController else {return} 162 | screenSharingVC.sharingImage = selectedImage 163 | } 164 | 165 | func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) { 166 | guard let image = info[UIImagePickerController.InfoKey.originalImage] as? UIImage else {return} 167 | selectedImage = image 168 | picker.dismiss(animated: true) { 169 | [unowned self] in 170 | self.performSegue(withIdentifier: "ScreenSharing", sender: nil) 171 | } 172 | } 173 | } 174 | -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSample/MainViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // MainViewController.m 3 | // 4 | // Copyright © 2017 Tokbox, Inc. All rights reserved. 5 | // 6 | 7 | #import "MainView.h" 8 | #import "MainViewController.h" 9 | #import "ScreenShareViewController.h" 10 | #import "OTMultiPartyCommunicator.h" 11 | #import "AppDelegate.h" 12 | 13 | #import "TextChatTableViewController.h" 14 | 15 | #import 16 | 17 | @interface MainViewController () { 18 | UIImage *selectedImage; 19 | } 20 | @property (nonatomic) MainView *mainView; 21 | @property (nonatomic) OTMultiPartyCommunicator *multipartyCommunicator; 22 | @property (nonatomic) NSMutableArray *subscribers; 23 | 24 | @property (nonatomic) UIAlertController *screenShareMenuAlertController; 25 | @property (nonatomic) UIImagePickerController *imagePickerViewContoller; 26 | 27 | @end 28 | 29 | @implementation MainViewController 30 | 31 | - (void)viewDidLoad { 32 | [super viewDidLoad]; 33 | 34 | self.mainView = (MainView *)self.view; 35 | 36 | self.multipartyCommunicator = [[OTMultiPartyCommunicator alloc] init]; 37 | self.multipartyCommunicator.dataSource = self; 38 | self.subscribers = [[NSMutableArray alloc] initWithCapacity:6]; 39 | } 40 | 41 | - (void)viewDidLayoutSubviews { 42 | [super viewDidLayoutSubviews]; 43 | [self.mainView updateSubscriberViews:self.subscribers 44 | publisherView:self.multipartyCommunicator.publisherView]; 45 | } 46 | 47 | - (IBAction)publisherCallButtonPressed:(UIButton *)sender { 48 | 49 | if (!self.multipartyCommunicator.isCallEnabled) { 50 | 51 | // start call 52 | [SVProgressHUD show]; 53 | 54 | __weak MainViewController *weakSelf = self; 55 | [self.multipartyCommunicator connectWithHandler:^(OTCommunicationSignal signal, OTMultiPartyRemote *subscriber, NSError *error) { 56 | if (!error) { 57 | [weakSelf handleCommunicationSignal:signal remote:subscriber]; 58 | } 59 | else { 60 | [SVProgressHUD showErrorWithStatus:error.localizedDescription]; 61 | } 62 | }]; 63 | } 64 | else { 65 | 66 | // end call 67 | [SVProgressHUD dismiss]; 68 | [self.multipartyCommunicator disconnect]; 69 | [self.mainView resetAllControl]; 70 | [self.subscribers removeAllObjects]; 71 | } 72 | } 73 | 74 | - (void)handleCommunicationSignal:(OTCommunicationSignal)signal 75 | remote:(OTMultiPartyRemote *)remote { 76 | 77 | switch (signal) { 78 | case OTPublisherCreated: { // join a call 79 | [SVProgressHUD dismiss]; 80 | self.multipartyCommunicator.publisherView.showAudioVideoControl = NO; 81 | [self.mainView enableControlButtonsForCall:YES]; 82 | [self.mainView connectCallHolder:self.multipartyCommunicator.isCallEnabled]; 83 | [self.mainView addPublisherView:self.multipartyCommunicator.publisherView]; 84 | break; 85 | } 86 | case OTSubscriberCreated: { // one participant is ready to join 87 | [SVProgressHUD show]; 88 | } 89 | case OTSubscriberReady: { // one participant joins 90 | [SVProgressHUD dismiss]; 91 | if (![self.subscribers containsObject:remote]) { 92 | [self.subscribers addObject:remote]; 93 | [self.mainView updateSubscriberViews:self.subscribers 94 | publisherView:self.multipartyCommunicator.publisherView]; 95 | } 96 | break; 97 | } 98 | case OTSubscriberDestroyed:{ // one participant leaves 99 | if ([self.subscribers containsObject:remote]) { 100 | [self.subscribers removeObject:remote]; 101 | [self.mainView updateSubscriberViews:self.subscribers 102 | publisherView:self.multipartyCommunicator.publisherView]; 103 | } 104 | break; 105 | } 106 | case OTSessionDidBeginReconnecting: { 107 | [SVProgressHUD showInfoWithStatus:@"Reconnecting"]; 108 | break; 109 | } 110 | case OTSessionDidReconnect: { 111 | [SVProgressHUD dismiss]; 112 | break; 113 | } 114 | case OTSubscriberVideoDisableWarning:{ 115 | remote.subscribeToVideo = NO; 116 | break; 117 | } 118 | case OTSubscriberVideoDisableWarningLifted:{ 119 | remote.subscribeToVideo = YES; 120 | break; 121 | } 122 | default: break; 123 | } 124 | } 125 | 126 | - (IBAction)publisherAudioButtonPressed:(UIButton *)sender { 127 | self.multipartyCommunicator.publishAudio = !self.multipartyCommunicator.publishAudio; 128 | [self.mainView updatePublisherAudio:self.multipartyCommunicator.publishAudio]; 129 | } 130 | 131 | - (IBAction)publisherVideoButtonPressed:(UIButton *)sender { 132 | self.multipartyCommunicator.publishVideo = !self.multipartyCommunicator.publishVideo; 133 | [self.mainView updatePublisherVideo:self.multipartyCommunicator.publishVideo]; 134 | } 135 | 136 | - (IBAction)textMessageButtonPressed:(id)sender { 137 | [self presentViewController:[[TextChatTableViewController alloc] init] animated:YES completion:nil]; 138 | } 139 | 140 | - (IBAction)screenShareButtonPressed:(id)sender { 141 | if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) { 142 | // handle iPhone 143 | [self presentViewController:self.screenShareMenuAlertController animated:YES completion:nil]; 144 | } 145 | else { 146 | // handle iPad 147 | self.screenShareMenuAlertController.modalPresentationStyle = UIModalPresentationPopover; 148 | self.screenShareMenuAlertController.popoverPresentationController.sourceView = self.mainView.screenShareButton; 149 | self.screenShareMenuAlertController.popoverPresentationController.sourceRect = self.mainView.screenShareButton.bounds; 150 | [self presentViewController:self.screenShareMenuAlertController animated:YES completion:nil]; 151 | } 152 | } 153 | 154 | - (OTAcceleratorSession *)sessionOfOTMultiPartyCommunicator:(OTMultiPartyCommunicator *)multiPartyCommunicator { 155 | AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate]; 156 | return appDelegate.acceleratorSession; 157 | } 158 | 159 | #pragma mark - UIImagePickerControllerDelegate, UINavigationControllerDelegate 160 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 161 | if ([segue.destinationViewController isKindOfClass:[ScreenShareViewController class]]) { 162 | 163 | ScreenShareViewController *vc = (ScreenShareViewController *)segue.destinationViewController; 164 | vc.sharingImage = selectedImage; 165 | } 166 | } 167 | 168 | - (UIAlertController *)screenShareMenuAlertController { 169 | if (!_screenShareMenuAlertController) { 170 | _screenShareMenuAlertController = [UIAlertController alertControllerWithTitle:nil 171 | message:@"Please choose the content you want to share" 172 | preferredStyle:UIAlertControllerStyleActionSheet]; 173 | 174 | 175 | __weak MainViewController *weakSelf = self; 176 | UIAlertAction *cameraRollAction = [UIAlertAction actionWithTitle:@"Camera Roll" 177 | style:UIAlertActionStyleDefault 178 | handler:^(UIAlertAction *action) { 179 | 180 | if (!_imagePickerViewContoller) { 181 | _imagePickerViewContoller = [[UIImagePickerController alloc] init]; 182 | _imagePickerViewContoller.delegate = weakSelf; 183 | _imagePickerViewContoller.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; 184 | } 185 | [weakSelf presentViewController:_imagePickerViewContoller animated:YES completion:nil]; 186 | }]; 187 | 188 | [_screenShareMenuAlertController addAction:cameraRollAction]; 189 | [_screenShareMenuAlertController addAction: 190 | [UIAlertAction actionWithTitle:@"Cancel" 191 | style:UIAlertActionStyleDestructive 192 | handler:^(UIAlertAction *action) { 193 | 194 | [_screenShareMenuAlertController dismissViewControllerAnimated:YES completion:nil]; 195 | }] 196 | ]; 197 | } 198 | return _screenShareMenuAlertController; 199 | } 200 | 201 | - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { 202 | selectedImage = info[UIImagePickerControllerOriginalImage]; 203 | __weak MainViewController *weakSelf = self; 204 | [picker dismissViewControllerAnimated:YES completion:^(){ 205 | [weakSelf performSegueWithIdentifier:@"ScreenSharing" sender:nil]; 206 | }]; 207 | } 208 | 209 | @end 210 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Accelerator Sample App for iOS 2 | 3 | Tokbox is now known as Vonage 4 | 5 | ## Quick start 6 | 7 | This app is built using [accelerator-core-ios](https://github.com/opentok/accelerator-core-ios) and the following accelerator packs: 8 | 9 | - [TextChat](https://github.com/opentok/accelerator-textchat-ios) 10 | - [Annotation](https://github.com/opentok/accelerator-annotation-ios) 11 | 12 | ### Install the project files 13 | 14 | Use CocoaPods to install the project files and dependencies. 15 | 16 | 1. Install CocoaPods as described in [CocoaPods Getting Started](https://guides.cocoapods.org/using/getting-started.html#getting-started). 17 | 1. In Terminal, `cd` to your project directory and type `pod install`. (Sometimes, `pod update` is magical) 18 | 1. Reopen your project in Xcode using the new `*.xcworkspace` file. 19 | 20 | ### Configure and build the app 21 | 22 | Configure the sample app code. Then, build and run the app. 23 | 24 | 1. The application **requires** values for **API Key**, **Session ID**, and **Token**. In the sample, you can get these values at the [OpenTok Developer Dashboard](https://dashboard.tokbox.com/). For production deployment, you must generate the **Session ID** and **Token** values using one of the [OpenTok Server SDKs](https://tokbox.com/developer/sdks/server/). 25 | 26 | 1. Replace the following empty strings with the corresponding **API Key**, **Session ID**, and **Token** values: 27 | 28 | ```objc 29 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 30 | self.acceleratorSession = [[OTAcceleratorSession alloc] initWithOpenTokApiKey:<#apikey#> 31 | sessionId:<#sessionid#> 32 | token:<#token#>]; 33 | return YES; 34 | } 35 | ``` 36 | ```swift 37 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]? = nil) -> Bool { 38 | 39 | session = OTAcceleratorSession.init(openTokApiKey: <#apikey#>, sessionId: <#sessionid#>, token: <#token#>) 40 | return true 41 | } 42 | ``` 43 | 44 | 1. Use Xcode to build and run the app on an iOS simulator or device. 45 | 46 | ## Exploring the code 47 | 48 | This section shows you how to prepare, build, and run the sample application. Example code is added in [Objective-C](https://github.com/opentok/accelerator-sample-apps-ios/tree/master/AcceleratorSample) and [Swift](https://github.com/opentok/accelerator-sample-apps-ios/tree/master/AcceleratorSampleApp-Swift). With the sample application you can: 49 | 50 | - [Start a Audio/Video Call](#call) 51 | - [Send text messages](#textchat) 52 | - [Share your screen](#screenshare) 53 | - [Annotate on the screen](#annotation) 54 | 55 | For details about developing with the SDK and the APIs this sample uses, see the [OpenTok iOS SDK Requirements](https://tokbox.com/developer/sdks/ios/) and the [OpenTok iOS SDK Reference](https://tokbox.com/developer/sdks/ios/reference/). 56 | 57 | _**NOTE:** This sample app collects anonymous usage data for internal TokBox purposes only. Please do not modify or remove any logging code from this sample application._ 58 | 59 | 60 | ###Call 61 | 62 | When the call button is pressed `OTMultiPartyCommunicator` initiates the connection to the OpenTok session and sets up the listeners for the publisher and subscriber streams: 63 | 64 | 65 | ```objc 66 | // start call 67 | [SVProgressHUD show]; 68 | __weak MainViewController *weakSelf = self; 69 | [self.multipartyCommunicator connectWithHandler:^(OTCommunicationSignal signal, OTMultiPartyRemote *subscriber, NSError *error) { 70 | if (!error) { 71 | [weakSelf handleCommunicationSignal:signal remote:subscriber]; 72 | } 73 | else { 74 | [SVProgressHUD showErrorWithStatus:error.localizedDescription]; 75 | } 76 | }]; 77 | ``` 78 | 79 | ```swift 80 | // start call 81 | SVProgressHUD.show() 82 | multipartyCommunicator.connect { 83 | [unowned self] (signal, remote, error) in 84 | 85 | guard error == nil else { 86 | SVProgressHUD.showError(withStatus: error!.localizedDescription) 87 | return 88 | } 89 | self.handleCommunicationSignal(signal, remote: remote) 90 | } 91 | ``` 92 | 93 | 94 | The remote connection to the subscriber is handled according to the signal obtained: 95 | 96 | ```objc 97 | - (void)handleCommunicationSignal:(OTCommunicationSignal)signal 98 | remote:(OTMultiPartyRemote *)remote { 99 | switch (signal) { 100 | case OTPublisherCreated: { // join a call 101 | [SVProgressHUD popActivity]; 102 | self.multipartyCommunicator.publisherView.showAudioVideoControl = NO; 103 | [self.mainView enableControlButtonsForCall:YES]; 104 | [self.mainView connectCallHolder:self.multipartyCommunicator.isCallEnabled]; 105 | [self.mainView addPublisherView:self.multipartyCommunicator.publisherView]; 106 | break; 107 | } 108 | case OTSubscriberCreated: { // one participant is ready to join 109 | [SVProgressHUD show]; 110 | } 111 | case OTSubscriberReady: { // one participant joins 112 | [SVProgressHUD popActivity]; 113 | if (![self.subscribers containsObject:remote]) { 114 | [self.subscribers addObject:remote]; 115 | [self.mainView updateSubscriberViews:self.subscribers 116 | publisherView:self.multipartyCommunicator.publisherView]; 117 | } 118 | break; 119 | } 120 | case OTSubscriberDestroyed:{ // one participant leaves 121 | if ([self.subscribers containsObject:remote]) { 122 | [self.subscribers removeObject:remote]; 123 | [self.mainView updateSubscriberViews:self.subscribers 124 | publisherView:self.multipartyCommunicator.publisherView]; 125 | } 126 | break; 127 | } 128 | ... 129 | } 130 | } 131 | ``` 132 | 133 | ```swift 134 | fileprivate func handleCommunicationSignal(_ signal: OTCommunicationSignal, remote: OTMultiPartyRemote?) { 135 | switch signal { 136 | case .publisherCreated: // join a call 137 | 138 | guard let multipartyCommunicator = multipartyCommunicator else {break} 139 | SVProgressHUD.popActivity() 140 | multipartyCommunicator.publisherView.showAudioVideoControl = false 141 | mainView.enableControlButtonsForCall(enabled: true) 142 | mainView.connectCallHolder(connected: multipartyCommunicator.isCallEnabled) 143 | mainView.addPublisherView(multipartyCommunicator.publisherView) 144 | 145 | case .subscriberReady: // one participant joins 146 | SVProgressHUD.popActivity() 147 | if let remote = remote, subscribers.firstIndex(of: remote) == nil { 148 | subscribers.append(remote) 149 | mainView.updateSubscriberViews(subscribers, publisherView: multipartyCommunicator?.publisherView) 150 | } 151 | 152 | case .subscriberDestroyed: // one participant leaves 153 | if let remote = remote, let index = subscribers.firstIndex(of: remote) { 154 | subscribers.remove(at: index) 155 | mainView.updateSubscriberViews(subscribers, publisherView: multipartyCommunicator?.publisherView) 156 | } 157 | ... 158 | } 159 | } 160 | ``` 161 | 162 | ### TextChat 163 | 164 | The **TextCHat** feature is built using [accelerator-textchat-ios](https://github.com/opentok/accelerator-textchat-ios). When the text message button is pressed the view changes to present the chat UI: 165 | 166 | ```objc 167 | - (IBAction)textMessageButtonPressed:(id)sender { 168 | [self presentViewController:[[TextChatTableViewController alloc] init] animated:YES completion:nil]; //When the text message button is pressed the view changes to present the chat UI 169 | } 170 | ``` 171 | 172 | The textchat logic and UI is pre-configured, you can also change properties like `textChatNavigationBar.topItem.title` and `alias` in `TextChatTableViewController`: 173 | 174 | ```objc 175 | - (void)viewDidLoad { 176 | [super viewDidLoad]; 177 | 178 | self.textChat = [[OTTextChat alloc] init]; 179 | self.textChat.dataSource = self; 180 | self.textChat.alias = @"Tokboxer"; 181 | self.textMessages = [[NSMutableArray alloc] init]; 182 | 183 | self.textChatNavigationBar.topItem.title = self.textChat.alias; 184 | self.tableView.textChatTableViewDelegate = self; 185 | self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone; 186 | self.textChatInputView.textField.delegate = self; 187 | 188 | __weak TextChatTableViewController *weakSelf = self; 189 | [self.textChat connectWithHandler:^(OTTextChatConnectionEventSignal signal, OTConnection *connection, NSError *error) { 190 | if (signal == OTTextChatConnectionEventSignalDidConnect) { 191 | NSLog(@"Text Chat starts"); 192 | } 193 | else if (signal == OTTextChatConnectionEventSignalDidDisconnect) { 194 | NSLog(@"Text Chat stops"); 195 | } 196 | } messageHandler:^(OTTextChatMessageEventSignal signal, OTTextMessage *message, NSError *error) { 197 | 198 | if (signal == OTTextChatMessageEventSignalDidSendMessage || signal == OTTextChatMessageEventSignalDidReceiveMessage) { 199 | 200 | if (!error) { 201 | [weakSelf.textMessages addObject:message]; 202 | [weakSelf.tableView reloadData]; 203 | weakSelf.textChatInputView.textField.text = nil; 204 | [weakSelf scrollTextChatTableViewToBottom]; 205 | } 206 | } 207 | }]; 208 | 209 | [self.textChatInputView.sendButton addTarget:self action:@selector(sendTextMessage) forControlEvents:UIControlEventTouchUpInside]; 210 | } 211 | ``` 212 | 213 | ```swift 214 | override func viewDidLoad() { 215 | super.viewDidLoad() 216 | 217 | textChat = OTTextChat() 218 | textChat?.dataSource = self 219 | textChat?.alias = "Toxboxer" 220 | 221 | textChatNavigationBar.topItem?.title = textChat?.alias 222 | tableView.textChatTableViewDelegate = self 223 | tableView.separatorStyle = .none 224 | textChatInputView.textField.delegate = self 225 | 226 | textChat?.connect(handler: { (signal, connection, error) in 227 | 228 | guard error == nil else { 229 | SVProgressHUD.showError(withStatus: error!.localizedDescription) 230 | return 231 | } 232 | 233 | if signal == .didConnect { 234 | print("Text Chat starts") 235 | } 236 | else if signal == .didDisconnect { 237 | print("Text Chat stops") 238 | } 239 | 240 | }) { [unowned self](signal, message, error) in 241 | 242 | guard error == nil, let message = message else { 243 | SVProgressHUD.showError(withStatus: error!.localizedDescription) 244 | return 245 | } 246 | 247 | self.textMessages.append(message) 248 | self.tableView.reloadData() 249 | self.textChatInputView.textField.text = nil 250 | self.scrollTextChatTableViewToBottom() 251 | } 252 | 253 | textChatInputView.sendButton.addTarget(self, action: #selector(sendTextMessage), for: .touchUpInside) 254 | } 255 | ``` 256 | 257 | ### ScreenShare 258 | 259 | The **screen share** features shares images from your camera roll using the `ScreenShareViewController` class which publishes the content. 260 | 261 | ```objc 262 | - (void)startScreenSharing { 263 | self.multipartyScreenSharer = [[OTMultiPartyCommunicator alloc] initWithView:self.annotationView]; 264 | self.multipartyScreenSharer.dataSource = self; 265 | 266 | // publishOnly here is to avoid subscripting to those who already subscribed 267 | self.multipartyScreenSharer.publishOnly = YES; 268 | 269 | __weak ScreenShareViewController *weakSelf = self; 270 | [self.multipartyScreenSharer connectWithHandler:^(OTCommunicationSignal signal, OTMultiPartyRemote *subscriber, NSError *error) { 271 | 272 | if (error) { 273 | [weakSelf dismissViewControllerAnimated:YES completion:^(){ 274 | [SVProgressHUD showErrorWithStatus:error.localizedDescription]; 275 | }]; 276 | return; 277 | } 278 | 279 | if (signal == OTPublisherCreated) { 280 | 281 | weakSelf.multipartyScreenSharer.publishAudio = NO; 282 | [weakSelf startAnnotation]; 283 | } 284 | }]; 285 | } 286 | ``` 287 | 288 | ```swift 289 | fileprivate func startScreenSharing() { 290 | multipartyScreenSharer = OTMultiPartyCommunicator.init(view: annotationView) 291 | multipartyScreenSharer?.dataSource = self 292 | 293 | // publishOnly here is to avoid subscripting to those who already subscribed 294 | multipartyScreenSharer?.isPublishOnly = true 295 | 296 | multipartyScreenSharer?.connect { 297 | [unowned self](signal, remote, error) in 298 | 299 | guard error == nil else { 300 | self.dismiss(animated: true) { 301 | SVProgressHUD.showError(withStatus: error!.localizedDescription) 302 | } 303 | return 304 | } 305 | 306 | if signal == .publisherCreated { 307 | self.multipartyScreenSharer?.isPublishAudio = false 308 | self.startAnnotation() 309 | } 310 | } 311 | } 312 | ``` 313 | 314 | ### Annotation 315 | 316 | The `ScreenShareViewController` class also handles local annotation: 317 | 318 | The beta version is unstable when it comes to work with cross-platform, it's much stable if two canvas has same aspect ratio. 319 | ```objc 320 | - (void)startAnnotation { 321 | self.annotator = [[OTAnnotator alloc] init]; 322 | self.annotator.dataSource = self; 323 | __weak ScreenShareViewController *weakSelf = self; 324 | [self.annotator connectWithCompletionHandler:^(OTAnnotationSignal signal, NSError *error) { 325 | if (error) { 326 | [weakSelf dismissViewControllerAnimated:YES completion:^(){ 327 | [SVProgressHUD showErrorWithStatus:error.localizedDescription]; 328 | }]; 329 | return; 330 | } 331 | 332 | if (signal == OTAnnotationSessionDidConnect) { 333 | 334 | // using frame and self.view to contain toolbarView is for having more space to interact with color picker 335 | [weakSelf.annotator.annotationScrollView initializeToolbarView]; 336 | weakSelf.annotator.annotationScrollView.toolbarView.toolbarViewDataSource = self; 337 | weakSelf.annotator.annotationScrollView.toolbarView.frame = weakSelf.annotationToolbarView.frame; 338 | [weakSelf.view addSubview:weakSelf.annotator.annotationScrollView.toolbarView]; 339 | 340 | weakSelf.annotator.annotationScrollView.frame = weakSelf.annotationView.bounds; 341 | weakSelf.annotator.annotationScrollView.scrollView.contentSize = CGSizeMake(CGRectGetWidth(weakSelf.annotator.annotationScrollView.bounds), CGRectGetHeight(weakSelf.annotator.annotationScrollView.bounds)); 342 | [weakSelf.annotationView addSubview:weakSelf.annotator.annotationScrollView]; 343 | 344 | weakSelf.annotator.annotationScrollView.annotatable = NO; 345 | } 346 | }]; 347 | } 348 | ``` 349 | 350 | ```swift 351 | fileprivate func startAnnotation() { 352 | annotator = OTAnnotator() 353 | annotator?.dataSource = self 354 | annotator?.connect { 355 | [unowned self] (signal, error) in 356 | 357 | guard error == nil else { 358 | self.dismiss(animated: true) { 359 | SVProgressHUD.showError(withStatus: error!.localizedDescription) 360 | } 361 | return 362 | } 363 | 364 | if signal == .sessionDidConnect { 365 | 366 | guard let annotator = self.annotator, 367 | let toolbarView = annotator.annotationScrollView.toolbarView else { 368 | print("Error on launching annotation") 369 | return 370 | } 371 | 372 | // using frame and self.view to contain toolbarView is for having more space to interact with color picker 373 | self.annotator?.annotationScrollView.initializeToolbarView() 374 | toolbarView.toolbarViewDataSource = self 375 | toolbarView.frame = self.annotationToolbarView.frame 376 | self.view.addSubview(toolbarView) 377 | 378 | annotator.annotationScrollView.frame = self.annotationView.bounds; 379 | annotator.annotationScrollView.scrollView.contentSize = CGSize(width: CGFloat(annotator.annotationScrollView.bounds.width), height: CGFloat(annotator.annotationScrollView.bounds.height)) 380 | self.annotationView.addSubview(annotator.annotationScrollView) 381 | 382 | annotator.annotationScrollView.isAnnotatable = false 383 | } 384 | } 385 | } 386 | ``` 387 | 388 | ## Development and Contributing 389 | 390 | Interested in contributing? We :heart: pull requests! See the [Contribution](CONTRIBUTING.md) guidelines. 391 | 392 | ## Getting Help 393 | 394 | We love to hear from you so if you have questions, comments or find a bug in the project, let us know! You can either: 395 | 396 | - Open an issue on this repository 397 | - See for support options 398 | - Tweet at us! We're [@VonageDev](https://twitter.com/VonageDev) on Twitter 399 | - Or [join the Vonage Developer Community Slack](https://developer.nexmo.com/community/slack) 400 | 401 | ## Further Reading 402 | 403 | - Check out the Developer Documentation at 404 | 405 | -------------------------------------------------------------------------------- /AcceleratorSample/AcceleratorSample/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 41 | 53 | 65 | 78 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | -------------------------------------------------------------------------------- /AcceleratorSampleApp-Swift/AcceleratorSampleApp-Swift/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 41 | 53 | 65 | 77 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | --------------------------------------------------------------------------------