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

A wrapper class for native player that controls the movie playback. More...

Inherits CriDisposable.

Public Types

enum  Status {
  Stop, Dechead, WaitPrep, Prep,
  Ready, Playing, PlayEnd, Error,
  StopProcessing, ReadyForRendering
}
 A value indicating the player status. More...
 
enum  SetMode { New, Append, AppendRepeatedly }
 A mode for setting files. More...
 
enum  MovieEventSyncMode { FrameTime, PlayBackTime }
 Synchronization mode for movie events (Cue points, subtitles). More...
 
enum  AudioTrack { Off, Auto }
 A mode when setting the audio track. More...
 
enum  TimerType : int {
  None = 0, System = 1, Audio = 2, User = 3,
  Manual = 4
}
 Timer type. More...
 

Public Member Functions

delegate void CuePointCallback (ref EventPoint eventPoint)
 A Cue point callback delegate type. More...
 
delegate void StatusChangeCallback (Status status)
 A delegate type for the callback when the player status changes. More...
 
delegate void SubtitleChangeCallback (IntPtr subtitleBuffer)
 Delegate type of subtitle information update callback More...
 
delegate UnityEngine.Shader ShaderDispatchCallback (MovieInfo movieInfo, bool additiveMode)
 A shader selection delegate type. More...
 
override void Dispose ()
 Discards the player object More...
 
void CreateRendererResource (int width, int height, bool alpha)
 Generates the resources required for movie rendering. More...
 
void DisposeRendererResource ()
 Discards the resources required for rendering movie. More...
 
void Prepare ()
 Prepares for playback. More...
 
void PrepareForRendering ()
 Prepares for playback. More...
 
void Start ()
 Start playback. More...
 
void Stop ()
 Requests to stop movie playback. More...
 
void StopForSeek ()
 Requests to stop movie playback. More...
 
void Pause (bool sw)
 Pauses/unpauses the movie playback. More...
 
bool IsPaused ()
 Gets the pausing status of the movie playback. More...
 
bool SetFile (CriFsBinder binder, string moviePath, SetMode setMode=SetMode.New)
 Sets the file path of the streaming playback. More...
 
bool SetData (IntPtr data, System.Int64 dataSize, SetMode setMode=SetMode.New)
 Sets the data for memory playback. More...
 
bool SetData (byte[] data, System.Int64 datasize, SetMode setMode=SetMode.New)
 
bool SetContentId (CriFsBinder binder, int contentId, SetMode setMode=SetMode.New)
 Specifies the movie file in the CPK file. (Specify content ID) More...
 
bool SetFileRange (string filePath, System.UInt64 offset, System.Int64 range, SetMode setMode=SetMode.New)
 Specifies the movie file in the pack file. (File range specified) More...
 
void Loop (bool sw)
 Switching on/off the movie playback loop. More...
 
void SetAudioBaseConcatenation (bool enabled)
 Set the flag for the audio-based adjustment of the starting time when using concatenated playback. More...
 
void SetMasterTimerType (TimerType timerType)
 Sets the master timer type. More...
 
void SetSeekPosition (int frameNumber)
 Sets the seek position. More...
 
void SetMovieEventSyncMode (MovieEventSyncMode mode)
 Sets the sync mode for movie events (Cue points, subtitles). More...
 
void SetSpeed (float speed)
 Adjusts the movie playback speed. More...
 
void SetMaxPictureDataSize (System.UInt32 maxDataSize)
 Specifies the maximum picture data size More...
 
void SetBufferingTime (float sec)
 Specify the buffering time for the input data. More...
 
void SetMinBufferSize (int min_buffer_size)
 Specify the minimum buffer size. More...
 
void SetAudioTrack (int track)
 Sets the Main Audio Track number. More...
 
void SetSubAudioTrack (int track)
 Sets the sub audio track number. More...
 
void SetExtraAudioTrack (int track)
 Sets the extra audio track number. More...
 
void SetVolume (float volume)
 Adjusts the sound volume for movie playback. (Main Audio Track) More...
 
float GetVolume ()
 Gets the volume of the movie playback. (Main audio track) More...
 
void SetSubAudioVolume (float volume)
 Adjusts the sound volume for movie playback. (sub audio) More...
 
float GetSubAudioVolume ()
 Gets the volume of the movie playback. (Sub-audio track) More...
 
void SetExtraAudioVolume (float volume)
 Adjusts the sound volume for movie playback. (extra audio) More...
 
float GetExtraAudioVolume ()
 Gets the volume of the movie playback. (Extra audio track) More...
 
void SetBusSendLevel (string bus_name, float level)
 Adjusts the Bus Send Level of the Main Audio Track. More...
 
void SetSubAudioBusSendLevel (string bus_name, float volume)
 Adjusts the Bus Send Level of the sub audio track. More...
 
void SetExtraAudioBusSendLevel (string bus_name, float volume)
 Adjusts the Bus Send Level of the extra audio track. More...
 
void SetSubtitleChannel (int channel)
 Sets the subtitle channel. More...
 
void SetShaderDispatchCallback (ShaderDispatchCallback shaderDispatchCallback)
 Sets the shader selection delegate. More...
 
long GetTime ()
 Gets the playback time. More...
 
int GetDisplayedFrameNo ()
 Gets the frame number being displayed. More...
 
bool HasRenderedNewFrame ()
 Checks whether a new frame was rendered. More...
 
void SetAsrRackId (int asrRackId)
 Configures the ASR Rack. More...
 
void SetTimeStretchQuality (float quality)
 Adjust the quality of the audio time-stretch. More...
 
void UpdateWithUserTime (ulong timeCount, ulong timeUnit)
 Updates the status by specifying the user time. More...
 
void SetManualTimerUnit (ulong timeUnitN, ulong timeUnitD)
 Sets the unit by which the time of the manual timer advances. More...
 
void UpdateWithManualTimeAdvanced ()
 Updates while advancing the time of the manual timer. More...
 
void Update ()
 Updates the status. More...
 
void SyncMasterTimer ()
 Synchronize the time to the master timer. More...
 
bool UpdateMaterial (UnityEngine.Material material)
 Sets up the Material to display the current frame. More...
 
void PauseOnApplicationPause (bool sw)
 Assign pause status based on the changes in the application status. More...
 

Public Attributes

CuePointCallback cuePointCallback
 A Cue point callback delegate. More...
 
StatusChangeCallback statusChangeCallback
 A delegate for the callback when the player status changes. More...
 

Properties

bool additiveMode [get, set]
 Sets the blend mode to additive composition mode. More...
 
int maxFrameDrop [get, set]
 Sets the maximum number of frame drops. 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...
 
bool isFrameAvailable [get]
 Whether a valid frame is held More...
 
MovieInfo movieInfo [get]
 Gets the information on the movie being played. More...
 
FrameInfo frameInfo [get]
 Gets the frame information of the movie being played. More...
 
Status status [get]
 Gets the player status. More...
 
Status nativeStatus [get]
 Gets the status of the internal handle. More...
 
System.Int32 numberOfEntries [get]
 Gets the number of seamless playback entries. More...
 
System.IntPtr subtitleBuffer [get]
 Gets the pointer to the subtitle data buffer. More...
 
int subtitleSize [get]
 Gets the size of the subtitle data buffer. More...
 
CriAtomExPlayer atomExPlayer [get]
 Gets the CriAtomExPlayer handle. More...
 
CriAtomExPlayer subAtomExPlayer [get]
 Get the CriAtomExPlayer handle (sub audio track) More...
 
CriAtomExPlayer extraAtomExPlayer [get]
 Get the CriAtomExPlayer handle (extra track) More...
 
CriManaMoviePlayerHolder playerHolder [get, set]
 Object to hold the player. More...
 

Events

SubtitleChangeCallback OnSubtitleChanged
 Callback function for subtitle information update More...
 

Detailed Description

A wrapper class for native player that controls the movie playback.

Description:

In general, it is used by extracting it from the CriManaMovieController or CriManaMovieControllerForUI component. Use this class when you want to perform complicated playback control beyond stopping/pausing playback.
If you want to control movie playback directly without using a component, you can directly generate this object and use it.
Note:
If you directly create an object of this class from the application, be sure to discard it using the Player::Dispose function after completing playback.

Member Enumeration Documentation

enum Status
strong

A value indicating the player status.

See also
Player::status
Enumerator
Stop 

Stopped

Dechead 

The header is under analysis

WaitPrep 

Buffering start stopped

Prep 

Preparing for playback

Ready 

Playback preparation completed

Playing 

Playing

PlayEnd 

Playback completed

Error 

Error

StopProcessing 

Being stopped

ReadyForRendering 

Rendering preparation completed

enum SetMode
strong

A mode for setting files.

See also
Player::SetFile, Player::SetContentId, Player::SetFileRange
Enumerator
New 

Specifies the movie to use in the next playback

Append 

Adds to the concatenated playback Cue

AppendRepeatedly 

Adds repeatedly until the next movie is enCued in the concatenated playback Cue

enum MovieEventSyncMode
strong

Synchronization mode for movie events (Cue points, subtitles).

See also
Player::SetMovieEventSyncMode
Enumerator
FrameTime 

Synchronizes to the frame time

PlayBackTime 

Synchronizes to the playback time based on the timer type

enum AudioTrack
strong

A mode when setting the audio track.

See also
Player::SetAudioTrack, Player::SetSubAudioTrack
Enumerator
Off 

A value specifying the audio playback OFF

Auto 

Default value for audio track

enum TimerType : int
strong

Timer type.

See also
Player::SetMasterTimerType
Enumerator
None 

No time synchronization

System 

System time

Audio 

Audio time of the Main Audio Track

User 

User-specific timer

Manual 

Manual timer

Member Function Documentation

delegate void CuePointCallback ( ref EventPoint  eventPoint)

A Cue point callback delegate type.

Parameters
eventPointEvent point information
Description:
A Cue point callback delegate type.
Note:
Do not call functions that control movie playback in the Cue point callback.
See also
Player::cuePointCallback
delegate void StatusChangeCallback ( Status  status)

A delegate type for the callback when the player status changes.

Parameters
statusPlayer state after change
Description:
A delegate type for the callback when the player status changes.
See also
Player::statusChangeCallback
delegate void SubtitleChangeCallback ( IntPtr  subtitleBuffer)

Delegate type of subtitle information update callback

Parameters
subtitleBufferPointer to the subtitle string
Description:
This is the delegate type for the subtitle information update callback.
See also
Player::OnSubtitleChanged
delegate UnityEngine.Shader ShaderDispatchCallback ( MovieInfo  movieInfo,
bool  additiveMode 
)

A shader selection delegate type.

Parameters
movieInfoMovie information
additiveModeWhether to do additive composition
Description:
A shader selection delegate type.
See also
Player::SetShaderDispatchCallback
override void Dispose ( )
inline

Discards the player object

Description:
Discards a player object.
If you create your own CriMana::Player object, be sure to call the Dispose function. When this function is called, all the resources allocated when creating the player are released.
void CreateRendererResource ( int  width,
int  height,
bool  alpha 
)
inline

Generates the resources required for movie rendering.

Parameters
widthMovie width
heightMovie height
alphaWhether it is an alpha movie
Description:
Generates the resources required for movie rendering.
Normally, the resources required for movie rendering are automatically generated inside the player, but you can generate them in advance by calling this function before calling Player::Prepare and Player::Start.
However, if the resource created in advance using this function cannot be used for rendering movie to be played
due to insufficient width or height, the resource is discarded and regenerated.
See also
Player::DisposeRendererResource
void DisposeRendererResource ( )
inline

Discards the resources required for rendering movie.

Description:
Discards the resources required for rendering movie.
Although the resource is discarded in Player::Dispose, it can be done explicitly using this function.
See also
Player::CreateRendererResource
void Prepare ( )
inline

Prepares for playback.

Description:
This function does not start movie playback but only analyzes the header and prepares for playback (buffering).

Call this function after specifying the movie to be played. When the playback is ready, the player's status changes to Player.Status.Ready.

Call this function only when the status of the player is Player.Status.Stop or Player.Status.PlayEnd.
See also
Player::Status
void PrepareForRendering ( )
inline

Prepares for playback.

Description:
This function does not start movie playback but only analyzes the header and prepares for playback (buffering and preparation of the first frame).
Use this function when you want to align the beginning of movie playback.

Call this function after specifying the movie to be played. When the playback is ready, the player's status becomes Player.Status.ReadyForRendering, and rendering starts immediately by CriMana.Player.Play.

Call this function only when the status of the player is Player.Status.Stop, Player.Status.PlayEnd or Player.Status.Prepare.
See also
Player::Status
void Start ( )
inline

Start playback.

Description:
Starts movie playback.
When playback starts, the status changes to Player.Status.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, prepare for playback in advance using the Player.Prepare function.
See also
Player::Stop, Player::Status
void Stop ( )
inline

Requests to stop movie playback.

Description:
Issues a request to stop movie playback. This function returns immediately.
Playback does not stop immediately when this function is called.
See also
Player::Status
void StopForSeek ( )
inline

Requests to stop movie playback.

Description:
Issues a request to stop movie playback. This function returns immediately.
Playback does not stop immediately when this function is called.
Playback is stopped internally, but the rendering status is kept.
Use this when you need to stop the movie while keeping it be rendered, such as when performing a seek during playback.
See also
Player::Start, Player::Status
void Pause ( bool  sw)
inline

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 the Player::Stop function is called.
See also
Player::IsPaused
bool IsPaused ( )
inline

Gets the pausing status of the movie playback.

Returns
Pausing status
Description:
Gets the ON/OFF status of the pause.
See also
Player::Pause
bool SetFile ( CriFsBinder  binder,
string  moviePath,
SetMode  setMode = SetMode.New 
)
inline

Sets the file path of the streaming playback.

Parameters
binderBinder with CPK file bound
moviePathContent path in a CPK file
setModeMovie addition mode
Returns
Whether the set was successful
Description:
Sets the file path for streaming playback.
A movie from the CPK file can be played by passing the binder handle to which the CPK file is bound for the first argument.
To stream directly from a file instead of a CPK, specify null for the "binder" argument.
If Player::SetMode::Append is passed for the third argument "setMode", concatenated playback will be performed. In this case, the function may return false.
Movie files for concatenated playback must meet the following conditions.
  • Video resolution, frame rate and codec must be identical
  • Presence or not of alpha information must be identical
  • Audio tracks configuration (track numbers and number of channels) and codec must be identical
When no binder is specified (null is specified):
- Equivalent to setting the moviePath property.
  • If a relative path is specified, the file is loaded relative to StreamingAssets folder.
  • If an absolute path is specified, the file is loaded from the specified path.
When a binder is specified:
If the moviePath property is set after setting the binder, the movie is played from the CPK file bound to the binder.
Note:
You can also specify moviePath as URL. For example, by specifying a string such as "http://hoge-server/fuga-movie.usm", it is possible to stream playback the movie file on the HTTP server. However, this feature is not recommended. Also, only HTTP is supported as a communication protocol. HTTPS is not supported.
See also
Player::SetContentId, Player::SetFileRange, Player::moviePath
bool SetData ( IntPtr  data,
System.Int64  dataSize,
SetMode  setMode = SetMode.New 
)
inline

Sets the data for memory playback.

Parameters
dataMovie data on the memory
dataSizeData size
setModeMovie addition mode
Returns
Whether the set was successful
Description:
Assigns the data settings for in-memory playback.
The first and second arguments specify the address and size of the data. If Player::SetMode::Append is passed for the third argument "setMode", concatenated playback will be performed. In this case, the function may return false.
The conditions for the movie files that can be used for concatenated playback are the same than for the Player::SetFile function.
Note:
The buffer address passed to SetData should be fixed beforehand by the application so that it is not moved by the garbage collector.
In addition, release the memory lock after the playback is finished, the playback is stopped, or after the player object is discarded.
See also
Player::SetFile, Player::SetContentId, Player::SetFileRange, Player::moviePath
bool SetData ( byte[]  data,
System.Int64  datasize,
SetMode  setMode = SetMode.New 
)
inline
Deprecated:
This is a deprecated API that will be removed. Please consider using Player.SetData(IntPtr data, System.Int64 dataSize, SetMode setMode = SetMode.New) instead.
bool SetContentId ( CriFsBinder  binder,
int  contentId,
SetMode  setMode = SetMode.New 
)
inline

Specifies the movie file in the CPK file. (Specify content ID)

Parameters
binderBinder with CPK file bound
contentIdContent ID in the CPK file
setModeMovie addition mode
Returns
Whether the set was successful
Description:
Sets the content ID for streaming playback.
By specifying a binder and a content ID as arguments, any movie data in the CPK file can be used as the data source. If Append is passed for the third argument "setMode", concatenated playback will be performed. In this case, the function may return false.
Movie files for concatenated playback must meet the following conditions:
  • Video resolution, frame rate and codec must be identical
  • Presence or not of alpha information must be identical
  • Audio tracks configuration (track numbers and number of channels) and codec must be identical
See also
Player::SetFile, Player::SetFileRange, Player::SetData
bool SetFileRange ( string  filePath,
System.UInt64  offset,
System.Int64  range,
SetMode  setMode = SetMode.New 
)
inline

Specifies the movie file in the pack file. (File range specified)

Parameters
filePathPath to the pack file
offsetData start position of movie file in the pack file
rangeData range of the movie file in pack file
setModeMovie addition mode
Returns
Whether the set was successful
Description:
Specifies a packed file containing movies for streaming playback.
By specifying the offset and the data range (length) as arguments, any movie data in the packed file can be used as the data source. If -1 is specified for the second argument "range," the data range will extend to the end of the packed file. If Player::SetMode.Append is passed for the 4th argument "setMode", concatenated playback will be performed. In this case, the function may return false.
Movie files for concatenated playback must meet the following conditions:
  • Video resolution, frame rate and codec must be identical
  • Presence or not of alpha information must be identical
  • Audio tracks configuration (track numbers and number of channels) and codec must be identical
See also
Player::SetFile, Player::SetContentId, Player::SetData, Player::moviePath
void Loop ( bool  sw)
inline

Switching on/off the movie playback loop.

Parameters
swLoop switch (True: loop mode, False: non-loop mode)
Description:
Switches loop playback ON/OFF. By default, loop is OFF.
When loop playback is turned ON, the playback does not end at the end of the movie, and the playback is repeated from the beginning.
void SetAudioBaseConcatenation ( bool  enabled)
inline

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

Parameters
enabledEnable flag
Description:
Specifies whether to perform audio-based concatenation adjustment on looped or concatenated playback.
Please call this function before starting the playback.
The audio-based concatenation adjustment is disabled by default.

If looped or concatenated playback is performed while the audio/video lengths are different in the usm file, the inconsistency in timing will accumulate, possibly stopping the playback.
By using this function, the runtime library will automatically adjust the timing based on the audio playback.
void SetMasterTimerType ( TimerType  timerType)
inline

Sets the master timer type.

Parameters
timerTypeMaster timer type
Description:
Sets the timer mode for video playback.
The default is the system timer specified when creating the handle.
If you want to synchronize the display timing of video frames with an arbitrary timer, specify the user timer.
In that case, call CriWare.CriMana::Player::UpdateWithUserTime regularly.
See also
Player::UpdateWithUserTime, Player::SetManualTimerUnit, Player::UpdateWithManualTimeAdvanced
void SetSeekPosition ( int  frameNumber)
inline

Sets the seek position.

Parameters
frameNumberSeek frame number
Description:
Specifies the frame number to start seek playback.
If this function is not called, or if frame number 0 is specified, playback starts from the beginning of the movie. If the specified frame number is greater than the total number of frames in the movie data or is a negative value, the movie is also played from the beginning.
void SetMovieEventSyncMode ( MovieEventSyncMode  mode)
inline

Sets the sync mode for movie events (Cue points, subtitles).

Parameters
modeMovie event synchronization mode
Description:
Sets the sync mode for movie events (Cue points, subtitles).
By default, the event is triggered in sync with the frame time.
If you want to synchronize with the movie playback time, specify MovieEventSyncMode::PlayBackTime.
Note:
Call this function before starting playback.
void SetSpeed ( float  speed)
inline

Adjusts the movie playback speed.

Parameters
speedPlayback speed
Description:
Specify the playback speed of the movie.
A real number between 0.0f and 3.0f should be specified for the playback speed.
If 1.0f is specified, the data will be played back at its original speed.
If 2.0f is specified, the movie will be played at twice the frame rate of the movie data.
The default value for playback speed is 1.0f.

When a Mana player has the Advanced Audio Mode enabled, calling this function will enable time-stretching for the movie's audio, allowing you to play back at double speed without changing the pitch of the audio. Playback speed of the audio with time stretching enabled can be specified between 0.5x and 2.0x.

Note:
Changing the playback speed for movies that are being played is only supported when the movie has no sound.
Changing the playback speed for the movie with sound during playback does not work correctly. For movies with sound, stop the playback, change the playback speed, and then perform seek playback from the target frame number.

See also
Player::SetTimeStretchQuality
void SetMaxPictureDataSize ( System.UInt32  maxDataSize)
inline

Specifies the maximum picture data size

Parameters
maxDataSizeMaximum picture data size
Description:
Sets the maximum picture data size.
It is not required to use this function in normal playback.

When doing linked playback on videos with codec other than Sofdec.Prime, set the maximum picture data size with this function before starting playback.
The data size to be set is the maximum "Maximum chunk size" of all USM files shown in the Wizz tool;
or the maximum value of MovieInfo.maxChunkSize of all USM files scheduled for concatenated playback.
void SetBufferingTime ( float  sec)
inline

Specify the buffering time for the input data.

Parameters
secBuffering time [sec]
Description:
Specify the amount of input data to buffer for streaming playback, in seconds.
The Mana player determines the size of the read buffer according to the buffering time and movie bitrate.
The default buffering time is 1 second.
If the buffering time is set to 0.0f, the default value of the library will be used.
void SetMinBufferSize ( int  min_buffer_size)
inline

Specify the minimum buffer size.

Parameters
min_buffer_sizeMinimum buffer size [byte]
Description:
Specify the minimum buffer size for movie data.
When a minimum buffer size is specified, the Mana player has an input buffer larger than the specified value.
This function is not neccessary for simple playback. However, for seamless concatenated playback of videos with great bitrate differences, calling the function may be requisite.
If it is set to 0, the attributive value of the movie data will be used. (Default)
void SetAudioTrack ( int  track)
inline

Sets the Main Audio Track number.

Parameters
trackTrack number
Description:
Specifies the sound to be played if the movie has multiple sound tracks.
If this function is not called, the audio track with the smallest number is played.
If you specify a Track number that has no data, no audio is played.

If you specify AudioTrack.Off as the Track number, no audio is played even if the movie contains audio.

If you want to use the default settings (playing the sound of the smallest channel number), specify AudioTrack.Auto as the channel.
Note:
Changing tracks during playback is not supported. Record the frame number before change and use the seek playback.
void SetSubAudioTrack ( int  track)
inline

Sets the sub audio track number.

Parameters
trackTrack number
Description:
Specifies the sound to be played if the movie has multiple sound tracks.
If you don't call this function (default setting), nothing is played from the sub-audio. If you specify a track number that has no data, nothing is played from the sub-audio, even if you specify the same track for the main audio as the sub-audio track.
Note:
Changing tracks during playback is not supported. Record the frame number before change and use the seek playback.
void SetExtraAudioTrack ( int  track)
inline

Sets the extra audio track number.

Parameters
trackTrack number
Description:
Specifies the sound to be played if the movie has multiple sound tracks.
If you don't call this function (default setting), nothing is played from the extra audio. If you specify a track number that has no data, nothing is played from the extra audio even if you specify the same track as the main audio as the extra audio track.
Note:
Changing tracks during playback is not supported. Record the frame number before change and use the seek playback.
void SetVolume ( float  volume)
inline

Adjusts the sound volume for movie playback. (Main Audio Track)

Parameters
volumeVolume
Description:
Specifies the output sound volume of the movie's Main Audio Track.
Specify a real value in the range of 0.0f to 1.0f for the volume value.
The volume value is a scale factor for the amplitude of the sound data (the unit is not decibel).
For example, if you specify 1.0f, the original sound is played at its unmodified volume.
If you specify 0.0f, the sound is muted (silent).
The default value for volume is 1.0f.
Note:
If you specify a value outside the range of 0.0f to 1.0f, it is clipped to its minimum and maximum values.
float GetVolume ( )
inline

Gets the volume of the movie playback. (Main audio track)

Description:
Gets the output audio volume of the movie's main audio track.
The range of the volume is [0.0f…1.0f].
void SetSubAudioVolume ( float  volume)
inline

Adjusts the sound volume for movie playback. (sub audio)

Parameters
volumeVolume
Description:
Specifies the output volume of the movie's sub-audio track.
Specify a real value in the range of 0.0f to 1.0f for the volume value.
The volume value is a scale factor for the amplitude of the sound data (the unit is not decibel).
For example, if you specify 1.0f, the original sound is played at its unmodified volume.
If you specify 0.0f, the sound is muted (silent).
The default value for volume is 1.0f.
Note:
If you specify a value outside the range of 0.0f to 1.0f, it is clipped to its minimum and maximum values.
float GetSubAudioVolume ( )
inline

Gets the volume of the movie playback. (Sub-audio track)

Description:
Gets the output audio volume of the movie's sub-audio track.
The range of the volume is [0.0f…1.0f].
void SetExtraAudioVolume ( float  volume)
inline

Adjusts the sound volume for movie playback. (extra audio)

Parameters
volumeVolume
Description:
Specifies the output volume of the movie's extra audio track.
Specify a real value in the range of 0.0f to 1.0f for the volume value.
The volume value is a scale factor for the amplitude of the sound data (the unit is not decibel).
For example, if you specify 1.0f, the original sound is played at its unmodified volume.
If you specify 0.0f, the sound is muted (silent).
The default value for volume is 1.0f.
Note:
If you specify a value outside the range of 0.0f to 1.0f, it is clipped to its minimum and maximum values.
float GetExtraAudioVolume ( )
inline

Gets the volume of the movie playback. (Extra audio track)

Description:
Gets the output audio volume of the movie's extra audio track.
The range of the volume is [0.0f…1.0f].
void SetBusSendLevel ( string  bus_name,
float  level 
)
inline

Adjusts the Bus Send Level of the Main Audio Track.

Parameters
bus_nameBus name
levelBus Send Level
Description:
Specifies the Bus Send Level (amplitude level) of the movie Main Audio Track and the name of the send destination bus.
Specify a real value in the range of 0.0f to 1.0f for the Bus Send Level value.
The Bus Send Level value is a scale factor for the amplitude of sound data (in decibels).
For example, if you specify 1.0f, the original sound is sent to the bus at its unmodified volume.
If you specify 0.0f, silence is output to the bus.
void SetSubAudioBusSendLevel ( string  bus_name,
float  volume 
)
inline

Adjusts the Bus Send Level of the sub audio track.

Parameters
bus_nameBus name
volumeBus Send Level
Description:
Specifies the Bus Send Level (amplitude level) of the movie sub-audio track and the name of the send destination bus.
The operation specification of this function is the same as SetBusSendLevel.
void SetExtraAudioBusSendLevel ( string  bus_name,
float  volume 
)
inline

Adjusts the Bus Send Level of the extra audio track.

Parameters
bus_nameBus name
volumeBus Send Level
Description:
Specifies the Bus Send Level (amplitude level) of the movie extra audio track and the name of the send destination bus.
The operation specification of this function is the same as SetBusSendLevel.
void SetSubtitleChannel ( int  channel)
inline

Sets the subtitle channel.

Parameters
channelSubtitle channel number
Description:
Sets the subtitle channel to get. The default is no subtitle acquisition.
If you want to use the default setting (no subtitle acquisition), specify -1 as the channel.
It is also possible to switch the subtitle channel during movie playback. However, the is channel actually switched from the next subtitle immediately after the setting.
See also
Player::subtitleBuffer, Player::subtitleBuffer
void SetShaderDispatchCallback ( ShaderDispatchCallback  shaderDispatchCallback)
inline

Sets the shader selection delegate.

Parameters
shaderDispatchCallbackShader selection delegate
Description:
Sets the delegate that determines the user-defined shader
Note:
This must be set before the Player::Prepare and Player::Start functions.
See also
Player::ShaderDispatchCallback
long GetTime ( )
inline

Gets the playback time.

Returns
Playback time (in microseconds)
Description:
Gets the playback time of the movie that is currently being played.
Returns 0 before starting playback or after stopping playback.
The unit is microseconds.
int GetDisplayedFrameNo ( )
inline

Gets the frame number being displayed.

Returns
Frame number
Description:
Gets the frame number currently being displayed.
Returns -1 before starting rendering or after stopping playback.
Depending on the platform and codec, a number that is smaller than the frame information that can be obtained may be returned.
bool HasRenderedNewFrame ( )
inline

Checks whether a new frame was rendered.

Returns
A flag whether the frame was rendered
Description:
Returns whether a new frame was rendered on the screen after the current call of the playback control.
void SetAsrRackId ( int  asrRackId)
inline

Configures the ASR Rack.

Parameters
asrRackIdASR Rack ID
Description:
Specifies the output ASR Rack ID of the sound to be played.
The output ASR Rack ID setting is reflected on both the Main Audio Track and the sub audio track.
Note:
It cannot be changed during playback. If this API is called during playback, the settings is reflected from the next movie playback.
See also
CriAtomExAsrRack::rackId
void SetTimeStretchQuality ( float  quality)
inline

Adjust the quality of the audio time-stretch.

Parameters
qualityQuality
Description:
Specify the quality of the time-stretching performed on the audio.
The value must be between 0 and 10.
The higher the number, the higher the audio quality, but the higher the CPU load.
The default value is 2.
See also
Player::SetSpeed
void UpdateWithUserTime ( ulong  timeCount,
ulong  timeUnit 
)
inline

Updates the status by specifying the user time.

Description:
Updates the player status.
If you have enabled the user timer using CriWare.CriMana::Player::SetMasterTimerType , call this function periodically.
Note:
If the call to this function is delayed, the movie playback may hitch.
If the user timer is advanced fast or slow, the accuracy of the master timer decreases, and it will be difficult to acquire the frame at the correct time. So, normally, use this function in normal speed playback.
See also
Player::SetMasterTimerType
void SetManualTimerUnit ( ulong  timeUnitN,
ulong  timeUnitD 
)
inline

Sets the unit by which the time of the manual timer advances.

Parameters
timeUnitNNumerator of the unit in which time progresses
timeUnitDDenominator of the unit in which time progresses
Description:
Set the unit by which the time of the manual timer advances in rational number format.
If you enabled the manual timer using CriWare.CriMana::Player::SetMasterTimerType , set the unit by which the time advances using this function.
"Numerator (timer_manual_unit_n) / denominator (timer_manual_unit_d) = unit of time advancement (seconds)."
For example, if you want to set to 29.97fps, specify 1001 and 30000.
See also
Player::SetMasterTimerType, Player::UpdateWithManualTimeAdvanced
void UpdateWithManualTimeAdvanced ( )
inline

Updates while advancing the time of the manual timer.

Description:
Advance the handle time using the manual timer to update the rendering.
If you enabled the manual timer using CriWare.CriMana::Player::SetMasterTimerType , it is necessary to call this function regularly.
The time advances when the player status is PLAYING.
Even if this function is called while the player is paused, and the time is reset to 0 when playback starts or stops.
See also
Player::SetMasterTimerType, Player::SetManualTimerUnit
void Update ( )
inline

Updates the status.

Description:
Updates the player status.
The application has to call this function regularly.
Note:
If the call to this function is delayed, the movie playback may hitch.
void SyncMasterTimer ( )
inline

Synchronize the time to the master timer.

Description:
Synchronize the state of the player handle to the master timer.
Note:
This function will be executed within CriWare.CriMana::Player::Update, so there is no need for the user to periodically call it.
It can be used when time-sensitive playback processing (e.g., for synchonization purposes) is required.
bool UpdateMaterial ( UnityEngine.Material  material)
inline

Sets up the Material to display the current frame.

Parameters
materialMaterial to be set
Returns
Whether the setting succeeded
Description:
Sets the shader and various parameters to display the current frame in the Material.
void PauseOnApplicationPause ( bool  sw)
inline

Assign pause status based on the changes in the application status.

Parameters
swPause switch (true: pause, false: resume)
Description:
The pause can be switched between ON/OFF.
Specify true for the argument to pause the playback. Specify false to resume the playback.
This function is intended to be called to reflect the status of the application.
In other cases, use the CriWare.CriMana::Player::Pause function instead.
Note:
Other than the normal pause processing, this function will also trigger the related rendering processing.
When using components such as CriWare.CriManaMovieMaterial provided by the plugin, it is not necessary to call this function as it will be called automatically internally.
When simply playing with the CriWare.CriMana.Player function, call this function with MonoBehaviour.OnApplicationPause .

Member Data Documentation

CuePointCallback cuePointCallback

A Cue point callback delegate.

Description:
A Cue point callback delegate.
Note:
This must be set before the Player::Prepare and Player::Start functions.
See also
Player::CuePointCallback
StatusChangeCallback statusChangeCallback

A delegate for the callback when the player status changes.

Description:
A delegate for the callback when the player status changes.
See also
Player::StatusChangeCallback

Property Documentation

bool additiveMode
getset

Sets the blend mode to additive composition mode.

Description:
This is an argument passed to the shader selection callback during playback.
Note:
This must be set before the Player::Prepare and Player::Start functions.
See also
Player::ShaderDispatchCallback
int maxFrameDrop
getset

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 applyTargetAlpha
getset

Sets whether to apply the object transparency.

Description:
Sets whether to make the movie transparent depending on the transparency of the attached object.
Note:
This must be set before the Player::Prepare and Player::Start functions.
bool uiRenderMode
getset

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.
Note:
This must be set before the Player::Prepare and Player::Start functions.
bool isFrameAvailable
get

Whether a valid frame is held

Description:
Returns whether a valid frame is maintained.
Note:
When you render by yourself, switch the rendering using this flag.
MovieInfo movieInfo
get

Gets the information on the movie being played.

Parameters
movieInfoMovie information
Description:
The information on the header analysis result of the movie that was started.
You can get information such as movie resolution and frame rate.
Note:
Information can be acquired only when the player status is between Player.Status.WaitPrep and Player.Status.Playing.
In other states, null is returned.
See also
Player::Status
FrameInfo frameInfo
get

Gets the frame information of the movie being played.

Parameters
frameInfoFrame information
Description:
You can get information about the frame currently being rendered.
Note:
Information can be acquired only when the sound is being played. In other states, null is returned.
Status status
get

Gets the player status.

Returns
Status
Description:
Gets the player status.
Status nativeStatus
get

Gets the status of the internal handle.

Returns
Status
Description:
Gets the status of the Mana player handle used internally by the plugin.
It is used for detailed debugging or state management.
If you want to check the playback status of the video in the application, please use Player::status .
See also
Player::status
System.Int32 numberOfEntries
get

Gets the number of seamless playback entries.

Description:
Gets the number of seamless playback entries.
The value obtained from this property is the number of entries that are not started loading.
Loading the movie registered in the entry starts few frames before it is linked.
System.IntPtr subtitleBuffer
get

Gets the pointer to the subtitle data buffer.

Description:
Gets a pointer to the subtitle data buffer.
The subtitle data at the display time is stored.
Note:
The character code of the subtitle data follows the subtitle file specified when encoding the video file.
Please convert to a string with the character code corresponding to the subtitle file.
Note:
As the string indicated by the pointer may not contain a terminating character, be sure to perform the conversion using a function that takes the buffer size along with the pointer.
See also
Player::SetSubtitleChannel, Player::subtitleSize
int subtitleSize
get

Gets the size of the subtitle data buffer.

Description:
Gets the size of the subtitle data buffer.
Please use it when you get the subtitle data from Player::subtitleBuffer .
See also
Player::SetSubtitleChannel, Player::subtitleBuffer
CriAtomExPlayer atomExPlayer
get

Gets the CriAtomExPlayer handle.

Description:
Gets the CriAtomExPlayer handle used to play the audio data from the video.
This property can only get a valid handle when Advanced Audio mode is enabled by CriManaMovieMaterial::advancedAudio.
See also
CriManaMovieMaterial::advancedAudio
CriAtomExPlayer subAtomExPlayer
get

Get the CriAtomExPlayer handle (sub audio track)

Description:
Get the CriAtomExPlayer handle used to play the audio data from the video.
The CriAtomExPlayer that is obtained via this property is used for sub audio tracks.
A valid handle can only be retrieved
when the Advanced Audio mode in CriManaMovieMaterial.advancedAudio is enabled.
See also
CriManaMovieMaterial.advancedAudio, CriAtomExPlayer, SetSubAudioTrack
CriAtomExPlayer extraAtomExPlayer
get

Get the CriAtomExPlayer handle (extra track)

Description:
Get the CriAtomExPlayer handle used to play the audio data from the video.
The CriAtomExPlayer that is obtained via this property is used for extra audio tracks.
A valid handle can only be retrieved
when the Advanced Audio mode in CriManaMovieMaterial.advancedAudio is enabled.
See also
CriManaMovieMaterial.advancedAudio, CriAtomExPlayer, SetExtraAudioTrack
CriManaMoviePlayerHolder playerHolder
getset

Object to hold the player.

Description:
MonoBehaviour object that holds a valid CriWare.CriMana::Player until it is destroyed. It is used inside the plugin to perform coroutine by which unmanaged resources handled by GPU and rendering thread will be deleted.

Event Documentation

SubtitleChangeCallback OnSubtitleChanged

Callback function for subtitle information update

Description:
This is the subtitle information callback event.
Note:
The string data referenced by this pointer may not contain a terminating character.
Please be sure to perform the conversion using a function that passes the buffer size along with the pointer.
See also
Player::SubtitleChangeCallback, subtitleSize

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