Displaying past onelives on the website

We need a video archive page to display past one live videos. We use youtube API to get videos from the SEF youtube channel.

1 Like

Good work @anjisvj! :star_struck:
What are the next steps?

Please let us know if there’s any blockers. Also, mention if you need any help. :slight_smile:

So the dummy page also have been created. but youtube url shows only 5 items in the first place. I think it should show atleast 10 items cuz main purpose of that page is to show videos.

1 Like

How about allowing user (frontend) to decide the maxLength?
According to the youtube API it can be any value between 0 - 50.

Think about a scenario like this. What if we need to display latest 3 onelives on the main onelive page or on another page?
If we can send the maxLength as a query param, I think it will be more flexible for the user. :slight_smile:

What do you think?

I think it’s cool. So we have some issues to be done with the data-holder

1 Like

@Yohan and @osusara since you are available now. can you do this https://github.com/sef-global/sef-data-holder/issues/14 ? we need to finish this as soon as we can.

1 Like

Here’s a quick update on what going:
There was a CORS policy issue and now it’s fixed so the first 10 videos are now displayed in the archive. next step is to work on how send nextPageToken using query param to load next 10 videos and append it to the current videos.

1 Like

Great @anjisvj! Send the archive PR too. :innocent:

Here’s a quick update on Issue#14:

There was a issue with when we get data. Because the payloads sent as plain strings(text).Then browser recognized it as plain text because of that we can’t get a data. Then I Set the ContentType of payloads to application/json for issue#14. then we can get payload as JSON.

PR link:

1 Like

Here is the issue for the next step: @jaye Can you please review this issue.

1 Like

@anjisvj Currently there’s nothing on the archive page because that PR has been reverted. We have to implement it first. :slight_smile:

Sorry my bad! I saw it now. Next time please add the relevant PR links, screenshots, previews for this thread.

@Gravewalker can you review the issue above and tell me?

Nice @anjisvj!
I just modified it as below. Update the issue description using these details too.

Currently, the onelive archive page ( add path ) displays only the first 10 videos. We need to load and display all videos in the playlist for the user. Since this is a paginated result, you have to load the given number of videos at a time.

This is because API has been designed to send a paginated request, that is 10 videos per page at the moment. Since this api designed by wrapping the YouTube playlist API (just link the word ‘YouTube playlist API’ with the link :wink: ) the paginated result is a little bit different from the traditional paginated result with offset and limit.

The payload contains the token for the next page. You have to send it with the url to get the next videos in the following format.
https://sef-dataholder.herokuapp.com/youtube/onelive?nextPageToken={token-for-the-next-page}
The returning payload contains the token for the next page.

Requirement:
Find an optimal way to store the page token and send it with the next request. :cowboy_hat_face:
Find a creative way to display load more strategy for the user ( a load more button, infinite scroll, or feel free to use your own cool feature :heart_eyes:)

Thank you. :hugs: I updated the issue.

1 Like

Welcome @anjisvj!
I think it will be easy if we can implement this before going to the UI.

yeah I added max results as a query parameter using this pr so now we can get a specific number of videos. I need some help on how to send a query param I couldn’t find it how to do it.

1 Like

We need to limit the video description text. Currently it shows complete description and it can be a problem if it has a long description. I’ll raise an issue for this.

1 Like

Thanks, @anjisvj this is exactly what I was looking for! :purple_heart:

You can send this as a hardcoded value in your ajax call in the UI.

ex:

$.ajax({
    type: 'get'
    url: 'https://sef-dataholder.herokuapp.com/youtube/onelive?maxResults=10', 
    success:... 

oh that’s great.I’ll try it. thanks @jaye :star_struck:

1 Like