join-channel-video-guide

Guide for implementing video call functionality in business scenarios, including SDK initialization, joining channels, video encoding configuration, and event handling

342 stars

Best use case

join-channel-video-guide is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Guide for implementing video call functionality in business scenarios, including SDK initialization, joining channels, video encoding configuration, and event handling

Teams using join-channel-video-guide should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/JoinChannelVideo/SKILL.md --create-dirs "https://raw.githubusercontent.com/AgoraIO/API-Examples/main/iOS/APIExample/APIExample/Examples/Basic/JoinChannelVideo/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/JoinChannelVideo/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How join-channel-video-guide Compares

Feature / Agentjoin-channel-video-guideStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Guide for implementing video call functionality in business scenarios, including SDK initialization, joining channels, video encoding configuration, and event handling

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# Video Call Implementation Guide

## Feature Description

This example demonstrates how to use Agora RTC SDK to implement basic video call functionality, including:
- Initialize SDK engine
- Configure video encoding parameters (resolution, frame rate, orientation)
- Join channel
- Display local and remote video
- Handle user join/leave events

## Core API Call Flow

### 1. Initialize SDK

```swift
let config = AgoraRtcEngineConfig()
config.appId = KeyCenter.AppId
config.areaCode = GlobalSettings.shared.area
config.channelProfile = .liveBroadcasting
agoraKit = AgoraRtcEngineKit.sharedEngine(with: config, delegate: self)
```

**Key Parameters:**
- `appId`: App ID obtained from Agora Console
- `areaCode`: Region code for specifying connection region
- `channelProfile`: Channel profile, `.liveBroadcasting` supports host and audience roles

### 2. Set User Role and Enable Audio/Video

```swift
agoraKit.setClientRole(.broadcaster)  // or .audience
agoraKit.enableVideo()
agoraKit.enableAudio()
```

### 3. Configure Video Encoding Parameters

```swift
agoraKit.setVideoEncoderConfiguration(
    AgoraVideoEncoderConfiguration(
        size: CGSize(width: 960, height: 540),
        frameRate: .fps15,
        bitrate: AgoraVideoBitrateStandard,
        orientationMode: .adaptative,
        mirrorMode: .auto
    )
)
```

**Configurable Parameters:**
- `size`: Video resolution (90x90 ~ 1280x720)
- `frameRate`: Frame rate (10/15/24/30/60 fps)
- `orientationMode`: Video orientation mode
  - `.adaptative`: Adaptive
  - `.fixedLandscape`: Fixed landscape
  - `.fixedPortrait`: Fixed portrait

### 4. Set Local Video Preview

```swift
let videoCanvas = AgoraRtcVideoCanvas()
videoCanvas.uid = 0  // Local user uid is 0
videoCanvas.view = localVideoView
videoCanvas.renderMode = .hidden
agoraKit.setupLocalVideo(videoCanvas)
agoraKit.startPreview()
```

### 5. Join Channel

```swift
let option = AgoraRtcChannelMediaOptions()
option.publishCameraTrack = true
option.publishMicrophoneTrack = true
option.clientRoleType = .broadcaster

agoraKit.joinChannel(
    byToken: token,
    channelId: channelName,
    uid: 0,  // 0 means SDK automatically assigns uid
    mediaOptions: option
)
```

**Important Notes:**
- If App Certificate is enabled in console, Token must be used
- Token must be generated with the same channel name and uid
- Return value of 0 indicates success

### 6. Set Remote Video

Set in `didJoinedOfUid` callback:

```swift
func rtcEngine(_ engine: AgoraRtcEngineKit, didJoinedOfUid uid: UInt, elapsed: Int) {
    let videoCanvas = AgoraRtcVideoCanvas()
    videoCanvas.uid = uid
    videoCanvas.view = remoteVideoView
    videoCanvas.renderMode = .hidden
    agoraKit.setupRemoteVideo(videoCanvas)
}
```

### 7. Leave Channel and Clean Up Resources

```swift
agoraKit.disableAudio()
agoraKit.disableVideo()
agoraKit.stopPreview()
agoraKit.leaveChannel { stats in
    print("left channel, duration: \(stats.duration)")
}
```

## Key Event Callbacks

### didJoinChannel
```swift
func rtcEngine(_ engine: AgoraRtcEngineKit, didJoinChannel channel: String, withUid uid: UInt, elapsed: Int)
```
Triggered when local user successfully joins channel.

### didJoinedOfUid
```swift
func rtcEngine(_ engine: AgoraRtcEngineKit, didJoinedOfUid uid: UInt, elapsed: Int)
```
Triggered when remote user joins channel (not triggered for audience role).

### didOfflineOfUid
```swift
func rtcEngine(_ engine: AgoraRtcEngineKit, didOfflineOfUid uid: UInt, reason: AgoraUserOfflineReason)
```
Triggered when remote user leaves channel.

### didOccurError
```swift
func rtcEngine(_ engine: AgoraRtcEngineKit, didOccurError errorCode: AgoraErrorCode)
```
Triggered when SDK encounters an error, recommend displaying error message to user.

## Common Questions

### Q: Can't see local video?
A: Check if `startPreview()` and `setupLocalVideo()` have been called

### Q: Can't see remote video?
A: 
1. Confirm remote user role is broadcaster
2. Check if `setupRemoteVideo()` is correctly set in `didJoinedOfUid` callback
3. Confirm `option.publishCameraTrack = true`

### Q: joinChannel returns non-zero value?
A: 
- Check if App ID is correct
- If App Certificate is enabled, check if Token is valid
- Check if channel name and uid match those used when generating Token

### Q: How to switch camera?
A: Call `agoraKit.switchCamera()`

### Q: How to mute/unmute?
A: 
- Local mute: `agoraKit.muteLocalAudioStream(true/false)`
- Remote mute: `agoraKit.muteRemoteAudioStream(uid, mute: true/false)`

### Q: How to disable/enable video?
A:
- Local video: `agoraKit.muteLocalVideoStream(true/false)`
- Remote video: `agoraKit.muteRemoteVideoStream(uid, mute: true/false)`

## Reference Documentation

- [iOS API Reference (English)](https://api-ref.agora.io/en/video-sdk/ios/4.x/documentation/agorartckit)
- [iOS API Reference (Chinese)](https://doc.shengwang.cn/api-ref/rtc/ios/API/toc_video_call)
- [Error Code Description](https://doc.shengwang.cn/api-ref/rtc/ios/error-code)

## Related Examples

- `JoinChannelAudio` - Audio-only call
- `JoinChannelVideoToken` - Join channel with Token
- `VideoProcess` - Video processing (filters, watermarks)
- `CustomVideoSourcePush` - Custom video source

Related Skills

upsert-case

342
from AgoraIO/API-Examples

Add a new audio API example case or modify an existing one in the APIExample-Audio Android demo — creates or updates Fragment class, XML layout, string resources, and nav_graph registration. Use when: adding a new Agora audio API demo screen, modifying an existing case's implementation or registration, implementing a new audio feature example in Java + XML layouts, registering a new case via @Example annotation, subclassing BaseFragment for a new audio demo screen, or updating an existing case's strings, layout, or nav entry. This project uses voice-sdk — no video APIs available. Keywords: add case, modify case, update case, new fragment, nav_graph, @Example, BaseFragment, APIExample-Audio, audio case, voice-sdk, new screen, audio demo, upsert case.

review-case

342
from AgoraIO/API-Examples

Review an existing case implementation against project-specific red lines and coding standards. Use after implementing or modifying a case. Use when: reviewing a case for correctness, checking red-line compliance, verifying lifecycle and threading patterns, auditing an existing Fragment. Keywords: review, audit, check, red lines, lifecycle, threading, compliance.

query-cases

342
from AgoraIO/API-Examples

Query and browse existing API example cases in the APIExample-Audio Android demo — lists cases by group, finds which case demonstrates a specific Agora audio API, checks sort index availability, and resolves display names from string resources. Use when: someone asks what cases exist, which audio APIs are demonstrated, wants to find a case by name or API (e.g. setVoiceBeautifierPreset, enableSpatialAudio), needs a free sort index before adding a new case, or wants to know if an audio feature is already implemented. This project uses voice-sdk — no video APIs. Keywords: list cases, find case, query cases, @Example, sort index, BASIC, ADVANCED, available cases, existing cases, which case, is there a case, audio case.

manim-video

144923
from affaan-m/everything-claude-code

Build reusable Manim explainers for technical concepts, graphs, system diagrams, and product walkthroughs, then hand off to the wider ECC video stack if needed. Use when the user wants a clean animated explainer rather than a generic talking-head script.

DevelopmentClaude

videodb

144923
from affaan-m/everything-claude-code

视频与音频的查看、理解与行动。查看:从本地文件、URL、RTSP/直播源或实时录制桌面获取内容;返回实时上下文和可播放流链接。理解:提取帧,构建视觉/语义/时间索引,并通过时间戳和自动剪辑搜索片段。行动:转码和标准化(编解码器、帧率、分辨率、宽高比),执行时间线编辑(字幕、文本/图像叠加、品牌化、音频叠加、配音、翻译),生成媒体资源(图像、音频、视频),并为直播流或桌面捕获的事件创建实时警报。

Media ProcessingClaude

video-editing

144923
from affaan-m/everything-claude-code

AI-assisted video editing workflows for cutting, structuring, and augmenting real footage. Covers the full pipeline from raw capture through FFmpeg, Remotion, ElevenLabs, fal.ai, and final polish in Descript or CapCut. Use when the user wants to edit video, cut footage, create vlogs, or build video content.

Content Creation & MarketingClaude

lightning-channel-factories

31392
from sickn33/antigravity-awesome-skills

Technical reference on Lightning Network channel factories, multi-party channels, LSP architectures, and Bitcoin Layer 2 scaling without soft forks. Covers Decker-Wattenhofer, timeout trees, MuSig2 key aggregation, HTLC/PTLC forwarding, and watchtower breach detection.

Blockchain & Web3Claude

frontend-dev-guidelines

31392
from sickn33/antigravity-awesome-skills

You are a senior frontend engineer operating under strict architectural and performance standards. Use when creating components or pages, adding new features, or fetching or mutating data.

Code GenerationClaude

environment-setup-guide

31392
from sickn33/antigravity-awesome-skills

Guide developers through setting up development environments with proper tools, dependencies, and configurations

Developer ToolsClaude

claude-code-guide

31392
from sickn33/antigravity-awesome-skills

To provide a comprehensive reference for configuring and using Claude Code (the agentic coding tool) to its full potential. This skill synthesizes best practices, configuration templates, and advanced usage patterns.

cc-skill-project-guidelines-example

31392
from sickn33/antigravity-awesome-skills

Project Guidelines Skill (Example)

Developer ToolsClaude

brand-guidelines

31392
from sickn33/antigravity-awesome-skills

Write copy following Sentry brand guidelines. Use when writing UI text, error messages, empty states, onboarding flows, 404 pages, documentation, marketing copy, or any user-facing content. Covers both Plain Speech (default) and Sentry Voice tones.

Content GenerationClaude