Shop Forums JW Player 7 for WordPress Disabling Cloudflare's Rocket Loader on the JW Player

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1712
    nissiu
    Participant

    Hello, I use Cloudflare on my website and I have Rocket Loader activated because it’s really useful but I would like to disable it on the player. As Rocket Loader defers the scripts it causes the JW player to be one of the last elements to load on my pages and I want it to be one of the first elements to load. Now, in order to disable Rocket Loader on specific scripts this code data-cfasync="false" must be added before the src tag in the script. The problem is that when I modify your plugin’s functions file in order to add that piece of code in the jwppp_add_header_code function to echo data-cfasync="false" before src=\"$library\", it breaks my website giving me 500 error on all pages. I can’t really play too much with this because my website has a pretty large volume of traffic so could you suggest me a solution? I would really appreciate it. Thanks!

    #1720
    ilGherailGhera
    Keymaster

    Hi @nissiu, sorry for the late.
    What about this?
    echo "<script data-cfasync=\"false\" src=\"$library\"></script>\n";
    Line 671, jwppp-functions.php, includes folder.

    #1721
    nissiu
    Participant

    Hi, thanks! it works now.

    • This reply was modified 4 years ago by nissiu.
    #1724
    ilGherailGhera
    Keymaster

    Perfect 😉
    Please, if you find the plugin useful, consider to leave it a good review, I will really appreciate it.
    https://wordpress.org/support/plugin/jw-player-7-for-wp/reviews/?filter=5

    JW Player 7 for WordPress – Premium

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.