Skip to content

Instantly share code, notes, and snippets.

@digitallysavvy
Last active December 3, 2019 19:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save digitallysavvy/9e0609cf5f78dec10ce096f899ff74a9 to your computer and use it in GitHub Desktop.
Save digitallysavvy/9e0609cf5f78dec10ce096f899ff74a9 to your computer and use it in GitHub Desktop.
A snippet showing how to create a DataStream using Agora's Video SDK
func rtcEngine(_ engine: AgoraRtcEngineKit, firstRemoteVideoDecodedOfUid uid:UInt, size:CGSize, elapsed:Int) {
// ...
if self.remoteUser == uid {
// ...
// create the data stream
self.streamIsEnabled = self.agoraKit.createDataStream(&self.dataStreamId, reliable: true, ordered: true)
if self.debug {
print("Data Stream initiated - STATUS: \(self.streamIsEnabled)")
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment