CRIWARE Unity Plugin Manual
Last Updated: 2024-07-12
[CriMana] Playing from a downloaded file
Description of the sample
Overview
This sample plays a movie from a CPK file (a pack file from FileMajik PRO) installed from the network.
In this sample, installing a file means downloading the file from the network and saving it locally.
All the processes related to the movie playback are implemented by a runtime script.
Note that it differs from loading a file from StreamingAssets only in how to specify the file when binding a CPK file.
When the sample is executed, the movie playback does not start.
Use the steps below to start playback.
(1) Click on the Install CPK File button to start to install the CPK file.
(2) When the installation is complete, the Bind CPK File button appears on the screen.
(3) Click on the Bind CPK File button to bind the CPK file.
(4) When binding is complete, an asterisk (*) appears at the beginning of the string on the Bind CPK File button, and the Play button is displayed on the screen.
(5) Click on the Play button. The movie is started as a texture on the cube, and the Play button becomes the Stop button.
(6) If you click the Stop button during playback, the movie is stopped.
(7) If you click the Reset button, the sample returns to its initial status before a CPK file was installed.
The steps after Step (3) are the same than in " [CriMana] Playing from a CPK file ".
This sample program plays a movie from a CPK file that was downloaded.
Note that it differs from loading a file from StreamingAssets only in how to specify the file when binding a CPK file.
Instead of configuring the CriManaMovieController component in Unity Editor, all the processes related to the movie playback are handled by the script.
The binding of a CPK file and how to start/stop the playback are both described in the script of Scenes/Scene_04_DownloadCpk.
Installing and binding a CPK file
The installation and the binding of a CPK file are handled in the same way as in the sample program of FileMajik PRO. Therefore, their description is omitted here. For details, please see the samples for FileMajik PRO ( " [CriFs] Loading a CPK file (packed file) ", " [CriFs] Installing data ").
This sample uses a coroutine for the binding. You can also use status polling by FileMajik PRO if you don't want to use a coroutine. You can see both methods in the sample for FileMajik PRO ( " [CriFs] Loading a file ").
Movie playback script
The playback procedure after binding a CPK file that was downloaded is the same as for the playback of a file from StreamingAssets.
For details, see the sample at " [CriMana] Playing from a CPK file ".