Title: Subtitle for default
Last modified: November 13, 2020

---

# Subtitle for default

 *  Resolved [bazza](https://wordpress.org/support/users/bazza/)
 * (@bazza)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/subtitle-for-default/)
 * You have the possibility to choose subtitles by default or choose them depending
   on the language of the platform
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fsubtitle-for-default%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [team-ok](https://wordpress.org/support/users/team-ok/)
 * (@team-ok)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/subtitle-for-default/#post-13658598)
 * Please refer to the answer of a similar question that was asked here:
    [](https://wordpress.org/support/topic/subtitles-on-by-default/)
 * To preselect the language that is set on your page, you could try this (wrap 
   it in a <script> tag or put in a js file that is included on your site):
 *     ```
       var lang = document.documentElement.lang;
        if (lang){
       	jQuery('.mejs-video.svq .mejs-captions-selector-input[value$="'+lang.substr(0,2)+'"]').click();
           }
       ```
   
 *  Thread Starter [bazza](https://wordpress.org/support/users/bazza/)
 * (@bazza)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/subtitle-for-default/#post-13659048)
 * thanks,
    I add a delay because it takes a while to load
 * setTimeout(function(){
    var lang = document.documentElement.lang; if (lang){ 
   jQuery(‘.mejs-video.svq .mejs-captions-selector-input[value$=”‘+lang.substr(0,2)
   +'”]’).click();} }, 6000);
 *  Plugin Author [team-ok](https://wordpress.org/support/users/team-ok/)
 * (@team-ok)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/subtitle-for-default/#post-13659848)
 * Great!
    The link didn’t show up in my last post. Here it is again: [https://wordpress.org/support/topic/subtitles-on-by-default/](https://wordpress.org/support/topic/subtitles-on-by-default/)
 *  Thread Starter [bazza](https://wordpress.org/support/users/bazza/)
 * (@bazza)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/subtitle-for-default/#post-13661137)
 * If you don’t have javascript I also add this:
 *     ```
       if ( stripos(get_locale(), $sub['svq_lang'] ) > -1 ) {$svq_default_lang = "default"; } else { $svq_default_lang = ""; }
       $html .= '<track srclang="' . esc_attr($sub['svq_lang']) . '" label="' . esc_html($sub['svq_label']) . '" kind="subtitles" src="' . esc_url($sub['svq_src']) .'" '. $svq_default_lang . '>';
       ```
   
    -  This reply was modified 5 years, 7 months ago by [bazza](https://wordpress.org/support/users/bazza/).

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Subtitle for default’ is closed to new replies.

 * ![](https://ps.w.org/switch-video-quality/assets/icon-128x128.png?rev=1233901)
 * [Switch Video Quality](https://wordpress.org/plugins/switch-video-quality/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/switch-video-quality/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/switch-video-quality/)
 * [Active Topics](https://wordpress.org/support/plugin/switch-video-quality/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/switch-video-quality/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/switch-video-quality/reviews/)

## Tags

 * [track](https://wordpress.org/support/topic-tag/track/)

 * 4 replies
 * 2 participants
 * Last reply from: [bazza](https://wordpress.org/support/users/bazza/)
 * Last activity: [5 years, 7 months ago](https://wordpress.org/support/topic/subtitle-for-default/#post-13661137)
 * Status: resolved