Vertical videos are also supported.
Just set it to Auto mode, and it will automatically check the video’s aspect ratio and adjust accordingly.
Local videos are also referenced as dependencies when packaging.
When a video is included together with a packaged scene, the path is saved as self:/ when the scene is loaded, meaning it references the file inside that VAR package itself.
However, Unity 2018 cannot directly load videos packaged inside a VAR file.
Because of that, I used a workaround.
The method is simple.
The video inside the VAR package is copied as a cache file and converted into a local video path.
The copied videos are created in the following folder:
Custom\PluginData\bqbq\PipSimpleVideo\VideoCache
This folder is inside the VaM directory.
So if VaM is installed on an SSD, the videos are saved on that SSD. If VaM is installed on an HDD, they are saved on that HDD. These files are not stored temporarily in memory.
To prevent conflicts even when videos have the same filename, the copied video file is given a label at the beginning of its name.
This label includes the VAR name and a random 16-digit number.
Of course, the generated cache files can be easily removed from within the plugin.
There is one downside.
If you save a packaged scene locally as a JSON file and then load it again, the video path may be treated as missing.
This happens because when a packaged scene is saved as JSON, the video path is stored as self:/ instead of the native local path to the packaged .var file.
I tried several ways to solve this, but I have not found a reliable solution for this part yet.
There are a few possible alternatives.
The first option is to use only the JSON save file included inside the VAR package.
The second option is to use AssetBundles only.
Personally, I think this is the best method. The local file cache method effectively doubles the required video storage size, while AssetBundles do not have that issue.
The third option is to package only the video separately as a VAR file so that it is not handled as self:/.
In that case, it may be saved as a native local path. However, this may depend on the environment and needs to be checked.
There is also one remaining issue.
When using the Seek Time Jump feature at any playback speed other than 1.0x, the video may still reset to 00:00.
I have improved this somewhat, but the timestamp can still become unstable at certain points.
The symptoms may vary depending on the video.
Distribution of videos with copyright or legal issues is prohibited.
This plugin only provides the ability to load or package video files prepared by the user. It does not guarantee that the user has the copyright or distribution rights for those videos.
Users are responsible for confirming that they have the proper rights and legal permission to distribute any video files they include.
I am not responsible for any copyright disputes, legal issues, or distribution problems that may arise from the use or distribution of such videos.