Search
 
SCRIPT & CODE EXAMPLE
 

HTML

display subtitles with audio html

<audio controls class="audio-player">
  <source src="media.mp3" >
  <track label="English" kind="subtitles" srclang="en" src="sample.vtt" default>
</audio>
<div id="subtitle-display"></div>

<script>
  $('.audio-player')[0].textTracks[0].oncuechange = function() {
    var currentCue = this.activeCues[0].text;
    $('#subtitle-display').html(currentCue);
  }
</script>
Comment

PREVIOUS NEXT
Code Example
Html :: html button with link 
Html :: a tag open new tab 
Html :: html href click not refresh 
Html :: how to make a link in html that opens in a new tab 
Html :: html bottom right corner 
Html :: robots txt disallow all 
Html :: laravel phpcs.xml 
Html :: html width 
Html :: twig check variables type 
Html :: how to make html open link in new tab 
Html :: fa fa dropdown icon 
Html :: html check-box 
Html :: how to get a division to be in centre of screen in responsive web page for screen of any size 
Html :: page html exemple 
Html :: what is the difference between span and div 
Html :: html input date validation 
Html :: vue render html raw 
Html :: stopimmediatepropagation vs stoppropagation 
Html :: html auto start video 
Html :: how to change font color in html 
Html :: html escape quote in atribute 
Html :: icon is not showing in html 
Html :: use v-model in custom component 
Html :: css title and label aligned alongside image 
Html :: html text alignment 
Html :: html span title tooltip 
Html :: bootstrap 5 border bottom 
Html :: gap between grid layout bootstrap 
Html :: box search bootstrap 
Html :: on this image error 
ADD CONTENT
Topic
Content
Source link
Name
4+1 =