Media player scrub through functionality support

Hi,

I’m working on a iOS app that needs to consume video and handle touch gestures to scrub through a video. To achieve that, I import the video uncompressed as an image sequence (img media source), use a media player, media texture and material to render it to a widget. I have attached a slider and using play, pause and seek functionality I managed to achieve the result. However, when I try to set the value of the seek component through the pawn/component, there’s a significant lag and it only jumps to the frame when the input is complete (check below). When logging the values however to the log, the values are continuous and as intended. Initially, I attempted to go through the play/seek/pause directly and set the slider value directly (which triggers the event on value changed). Lastly, as seen below, I also tried to set the value on tick. However the issue still persists. Additionally, I would also like to make it work with compressed videos like an .mp4, so that it’s TestFlight/AppStore friendly. Could you let me know if there are any tips/pointers/recommendations for this?

[Image Removed]

Kind regards,

Lefteris

Steps to Reproduce

  1. Import an Img File Source
  2. Create a media player with a media texture
  3. Create a material using the media texture to render the media player output
  4. Assign the material to an image widget component.
  5. In the player pawn blueprint, use the enhanced input system to handle touch input and call the play/seek/pause sequence on the widget component, mapping the touch input value to the desired duration of the video.

Hi [mention removed],

This behavior depends on how your MediaPlayer is configured. If you’re using the Electra Player (which is enabled via plugin), it does exhibit the issue you’re describing. For comparison, the Windows Media Foundation (used on Windows platforms) tends to flush content more frequently due to its implementation.

If you’re open to modifying the engine’s source code, it’s definitely possible to achieve the behavior you’re looking for. That said, it will likely require changes within the MediaPlayer implementation itself.

Let me know if you’re comfortable going down that path—I’d be happy to assist with the necessary changes.

Best,

Joan

Hi Joan,

Thank you for your response. This is also noted when running on Windows, although in a lesser degree, but the aim is to have support both windows and iOS builds. I would be fine with working with a custom build of the engine for this, so any pointer on how to modify the MediaPlayer class would be much appreciated.

Kind regards,

Lefteris

Great Lefteris! I’ll take a look at it and see what I can get. I’ll let you know shortly.

Best,

Joan

Hi [mention removed]​,

After digging through the engine source, it looks like there may be limitations in how the current system handles and caches video playback data—particularly in scenarios involving scrubbing or jumping backward. Based on this, I believe there’s a more suitable alternative in Unreal Engine that could help with your issue.

Unreal provides the Img Media Source asset, which allows you to reference a directory containing an image sequence (i.e., one image per video frame). When used in a Level Sequence, this approach enables precise frame access, including smooth backward/forward scrubbing, as each frame is already available individually.

Description inside the ImgMediaSource class, you can see here the compatible formats:

/*Image sequence media sources point to a directory that contains a series of image files in which each image represents a single frame of the sequence. BMP, EXR, PNG and JPG images are currently supported. EXR image sequences are optimized for performance. The first frame of an image sequence is used to determine the image dimensions (all formats) and frame rate (EXR only).*/

Epic oficial documentation:

https://dev.epicgames.com/documentation/en-us/unreal-engine/cinematic-movie-media-track-in-unreal-engine

I tested this method myself and it resolved the issue you described. It’s relatively quick to try—shouldn’t take more than 30 minutes to set up. Let me know if it solved your issue.

Best Regards,

Joan