YouTube Player Controls

Adds features to YouTube player page: fill window with video, stretch, float video, set HD 4K 8K resolution, hide annotations and ads, click skip ads, click show more, loop, replay a video segment, pause at start/end, zoom and pan video.

< Відгуки до YouTube Player Controls

Відгук: Добре - скрипт працює добре

§
Опубліковано: 03.05.2018

Setting video playback quality feature won't work (solution inside)

Hello mate,

As the title says, setting video playback quality function won't work. It seems like YouTube has made some changes to their code again. I've found a way to make it work again.

Would you mind updating this part of your code:

function ytplayer_quality(def) {
    ytplayer_state('quality_status', 'fail');

    injectScript("var a = document.getElementById('c4-player') || document.getElementById('movie_player');\
                   if (a != null)\
                      if (a.setPlaybackQuality != null){\
                          a.setPlaybackQuality('" + def + "');\
                          var n = document.getElementById('ytpc_ytplayer_state');\
                          if (n) n.setAttribute('quality_status', 'success');\
                      }\
                  ");
}

into this to fix the issue, please:

    function ytplayer_quality(def) {
        ytplayer_state('quality_status', 'fail');

        injectScript("var a = document.getElementById('c4-player') || document.getElementById('movie_player');\
                       if (a != null)\
                          if (a.setPlaybackQualityRange != null){\
                              a.setPlaybackQualityRange('" + def + "');\
                              var n = document.getElementById('ytpc_ytplayer_state');\
                              if (n) n.setAttribute('quality_status', 'success');\
                          }\
                      ");
    }

Thanks,

CostasАвтор
§
Опубліковано: 14.05.2018

Thank you for this! I have implemented it in the new version.

§
Опубліковано: 20.05.2018

Good job! Thanks.

Опублікувати відповідь

Sign in to post a reply.