> For the complete documentation index, see [llms.txt](https://zerodensitydocumentation.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://zerodensitydocumentation.gitbook.io/docs/realityhub-1.3/realityhub-1.3/controlling-unreal-engine/unreal-engine-5.1/example-pipeline/utilizing-media-framework-tools.md).

# Utilizing Media Framework Tools

It is possible to utilize Unreal Engine 5.1 Media Framework tools for various tasks, such as **playing a video file** inside your Level through RealityHub.&#x20;

### Before You Begin

{% embed url="<https://docs.unrealengine.com/5.1/en-US/play-a-video-file-in-unreal-engine/>" %}
Unreal Engine Documentation Link
{% endembed %}

* Check out the Unreal Engine 5.1 Documentation Page using the link above and get your scene ready accordingly.

<div align="left"><figure><img src="/files/LuFTdCecfo2OM3paOtmz" alt=""><figcaption><p>Example Media Framework Tools in Content Browser</p></figcaption></figure></div>

To use Media Framework tools with a basic pipeline, your Level needs to have the content outlined in the picture above:

* Media File Source
* Material
* Media Player
* Media Texture
* Remote Control Preset

### Creating Blueprint

<div align="left"><figure><img src="/files/PFWrjMQmzlwDWXLjKi7e" alt=""><figcaption><p>Asset Creation Menu</p></figcaption></figure></div>

* Right-click on the **Content Browser** and select the **Blueprint Class**

<div align="left"><figure><img src="/files/AHbEDIDIvnqNoJ5HqxI5" alt=""><figcaption><p>Pick Parent Class Window</p></figcaption></figure></div>

* Pick the Actor from the "Pick Parent Class" window, and give it a new name for better organization (in this case, we'll call it BP\_Media)
* Drag & drop the blueprint into the Level
* Double-click on the blueprint or right-click on it and select **Edit**

<div align="left"><figure><img src="/files/k2M0oEZerz4mmITaKcWK" alt=""><figcaption><p>Adding Blueprint Component </p></figcaption></figure></div>

* Go to the **Components** section, click on **Add** button, find and select **Cube**

<div align="left"><figure><img src="/files/IYtyIyXzpnA2VZWrzV8g" alt=""><figcaption><p>Changing Scale</p></figcaption></figure></div>

* Adjust the Scale parameter value of the Cube component as seen in the image above

### Defining Variables

<div align="left"><figure><img src="/files/XXAy9rMUJguNXOlim95F" alt=""><figcaption><p>Adding Variable</p></figcaption></figure></div>

* Navigate to the **My Blueprint** section and click the **Plus** button to add your first **Variable**. If you want, you can rename it to **MediaPlayer** for better organization of your scene

<div align="left"><figure><img src="/files/1NQDkZhzo0ksHNU7Alv8" alt=""><figcaption><p>Changin Variable Type</p></figcaption></figure></div>

* Change the Variable type to **Media Player** > **Object Reference**, as shown in the image above

<div align="left"><figure><img src="/files/1adfdtmoeIYuCfpqbzaH" alt=""><figcaption><p>Details Panel in Blueprint UI</p></figcaption></figure></div>

* Go to the **Details** panel, select your **MediaPlayer** as a **Default Value**, as illustrated above

<div align="left"><figure><img src="/files/JC30Y0P7RLDENqbK723b" alt=""><figcaption><p>Adding Variables</p></figcaption></figure></div>

* Add another **Variable**, and change its type to **Media Source** > **Object Reference**
* Rename it as **VideoTexture**, and leave its **Default Value** empty
* Add another **Variable**, change its type to **String**, rename it something like **File Path**, and make it **Instance Editable** by clicking on the **eye icon** as illustrated above

<div align="left"><figure><img src="/files/6nd9p42213AVq2F5A2wP" alt=""><figcaption><p>Node Tree</p></figcaption></figure></div>

* Create the node tree as shown above.&#x20;

### Creating Material

<div align="left"><figure><img src="/files/J7J29aJWsYe0p5ZCU0Oy" alt=""><figcaption><p>Matertial Creation</p></figcaption></figure></div>

* Right-click on the Content Browser and select the Material asset, rename it something like M\_Media

<div align="left"><figure><img src="/files/dnEz5JqeXb10UCfKjqbO" alt=""><figcaption><p>Material Editor</p></figcaption></figure></div>

* Drag & drop your **Media Texture** asset (in our case, it is **my\_MediaPlayer\_Video**) to the **Material Editor**&#x20;
* Connect the RGB output of the **Texture Sample** to the **Base Color** input of the **Material,** and **Save** it as shown above

<div align="left"><figure><img src="/files/OxshfX1X3d8pKwgVJ6a5" alt=""><figcaption><p>Assigning Material to Blueprint Cube Asset</p></figcaption></figure></div>

* Go to **Outliner** and select your Blueprint
* Select the **Cube** asset in the **Details** panel
* Go to the **Materials** property group and assign the material to the **Element 0** slot

### Preparing Remote Control Preset

* Right-click on the Content Browser
* Go to Remote Control and select the Remote Control Preset (RCP)
* Double-click on the RCP and keep it open

<div align="left"><figure><img src="/files/pIJvUnfqKsrhO9b8k6CA" alt=""><figcaption><p>Exposing Property Parameter</p></figcaption></figure></div>

* Go to the **Details** panel, select the Blueprint
* Expose the **File Path** property by clicking on the eye icon, as shown above

<div align="left"><figure><img src="/files/xn2IrgPnpVmSUVLCSfOX" alt=""><figcaption><p>RCP</p></figcaption></figure></div>

* Click on the **Expose Function** button
* Go to **Actor Function** > **Blueprint** > select the **Play Video**&#x20;
* Save the RCP and then drag and drop it into the **Level**

<div align="left"><figure><img src="/files/5npwj98BGnJaiN0b7ZYM" alt=""><figcaption><p>Exposed Parameter and Function to RCP</p></figcaption></figure></div>

Your RCP should look like in the image above.&#x20;

<div align="left"><figure><img src="/files/QRNOd4DDsA8inQmyc9Oe" alt=""><figcaption><p>RCP Exposed Property Adding Suffix</p></figcaption></figure></div>

* Change the exposed property's name to something like Video for better organizing&#x20;
* Add the following suffix after the exposed property's name: **`_FilePath_AssetPath`** as illustrated above
* Save the RCP, then Go to **File** > **Save All**
* Close the Unreal Editor
* Switch to RealityHub and Launch the Project via [Launcher Module](/docs/realityhub-1.3/realityhub-1.3/launcher.md)

<div align="left"><figure><img src="/files/cu8uP8xRWsSk8P588Zdr" alt=""><figcaption><p>Image 1</p></figcaption></figure></div>

<div align="left"><figure><img src="/files/PtpPHkL9SFVckoDkVB0J" alt=""><figcaption><p>Image 2</p></figcaption></figure></div>

* Image 1 shows the exposed property as a FileInput component inside the RealityHub
* Image 2 shows the exposed Blueprint Function as a button&#x20;

Now you can select a video through [Asset Browser](/docs/realityhub-1.3/realityhub-1.3/nodegraph-actions/nodegraph/asset-browser.md), and utilize it through RealityHub modules such as [Actions](/docs/realityhub-1.3/realityhub-1.3/nodegraph-actions/actions.md), [Form Builder](/docs/realityhub-1.3/realityhub-1.3/nodegraph-actions/form-builder.md), and [Playout](/docs/realityhub-1.3/realityhub-1.3/playout.md).&#x20;
