(SOLVED)How to play a movie and still able to display text?

Hello everyone,

I’m trying to loop a 2-second animation during a regular dialogue scene. However, when I use the Play Movie function, the dialogue text doesn't show up while the animation is playing. Is there a way to display the dialogue text while the animation loops at the same time?

Any help would be greatly appreciated!

There should be some video player plugins, like this.

There should be some video player plugins, like this.
Thank you for the suggestion, but I just try out this plugin but it does not have the feature im looking for. I want to loop a video during event not on the map. so for example, during the breakfast event, I want to play an video of eating breakfast while the characters dialogue happen the same time, and stop the video at some point of the event. is there any plugin that can do this? I don't mind if its a paid only.
There are some video players for RMMV but I don't know if they work on MZ.
For example this one seems to suit your need.

If not you have to be more specific(Maybe show a picture of what is supposed to be displayed on the screen).
You want to make a video based game(like a visual novel)?
Or do you just want to play the event eating breakfast. If so maybe you can just make some animations using events.
If you can't find a suitable video player for rmmz maybe I can write one for you.
There are some video players for RMMV but I don't know if they work on MZ.
For example this one seems to suit your need.

If not you have to be more specific(Maybe show a picture of what is supposed to be displayed on the screen).
You want to make a video based game(like a visual novel)?
Or do you just want to play the event eating breakfast. If so maybe you can just make some animations using events.
If you can't find a suitable video player for rmmz maybe I can write one for you.
So basically I want the animation video to be play at full screen in the event at the player screen while the dialogue between characters proceeds without interruption. (so player still able to see the text and go next line of the text).

I just found this plugin and im going to give it a try. https://synrec.itch.io/rpg-maker-mvmz-video-player

well...its not going well , the video is still on top of the message window box, so player cant see the text at all. But I found a temporary fix by adjusting the video width and height so the text box can be shown. but this look so ugly :/ there has to be a smarter way, if anyone know please help me.
I wrote a video player plugin that plays a video over an event.
You can try this script to play a video.

makeEventVideo(this,'move file name',0,0,816,624);
$E(this).setPriorityType(3);

To stop the video:
$E(this).stopVideo();

Additionally, if your event is named 'Event001', you can replace this with 'Event001', for example:
makeEventVideo('Event001','movie1',0,0,816,624)

Spoiler
JavaScript:
//////////////////////////////////////////////////////////////////////

function $E(n){
  if(n instanceof Game_Event) return n;
  if(typeof n.eventId=='function') n = n.eventId();
  return $gameMap._events[n]||$gameMap._events.find(function(e){return e&&e.event().name==n;})||$gameMap._events.find(function(e){return e&&e.event().note.contains(n);})||null;
}

function $spr(c){
  if(c instanceof Game_Character == false){
    c = $E(c);
  }
  if(!c) return null;
  return SceneManager._scene._spriteset._characterSprites.find(function(s){return s._character==c;});
}

/////////////////////////////////////video player///////////////////////////////////////////

function makeEventVideo(e,name,x,y,w,h){
  e = $E(e);
  var spr = $spr(e);
  spr.updateCharacterFrame();
  x = x||0;
  y=y||0;
  w=w||spr.width;
  h=h||spr.height;
  var vp = 'movies/';
  var v = e.video||document.createElement('video');
  var s1 = document.createElement('source');
  s1.type = 'video/webm';
  s1.src = vp + name + '.webm';
  var s2 = document.createElement('source');
  s2.type = 'video/mp4';
  s2.src = vp + name + '.mp4';
  v.autoplay=false;
  while(v.children.length) v.removeChild(v.children[0]);
  v.append(s1,s2);
  v.autoplay=false;
  v.preload=true;
  v.loop=true;
  v.load();
  v.play();
  var bitmap = new Bitmap(w,h);
  var sspr = new Sprite(bitmap);
  sspr.video = v;
  sspr.videox = x;
  sspr.videoy = y;
  spr.removeChildren();
  spr.addChild(sspr);
  sspr.update = function(){
    this.x = -this.parent.x+this.videox;
    this.y = -this.parent.y+this.videoy;
    this.bitmap.canvas.getContext('2d').drawImage(this.video,0,0,this.width,this.height);
    this.bitmap.baseTexture.update();
    Sprite.prototype.update.call(this);
  }
  e.video = v;
  e.stopVideo = function(){
    this.video.pause();
    $spr(this).removeChildren();
  }
}
I wrote a video player plugin that plays a video over an event.
You can try this script to play a video.

makeEventVideo(this,'move file name',0,0,816,624);
$E(this).setPriorityType(3);

To stop the video:
$E(this).stopVideo();

Additionally, if your event is named 'Event001', you can replace this with 'Event001', for example:
makeEventVideo('Event001','movie1',0,0,816,624)

Spoiler
JavaScript:
//////////////////////////////////////////////////////////////////////

function $E(n){
  if(n instanceof Game_Event) return n;
  if(typeof n.eventId=='function') n = n.eventId();
  return $gameMap._events[n]||$gameMap._events.find(function(e){return e&&e.event().name==n;})||$gameMap._events.find(function(e){return e&&e.event().note.contains(n);})||null;
}

function $spr(c){
  if(c instanceof Game_Character == false){
    c = $E(c);
  }
  if(!c) return null;
  return SceneManager._scene._spriteset._characterSprites.find(function(s){return s._character==c;});
}

/////////////////////////////////////video player///////////////////////////////////////////

function makeEventVideo(e,name,x,y,w,h){
  e = $E(e);
  var spr = $spr(e);
  spr.updateCharacterFrame();
  x = x||0;
  y=y||0;
  w=w||spr.width;
  h=h||spr.height;
  var vp = 'movies/';
  var v = e.video||document.createElement('video');
  var s1 = document.createElement('source');
  s1.type = 'video/webm';
  s1.src = vp + name + '.webm';
  var s2 = document.createElement('source');
  s2.type = 'video/mp4';
  s2.src = vp + name + '.mp4';
  v.autoplay=false;
  while(v.children.length) v.removeChild(v.children[0]);
  v.append(s1,s2);
  v.autoplay=false;
  v.preload=true;
  v.loop=true;
  v.load();
  v.play();
  var bitmap = new Bitmap(w,h);
  var sspr = new Sprite(bitmap);
  sspr.video = v;
  sspr.videox = x;
  sspr.videoy = y;
  spr.removeChildren();
  spr.addChild(sspr);
  sspr.update = function(){
    this.x = -this.parent.x+this.videox;
    this.y = -this.parent.y+this.videoy;
    this.bitmap.canvas.getContext('2d').drawImage(this.video,0,0,this.width,this.height);
    this.bitmap.baseTexture.update();
    Sprite.prototype.update.call(this);
  }
  e.video = v;
  e.stopVideo = function(){
    this.video.pause();
    $spr(this).removeChildren();
  }
}
thanks for the help, but I still cant get it work. I turn your code into a js file and run the script call in event. I put video in both movies and videos folder. then when the event is trigger, only the text is popping up like normal, nothing else happen.
1727370021724.png
I just try another approach for this problem by spliting the animation into frames, then use show picture + wait frame to achieve the animation. In this case, the text window display but the animationstops. is there anyway for the fix? also is this gonna use too much memory?
I would still prefer the play video solution if I can get it work..

1727377895173.png
thanks for the help, but I still cant get it work. I turn your code into a js file and run the script call in event. I put video in both movies and videos folder. then when the event is trigger, only the text is popping up like normal, nothing else happen. View attachment 318824
You need to use 'test1' with the quote marks.
You need to use 'test1' with the quote marks.
This work perfectly. sorry for being like a idiot, how come I forget about those quote mark.
Thank you so much!!

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/solved-how-to-play-a-movie-and-still-able-to-display-text.172164/