# New Generation Renderer

### What is the New Generation Renderer?

The new generation renderer enhances how video layouts are handled, providing a more efficient and flexible way to manage and display video streams, especially in complex conferencing scenarios. This technology improves the user experience across devices, including mobile phones, tablets, and desktop computers.

### Key Features and Benefits

* **Enhanced Layouts:** The new renderer supports speaker and grid layouts for optimal viewing.
* **Improved Tile Management:** Video streams are presented as tiles with smarter screen utilization and more intuitive arrangement.
* **Content Sharing Priority:** The renderer prioritizes content sharing by automatically adjusting layouts.
* **Flexible Orientation Support:** The renderer adapts to both landscape and portrait orientations on mobile and tablet devices.
* **Pinned Tile Feature:** Users can now "pin" a participant's video feed to ensure its visibility.

### Layout Details

* **Speaker Layout:** The active speaker is dynamically highlighted, occupying most of the screen.
* **Grid Layout:** Provides equal screen space to each participant. The number and size of tiles adjust automatically based on participant count and device orientation.

### Tile Types

The new renderer supports several tile types:

* **Preview Tile:** Displays the user's own video feed.
* **Loudest Participant Tile:** Highlights the current speaker in Speaker Layout.
* **Content Share Tile:** Maximizes visibility of shared content.
* **Remote Participant Tile:** Displays video feeds from other participants.
* **Remote Participant Tile with Camera Control:** Provides users controls to adjust remote PTZ camera focus.
* **Pinned Tile:** Allows users to prioritize a participant's video feed.

### Swift Code Integration

We have enabled new generation renderer in our classic iOS application sample: <https://github.com/VidyoAPI-SDK/Swift-Sample>. This commit is actually what has been changed: <https://github.com/VidyoAPI-SDK/Swift-Sample/commit/8ccad2479b0a9afcf1341780af770c77cc09474c>.&#x20;

1. **Connector Initialization:** When initializing the `VCConnector`, the `viewStyle` parameter should be set to `.ngrSpeaker`. This activates the new generation renderer.

   ```swift
   connector = VCConnector(
       nil,
       viewStyle: .ngrSpeaker, // Enable new gen renderer
       remoteParticipants: participantsNumber,
       logFileFilter: "".cString(using: .utf8),
       logFileName: "\(Constants.LogsFile.pathString)/\(Constants.LogsFile.name)"
   )

   ```
2. **Default Values:** In `DefaultValuesManager.swift`, update the `renderer` and `layout` properties to use the new generation renderer's default settings:

   ```swift
   public var renderer = RendererType.ngr // Use new gen renderer
   public var layout = LayoutType.speaker // Use speaker layout as default for new renderer

   ```
3. **Settings Management:** Within `SettingsManager.swift`, adjust the `isEnabled` property for the layout settings option. This ensures that the layout options are correctly enabled or disabled based on the selected renderer:

   ```swift
   isEnabled: DefaultValuesManager.shared.renderer != .tile // layout is enabled when the renderer is not .tile

   ```

These code changes ensure that your iOS application leverages the new generation renderer, providing an enhanced video conferencing experience.


---

# 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://enghouse-vidyo.gitbook.io/vidyoplatform/use-cases/new-generation-renderer.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.
