Comments (2)
@goncalocostamendes, any pro tips?
from opentok-ios-sdk-samples-swift.
@vodemn on iOS you can set up a key-value observer for the properties (hasAudio, hasVideo hasCaptions, etc) of an OTStream. For example to see when a stream has captions enabled and disabled:
swift example
//add observer on a stream of interest
let hasCaptionsObservation: NSKeyValueObservation = subscriber.stream.observe(\.hasCaptions, options: [.old, .new]) { object, change in
guard let oldValue = change.oldValue else { return }
guard let newValue = change.newValue else { return }
print("KVO change for \(subscriber.stream.streamId) hasCaptions: \(newValue)")
//manipulate GUI element
}
objc example
//add observer on a stream of interest
[_subscriber.stream addObserver:self forKeyPath:@"hasCaptions" options:NSKeyValueObservingOptionNew context:NULL];
- (void)observeValueForKeyPath:(NSString *)keyPath
ofObject:(id)object
change:(NSDictionary *)change
context:(void *)context {
NSLog(@"KVO change for %@ = %@",keyPath, change);
//manipulate GUI element
}
from opentok-ios-sdk-samples-swift.
Related Issues (20)
- Crash when Accessing Streams property of OTSession HOT 3
- Mirroring issue is not getting resolve by using Custom-Video-Driver project implementation
- Remain green dot HOT 3
- Sync Custom-audio-driver with Objective C repo HOT 2
- App cannot be run on Simulator due to lack of Apple silicon support HOT 1
- application Crashed HOT 1
- Warning: -[AVCaptureSession startRunning] should be called from background thread HOT 4
- iOS 16 "Timed out while attempting to publish." HOT 17
- Subscriber Video Enabling Problem HOT 2
- Latency of 10sec between the call of doPublish() and the call of session.publish() HOT 3
- Threading Issues HOT 2
- Session connect memory error access HOT 12
- VonageWebRTC-99.2.39: 1 vulnerabilities (highest severity is: 7.5) HOT 1
- Crash on OTPublisher instance creation HOT 3
- Does not compile for arm64 simulator if the project also uses Swift Package Manager HOT 4
- OTPublisher never be published with internal error from AudioUnitInitialize HOT 9
- How do you stop a Publisher that is not published to a session? HOT 2
- App crash - Attempted to dereference garbage pointer HOT 1
- metrics.yml - Ensure top-level permissions are not set to write-all
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from opentok-ios-sdk-samples-swift.