Skip to main content
View as Markdown

Player Integration - Content Moderation

Player Integration​

The playkit-js-moderation plugin adds a "Report" button to the Kaltura Player, letting viewers flag content directly from the player UI.

Configuration​

const config = {
plugins: {
moderation: {
moderateProcessColor: '#00B4D8',
reportLength: 500,
notificationType: 'toast',
subtitle: 'Report inappropriate content',
onlyWhenPlaying: false
}
}
};

Plugin options:

OptionTypeDefaultDescription
moderateProcessColorstring'#00B4D8'Color for the loading/progress indicator
reportLengthnumber500Max characters for the report comment
notificationTypestring'toast'How to show success/error — 'toast' or 'overlay'
subtitlestring''Subtitle text below the "Report" heading
onlyWhenPlayingbooleanfalseIf true, the report button only appears during playback

Events​

The plugin fires events on the player's event bus:

EventWhen
moderation:openReport dialog opens
moderation:closeReport dialog closes (cancel or submit)
moderation:submitReport submitted — payload includes { flagType, comments }
moderation:successServer confirmed the flag was created
moderation:errorFlag creation failed — payload includes { error }
player.addEventListener('moderation:success', (event) => {
console.log('Content reported successfully', event.payload);
});

How It Works​

When a viewer submits a report, the plugin calls baseEntry.flag using the player's widget KS. The flag appears in the moderation queue alongside flags created via the API. No additional server configuration is needed — the plugin uses the same flagging endpoint documented in User Flagging.