Default subtitle for videos

How can I set the default subtitle in wordpress videos?

Here is the shortcode that wp created after adding a video with a subtitle from media:

[video 
    width="960" 
    height="540" 
    mp4="example.com/wp-content/uploads/test.mp4"
]track 
    srclang="En" 
    label="English" 
    kind="subtitles" 
    src="example.com/wp-content/uploads/test.vtt" 
/[/video]

Now when I see the post in FO, I have to click on "cc" in video control bar and choose "English". The default is "None".

Now how can I change this default to English so that the user doesn't have to choose subtitle?

Topic video-player Wordpress

Category Web


With jQuery click on subtitle label

"en" srclang value.

if ($('#mep_0_track_0_subtitles_en').length > 0) 
    $('#mep_0_track_0_subtitles_en').trigger('click');

From a UX perspective whether to display a subtitle track is a preference that should really be left up to the user.

Edit: that being said, mediaelement.js allows you to specify a starting sub track by passing in this option:

{ startLanguage: 'en' }

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.