Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author plugin.builders

    (@pluginbuilders)

    Hi, add limit=”50″. YouTube API returns at most 50 videos per load.

    Your API Key’s restrictions are also not working. Try disabling the HTTP referrer checkbox at Google’s settings. You’ll see YouTube API being called in browser’s network tab if restrictions are not working, otherwise it’ll call the API in server and will cache results.

    Thread Starter chrismartinjenkins

    (@chrismartinjenkins)

    Thanks for getting back to me so quickly. I’ve changed limit=”50″ and now all videos from the playlist can be viewed, but unfortunately the videos don’t get displayed in the correct order.

    https://www.iwa.wales/videos/ initially displays 50 videos, and if you scroll to the bottom and click ‘View more’, it displays the rest. That’s fine.

    However, the newest videos only get displayed once the ‘View more’ button is clicked, and display at the bottom. They should be displayed at the top.

    So if there are 52 videos in a playlist, it displays the following videos on the first page load:

    50
    49
    48

    47-4

    3
    2
    1

    Then upon clicking ‘View more’, it displays videos 52 and 51 at the bottom of the list:

    3
    2
    1
    52
    51

    The latest videos (52 and 51 in this case) should be displayed at the very top on the first page load. It should be videos 2 and 1 which don’t get displayed until the ‘Display remaining videos’ button is clicked.

    Is this something that can be fixed?

    Plugin Author plugin.builders

    (@pluginbuilders)

    Hi, sorry, that cannot be fixed. YouTube API doesn’t let us sort playlist videos, they’ll appear in the same order they’re at YouTube.

    Thread Starter chrismartinjenkins

    (@chrismartinjenkins)

    Thanks for the reply, and that makes sense.

    Unfortunately they don’t seem to be displaying in the same order as on YouTube. Each ‘page’ of results seems to be in reverse order to what the API response provides.

    For example, on a YouTube playlist of 5 videos, they would be numbered:

    1
    2
    3
    4
    5

    But YourChannel seems to display them in the reverse order, with the final video of the API response at the top:

    5
    4
    3
    2
    1

    This becomes more of a problem when the results get split over multiple pages, like in my example. For a 10-video playlist split over two pages, the order becomes:

    5
    4
    3
    2
    1
    -VIEW MORE-
    10
    9
    8
    7
    6

    If it displayed them in numerical order, from 1-5 then 6-10, then it would be a lot more logical.

    I’ve sent a test request to the https://www.googleapis.com/youtube/v3/playlistItems API, and it does seem to return the videos in the correct order (1-5, then 6-10 once nextPageToken is provided). So I’m not sure why the plugin seems to reverse the results.

    You can see the problem by comparing https://www.iwa.wales/videos/ to the playlist at https://www.youtube.com/playlist?list=PLXIW8hc6slNQjD14FB8nKafNupVZY4Kmh

    On https://www.iwa.wales/videos/ it’s displaying videos 50-1, with video 50 first.

    Surely it should display 1-50, then after the button click it should display 51-56?

    Thanks in advance.

    Thread Starter chrismartinjenkins

    (@chrismartinjenkins)

    Apologies, changing ‘Default Sorting’ from ‘Latest’ to ‘None’ on the YourChannel settings page seems to sort that problem.

    Plugin Author plugin.builders

    (@pluginbuilders)

    Yes YourChannel will also sort videos after they’re loaded (this function was specifically built to sort playlist videos after they’re loaded from the API).

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Playlist shortcode not displaying latest posts’ is closed to new replies.