Certain Videos are not working

So all of my videos are on their own interactable widget. The player clicks on one of these widgets and a video that is tied to that specific is supposed to play. However, it does not play for all of them. What would be the best way to make all of these videos work?

Hi Al,

Are all the videos the same file format? If so, I wonder if the videos play individually. (Outside of the widget context in a new/different level)

Welcome to the Forums.

Thank You!

They are in the same format but they are all on the same media player. 5/15 videos work. I wonder if it is something about finding the specific videos when called on because the blueprint to play these videos on click says the video is null when I check my stack trace.

I was working on a gallery a while back and decided to code in a player per instance, it raised stability of playback.

This is the setup to instantiate it in pure c++ on beginplay

in .h needed parameters

includes:
#include “Engine/Texture2D.h”
#include “MediaTexture.h”
#include “MediaPlayer.h”
#include “StreamMediaSource.h”
#include “MediaPlayerFacade.h”
#include “Engine/Texture2DDynamic.h”

UPROPERTIES:



	UPROPERTY(EditAnywhere, BlueprintReadWrite)
		UMediaTexture* VideoTexture;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
		UStreamMediaSource* VideoSource;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
		UMediaPlayer* VideoPlayer;

in .cpp

// Called when the game starts or when spawned

void AHttpActor::BeginPlay()
{
	Super::BeginPlay();	
	VideoPlayer = NewObject<UMediaPlayer>();
	VideoPlayer->SetLooping(true);
	VideoTexture = NewObject<UMediaTexture>();
	VideoTexture->SetDefaultMediaPlayer(VideoPlayer);
	VideoTexture->SetMediaPlayer(VideoPlayer);
	VideoTexture->UpdateResource();
}

Then the setup in bp and needed material


It was a while ago but I remember a single player would cause problems.

This way you should have unhindered instances that don’t interfere with each other.