CommonUI.VideoPlayer.PreviewStepSize
CommonUI.VideoPlayer.PreviewStepSize
#Overview
name: CommonUI.VideoPlayer.PreviewStepSize
This variable is created as a Console Variable (cvar).
- type:
Var
- help: ``
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of CommonUI.VideoPlayer.PreviewStepSize is to control the step size for previewing video content in the CommonUI video player within the Unreal Engine editor.
This setting variable is primarily used by the CommonUI plugin, specifically in the CommonUIEditor module. It is utilized in the video player customization for the editor interface.
The value of this variable is set using an FAutoConsoleVariableRef, which allows it to be modified at runtime through the console. It is initialized with a default value of 0.25f.
The associated variable VideoPlayerPreviewStepSize directly interacts with CommonUI.VideoPlayer.PreviewStepSize. They share the same value, with VideoPlayerPreviewStepSize being the actual float variable used in the code.
Developers should be aware that this variable affects the behavior of the video player in the editor, specifically the step size when using the forward and backward controls. Changing this value will alter the amount of time skipped when using these controls.
Best practices when using this variable include:
- Adjusting the value based on the typical length of videos being worked with in the project.
- Keeping the value reasonably small for precise control, but large enough for efficient navigation through longer videos.
- Using the console variable to experiment with different values during development without needing to recompile code.
Regarding the associated variable VideoPlayerPreviewStepSize:
The purpose of VideoPlayerPreviewStepSize is to provide a direct, in-code reference to the step size value used by the video player preview controls.
This variable is used within the CommonUIEditor module, specifically in the FCommonVideoPlayerCustomization class.
The value of VideoPlayerPreviewStepSize is set through the FAutoConsoleVariableRef mechanism, which binds it to the CommonUI.VideoPlayer.PreviewStepSize console variable.
VideoPlayerPreviewStepSize interacts directly with the video player object, being used in the HandleBackwardStep and HandleForwardStep functions to determine the amount of time to seek when these controls are activated.
Developers should be aware that modifying VideoPlayerPreviewStepSize directly in the code will not persist across editor sessions, as its value is controlled by the console variable.
Best practices for using VideoPlayerPreviewStepSize include:
- Avoiding direct modification of the variable in code, instead using the console variable for adjustments.
- Considering the variable’s value when implementing custom video player controls or functionality.
- Documenting any dependencies on this variable in custom code to ensure consistency if the step size is changed.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Plugins/Runtime/CommonUI/Source/CommonUIEditor/Private/CommonVideoPlayerCustomization.cpp:11
Scope: file
Source code excerpt:
float VideoPlayerPreviewStepSize = 0.25f;
FAutoConsoleVariableRef CVarVideoPlayerPreviewStepSize(
TEXT("CommonUI.VideoPlayer.PreviewStepSize"),
VideoPlayerPreviewStepSize,
TEXT(""));
TSharedRef<IDetailCustomization> FCommonVideoPlayerCustomization::MakeInstance()
{
return MakeShareable(new FCommonVideoPlayerCustomization());
#Associated Variable and Callsites
This variable is associated with another variable named VideoPlayerPreviewStepSize
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Plugins/Runtime/CommonUI/Source/CommonUIEditor/Private/CommonVideoPlayerCustomization.cpp:9
Scope: file
Source code excerpt:
#include "Modules/ModuleManager.h"
float VideoPlayerPreviewStepSize = 0.25f;
FAutoConsoleVariableRef CVarVideoPlayerPreviewStepSize(
TEXT("CommonUI.VideoPlayer.PreviewStepSize"),
VideoPlayerPreviewStepSize,
TEXT(""));
TSharedRef<IDetailCustomization> FCommonVideoPlayerCustomization::MakeInstance()
{
return MakeShareable(new FCommonVideoPlayerCustomization());
}
#Loc: <Workspace>/Engine/Plugins/Runtime/CommonUI/Source/CommonUIEditor/Private/CommonVideoPlayerCustomization.cpp:114
Scope (from outer to inner):
file
function FReply FCommonVideoPlayerCustomization::HandleBackwardStep
Source code excerpt:
FReply FCommonVideoPlayerCustomization::HandleBackwardStep()
{
VideoPlayer->Seek(VideoPlayer->GetPlaybackTime() - VideoPlayerPreviewStepSize);
return FReply::Handled();
}
FReply FCommonVideoPlayerCustomization::HandleForwardStep()
{
VideoPlayer->Seek(VideoPlayer->GetPlaybackTime() + VideoPlayerPreviewStepSize);
return FReply::Handled();
}
FReply FCommonVideoPlayerCustomization::HandleGoToEndClicked()
{
VideoPlayer->Seek(VideoPlayer->GetVideoDuration());