# (Bug?). I can't open a file with the media player trough a UI.

**URL:** <https://forums.unrealengine.com/t/bug-i-cant-open-a-file-with-the-media-player-trough-a-ui/2708398>\
**Category:** Programming & Scripting\
**Tags:** files, unreal-engine, bug-report, question\
**Created:** [March 23, 2026, 5:09pm UTC](https://forums.unrealengine.com/t/bug-i-cant-open-a-file-with-the-media-player-trough-a-ui/2708398 "2026-03-23T17:09:59Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![OrangeAedan](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/orangeaedan/32/1133224_2.png) [@OrangeAedan](https://forums.unrealengine.com/u/OrangeAedan)\
**Post date:** [March 23, 2026, 5:09pm UTC](https://forums.unrealengine.com/t/bug-i-cant-open-a-file-with-the-media-player-trough-a-ui/2708398/1 "2026-03-23T17:09:59Z")

</div>

I am trying to load a .WAV file into the game at runtime using the media player trough a UI. However I am not hearing anything. And before you ask:

- Yes, the file works correctly. Because the exact same code works when placed in a normal actor.
- Yes, all the booleans at the end return true.
- And yes, the event fires.

Here is my current code.

 ![Screenshot 2026-03-22 221410](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/c/4/ec4a2352c818904f3a7f3266e87456b9101825e1.png)

This code is in my UI.

 ![Screenshot 2026-03-22 221223](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/5/2/5526b9b5d23d9b6e49361c8d397585d1f8a2397a.png)

And this code is in my actor.

The music gets played when I press “1”. But not when its called from the UI. I have also tried doing it via a replicated variable update function. But that gives the same result.

I just don’t get why this doesn’t work. First of, why can you not put the code in image 2 in the UI? Because when its played, it can be treated like a sound 2D. And secondly, why is it different if I call the same event from my actor vs my UI? This should be the same.

I think its a bug. But if someone has a solution, please let me know. Because this has been really frustrating. Thank you!

---

<div class="post-metadata">

**Author:** ![Dejan33](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/dejan33/32/1194514_2.png) [@Dejan33](https://forums.unrealengine.com/u/Dejan33)\
**Post date:** [March 23, 2026, 10:59pm UTC](https://forums.unrealengine.com/t/bug-i-cant-open-a-file-with-the-media-player-trough-a-ui/2708398/2 "2026-03-23T22:59:28Z")

</div>

Connect url from playmusic to create path from directory.

---

<div class="post-metadata">

**Author:** ![OrangeAedan](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/orangeaedan/32/1133224_2.png) [@OrangeAedan](https://forums.unrealengine.com/u/OrangeAedan)\
**Post date:** [March 24, 2026, 4:08pm UTC](https://forums.unrealengine.com/t/bug-i-cant-open-a-file-with-the-media-player-trough-a-ui/2708398/3 "2026-03-24T16:08:13Z")

</div>

That url input does nothing. It is only there for later. The function always uses the same file right now.

---

<div class="post-metadata">

**Author:** ![Dejan33](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/dejan33/32/1194514_2.png) [@Dejan33](https://forums.unrealengine.com/u/Dejan33)\
**Post date:** [March 24, 2026, 10:39pm UTC](https://forums.unrealengine.com/t/bug-i-cant-open-a-file-with-the-media-player-trough-a-ui/2708398/4 "2026-03-24T22:39:49Z")

</div>

So, the play music function from actor is IDENTICAL as one in the UI?

---

<div class="post-metadata">

**Author:** ![OrangeAedan](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/orangeaedan/32/1133224_2.png) [@OrangeAedan](https://forums.unrealengine.com/u/OrangeAedan)\
**Post date:** [March 25, 2026, 2:36pm UTC](https://forums.unrealengine.com/t/bug-i-cant-open-a-file-with-the-media-player-trough-a-ui/2708398/5 "2026-03-25T14:36:56Z")

</div>

Yes. That is the weird part.

---

<div class="post-metadata">

**Author:** ![Dejan33](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/dejan33/32/1194514_2.png) [@Dejan33](https://forums.unrealengine.com/u/Dejan33)\
**Post date:** [March 25, 2026, 2:43pm UTC](https://forums.unrealengine.com/t/bug-i-cant-open-a-file-with-the-media-player-trough-a-ui/2708398/6 "2026-03-25T14:43:10Z")

</div>

add some print string along the ui to see if they all execute (1,2,3…).Also check if the music is playing (is\_playing) and such.

---

<div class="post-metadata">

**Author:** ![OrangeAedan](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/orangeaedan/32/1133224_2.png) [@OrangeAedan](https://forums.unrealengine.com/u/OrangeAedan)\
**Post date:** [March 25, 2026, 2:44pm UTC](https://forums.unrealengine.com/t/bug-i-cant-open-a-file-with-the-media-player-trough-a-ui/2708398/7 "2026-03-25T14:44:32Z")

</div>

I already checked that. They all return true. And it is playing. The issue is that the MediaSoundComponent doesn’t work. Even if its added to my actor.

---

<div class="post-metadata">

**Author:** ![Dejan33](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/dejan33/32/1194514_2.png) [@Dejan33](https://forums.unrealengine.com/u/Dejan33)\
**Post date:** [March 25, 2026, 2:49pm UTC](https://forums.unrealengine.com/t/bug-i-cant-open-a-file-with-the-media-player-trough-a-ui/2708398/8 "2026-03-25T14:49:26Z")

</div>

Aedan manul is the actor?

---

<div class="post-metadata">

**Author:** ![OrangeAedan](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/orangeaedan/32/1133224_2.png) [@OrangeAedan](https://forums.unrealengine.com/u/OrangeAedan)\
**Post date:** [March 25, 2026, 2:49pm UTC](https://forums.unrealengine.com/t/bug-i-cant-open-a-file-with-the-media-player-trough-a-ui/2708398/9 "2026-03-25T14:49:38Z")

</div>

Yes.

---

<div class="post-metadata">

**Author:** ![Dejan33](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/dejan33/32/1194514_2.png) [@Dejan33](https://forums.unrealengine.com/u/Dejan33)\
**Post date:** [March 25, 2026, 2:52pm UTC](https://forums.unrealengine.com/t/bug-i-cant-open-a-file-with-the-media-player-trough-a-ui/2708398/10 "2026-03-25T14:52:06Z")

</div>

first , you need to refrenc it by get all actors of a class(index 0)(if that is the only one!) and refrence the media sound component in play music function of UI bplueprint.

---

<div class="post-metadata">

**Author:** ![OrangeAedan](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/orangeaedan/32/1133224_2.png) [@OrangeAedan](https://forums.unrealengine.com/u/OrangeAedan)\
**Post date:** [March 25, 2026, 2:54pm UTC](https://forums.unrealengine.com/t/bug-i-cant-open-a-file-with-the-media-player-trough-a-ui/2708398/11 "2026-03-25T14:54:18Z")

</div>

Wait. But the music function is in my actor. And I referenced the actor in my UI when calling the function.

---

<div class="post-metadata">

**Author:** ![Dejan33](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/dejan33/32/1194514_2.png) [@Dejan33](https://forums.unrealengine.com/u/Dejan33)\
**Post date:** [March 25, 2026, 2:55pm UTC](https://forums.unrealengine.com/t/bug-i-cant-open-a-file-with-the-media-player-trough-a-ui/2708398/12 "2026-03-25T14:55:49Z")

</div>

Ok, then try get all actors of a class rather than get actor of a class.

---

<div class="post-metadata">

**Author:** ![OrangeAedan](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/orangeaedan/32/1133224_2.png) [@OrangeAedan](https://forums.unrealengine.com/u/OrangeAedan)\
**Post date:** [March 25, 2026, 2:57pm UTC](https://forums.unrealengine.com/t/bug-i-cant-open-a-file-with-the-media-player-trough-a-ui/2708398/13 "2026-03-25T14:57:14Z")

</div>

Alright. I will test that. Although I don’t think it will work. Because this actor only exists once. But I will let you know.

---

<div class="post-metadata">

**Author:** ![OrangeAedan](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/orangeaedan/32/1133224_2.png) [@OrangeAedan](https://forums.unrealengine.com/u/OrangeAedan)\
**Post date:** [March 25, 2026, 5:05pm UTC](https://forums.unrealengine.com/t/bug-i-cant-open-a-file-with-the-media-player-trough-a-ui/2708398/14 "2026-03-25T17:05:12Z")

</div>

Hello again. Sorry for the wait. I had to move my project to Unreal 5.7.4. I have tested it. And it doesn’t work. And my actor does indeed only exist once in the world.

---

<div class="post-metadata">

**Author:** ![Dejan33](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/dejan33/32/1194514_2.png) [@Dejan33](https://forums.unrealengine.com/u/Dejan33)\
**Post date:** [March 25, 2026, 5:09pm UTC](https://forums.unrealengine.com/t/bug-i-cant-open-a-file-with-the-media-player-trough-a-ui/2708398/15 "2026-03-25T17:09:36Z")

</div>

The actor has to be in the levels. Weather drag and drop in levels, or spawn, or put the code in player character or in a blank actor you put in a level or whatever, but the actor has to be in the level. And you need to use get all actors of a class (get 0) to reference it or use some other technique.

---

<div class="post-metadata">

**Author:** ![OrangeAedan](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/orangeaedan/32/1133224_2.png) [@OrangeAedan](https://forums.unrealengine.com/u/OrangeAedan)\
**Post date:** [March 25, 2026, 5:12pm UTC](https://forums.unrealengine.com/t/bug-i-cant-open-a-file-with-the-media-player-trough-a-ui/2708398/16 "2026-03-25T17:12:17Z")

</div>

Yes. They are in the level. And I used get all actors of class. The code is identical. The only difference is that I trigger the event from the UI instead of the actor.

---

<div class="post-metadata">

**Author:** ![Dejan33](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/dejan33/32/1194514_2.png) [@Dejan33](https://forums.unrealengine.com/u/Dejan33)\
**Post date:** [March 25, 2026, 5:18pm UTC](https://forums.unrealengine.com/t/bug-i-cant-open-a-file-with-the-media-player-trough-a-ui/2708398/17 "2026-03-25T17:18:18Z")

</div>

Sometimes if you check this on event begin (in UI widget) the actor may not be loaded in the level, so it doesn’t fetch the reference to that actor. Check for errors and warning in the log.

---

<div class="post-metadata">

**Author:** ![OrangeAedan](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/orangeaedan/32/1133224_2.png) [@OrangeAedan](https://forums.unrealengine.com/u/OrangeAedan)\
**Post date:** [March 25, 2026, 5:31pm UTC](https://forums.unrealengine.com/t/bug-i-cant-open-a-file-with-the-media-player-trough-a-ui/2708398/18 "2026-03-25T17:31:11Z")

</div>

I have no errors in the log. And the event does fire. All checks return true. But I just don’t hear anything. So I think that the MediaSoundComponent doesn’t work for some reason even though everything is identical.

---

<div class="post-metadata">

**Author:** ![OrangeAedan](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/orangeaedan/32/1133224_2.png) [@OrangeAedan](https://forums.unrealengine.com/u/OrangeAedan)\
**Post date:** [March 27, 2026, 6:34pm UTC](https://forums.unrealengine.com/t/bug-i-cant-open-a-file-with-the-media-player-trough-a-ui/2708398/19 "2026-03-27T18:34:03Z")

</div>

I finally solved it. You need to add the MediaSoundComponent at runtime for some reason. But now it works. I can now play my .WAV file from a UI. Although the old code should have worked as well. So I still think its a bug.

 ![Screenshot 2026-03-27 193154](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/a/f/2afb92f4b3f0e4779afa024525617f6cc8c861e8.png)
