CRIWARE Unity Plugin Manual  Last Updated: 2024-07-12
CriManaMovieController Class Reference

A component to be attached to a GameObject for playing movies. More...

Inheritance diagram for CriManaMovieController:
CriManaMovieMaterial

Public Types

enum  MaxFrameDrop
 Maximum frame drop number type
 
enum  RenderMode
 Material rendering mode type More...
 

Public Member Functions

delegate void OnApplicationPauseCallback (CriManaMovieMaterialBase manaMovieMaterial, bool appPause)
 Callback delegate on application pause More...
 
void Play ()
 Start playback. More...
 
void Stop ()
 Requests to stop movie playback. More...
 
void Pause (bool sw)
 Pauses/unpauses the movie playback. More...
 
void PlayerManualInitialize ()
 Initializes the player (for manual) More...
 
void PlayerManualFinalize ()
 Terminates the player (for manual) More...
 
void PlayerManualSetup ()
 Prepares the player (for manual) More...
 
void PlayerManualUpdate ()
 Updates the player frame (for manual) More...
 

Public Attributes

Renderer target
 A UnityEngine.Renderer to which the movie Material is set. More...
 
bool useOriginalMaterial
 Whether to display the original Material when movie frames are not available. More...
 
bool playOnStart = false
 Sets whether to play at Start. More...
 
bool restartOnEnable = false
 A setting whether to play from the start on OnEnable. More...
 
RenderMode renderMode = RenderMode.Always
 Material rendering mode More...
 
OnApplicationPauseCallback onApplicationPauseCallback = null
 Callback on application pause More...
 

Protected Member Functions

virtual void OnMaterialUpdated ()
 A method called when a new frame is fed to the Material. More...
 

Properties

string moviePath [get, set]
 The file path for streaming playback at Start. More...
 
bool loop [get, set]
 Loop setting for movie playback at Start. More...
 
bool audioBaseConcatenation [get, set]
 Setting for the audio-based adjustment of the starting time when using concatenated playback. More...
 
bool advancedAudio [get, set]
 Switches to the Advanced Audio mode. More...
 
bool ambisonics [get, set]
 Enables the playback of movies with Ambisonic sound. More...
 
bool additiveMode [get, set]
 Additive synthesis mode setting at Start. More...
 
bool applyTargetAlpha [get, set]
 Sets whether to apply the object transparency. More...
 
bool uiRenderMode [get, set]
 Specifies whether shader settings for UI components are applied. More...
 
MaxFrameDrop maxFrameDrop [get, set]
 Sets the maximum number of frame drops. More...
 
bool isMaterialAvailable [get]
 Whether movie frames can be rendered with CriManaMovieMaterial::material More...
 
CriMana.Player player [get]
 Playback control player More...
 
Material material [get, set]
 Sets the Material for feeding the movie. More...
 

Detailed Description

A component to be attached to a GameObject for playing movies.

Description:
A component to be attached to a GameObject for playing movies.
The movie is displayed by setting a Material to UnityEngine.Renderer.
It inherits CriManaMovieMaterial.
Note:
In this class, you can only perform basic operations such as play, stop, or pause.
If you want to perform complicated playback control, operate the core player using the player property.

Member Enumeration Documentation

enum RenderMode
stronginherited

Material rendering mode type

Description:
A type which indicates how the video should be rendered on the Material.
  • Always: Draw every frame.
  • OnVisibility: Renders if the GameObject is the rendering target (if active for UI.Graphic).
  • Never: Do not render. You must explicitly call CriManaMovieMaterial::RenderMovie to do the rendering.

Member Function Documentation

delegate void OnApplicationPauseCallback ( CriManaMovieMaterialBase  manaMovieMaterial,
bool  appPause 
)
inherited

Callback delegate on application pause

Description:
A callback delegate called at the time of suspend/resume or when the application pauses such as by pressing the pause button while running the Editor.
void Play ( )
inlineinherited

Start playback.

Description:
Starts movie playback.
When playback starts, the status ( CriWare.CriMana::Player::Status ) changes to Playing.
Note:
After calling this function, it takes several frames before the rendering of movie actually starts.
If you want to synchronize the movie playback, instead of using this function, access the player property, and prepare for playback in advance using the CriMana::Player::Prepare function.
See also
CriManaMovieMaterial::Stop, CriMana::Player::Status
void Stop ( )
inlineinherited

Requests to stop movie playback.

Description:
Issues a request to stop movie playback. This function returns immediately.
The rendering ends immediately when you call this function, but the playback does not stop immediately.
See also
CriMana::Player::Status
void Pause ( bool  sw)
inlineinherited

Pauses/unpauses the movie playback.

Parameters
swPause switch (true: pause, false: resume)
Description:
Turns the pause on and off.
Pauses the playback if the argument is true, resumes the playback if it is false.
The pause state will be cleared when CriManaMovieMaterial::Stop is called.
virtual void OnMaterialUpdated ( )
inlineprotectedvirtualinherited

A method called when a new frame is fed to the Material.

Description:
A method called when a new frame is fed to the Material.
It is supposed to be overridden in the inherited class.
void PlayerManualInitialize ( )
inlineinherited

Initializes the player (for manual)

Description:
Manually initializes the player.
Note:
Since it is usually called from the Awake function, it is not required to call this function separately.
Use this function only if you want to perform initialization manually for editor extension etc.
void PlayerManualFinalize ( )
inlineinherited

Terminates the player (for manual)

Description:
Manually terminates the player.
Note:
This function is called from OnDestroy(), therefore it is not necessary to call it manually.
Call this function only when you want to perform initialization manually (e.g., for editor customization).
void PlayerManualSetup ( )
inlineinherited

Prepares the player (for manual)

Description:
Manually prepares the player.
Note:
Since it is usually called from the Start function, it is not required to call this function separately.
Use this function if you want perform preparation manually for editor extension etc.
void PlayerManualUpdate ( )
inlineinherited

Updates the player frame (for manual)

Description:
Manually updates the player frame.
Note:
Since it is usually called from the Update function, it is not required to call this function separately.
Use this function if you want update frames manually for editor extension etc.

Member Data Documentation

Renderer target

A UnityEngine.Renderer to which the movie Material is set.

Description:
A UnityEngine.Renderer to which the movie Material is set.
If not specified, UnityEngine.Renderer of the attached game object is used.
bool useOriginalMaterial

Whether to display the original Material when movie frames are not available.

Description:
Whether to display the original material when a movie frame is not available.
true : display the original material when a movie frame is not available.
false : disable the rendering of the target when a movie frame is not available.
bool playOnStart = false
inherited

Sets whether to play at Start.

Description:
Specifies whether playback is to be performed on Start. The default value is false.
bool restartOnEnable = false
inherited

A setting whether to play from the start on OnEnable.

Description:
If true, the playback will start over from the beginning when a component is disabled during playback and then re-enabled.
The default value is false.
RenderMode renderMode = RenderMode.Always
inherited

Material rendering mode

Description:
Sets how the video is rendered for the Material.
Note:
On some platforms (PC/iOS, etc.), rendering is always done regardless of this setting.
OnApplicationPauseCallback onApplicationPauseCallback = null
inherited

Callback on application pause

Description:
Sets the processing when the application is paused/resumed.
The behavior if not set (when null is specified) is "paused at start, resumed at end (remains paused if it was already paused at the)".
If you want to change the above behavior in the application side, set your own callback process in this property.

Property Documentation

string moviePath
getsetinherited

The file path for streaming playback at Start.

Parameters
filePathFile path
Description:
The file path for streaming playback at Start.
  • If a relative path is specified, the file is loaded relative to StreamingAssets folder.
  • The file is loaded using the absolute path, or the specified path if a URL is specified.
Note:
To set the file path from the script, use the CriMana::Player::SetFile method etc. of the player property.
This property is provided to set the file path for streaming playback at Start on the Inspector. Changing this property after Start does not apply to the next playback.
bool loop
getsetinherited

Loop setting for movie playback at Start.

Description:
Loop setting applied on Start of a movie playback. The default value is false.
Note:
To set the loop from the script, use the CriMana::Player::Loop method of the player property.
This property is provided to set the loop at Start on the Inspector.
Changing this property after Start does not apply to the next playback.
bool audioBaseConcatenation
getsetinherited

Setting for the audio-based adjustment of the starting time when using concatenated playback.

Description:
Flag to enable the audio-based adjustment of the starting time when using concatenated playback.

 

Note:
To set a loop from script, use the CriMana.Player.SetAudioBaseConcatenation method of the player property.
This property can be set via the inspector to enable/disable looping at Start.
If this property is changed after Start, it will not apply to the current playback.
bool advancedAudio
getsetinherited

Switches to the Advanced Audio mode.

Description:
Advanced audio playback features are available when the Advanced Audio mode is enabled. The default value is true.
For example, it is necessary to enable this mode to play movies with Ambisonic audio.
bool ambisonics
getsetinherited

Enables the playback of movies with Ambisonic sound.

Description:
A property to enable the playback of movies with Ambisonic sound.
Only available when Advanced Audio mode is enabled.
Note:
When enabling this mode, a GameObject called Ambisonic Source is created as a child object.
The CriManaAmbisonicSource component is attached to this Ambisonic Source object.
bool additiveMode
getsetinherited

Additive synthesis mode setting at Start.

Description:
Additive mode setting applied on Start of a movie playback. The default value is false.
Note:
To set the additive synthesis mode from the script, use the CriMana::Player::additiveMode property of the player property.
This property is provided to set the additive synthesis mode at Start on the Inspector.
Changing this property after Start does not apply to the next playback.
bool applyTargetAlpha
getsetinherited

Sets whether to apply the object transparency.

Description:
Sets whether the movie will be transparent according to the transparency of the attached object.
The default value is false.
bool uiRenderMode
getsetinherited

Specifies whether shader settings for UI components are applied.

Description:
Sets whether to apply the rendering settings for UI components to the shader that renders the movie.
The default value is false.
MaxFrameDrop maxFrameDrop
getsetinherited

Sets the maximum number of frame drops.

Description:
Sets the maximum number of frames to be dropped in one update if the update of rendered frames is not keeping up with the playback.
This allows intended playback if the frame rate of the application is low or when the playback speed of the video is raised higher than the frame rate.
bool isMaterialAvailable
getinherited

Whether movie frames can be rendered with CriManaMovieMaterial::material

Description:
Indicates whether movie frames can be rendered with CriManaMovieMaterial::material.
CriMana.Player player
getinherited

Playback control player

Description:
A player property for fine movie playback control.
If you want to perform operations other than Start/Stop/Pause, use the CriMana::Player API via this property.
Material material
getsetinherited

Sets the Material for feeding the movie.

Description:
If you set a Material, the movie is fed to that Material.
If you do not set a Material, a Material to which the movie is fed is created.
Note:
If you set a Material, it must be set before the Start method is called.

The documentation for this class was generated from the following file: