Programming
Fundamentals
Setting Up Development Environment
UnigineScript
High-Level Systems
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine and Tools
GUI
Double Precision Coordinates
API
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
Math Functionality
Node-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
Rendering-Related Classes

Unigine::WidgetSpriteVideo Class

Header:#include <UnigineWidgets.h>
Inherits:WidgetSprite

This class is used to create a virtual monitor that plays a video file. It can be synchrozied with playback of the ambient sound or the directional sound source.

WidgetSpriteVideo Class

Members


static WidgetSpriteVideoPtr create(const Ptr<Gui> & gui, const char * name = 0, int mode = 1)

Constructor. Creates a new sprite that plays video.

Arguments

  • const Ptr<Gui> & gui - GUI, to which the new sprite will belong.
  • const char * name - Path to a video file.
  • int mode - YUV flag: 1 if convertion to RGB should be performed by the GPU, 0 - if by the CPU.

Ptr<WidgetSpriteVideo> cast(const Ptr<Widget> & widget)

Arguments

  • const Ptr<Widget> & widget

void setAmbientSource(const Ptr<AmbientSource> & source)

Synchronizes video playback to the ambient sound source playback.

Arguments

  • const Ptr<AmbientSource> & source - Ambient sound source according to which video playback will be synchronized.

Ptr<AmbientSource> getAmbientSource()

Returns the ambient sound source according to which video playback is synchronized.

Return value

Ambient sound source.

void setLoop(int loop)

Sets a value indicating if the video should be looped.

Arguments

  • int loop - Positive number to loop the video, 0 to play it only once.

int getLoop()

Returns a value indicating if the video is looped.

Return value

Positive number if the video is looped; otherwise, 0.

int isPlaying()

Returns a value indicating if the video is being played at the moment.

Return value

1 if the video is being played; otherwise, 0.

void setSoundSource(const Ptr<SoundSource> & source)

Synchronizes video playback to the sound source playback.

Arguments

  • const Ptr<SoundSource> & source - Sound source according to which video playback will be synchronized.

Ptr<SoundSource> getSoundSource()

Returns the sound source according to which video playback is synchronized.

Return value

Sound source.

int isStopped()

Returns a value indicating if the video is stopped at the moment.

Return value

1 if the video is stopped; otherwise, 0.

void setVideoTime(float time)

Rewinds or fast-forwards the video to a given time.

Arguments

  • float time - Time in seconds.

float getVideoTime()

Returns the time of the currently played frame.

Return value

Time in seconds.

void setYUV(int yuv)

Sets a flag for YUV conversion.

Arguments

  • int yuv - Mode flag: 1 if convertion to RGB should be performed by the GPU, 0 if it is converted by the CPU.

int getYUV()

Returns a flag for YUV conversion.

Return value

1 if convertion to RGB is performed by the GPU, 0 if it is converted by the CPU.

void play()

Starts playing video.

void stop()

Stops playing video. This function saves the playback position so that playing of the file can be resumed from the same point.
Last update: 2017-07-03