ActiveFence Video Content Moderation
Updated
Integrate and use the ActiveFence content moderation extension in your app.
ActiveFence provides trust and safety solutions to protect online platforms and their users from malicious behavior and content. By integrating ActiveFence capabilities in your app, you can design the exact content moderation solution you need. Content moderation is powered by AI-driven automated detection for text, audio, image, and video content, enabling you to moderate, enforce policies, manage user flags, and send notifications across multiple abuse areas and languages.
The following figure shows the ActiveFence workflow to moderate content sent by a specific user to a channel:
This page shows you how to integrate and use the ActiveFence content detection and moderation extension in your app.
Prerequisites
- Xcode 9.0 or later.
- A physical device (not an emulator) running iOS 9.0 or later.
- Implemented the SDK quickstart.
- If you use RTC SDK tokens, ensure that you are using AccessToken2 to enable ActiveFence video content moderation.
Project setup
Complete the same ActiveFence account, API key, webhook, and workflow configuration described in the Android section.
Integrate the extension
Set up your webhook
Create a server that receives and interprets the webhook data, for example with agora-activefence-kicker.
Initialize AgoraContentInspectConfig
Set up the inspect config inside ContentInspectManager. If you use a string UID to join the channel and want to receive it in the webhook callback, pass the string UID to extraInfo inside AgoraContentInspectConfig.
var inspectConfig: AgoraContentInspectConfig = {
let module = AgoraContentInspectModule()
module.type = .imageModeration
module.interval = 5
let config = AgoraContentInspectConfig()
config.modules = [module]
config.extraInfo = "YourExtraInfo"
return config
}()Apply AgoraContentInspectConfig
Enable content inspection after joining a channel and after the local video is published and played. To support taking screenshots for multiple video streams and uploading them, use enableContentInspectEx.
self.agoraEngine.enableContentInspect(true, config: self.inspectConfig)
self.agoraEngine.enableContentInspectEx(enabled, config: config, connection: connection)Catch banning events
func rtcEngine(
_ engine: AgoraRtcEngineKit,
connectionChangedTo state: AgoraConnectionState,
reason: AgoraConnectionChangedReason
) {
if state == .failed, reason == .reasonBannedByServer {
isBanned = true
}
}