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.

< Feedback on YouTube Player Controls

Review: Good - script works

§
Posted: 2018-05-03

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,

CostasAuthor
§
Posted: 2018-05-14

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

§
Posted: 2018-05-20

Good job! Thanks.

Post reply

Sign in to post a reply.