Yureka LogoDocs

Media Viewer

The Media Viewer is a hybrid application designed to visualize image files and play back video files seamlessly from the Virtual Filesystem.

Core Features

  • Automatic media switching based on file extensions.
  • Support for image displaying (Textures).
  • Support for video playback (Media Player & Media Texture).

Architecture & Dependencies

The UMediaViewerApp controller acts as a bridge.

  • It relies on UVirtualFilesystemSubsystem to resolve the actual disk path of media assets if they are referenced by VFS virtual paths.
  • The heavy lifting is done within the UMG widget (MediaViewerWidgetClass), which uses Unreal's UMediaPlayer to render video content, responding to the OnMediaLoaded(const FString& VFSPath) event fired by the C++ controller.

Technical Details

  • Controller Class: UMediaViewerApp (Inherits from UAppBase)
  • View Target: User must assign a UMG Widget to MediaViewerWidgetClass.
  • Window Specs:
    • Initial Size: 800x600
    • Resizable: true
    • Maximizable: true
  • Key Methods:
    • OpenMedia(const FString& VFSPath): Instructs the app to load and display the requested media.
    • GetCurrentMediaPath(): Returns the currently opened virtual file.
  • Key Events:
    • OnMediaLoaded: A Blueprint Implementable Event that the UMG widget must hook into to actually mount the texture or start the media player stream.