How To Display A Video In A Widget | With Audio - Unreal Engine 4 Tutorial
Вставка
- Опубліковано 3 лип 2024
- Hey guys, in today's video, I'm going to be showing you how to play a video in a widget on screen, with audio, within your games in Unreal Engine 4.
City Video: • City Life | Drone Vide...
Band Audio: • 20 New Free CITY Sound...
Water Audio: • Calm Seashore - No Co...
#Ue4 #UnrealEngine4 #Ue4Tutorial
___________________________________________________________________________
00:00 - Intro
00:13 - Overview
01:15 - Tutorial
11:14 - Final Overview
11:36 - Outro
___________________________________________________________________________
My Public Video List: trello.com/b/7vJgXzBm
Unreal Engine 4 Tutorials Playlist: • Unreal Engine 4 Tutorials
The Basics Of Nodes Playlist: • The Basics Of Nodes In...
Blender Tutorials Playlist: • Blender Tutorials
___________________________________________________________________________
If you enjoy make sure to subscribe: / @mattaspland
Join My Discord Server: / discord
Follow Me On Instagram: / matt_aspland_
___________________________________________________________________________
If you want to support me, you can PayPal me at "matt.aspland.1@gmail.com". This is by no means expected or required. It is just a nice support :)
Link to PayPal: www.paypal.com/
You can also support me on Ko-Fi following this link: ko-fi.com/mattaspland
Thank you :)
___________________________________________________________________________
♫Music By♫
●Kronicle - Chill Noons
●Soundcloud - / the-chemist-10
Matt, thanks for the great help on figuring this out. I put it to use about a month ago and have a fun little system working with it.
One thing I noticed - at least for my project in 4.27 is that as long as you attach the media sound to the pawn and set the media player up within the component you don't have to start it with the blueprint function. It seems to work fine.
Works great for what I am doing at least. Making some fun CYOA FMV games :) Thanks again for the primer on this.
This is the one I been searching for long time, Now I can insert pre rendered cutscene videos to deliver my game stories with less effort. Thank you mate!!
That's great to hear man, nice work! All the best :)
Thanks for the comprehensive and easy-to-follow tutorial!
It Works. Great Job as Always Matt !
OH GOD THANK YOU. Been looking everywhere for this...
thank you for the tutorial. You really helped me figure out how to play my game intro in a widget!
I honestly didn't know this was possible.
But this is so cool and can be applied to so many game features.
Absolutely Fleur, many things can be utilised great in many different ways! :)
Works perfectly. Thank you.
Thank you! I was able to setup FMV cutscenes thanks to this video!
Thanks bro great tutorial again!
No problem mate, thanks a lot :)
Again again again thanks bro great work
No problem mate, thanks for the support! :)
As usual, when I need something, there's Matt! Thanks!😄
Happy to help!
Thank you, very clear and usefull
This will be useful!
That's great to hear man, happy to help :)
Thank you for the tutorial! MediaPlayer has a GetDuration function that returns Timespan, from which GetTotalSeconds may be dragged. That may be used as delay duration (13 sec in the video)
great tutorial
Love you, thanks
Thank you. Very nice.
very helpful!
you always have just what i need
wesome video
Nice Outro Background picture :)
This can really add polish to a game. Thanks!
Absolutely Steve, all the best to you!
How to play the video on a loop@@MattAspland
Thanks for the sweet tutorial. For my widget I put a black image over the canvas and created an animation seq-image render opacity. To create a Fade from black!
Finally Great solution that works in UE5.3!
Especially after countless efforts of setting up Common Video Player from CommonUI 🤯
Thank you so much! You have no idea how many things I've tried to try to get a video playing like this. Finally figured I should use a widget, and this tutorial 100% worked! Thanks!!
So Good!
Thanks man!
I was literally just looking for this 👀
Perfect timing!
Nice video dude
Cheers a lot bro!
great video thanks! every other video on this is very confusing
I really like this, and it will be helpful in a few ways! I recently seen a UE4 Video talking about a different way of removing the widgets for better performance. I have been messing around with a few widgets lately, and definitely noticed a difference after installing a few of them. I am wanting to use a widget to display a video in a level, and was wondering what is the best way for displaying the widgets, then removing them. Thanks Matt!
That's great to hear, happy to help Pat! Yep, removing the widget after you are doing with it can definitely help with performance, especially in the long run! All the best man :)
Hey Matt! Thank you for the videos. What is the best way to get all background or world noise to not play while the video is being viewed? I can still hear my background noise over the video
Thanks, I was able to rickroll my friend using this.
PSA: If you set the delay node to "0.0", it will actually be one frame. 0.1 is several frames on 60 fps alone.
Better than that, you have a node "Delay Until Next Tick"
excellent
Thanks Matt! Does anyone know how to end/stop the video & audio? For example when pressing the space bar.
thanks :D
No problem at all James :D
this was released on my birthday
Question: Can I use this as a loading screen? I use your loading screen as mine and curious if I can Use both of these together?
Answer: YES, you can use this function with the loading screen!!! :D
ALSO, you can make it a Main Menu. when you do it with the main menu you can just throw in a sound in the world (if you use Matt's way of a MM with a empty level. WORKS AMAZING!
Rather than setting the Delay node to 13 seconds you could use the Media Player reference to get the duration using "Get Duration" and then pass the seconds into the delay node :)
Oh, so adding the delay of 0.1 doesn't help, because the reason it's white is because the video is loading. I've tested this in shipping and the first time it loaded my 4 minute video, it took like 7 seconds to start playing. Also, this messes up the delay before closing the widget, so there's a better way. Drag off the MediaPlayer variable and type On End and you'll see an option for Assign On End Reached. This will create a binding that will detect when the video has ended and then you can execute your closing the widget code from there without having to guess at the correct timing.
any idea why the sound is not playing or add sound to it?
Hey Matt, how about making something like the Speed Boost from Dark Deception? (With the effects as well) would be useful.
Hey mate, I can look into that and add it to my list :)
So I made this pop up widget to become a button but it only plays once. Is there a reset node or something so that I will be able to play the video again? Thank you for the help
How would you make it so that it starts paused and has a thumbnail (not just black/white) then you can start it after that? Think a menu of replay or hint videos with thumbnails you click to start the video.
hey mate your ai series was very helpful and now i am looking for a gun system same like gta v it would be really helpful if you make a tutorial on it's request
I was curious if I have my videos hidden are they still running in the background? I have rollover states that unhide them...
thank you! But I curious about how to build a mini-player? Like the UA-cam Video Player. Usually, in the lower corner , it has a little player and then we can expand it to the full screen video view.
Remove the "Disable input" and "enable input" nodes and anchor the image widget to whatever corner you would like it to be in, then change 1080x1920 to whatever size you want.
Thanks for you tut, I have another problem in 5.3. It can not play my mp4 file in reverse! My file has supported rate from 0.5 to 4 ( no negative rates are supported ! ). Do you know anyway for doing so?
Is there any way to remove the black background that is in the video? I exported a transparent one out of After Effects
Wondered about using this technique to play a pre-rendered cutscene on level change in place of a loading screen or to mask any scene loading lag. hmm...
Hey Matt! i see my video in editor but when i build the game the video is just blank white screen
I will play on LED hall so need 6911 resolution in width, then should i make it by custom size in widget blueprint?
What if the video already has sound?
Please Matt can u make a video on how to turn the camera with the left joystick Like in the game OUTRIDERS DEMO using the locomotion set up. So what i mean is that when the player is in motion the camera will snap back to the locomotion all direction movement and the left thumbstick just rotates while still facing forward but when the player stand still. you can rotate around to see the front of the player. .Thank you
youre very very awesome
Thanks so much man, all the best to you!! :)
hi please help me real quick after building the game it just shows white background
2:07 when I double click my video in the media player it just constantly buffers, and i cant find anything on fixing this. the vid is an mp4 file and i have the electra plugin installed
Does it has a limit for the resolution of video? It's not working well
i did one for the start and worked, then i did one for a screamer with a box collision but every time i test it my screen turns black
So when I press the button it flashes black for a split second...nothing else happens, the video doesn't play. I'm really desperate to make this work. Hope you can help! Btw how do I the video play after I pressed play in the main menu? When you press play you go straight to the game level but I want to play a cutscene before.
any one else getting a white background when i test it unless i have the media player open?
I'm opening the movie widget when I click a button on my start menu widget. It closes the start menu, plays the intro animation, then the player begins the game in the first level map once the animation closes (manually or automatically on finishing). So I'm not sure what to do about the sound bit (there doesn't seem to be an option for adding a media sound component). Is there another way around this?
I've added a play sound 2D to activate along with the movie. Hopefully this will be ok. Is there a better way around it?
Sometimes I suspect that you’re not really a human being but personified Unreal Engine itself trying to give us a hand
Hi for some reason the audio in the video cuts out before the video can finish. Could someone tell me why that is happening? Thanks
Video is presenting itself as a "Still Image" ?? no movement
Does anyone know how to add a video player into a widget, like give the users the ablity to play and pause a video export (with audio)?
My input didn't disable at all. I'm using the trigger box. what am i doing wrong?
how about you only press p when you arre on certain checkpoint
For anyone having full screen white problem.
I solved it by asigns the Media texture we create into the texture node of the Material.
hello, in unreal 5, I can't import the video
4:08 My media is not showing pls help
Tried it in version 5.0.1 and it doesn't work. will not make the material and unable to play sound.
for some reason, the video was playing fine but now when I add the sound component and add the media player to it the video screen turns white, it plays only without the mediaplayer plugged into the sound component, please any one know how to fix this stupid issue or is there any plugin that manges video better than the buildt -in BP in UE5 ? :/
does not work on electric dreams ue5 has a bug on pcg project
Videos don't play in packaged projects, I've packaged my game with videos using this method and it works just fine on my computer, but when the packaged game is played on another computer the video is a blank texture, how do I fix this?
Hi mate, in the project settings, under packaging. I believe there is a section to add specific videos to include in the packaged build. I believe this solves that issue.
@@MattAspland I've tried this and it works on my PC but not when a packaged game is executed on a different PC :/
@@MattAspland Unless I'm putting the names in incorrectly? Is it just the name of the videos or the entire file path?
@@ezekielhabegger Ah strange okay, I believe it is just the file name, the the entire path. However, we may need a new folder in Unreal to place these videos in. I know we need it for splash screens, and the same logic may also apply to in-game videos.
We'd need a folder in the content browser named "Movies", and place all of your videos in there. This may resolve it.
Creating folder movies in content folder solved your problem ?
This worked for me, but after the video plays, my UE4 hangs. Anyone else experiencing this or knows how to fix? Thanks
srry sir i want to ask something about play video in media player, I was import video file what i want to use for main menu, but in file path there is text like this "the selected media file will not get package , because its path points to a file outside the project". I can't play the video from media player, what should i do to fix it? I'll glad if u want to answer my problem. btw i always watching your videos every single day, because I learn much more unreal from your channel. Subsribe Done.
I have texture but I don’t have the normal texture how do I get it
Hey mate, if there isn't a download link to one, you can either create one easily in Photoshop, or use this website here :)
cpetry.github.io/NormalMap-Online/
How about play loop seamlessly?
Hey, incase you still need help. Open your media player file, select the video you want to play from the bottom left list and under 'details' (bottom right window), tick 'loop'. Then save.
Doesn’t work on UE5… when playing the video on the media player, I can see the Texture animating. But inside of the widget, the image material doesn’t work. Just show a blank image. Any idea if it’s due to UE5?
I am using UE5 and it works perfectly, check the material created for the MediaPlayer, check also that you have added that material to the widget image.
8:50 Heads up for anyone doing this in UE5, media sound is NOT accessible in the level blueprint.
Any Idea why playing the video is stutterring?
the sound is not playing
Can this also be used to add cinematics also?
Hey man, you can do yeah, or you can use the method in my video below :)
ua-cam.com/video/FOS9FMbUtq0/v-deo.html
@@MattAspland Thanks 🤘
Grape video
video stuck on first frameany ideas ?
Wonderful tutorial! I only have one problem with my project. The widget works perfectly, but if I package my game and open the packaged version on a different computer, the widget is completely white. Does anyone have the same issue? or know how to resolve it?
same problem
Hey, i managed to fix this issue through A LOT of searching. Basically, you have to make sure that the videos are imported and kept in a specifically named folder in your unreal engine folder. If i remember correctly, the name should be ´movies´ or something along those lines. If its not, i suggest searching up your problem and you will most likely find the websites i found. Hope this helps:))@@mrmateuszpl8207
I solved this full screen white problem, just asigns the Media texture we create into the texture node of the Material.
Hi! When I start the game, it only shows a white screen, it plays the sound but not the video. What is the problem?
Did You ever solve this ?
It works fine on one pc, but, on another just a white screen ??? I tried DX redist and C++ redist downloads ???
@@ECHSBACHS Unfortunately I haven't managed to solve it yet, if anyone has any ideas or solutions please let me know! I wonder if some kind of plugin might help, no? "Window Movie Player" maybe? I don't know...
@@ECHSBACHS Now the problem is solved! The path must be correct! .../Content/Movies - you have to put the video in the Movies folder. If you double-click on the video file, you can enter the path there
@@jankopapa That worked. Thanks !
if i'm able to use this as a video loping on my main menu then matt you can read our minds lol
Absolutely man, you can tick "loop" on the video in the media player and not remove from parent, just open source and that's it. All the best man :)
i followed every step and it just appears black.
someone please help
I don't think audio works in Unreal 5.2 anymore. *Edited - Adding a "Media Sound Component" NODE to the Level Blueprint at the collision box nodes that spawns the widget, allowed me to select the correct video for the "Media Sound Component" node and then add a "Start Node" after it. Then when the Widget is "created" the audio played. Just typing this out I realized it really makes no sense how they set this up lol.
There is one problem with this approach, it doesn't export the video along with the game when you build/package it.
How do You get it to do that ?
@@ECHSBACHS I'm still trying to figure that out. I'll report back if I find a solution
Did you found a solution ?
@@thenrgamingchannel sadly no :(
I've given up on it.
Did tou try creating movie folder in the content folder and add all videos there ?
...please avoid using the level BP. The moment your game gets even slightly complicated BOOM! A trillion glitches appear. I make invisible actors for that kinda thing. I've gotten horrifically complicated mechanics working like that.
How to make a Player pick up objects and drop it with sound
Hey mate, I can add it to my list :)
this is not working
How stupid is it that you can add a MediaSoundComponent to a widget, but it can't actually reference your media player. It works in game mode, or player or pretty much every other BP. Just not the actual UMG. Yay Epic!
How do you know, what i need ? lol
Haha, I'm a mind reader lol
Nikhe
haha cutscene