Last active
May 16, 2022 07:00
-
-
Save Samiulcse/21f94e05ab0378667564b3295aa3b84d to your computer and use it in GitHub Desktop.
Revisions
-
Md. Samiul Islam revised this gist
May 16, 2022 . 1 changed file with 0 additions and 17 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -40,21 +40,4 @@ loadYoutube(){ // this.loadYoutubeVideos(playListId, res.data.nextPageToken) // } }); }, -
Md. Samiul Islam revised this gist
May 16, 2022 . 1 changed file with 17 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -40,4 +40,21 @@ loadYoutube(){ // this.loadYoutubeVideos(playListId, res.data.nextPageToken) // } }); }, loadSections() { axios.get(`/api/home-sections?page=${this.current_page}&per_page=${this.per_page}&profile_id=${(this.currentProfile ? this.currentProfile.id : '')}`) .then((response) => { response.data.data.forEach(val => { this.sections.push(val) if (val.type == 'ad') { this.contentAd = true this.adSectionIds.push(val.id) setTimeout(() => { this.initSmallAdvertiseSlider(`small_advertise_slider${val.id}`) }, 200) } this.loadMore = false }); this.last_page = response.data.meta.last_page }); }, -
Md. Samiul Islam created this gist
May 16, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,43 @@ loadYoutube(){ axios.create().get('https://www.googleapis.com/youtube/v3/channels', { params: { part: "contentDetails", id: process.env.MIX_YOUTUBE_CHANNEL_ID, key: process.env.MIX_GOOGLE_API_KEY, }, headers: { 'Authorization': '', } }).then((response) => { this.loadYoutubeVideos(response.data.items[0].contentDetails.relatedPlaylists.uploads, '') }); }, loadYoutubeVideos(playListId, pageToken){ axios.create().get('https://www.googleapis.com/youtube/v3/playlistItems', { params: { part: "contentDetails,snippet", playlistId: playListId, key: process.env.MIX_GOOGLE_API_KEY, maxResults: this.maxResults, pageToken: pageToken }, headers: { 'Authorization': '', } }).then((res) => { if(pageToken == ''){ this.ytVideos = res.data.items.map(item => { return { id: item.contentDetails.videoId, type: 'y', playlist: playListId, preview_image_thumbs: item.snippet.thumbnails.medium.url } }) } // if(res.data.nextPageToken){ // this.loadYoutubeVideos(playListId, res.data.nextPageToken) // } }); },