Skip to main content
Participant
July 20, 2024
Question

Text overlay on video

  • July 20, 2024
  • 2 replies
  • 357 views

Hi There

 

I have to create some HTML5 ads in Animate. They include video and text that has to show on top of the video. I'm using the video component and aware it moves to the top. To get around this I updated the HTML file so that the Z-index of the dom_overlay_container is '-1'.

 

This works great when the stage is transparent. The issue I have is that there are some formats where the video is not going to cover the whole stage e.g. a portrait format where I want to add the video to the middle of the ad and have a black background covering the rest of the ad.

 

Is it possible to do this in Animate? I essentially want 3 layers - 1) black background  2) video 3) text overlay.

 

My only solution now is to edit the videos in After Effects and add the black background there but this doesn't seem like the best solution.

 

Thanks

 

Kam

 

    This topic has been closed for replies.

    2 replies

    JoãoCésar17023019
    Community Expert
    Community Expert
    July 23, 2024

    Hi.

     

    You'll need to use some more CSS to create the black background behind the video. One approach would be to send the canvas to the top instead and change the dom_overlay_container's background color to black. Like this:

    canvas.style.zIndex = 1;
    canvas.style.backgroundColor = "rgba(255,255,255,0)";
    dom_overlay_container.style.backgroundColor = "black";

     

    Regards,

    JC

    kglad
    Community Expert
    Community Expert
    July 20, 2024

    yes, it possible.  max flexibility is obtained by avoiding components and using js code to create, eg video.