web: Enable captions by default on mobile.
authorMarcus Brinkmann <marcus.brinkmann@ruhr-uni-bochum.de>
Fri, 19 May 2017 15:35:48 +0000 (17:35 +0200)
committerMarcus Brinkmann <marcus.brinkmann@ruhr-uni-bochum.de>
Fri, 19 May 2017 15:36:20 +0000 (17:36 +0200)
web/share/campaign/campaign.js

index 95d1bd6..99d08fb 100644 (file)
@@ -113,6 +113,9 @@ $(document).ready(function() {
        if (yt_list) {
            extra_parms = "&list=" + yt_list;
        }
+       if (screen.width < 768) {
+           extra_parms = extra_parms + "&cc_load_policy=1"
+       }
        $(this).html('<iframe class="embed-responsive-item" allowfullscreen src="https://www.youtube.com/embed/'
                     + yt_id + '?autoplay=1&modestbranding=1&rel=0' + extra_parms + '"></iframe>');
     });