Untitled

 avatar
unknown
c_cpp
2 years ago
1.1 kB
7
Indexable
// All Rights Reserved

#pragma once

#include "CoreMinimal.h"
#include "Components/ActorComponent.h"

#include "MediaPlayerComponent.generated.h"

class UMediaSoundComponent;
class UMediaPlayer;

UCLASS(ClassGroup=(Custom), meta=(BlueprintSpawnableComponent))
class VSIDE_API UMediaPlayerComponent : public UActorComponent
{
	GENERATED_BODY()

	UMediaPlayerComponent();
	
	UFUNCTION()
	void OnStreamOpened(FString OpenedUrl);

	UFUNCTION()
	void OnStreamOpenFailed(FString FailedUrl);

	UFUNCTION()
	void OnStreamClosed();

	UFUNCTION()
	void OnStreamPaused();

	UFUNCTION()
	void OnStreamResumed();

protected:
	UPROPERTY(BlueprintReadOnly, EditInstanceOnly)
	TObjectPtr<UMediaSoundComponent> MediaSoundComponent;

	UPROPERTY(BlueprintReadOnly, EditInstanceOnly)
	TObjectPtr<UMediaPlayer> MediaPlayer;

public:
	UFUNCTION(BlueprintCallable)
	void FadeIn();

	UFUNCTION(BlueprintCallable)
	void FadeOut();

	UFUNCTION(BlueprintCallable)
	void PlayURL(const FString& URL);
	
	UFUNCTION(BlueprintCallable)
	void Stop();
};
Editor is loading...