Skip to main content

What Problem Does This Solve?

Mobile users hold their devices in portrait (vertical) or landscape (horizontal) orientation. Social media platforms like Instagram Stories, TikTok, and YouTube Shorts expect vertical video (9:16), while traditional YouTube prefers horizontal (16:9). LckCameraOrientation lets you set the output orientation to match how users hold their device or the platform they’re targeting.

When to Use This

Use LckCameraOrientation when:
  • Building a mobile app with recording/streaming
  • Supporting social media uploads (TikTok, Instagram, Snapchat)
  • Users can rotate their device during gameplay
  • Creating platform-specific content (vertical for Stories, horizontal for YouTube)
Skip this if you’re desktop-only or always output the same orientation.

Quick Example


How It Works

Camera orientation determines the aspect ratio of the output video: Portrait (Vertical)
  • Aspect ratio: 9:16 (e.g., 1080×1920)
  • Matches vertical phone orientation
  • Best for: TikTok, Instagram Stories, Snapchat, Reels
Landscape (Horizontal)
  • Aspect ratio: 16:9 (e.g., 1920×1080)
  • Matches horizontal phone orientation
  • Best for: YouTube, traditional video platforms
The orientation affects how the resolution is interpreted. A CameraResolutionDescriptor(1080, 1920) in portrait mode outputs vertical video, while landscape swaps it to 1920×1080.

Common Patterns

Auto-detect device orientation

Platform-specific orientation

UI toggle


Resolution by Orientation

Portrait (9:16)
Landscape (16:9)
Make sure your resolution descriptor matches your intended orientation. A 1920×1080 resolution in portrait mode will output vertical video at 1080×1920.

Platform Orientation Guidelines


Enum Values


API Reference

Set Orientation

Parameters:
  • orientationPortrait or Landscape
Returns: LckResult indicating success/failure

Best Practices

Match target platform — Use portrait for TikTok, landscape for YouTube
Set before recording — Orientation should be configured before starting capture
Test both modes — Ensure your UI works in both orientations
Don’t change during recording — Stop recording before switching orientation

Good Pattern


Mobile Development Tips

Lock orientation in Unity

Handle safe areas