TitleVideo Plugin v1.1

NanoWizard

Villager
Member
Joined
Jul 6, 2017
Messages
8
Reaction score
15
First Language
English
Primarily Uses
RMMV
I'm an experienced web developer just getting started with RPG Maker MV, and this is my first plugin. Hope you enjoy :).

TitleVideo v1.2.0
Ryan Sivek (NanoWizard)


Introduction
This is a simple JavaScript plugin for RPG Maker MV that allows the addition of a video to the title screen above the background image. Parameters can be tweaked to get several various effects.

How To Use
Place the video files for your target platforms into the project's "movies" directory and this plugin will automatically select the video file using the same criteria RMMV uses to determine video compatibility on the current platform.

Make sure the Video Name parameter has the filename WITHOUT EXTENSION. For example, if you have a video named "TitleMovie.webm" in your movies folder, the Video Name parameter should be set to "TitleMovie".

RMMV currently supported movie formats are .webm and .mp4. So for wide distribution you should include both file types.

Width and Height can be set to "auto" (window dimensions), "video" (original video dimensions), or a specific number.

For Playback Rate, Values between 0 and 1 cause the video to play in slow motion. Values greater than 1 play in fast forward.

See PIXI.js documentation for compatible blend modes: http://pixijs.download/dev/docs/PIXI.html#.BLEND_MODES

See http://www.color-hex.com/ for hex color samples if you want to modify the tint for the video sprite

Using Multiple Videos
It is possible to overlay multiple videos. Simply copy the TitleVideo.js file to another file in the plugins folder with a new filename, and modify the following line inside that file:

Code:
var parameters = PluginManager.parameters('TitleVideo');
To
Code:
var parameters = PluginManager.parameters('NEW_FILENAME');
Replacing "NEW_FILENAME" with the filename of the copied js file without the ".js" extension.

For example, if I copy TitleVideo.js to TitleVideo2.js, I would change the line above inside TitleVideo2.js to be
Code:
var parameters = PluginManager.parameters('TitleVideo2');
Basically this method allows you to add each video as a separate plugin and modify the parameters for each video separately as you see fit.

Script
https://github.com/nanowizard/rmmv-title-video/raw/master/TitleVideo.js

Terms Of Use
- Credit to the author Ryan Sivek is appreciated but not required
- Plugin is free to use, modify and distribute for any use including commercial use according to the terms of the license
- Do not claim as your own work

Github Repo
https://github.com/nanowizard/rmmv-title-video


Changelog
v1.1 - Added ability to loop a custom section of the video instead of the entire thing
v1.2 - Added volume parameter and video will now adhere to Master Volume setting

Notes
Overlay video in the demo: https://pixabay.com/en/videos/flourish-flowers-swirls-abstract-2656/
 
Last edited:

Jonforum

Veteran
Veteran
Joined
Mar 28, 2016
Messages
1,623
Reaction score
1,430
First Language
French
Primarily Uses
RMMV
nice jobs friend

I had to fly over a bit the principle of video PIXI.Texture.fromVideo

Thanks to you I have a good functional example of the principle.
thank you

if i understant , you use a video with a black background, and you add one of those blend modes from pixi
PHP:
var BLEND_MODES = exports.BLEND_MODES = {
  NORMAL: 0,
  ADD: 1,
  MULTIPLY: 2,
  SCREEN: 3,
  OVERLAY: 4,
  DARKEN: 5,
  LIGHTEN: 6,
  COLOR_DODGE: 7,
  COLOR_BURN: 8,
  HARD_LIGHT: 9,
  SOFT_LIGHT: 10,
  DIFFERENCE: 11,
  EXCLUSION: 12,
  HUE: 13,
  SATURATION: 14,
  COLOR: 15,
  LUMINOSITY: 16
};
 

NanoWizard

Villager
Member
Joined
Jul 6, 2017
Messages
8
Reaction score
15
First Language
English
Primarily Uses
RMMV
Thanks @Jonforum! In the example video I used the ADD blend mode, which means black basically acts as transparent (pixel value + ~0 = ~unchanged pixel value).

If you want the video to play unchanged, you can just leave the Blend Mode option as NORMAL and it will appear just as it is in the video file. I added the blending options because that gives folks a lot of flexibility with the plugin.

Yes the code you've shown from pixi denotes the possible blend modes. However, keep this important notice in mind from their documentation (linked in the OP):
IMPORTANT - The WebGL renderer only supports the NORMAL, ADD, MULTIPLY and SCREEN blend modes. Anything else will silently act like NORMAL.
 

Jonforum

Veteran
Veteran
Joined
Mar 28, 2016
Messages
1,623
Reaction score
1,430
First Language
French
Primarily Uses
RMMV
Thanks @Jonforum! In the example video I used the ADD blend mode, which means black basically acts as transparent (pixel value + ~0 = ~unchanged pixel value).

If you want the video to play unchanged, you can just leave the Blend Mode option as NORMAL and it will appear just as it is in the video file. I added the blending options because that gives folks a lot of flexibility with the plugin.

Yes the code you've shown from pixi denotes the possible blend modes. However, keep this important notice in mind from their documentation (linked in the OP):
In fact your approach will interests me especially when I'm will going to tackle the FX in my engine.
I think using this system to use FX

I'm not at this step now, but your code will help me to work on my engine.
When I will work on the combat system with the FX.
It will remain to try with PIXI.Texture.fromVideo if pixi.js can take QuikTime (.mov) with alpha chanel :D
 

Ally

Linked Rooms Games Founder - Fleshforward
Member
Joined
Mar 17, 2012
Messages
332
Reaction score
154
First Language
Italy
Primarily Uses
RM2k
Awesome! but I receive this error when I try the plugin:
1.png

I have imported the video in webm format (in the movie folder) and delete file extension...
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
30,708
Reaction score
7,365
First Language
German
Primarily Uses
RMMV
@Ally please post a console screenshot with the full error sequence (press F8 when the error message appears)
 

Ally

Linked Rooms Games Founder - Fleshforward
Member
Joined
Mar 17, 2012
Messages
332
Reaction score
154
First Language
Italy
Primarily Uses
RM2k
@Ally please post a console screenshot with the full error sequence (press F8 when the error message appears)
Oh, here ^^
2.png

I have updated MV in 1.5 version and work, but the video not see...
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
30,708
Reaction score
7,365
First Language
German
Primarily Uses
RMMV
that screenshot is wrong - did you take it at the moment that you get the error message? because it should contain the type error message of your other screenshot in its full details, and that is missing in your screenshot.
 

Ally

Linked Rooms Games Founder - Fleshforward
Member
Joined
Mar 17, 2012
Messages
332
Reaction score
154
First Language
Italy
Primarily Uses
RM2k
Since I've updated MV to the latest version, I'm not getting any more errors.
The title screen works, but the video is not visible.

If I click in Deprecation Warning, I read this:
3.png

For security I have inserted the two video files with different extension...
I've also tried a video with a resolution smaller than the default one.
 

NanoWizard

Villager
Member
Joined
Jul 6, 2017
Messages
8
Reaction score
15
First Language
English
Primarily Uses
RMMV
Hi @Ally! Sorry I haven't responded sooner I've been extremely busy this week. Thanks for trying out the plugin!

Seems like the first problem you experienced could have been due to this plugin being incompatible with a previous version of MV.

I have a few questions:
  • Are there any errors in the console when the video doesn't play? (F8 while the title screen is open)
  • Does the video have audio that you can hear playing?
  • Are you using any other plugins that affect the title screen?
 

Ally

Linked Rooms Games Founder - Fleshforward
Member
Joined
Mar 17, 2012
Messages
332
Reaction score
154
First Language
Italy
Primarily Uses
RM2k
Hi @Ally! Sorry I haven't responded sooner I've been extremely busy this week. Thanks for trying out the plugin!

Seems like the first problem you experienced could have been due to this plugin being incompatible with a previous version of MV.

I have a few questions:
  • Are there any errors in the console when the video doesn't play? (F8 while the title screen is open)
  • Does the video have audio that you can hear playing?
  • Are you using any other plugins that affect the title screen?
Thanks to you for the answer ^^
The plugin now works...
but it started working alone...
I had started everything in a clean project...
The only thing I had changed in the settings, was to change NORMAL to ADD.
 

Tatsumaro

Veteran
Veteran
Joined
Aug 11, 2016
Messages
205
Reaction score
40
First Language
Portugues
Primarily Uses
RMMV
hi i have a bug report. But first mate thanks alote this is the real deal, this plugin is just what a need to my project. THANKS:thumbsup-right::troll:

the Bug:popcorn:

i have audio in my video, and when i select new game or any other option except exit, the audio file continues to play in the back. I imagine that the video is also playing . i tried to stop all music but nothing is working, a command to stop the video my not work because is you load a game you cant be 100% certain that it will be in map that was the event to stop that video.

Thanks
 

Ally

Linked Rooms Games Founder - Fleshforward
Member
Joined
Mar 17, 2012
Messages
332
Reaction score
154
First Language
Italy
Primarily Uses
RM2k
I've tried the plugin for the android apk, but inside on XDK receive the error Blend Mode...
android.png
 

NanoWizard

Villager
Member
Joined
Jul 6, 2017
Messages
8
Reaction score
15
First Language
English
Primarily Uses
RMMV
i have audio in my video, and when i select new game or any other option except exit, the audio file continues to play in the back. I imagine that the video is also playing . i tried to stop all music but nothing is working, a command to stop the video my not work because is you load a game you cant be 100% certain that it will be in map that was the event to stop that video.
Thanks Tatsumaro for bringing this to my attention. This has been fixed now in the latest version.

I've tried the plugin for the android apk, but inside on XDK receive the error Blend Mode...
I haven't yet tested on anything other than my desktop so I wouldn't be too surprised if there were some issues on mobile systems that I need to work out. That said, the error is interesting because my script does not reference a "blendModes" variable. It is probably an error thrown within the PIXI engine, so without additional information, it will be difficult to find out what the true problem is.

I plan to do some mobile testing in the future when I get around to it.
 

Tatsumaro

Veteran
Veteran
Joined
Aug 11, 2016
Messages
205
Reaction score
40
First Language
Portugues
Primarily Uses
RMMV
thanks love you plugin. I will post a video and give a BIG shout out to you mate :)
 

Tatsumaro

Veteran
Veteran
Joined
Aug 11, 2016
Messages
205
Reaction score
40
First Language
Portugues
Primarily Uses
RMMV
Hi NanoWizard can you please see this post. Thanks
 

Tatsumaro

Veteran
Veteran
Joined
Aug 11, 2016
Messages
205
Reaction score
40
First Language
Portugues
Primarily Uses
RMMV
Hi love this plugin, simple and working my intro menu is all done :)

but i have 2 suggestions:
  1. With MV 1.5 you can alter the Master Volume of the all game, but not the volume on the video i use for this plugin.
  2. I saw some plugins that use code to release videos from RAM, this would be great ad on to this plugin, not a command but if you leave the mane menu the video should be "deleted or released" from memory. [ Edit: even better, delete the video unless you enter OPTIONS.
Thanks for this plugin :) see you in ?RUST??
 

NanoWizard

Villager
Member
Joined
Jul 6, 2017
Messages
8
Reaction score
15
First Language
English
Primarily Uses
RMMV
hello nano wizard, i have the verison rpgmakermv 1.3.5 and this error apears to me
View attachment 79324
Sorry for the late reply. It appears this plugin is incompatible with MV version 1.3.5. The undefined function it's referring to there is PIXI.Texture.fromVideo, which is the PIXI feature on which the entire plugin is based. If that feature isn't supported by your version of MV, this plugin will not work.

Hi love this plugin, simple and working my intro menu is all done :)

but i have 2 suggestions:
  1. With MV 1.5 you can alter the Master Volume of the all game, but not the volume on the video i use for this plugin.
  2. I saw some plugins that use code to release videos from RAM, this would be great ad on to this plugin, not a command but if you leave the mane menu the video should be "deleted or released" from memory. [ Edit: even better, delete the video unless you enter OPTIONS.
Thanks for this plugin :) see you in ?RUST??
Thanks for the suggestions! I should certainly have the video match the master volume value when audio is enabled. I'll add that when I have time...

Assuming the following code does what I think it does
Code:
Scene_Title.prototype.terminate = function() {
    ST_terminate.call(this);
    vidSprite.destroy(true);

    removeListeners();
    vid.pause();
    vid.remove();
    vid = null;
    vidSprite = null;
};

the plugin should already be removing all references to video related objects when the title scene is unloaded, which allows the garbage collector to remove video data from memory. Note that in JS we don't have direct memory access, so we can't actually remove things from memory manually.

RUST? Never played it...
 

Tatsumaro

Veteran
Veteran
Joined
Aug 11, 2016
Messages
205
Reaction score
40
First Language
Portugues
Primarily Uses
RMMV
thanks :) i will be waiting for TitleVideo.js v1.1.2
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

I wrote a nice animated preloading system for mv+mz today. It only supports graphic assets atm, should it support audio too? See it in action in my recent minigame @
I posted my first commercial game on the forums, and now waiting for approval.
fingers crossed.
TMW the air quality is so bad, your hair changes color every time you wash it. :LZYyuck:
Finished two animations today. :kaojoy:
Sigony wrote on Ksi's profile.
Just wanna say that I love your videos.
When are you fighting Floyd Mayweather?

Forum statistics

Threads
102,999
Messages
996,633
Members
134,482
Latest member
Kartof
Top