# C++ (Unreal Engine)

Unreal Engine (UE) is a 3D computer graphics game engine developed by Epic Games, first showcased in the 1998 first-person shooter game Unreal. Written in C++, the Unreal Engine features a high degree of portability, supporting a wide range of desktop, mobile, console, and virtual reality platforms.

Sariska provides plugins to support media streaming for Unreal Gaming Engine. This documentation walks you through setting up the Sariska Unreal plugin for your Unreal project.

### SET UP

#### Android

The development of an android project in unreal requires changes to your unreal editor preferences. Follow the steps below to quickly start up with a project or you can follow the official quick start guide by Unreal [here](https://docs.unrealengine.com/4.26/en-US/SharingAndReleasing/Mobile/Android/GettingStarted/).

1. **Configure Android Platform**
   * Click Edit > Project Settings to bring up the Project Settings window.
   * Inside the Project Settings window, navigate to Platforms > Android.
   * Under APK Packaging, there will be a warning that reads "Project is not configured for the Android platform". Click the Configure Now button to automatically set up your project to write the required platform files.
   * Fill in the Android Package Name with an appropriate company and project name.
   * If the Accept SDK License button is enabled, click it in order to accept Android's SDK license agreement. If you have previously accepted this agreement, then you will not need to complete this step.
2. **Configuring Editor and PIE for Mobile Previews**
   * In the **Toolbar**, click **Settings** > **Preview Rendering Level**, then select one of the available rendering levels for Android.
   * <img src="https://1923881523-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmDQJQODiL3KY8lyrRqkj%2Fuploads%2Fgit-blob-700442112ee3249cbcb9f13f05767e851f6cf156%2Fimage.png?alt=media" alt="" data-size="original">
   *   Click the **dropdown** next to the **Play** button in the **Toolbar**. Choose one of the available **Mobile Preview** modes corresponding to the rendering level you selected.

       <img src="https://1923881523-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmDQJQODiL3KY8lyrRqkj%2Fuploads%2Fgit-blob-2e31a08bf998a0c8b24c476e3b0ffb1032e15298%2Fimage.png?alt=media" alt="" data-size="original">
3. **Configure Android SDK**
   1. You'd sometimes need to add the location of the Android SDK and NDK manually.
   2. Click Edit > Project Settings to bring up the Project Settings window.
   3. Inside the Project Settings window, navigate to Platforms > Android-SDK.
   4. Make changes to the SDK Config accordingly.

![](https://1923881523-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmDQJQODiL3KY8lyrRqkj%2Fuploads%2Fgit-blob-f45d805cb35a67e3d532b058ff1cd8983078150b%2FScreenshot%202022-06-07%20at%2011.57.56%20AM.png?alt=media)

**Launching on an Android Device**

* From the Launch menu under the Devices section select your Android device from the list by clicking on it.
* While your level is being launched on your device, the progress will be displayed in the bottom right-hand corner of the screen like in the following image.
* When the deployment has finished, the project should automatically start running on your Android device. If the project fails to automatically start, you can start it by finding the App on your device and tapping on it to launch it.

### Add Sariksa Media Plugin

Sariska's Media Plugin for Unreal can be cloned from [here](https://github.com/SariskaIO/Sariska-Media-Unreal-Plugin)

```git
git clone https://github.com/SariskaIO/Sariska-Media-Unreal-Plugin
```

You can clone the repository to `<Game>/Plugins/` or if you want you can use git submodules to your own git repository. Alternatively, you can copy to the `Engine/Plugins/` if you wish to make the plugin available to all of your projects.

Once the plugin is added to your project under the plugins folder(you can create one if you don't have a plugins folder already), you can generate project files and enable the plugin to use it.

### Adding AndroidX Support (For UE 4)

If you are using UE version 4.26, you might need AndroidX support to run Sariska's media services. You can clone the following repo into `<Game>/Plugins/`

```git
git clone https://github.com/ufna/AndroidX-UE4.git
```

A demo app showing Sariska Media usage for Unreal can be found here:&#x20;

```
git clone https://github.com/SariskaIO/Sariska-Media-Unreal-Demo.git
```

