Media source C++ not visible in BP

Hi all,

I’ve been trying to get a custom C++ class, derived from StreamMediaSource to work with my BP based display logic.
I am using a C++ MediaSource in order to add some functions that return the URL to stream. This is done in order to overwrite the single URL that is allowed in the default BP media Source.

My Header file:

UCLASS(BlueprintType)
class DRX_API UMyStreamMediaSource : public UStreamMediaSource
{
	GENERATED_BODY()
		

	//public:

	//UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "StreamingMedia")
	//TArray<FString> FilesFound;

	UFUNCTION(BlueprintCallable, Category = "StreamingMedia")
	void GetAllStreamingFilesInDir();

	UFUNCTION(BlueprintCallable, Category = "StreamingMedia")
	void SetFileToStream();

};

I also tried:

UCLASS(meta = (BlueprintSpawnableComponent))

Could you guys help me understand why this is not showing up as a selectable StreamMediaSource in BP.

Cheers

I can’t see anything wrong with your code. The only thing I can think of is that your module is not actually loaded, so your UObject class isn’t being discovered.

Hi, thanks for your comment: I Figured something like this was happening, i cant create an new instance of this class in the content browser, instancing/creating it as a BP class is allowed, but not recognized as a mediaSource(object) when i try to add it to a array of media sources. I can’t find any good documentation on how to actually create it as the class it is, or it’s derived from, instead of a BP class.

BlueprintType is all that should be needed.

When manipulating an array of media sources in BP, make sure that the type of the array is MediaSource, which is the base class of all media sources. If you only manage stream media sources, the type can also be StreamMediaSource.

See my [NdiMedia plug-in][2] where I implement a new media source as well. Make sure that your plug-in module’s Build.cs file has a [dependency to the MediaAssets module][3]. Also make sure that your plug-in compiled successfully and is enabled. Verifythat your plug-in’s module is actually loaded. Note that the new media source can be found by both the Editor and the BP Editor.

Did you try Blueprintable or any other specifiers that might help other than the two you mention in your post?