Hi,
I want to have the automatic subtitles in videos. But they are only shown when using the controls and manually clicking on the subtitle-button in youtube player. I use this script:
<script async src="https://www.youtube.com/iframe_api"></script>
<script>
function onYouTubeIframeAPIReady() {
var player;
player = new YT.Player('muteYouTubeVideoPlayer', {
videoId: 'ImgUeGLvvw8', // YouTube Video ID
width: 530, // Player width (in px)
height: 308, // Player height (in px)
playerVars: {
autoplay: 1, // Auto-play the video on load
controls: 1, // Show pause/play buttons in player
showinfo: 0, // Hide the video title
modestbranding: 1, // Hide the Youtube Logo
loop: 1, // Run the video in a loop
rel: 0,
fs: 0, // Hide the full screen button
cc_load_policy: 1, // Hide closed captions
iv_load_policy: 1, // Hide the Video Annotations
autohide: 0 // Hide video controls when playing
},
events: {
onReady: function(e) {
e.target.setVolume(0);
}
}
});
}
// Written by @labnol
</script>
Any idea how to get this to work?
Or is there any workaround by using jQuery to simulate a click on the subtitle button?
Thanks!