# Video-Like Replay

***

### Quick Start <a href="#quick-start" id="quick-start"></a>

Add these APIs before initializing the SDK for the best experience:

{% tabs %}
{% tab title="Swift" %}

```swift
import Luciq 
// Configure video-like replay
SessionReplay.screenshotCapturingMode = .frequency // 1 screenshot per second, value in ms 
SessionReplay.screenshotCaptureInterval = 1000 
SessionReplay.screenshotQualityMode = .normal 

// Initialize SDK 
Luciq.start(withToken: "YOUR_APP_TOKEN", invocationEvents: [.shake])
```

{% endtab %}

{% tab title="Objective-C" %}

```objective-c
#import <Luciq/Luciq.h> 
// Configure video-like replay 
LCQSessionReplay.screenshotCapturingMode = LCQCapturingModeFrequency; // 1 screenshot per second, value in ms 
LCQSessionReplay.screenshotCaptureInterval = 1000; 
LCQSessionReplay.screenshotQualityMode = LCQScreenshotQualityNormal; 

// Initialize SDK 
[Luciq startWithToken:@"YOUR_APP_TOKEN" invocationEvents:LCQInvocationEventShake];
```

{% endtab %}
{% endtabs %}

***

### Capturing Modes <a href="#capturing-modes" id="capturing-modes"></a>

Control **when** screenshots are captured using the `screenshotCapturingMode` API.

#### Navigation Mode (Default) <a href="#navigation-mode-default" id="navigation-mode-default"></a>

Captures screenshots only when users navigate between screens. This is the default behavior, providing the lowest overhead.

**Best for:** Apps where screen transitions are the primary user flow

{% tabs %}
{% tab title="Swift" %}

```swift
SessionReplay.screenshotCapturingMode = .navigation
```

{% endtab %}

{% tab title="Objective-C" %}

```objective-c
LCQSessionReplay.screenshotCapturingMode = LCQCapturingModeNavigation;
```

{% endtab %}
{% endtabs %}

***

#### Interactions Mode <a href="#interactions-mode" id="interactions-mode"></a>

Captures screenshots on screen navigation **and** user interactions. Includes debouncing to prevent excessive captures.

**Best for:** Debugging user interaction issues, understanding how users interact with complex screens

**Supported Interactions**

| **UIKit**   | **SwiftUI** |
| ----------- | ----------- |
| Tap         | Tap         |
| Double Tap  | Double Tap  |
| Long Press  | Long Press  |
| Force Touch | Force Touch |
| Swipe       | Swipe       |
| Pinch       | Pinch       |
| Scroll      | Scroll\*    |

> *\*SwiftUI scroll detection requires manual integration, please refer to the* [SwiftUI Integration for iOS](https://docs.luciq.ai/ios/setup-luciq-for-ios/integrate-luciq-on-ios/integrate-swiftui) docs.

{% tabs %}
{% tab title="Swift" %}

```swift
SessionReplay.screenshotCapturingMode = .interactions
```

{% endtab %}

{% tab title="Objective-C" %}

```objective-c
LCQSessionReplay.screenshotCapturingMode = LCQCapturingModeInteractions;
```

{% endtab %}
{% endtabs %}

***

#### Frequency Mode <a href="#frequency-mode" id="frequency-mode"></a>

Captures screenshots at a fixed time interval for true video-like playback. Also captures on screen navigation.

**Best for:** Full video-like replay experience, debugging visual issues, understanding complete user journeys

{% tabs %}
{% tab title="Swift" %}

```swift
SessionReplay.screenshotCapturingMode = .frequency
SessionReplay.screenshotCaptureInterval = 1000 // Capture every 1000ms (1 FPS)
```

{% endtab %}

{% tab title="Objective-C" %}

```objective-c
LCQSessionReplay.screenshotCapturingMode = LCQCapturingModeFrequency;
LCQSessionReplay.screenshotCaptureInterval = 1000; // Capture every 1000ms (1 FPS)
```

{% endtab %}
{% endtabs %}

***

### Screenshot Capture Interval <a href="#screenshot-capture-interval" id="screenshot-capture-interval"></a>

When using **Frequency mode**, configure how often screenshots are captured.

| **Parameter** | **Description**                       |
| ------------- | ------------------------------------- |
| `intervalMs`  | Time between captures in milliseconds |
| **Default**   | 1000ms (1 screenshot per second)      |
| **Minimum**   | 500ms                                 |

{% tabs %}
{% tab title="Swift" %}

```swift
SessionReplay.screenshotCaptureInterval = 500 // Capture every 500ms (2 FPS)
SessionReplay.screenshotCaptureInterval = 2000 // Capture every 2 seconds 
```

{% endtab %}

{% tab title="Objective-C" %}

```objective-c
LCQSessionReplay.screenshotCaptureInterval = 500; // Capture every 500ms (2 FPS)
LCQSessionReplay.screenshotCaptureInterval:2000; // Capture every 2 seconds
```

{% endtab %}
{% endtabs %}

> ***Note:** Values below 500ms **will automatically use 500ms - the default minimum**. A warning will be logged to help you identify the issue.*

#### Timer Reset Behavior <a href="#timer-reset-behavior" id="timer-reset-behavior"></a>

The capture timer resets when:

* A manual screenshot is captured via the SDK API
* Screen navigation occurs

This ensures you always capture important moments regardless of the timer state.

***

### Screenshot Quality <a href="#screenshot-quality" id="screenshot-quality"></a>

Control the **visual quality** of captured screenshots. Higher quality provides better visuals but uses more storage.

#### Quality Profiles <a href="#quality-profiles" id="quality-profiles"></a>

| **Profile**          | **Compression**                | **Use Case**                                  |
| -------------------- | ------------------------------ | --------------------------------------------- |
| **High**             | 50% quality (WebP)             | Detailed debugging, visual regression testing |
| **Normal** (Default) | 25% quality (WebP)             | Balanced quality and storage                  |
| **Greyscale**        | 25% quality + grayscale (WebP) | Maximum storage efficiency, text-heavy apps   |

{% tabs %}
{% tab title="Swift" %}

```swift
SessionReplay.screenshotQualityMode = .high // Best visual quality 
SessionReplay.screenshotQualityMode = .normal // Balanced (default)
SessionReplay.screenshotQualityMode = .greyscale // Smallest file size
```

{% endtab %}

{% tab title="Objective-C" %}

```objective-c
LCQSessionReplay.screenshotQualityMode = LCQScreenshotQualityHigh; // Best visual quality 
LCQSessionReplay.screenshotQualityMode = LCQScreenshotQualityNormal; // Balanced (default)
LCQSessionReplay.screenshotQualityMode = LCQScreenshotQualityGreyscale; // Smallest file size
```

{% endtab %}
{% endtabs %}

#### Estimated Screenshots per Session <a href="#estimated-screenshots-per-session" id="estimated-screenshots-per-session"></a>

Based on the default 1MB session screenshot limit:

| **Quality Profile** | **Approx. Screenshots per Session** |
| ------------------- | ----------------------------------- |
| High                | \~62 screenshots                    |
| Normal              | \~104 screenshots                   |
| Greyscale           | \~130 screenshots                   |

> ***Tip:** For video-like replay at 1 FPS with Normal quality, you can capture approximately 1-2 minutes of continuous session activity.*

***

### Configuration Timing <a href="#configuration-timing" id="configuration-timing"></a>

#### Recommended: Before SDK Initialization <a href="#recommended-before-sdk-initialization" id="recommended-before-sdk-initialization"></a>

For best results, configure Video-like Session Replay **before** calling `Luciq.start()`:

{% tabs %}
{% tab title="Swift" %}

```swift
// Recommended approach 
SessionReplay.screenshotCapturingMode = .frequency SessionReplay.screenshotCaptureInterval = 1000
SessionReplay.screenshotQualityMode = .normal 
Luciq.start(withToken: "YOUR_APP_TOKEN", invocationEvents: [.shake])
```

{% endtab %}
{% endtabs %}

#### Runtime Configuration <a href="#runtime-configuration" id="runtime-configuration"></a>

You can also change settings during the session. Changes take effect as follows:

| **Setting**        | **When Applied**                 |
| ------------------ | -------------------------------- |
| Capturing Mode     | Next session                     |
| Screenshot Quality | Next screenshot                  |
| Capture Interval   | After current interval completes |

{% tabs %}
{% tab title="Swift" %}

```swift
// Change quality mid-session
SessionReplay.screenshotQualityMode = .high 
// Switch capturing mode (applies next session) 
SessionReplay.screenshotCapturingMode = .frequency
```

{% endtab %}
{% endtabs %}

***

### SwiftUI Considerations <a href="#swiftui-considerations" id="swiftui-considerations"></a>

For SwiftUI apps, most interactions are captured automatically. However, **scroll detection in SwiftUI requires manual gesture handling** if you want scroll events to trigger captures in Interactions mode.

UIKit views embedded in SwiftUI work as expected with full interaction detection.

*→ Please refer to our SwiftUI integration docs for more details* [SwiftUI Integration for iOS](https://docs.luciq.ai/ios/setup-luciq-for-ios/integrate-luciq-on-ios/integrate-swiftui)*.*

***

### Privacy & Masking <a href="#privacy-and-masking" id="privacy-and-masking"></a>

Video-like Session Replay **respects all existing privacy** configurations:

* **Auto-masking** continues to work across all capturing modes
* **Private views** are masked in all captured screenshots
* Views marked with `luciq_privateView` modifier are automatically masked

{% tabs %}
{% tab title="Swift" %}

```swift
// SwiftUI - Mark a view as private
Text("Sensitive Data").luciq_privateView()

// UIKit - Mark a view as private
sensitiveView.luciq_privateView = true
```

{% endtab %}
{% endtabs %}

For more information on privacy controls, see [Session Replay for iOS](/ios/setup-luciq-for-ios/setup-session-replay.md).

***

### Best Practices <a href="#best-practices" id="best-practices"></a>

#### Recommended Configurations <a href="#recommended-configurations" id="recommended-configurations"></a>

| **Use Case**      | **Configuration**                        |
| ----------------- | ---------------------------------------- |
| General debugging | Navigation mode + Normal quality         |
| UI/UX analysis    | Interactions mode + Normal quality       |
| Full video replay | Frequency mode (1000ms) + Normal quality |
| Visual debugging  | Frequency mode (500ms) + High quality    |
| Storage-conscious | Navigation mode + Greyscale quality      |

#### Code Examples <a href="#code-examples" id="code-examples"></a>

**Video-like Replay (Balanced)**

{% tabs %}
{% tab title="Swift" %}

```swift
SessionReplay.screenshotCapturingMode = .frequency 
SessionReplay.screenshotCaptureInterval = 1000 
SessionReplay.screenshotQualityMode = .normal
```

{% endtab %}
{% endtabs %}

**Interaction-Focused Debugging**

{% tabs %}
{% tab title="Swift" %}

```swift
SessionReplay.screenshotCapturingMode = .interactions 
SessionReplay.screenshotQualityMode = .normal
```

{% endtab %}
{% endtabs %}

**Maximum Visual Fidelity**

{% tabs %}
{% tab title="Swift" %}

```swift
SessionReplay.screenshotCapturingMode = .frequency 
SessionReplay.screenshotCaptureInterval = 500 
SessionReplay.screenshotQualityMode = .high
```

{% endtab %}
{% endtabs %}

**Storage-Optimized**

{% tabs %}
{% tab title="Swift" %}

```swift
SessionReplay.screenshotCapturingMode = .navigation
SessionReplay.screenshotQualityMode = .greyscale
```

{% endtab %}
{% endtabs %}

***

### API Reference <a href="#api-reference" id="api-reference"></a>

#### SessionReplay.screenshotCapturingMode <a href="#sessionreplay.screenshotcapturingmode" id="sessionreplay.screenshotcapturingmode"></a>

Sets when screenshots are captured.

```
SessionReplay.screenshotCapturingMode: ScreenshotCapturingMode
```

| **Value**       | **Description**                          |
| --------------- | ---------------------------------------- |
| `.navigation`   | Capture on-screen changes only (default) |
| `.interactions` | Capture navigation and user interactions |
| `.frequency`    | Capture at fixed time intervals          |

***

#### SessionReplay.screenshotQualityMode <a href="#sessionreplay.screenshotqualitymode" id="sessionreplay.screenshotqualitymode"></a>

Sets the visual quality of captured screenshots.

```
SessionReplay.screenshotQualityMode: ScreenshotQualityMode
```

| Value        | Description                      |
| ------------ | -------------------------------- |
| `.high`      | 50% WebP compression             |
| `.normal`    | 25% WebP compression (default)   |
| `.greyscale` | Grayscale + 25% WebP compression |

***

#### SessionReplay.screenshotCaptureInterval <a href="#sessionreplay.screenshotcaptureinterval" id="sessionreplay.screenshotcaptureinterval"></a>

Sets the capture interval for Frequency mode.

```
SessionReplay.screenshotCaptureInterval: Int
```

| Parameter    | Description                                        |
| ------------ | -------------------------------------------------- |
| `intervalMs` | Interval in milliseconds (min: 500, default: 1000) |

***

### Migration Guide <a href="#migration-guide" id="migration-guide"></a>

If you’re upgrading from a previous SDK version:

1. **No breaking changes** -> Default behavior remains Navigation mode with Normal quality
2. **Opt-in feature** -> Video-like replay must be explicitly configured
3. **Repro Steps unaffected** -> Bug and Crash report screenshots continue to use Navigation mode and Normal quality


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.luciq.ai/ios/setup-luciq-for-ios/setup-session-replay/video-like-replay.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
