Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

240
Views
Giving VTT subtitles a fading out effect

I'm currently trying to implement or test a new feature on my locally hosted page which plays video with subtitles on. The subtitle format being VTT.

I've been trying to find how to actually be able to edit the VTT itself as I am trying to give a fading out effect for the subtitle.

This probably won't be helpful but I just tried implementing it via the style.css part of my project but sadly it only affects the texts of the page and I am not sure how to make it work for the texts from the VTT file itself.

Down below is the part I've tried to work out on the style.css

.fade-in {
  animation: fadeIn 2s;
}

.fade-out {
  animation: fadeOut 3s;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
     }     
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
     }     
}


about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

There is a ::cue selector to modify the subtitle text on a video.

But not all css properties are allowed. You can change the color or opacity but you can not set the animation property.

Anyway, what you could do is to use css variable to set the opacity and the css variable could change with an animation

:root {
  --opacity-value: 1
}

::cue {
  opacity: var(--opacity-value);
}

@keyframes flickerAnimation {
  0%   { --opacity-value: 1; }
  50%  { --opacity-value: 0; }
  100% { --opacity-value: 1; }
}

video{
 animation: flickerAnimation 1s infinite;
}

An working example could be found here.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!