Posts

Showing posts with the label YouTube videos list in Sketchware

Create list of YouTube videos with thumbnails and titles

Image
To display a list of YouTube Videos on a page, we can follow the steps given below. 1. In VIEW area of  main.xml  add a ListView listview1 . 2. Create a Custom View custom.xml . Here add an ImageView imageview1 and TextView textview1 . 3. For listview1 select custom.xml as CustomView. 4. Add a RequestNetwork component  rn . Also add an Intent component i . 5. Create a String List idlist , a Map List videoList , a Number variable n , and a Map variable map . 6. In  onCreate  event: a. Add id of YouTube videos to idlist . Note that in video URL  https://youtu.be/dPHreMHHoGY   the video id is  dPHreMHHoGY . b. Then use a repeat block. Repeat for length of List  idlist . c. Inside repeat block, use RequestNetwork method GET for url Join https://www.youtube.com/oembed?url=https://www.youtube.com/watch?v= and get at n of idlist and &format=json * See image above. d. After this, inside repe...

YouTube Videos List in Sketchware

Image
Improved app on this topic https://www.sketchwarehelp.com/2020/03/create-list-of-youtube-videos-with.html?m=1 To display a list of YouTube Videos on a page, we can create multiple WebViews programmatically and add them to a Linear vertical in a ScrollView. Follow the steps given below. 1. In VIEW area of  main.xml  add a ScrollView with padding 0. Inside ScrollView add a LinearV  linear1 . 2. Add a Map List  urlList , and a Number variable n . 3. Add a RequestNetwork component rn . This will add INTERNET permissions in AndroidManifest.xml. 4. In  onCreate  event: a. Add items to the list with key 'url'. Here add the videos in html iframe codes. <html> <iframe width=100% height=100% src="https://www.youtube.com/embed/abIuko6FM3M" frameborder="0" allowfullscreen> </iframe> </html> Note that video URL should be as shown above: https://www.youtube.com/embed/( VIDEO ID) b. Then use a repeat block. Repeat for ...