

MEDIA PLAYER WIDGET WINDOWS

In order to hear audio along with your video, you will need to use a Media Sound Component which points to your Media Player asset. Right-click and add a Create Widget node and set Class to HUD, then off the Return Value use Add to Viewport and connect as shown.įollowing the Add to Viewport node, right-click and use Add Media Sound Component and set the Media Player to MyPlayer in the Details panel. When our game starts, we will go through the process of creating and displaying our HUD, set up sound for our stream, then open our stream so that it plays. Hold Ctrl and drag the MediaPlayer variable into the graph to create a Get node for this variable, then right-click and add an Event Begin Play node. You may need to click Compile in order to see the Default Value of your MediaPlayer variable. This will ensure that the image stays fixed in the center of the viewport regardless of viewport size.Ĭlose the HUD Widget Blueprint, then from the Level Editor Toolbar, select Blueprints and Open Level Blueprint.Ĭreate a new variable called MediaPlayer of the Media Player Reference type and set the Default Value to your MyPlayer Media Player asset. In the Details panel for the Image under Slot, click the Anchors dropdown and select the anchor middle option. In the Details panel for the Image under Appearance expand Brush then set the Image to MyPlayer_Material. We are going to apply our Media Texture to this image, and the image will fill the player's viewport when playing the game (creating a video that will play fullscreen). Inside the HUD Widget Blueprint, from the Palette window drag an Image into the graph and stretch it to fill the grid's aspect ratio. Right-click in the Media folder, then under User Interface select Widget Blueprint and call it HUD.Ī Widget Blueprint is an asset that is used with UMG UI Designer to create UI elements within Unreal Engine 4 which we will apply our streaming video to. If you are using a Texture Sample or Texture Object with the Electra Media Player, you will need to set the Sampler Type to Color. If you do not have a URL file to link to, right-click this Sample Video and copy the link address and paste it in the Stream URL field.

Open MediaStream then enter your desired Stream URL. Right-click inside the empty Media folder, then under Media, select Stream Media Source and name the asset MediaStream. In the Content Browser expand the Sources Panel and create a new folder called Media inside the Content folder. The stream can be loaded and played as part of a UI element, played fullscreen or even applied to a Static Mesh (such as a TV) and played inside your level.įor this how-to, we use Unreal Motion Graphics (UMG) to create a UI element that will play a streamed video fullscreen.įor this how-to we are using the Blueprint Third Person Template project with Starter Content enabled. With the stream defined, you can load it up and play it inside UE4 with a Media Player asset and (with an associated Media Texture) can assign it to various aspects of your level. Adding the Media Source to a User Interface WidgetĪ Stream Media Source is an asset that enables you to stream a video in the supported URL format inside Unreal Engine 4 (UE4). Associating the Media Source With a Materialģ. Creating the Streaming Media Source and TextureĢ.
