# How to receive a media player event in C++

**URL:** <https://forums.unrealengine.com/t/how-to-receive-a-media-player-event-in-c/427749>\
**Category:** Cinematics & Media\
**Tags:** unreal-engine, UE4, CPP, question, function-signature\
**Created:** [June 20, 2018, 12:17am UTC](https://forums.unrealengine.com/t/how-to-receive-a-media-player-event-in-c/427749 "2018-06-20T00:17:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![eagletree](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@eagletree](https://forums.unrealengine.com/u/eagletree)\
**Post date:** [June 20, 2018, 12:17am UTC](https://forums.unrealengine.com/t/how-to-receive-a-media-player-event-in-c/427749/1 "2018-06-20T00:17:36Z")

</div>

I have a C++ routine to launch a media player video on a media plane. What I don’t seem to be able to do, is receive the event broadcast to blueprints when the video is done playing. Is there a way to register one of my C++ functions to receive the event Media player generates (OnEndReached, or EMediaEvent::PlaybackEndReached in MediaPlayer.cpp) to notify the class that the video is done?

I was thinking this would be something like when you AddDynamic for a collision handler? I couldn’t find anything in MediaPlayer.cpp to allow me to do this.

---

<div class="post-metadata">

**Author:** ![eagletree](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@eagletree](https://forums.unrealengine.com/u/eagletree)\
**Post date:** [June 24, 2018, 5:01pm UTC](https://forums.unrealengine.com/t/how-to-receive-a-media-player-event-in-c/427749/2 "2018-06-24T17:01:44Z")

</div>

I had to give up and use a blueprint solution. By referencing the media player in the blueprint, I can get the OnEndReached for the video started within the C++ class. That blueprint event then calls a function within it’s parent C++ class to signal the end of the video. I am not sure why this works, but it’s functional.

If there is a real solution that anyone knows of, please let me know. There are some sections of our game where for development coordination purposes, I need to be able to do pure C++. The modeler does the blueprint work and trying to merge any changes I have for the blueprints is very error prone because it may be weeks before I get the prime copy of the game back and then have to remember all the little blueprint hacks I made. It would be far more convenient to receive the media player events directly in C++.
