Skip to content

Instantly share code, notes, and snippets.

@zontan
Created September 9, 2020 00:32
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 zontan/0ab069d5685928e52ecfa36749c03c35 to your computer and use it in GitHub Desktop.
Save zontan/0ab069d5685928e52ecfa36749c03c35 to your computer and use it in GitHub Desktop.
import AgoraUIKit
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let userName = liveUsers[indexPath.row]
let agoraAudienceView = AgoraVideoViewController(appID: "YOUR_AGORA_APP_ID", token: nil, channel: userName)
agoraAudienceView.setMaxStreams(streams: 1)
agoraAudienceView.setIsAudience()
agoraAudienceView.hideVideoMute() // Hide buttons we don't need
agoraAudienceView.hideAudioMute()
agoraAudienceView.hideSwitchCamera()
agoraAudienceView.controlOffset = 60 // Make sure the controls are above the tab bar
navigationController?.pushViewController(agoraAudienceView, animated: true)
tableView.deselectRow(at: indexPath, animated: true)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment