2 - Setting up the Media Texture and Material

In this step, we set up our Media Texture and Material that will be used for video playback.

On this page

## Marked as Docs as the page has been combined into one page.

In the previous step, we imported content and created some of the assets that we will use for this guide, up next we will create our Material that we will use to play our video. This requires us to incorporate our Media Texture inside a Material and a little bit of work to get the content to fit on our TV's screen correctly.


  1. In the TV folder, open the M_TV_Inst Material and delete the Vector Parameter node attached to the Base Color pin of the M_TV_Inst node.

  2. Right-click in the graph and add a Texture Sample node. Then, in the Details panel, change the Sampler Type to External.


    We can leave the Texture field empty for now, as we are going to populate it with a Texture Object Parameter. This will enable us to override what Media Texture to sample from through Blueprint. The Sampler Type field needs to be set to External for Media Textures, as this optimization provides more efficient video playback and decoding.

  3. Right-click in the graph and add a Param Tex Object node, then connect it to the Tex pin of the Texture Sample node.

  4. On the Param Tex Object node, use TV_Texture as the Parameter Name and set the Texture field to MediaPlayer_01_Video.


    When setting the Texture field to use our Media Texture, the Sampler Type field will automatically change to External.

  5. Right-click in the graph and add a TexCoord node, then connect it to the UVs pin of the Texture Sample. Set the VTiling property to 2.0.


    The values used for the TexCoord may vary based on the mesh you plan to apply this Material to. After some experimenting, we found these values to be sufficient for this example.

  6. Right-click and add another Texture Sample node and set the Texture property to the T_TV_M2 texture.


  7. Off the Green channel of the new Texture Sample, use a LinearInterpolate node and connect it to the Alpha channel.


    We are going to use this texture to separate the screen of our TV from the rest of the mesh so that we can apply the video to just the screen.

  8. Hold the 1 key and left-click to add a constant node and connect it to the B pin of the Lerp node, then connect the remaining nodes as shown.


End Result

Our TV Material is set up and ready to play our video. If you open the SM_TV Static Mesh, you may notice the screen is white.


Once you open the Media Player asset and play the video, if you re-open the SM_TV Static Mesh again the TV will be playing your video.


While the TV plays our content inside the Editor, if we were to drop this Static Mesh inside the level and play the game, our content would not play on the TV at runtime. In the next step, we will tell our content to open at runtime to start playback. Before we can do that however, we need to set up the Blueprint we will use to enable the player to press a button and turn on/off our TV. We will also provide a way to specify the content that will appear on the TV from within the Editor.

Select Skin

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback