B4A Library CustomYouTubeFeed

This library will allow you to get YouTube Feeds and display them on a WebView.

Requirements:

- B4A 2.7x


How to install:

- Copy the CustomYouTubeFeed.jar and CustomYouTubeFeed.xml to your additional libraries directory.


How to use:

B4X:
'Initialize the library
Dim Feed As CustomYouTubeFeed

Feed.Initialize(WebView1, "", "")

'Select the feed you want to retrieve, for example: Get user uploads
Feed.GetUserUploads("basic4android", 1, 25)

That's it!!.

You can use the WebView's events to do further processing of the results if needed.


This library will allow you to:

* Search Videos
* Browse Category
* Get User Uploads
* Get Channels
* Get Most Viewed Channels
* Get Most Subscribed Channels
* Get Most Popular
* Get Most Popular By Category
* Get Playlists
* Get Related Videos

There are also two variables:

- FeedType: Returns the selected feed.
- Results: Returns the number of results found.

The attached sample shows how simple is to use this library.

NOTE: Google has removed this API, this library no longer works.
 

Attachments

  • CustomYouTubeFeed_Library_1.0.zip
    8.7 KB · Views: 390
  • YouTubeFeed_Sample.zip
    11.3 KB · Views: 394
Last edited:

MarcoRome

Expert
Licensed User
Longtime User
Hi NJDude.
All work but i have a few question for you.

B4X:
Feed.GetMostPopular(paese,"this_week",fIndex, fMaxResults)

I have this result ( example ):

example.png


Is possible only things in red corner without description ???

Thank you very much for your response and great library
 

MarcoRome

Expert
Licensed User
Longtime User
Hi NJNude i have one question.
I utilize your library + SNYouTube.

image-music-CD76_53B276B2.png


Is possibile if i utilize Feed.GetPlayList know the name the video ( in this example "Ricky ...." as point 1 in picture) and name file youtube ( no playlist but name the movie that i load"??

Thank you
 

walterf25

Expert
Licensed User
Longtime User
Has anything changed on the youtube side, i have an idea for an app, i just downloaded your library and i get this error.

I haven't really looked too deep into it, so probably it's my fault, but let me know!

Thanks,
Walter
 

Attachments

  • Screenshot_2015-07-14-20-44-17~2.jpg
    Screenshot_2015-07-14-20-44-17~2.jpg
    145.1 KB · Views: 144

MarcoRome

Expert
Licensed User
Longtime User
Just to answer my own question: I have now managed to get Youtube API versie 3.0 working! It was easier than I thought. All I needed was to use my API key for Youtube. A good example of how to search on Youtube with API version 3.0 is to use a http2utils job and download a search URL like for example:
https://www.googleapis.com/youtube/v3/search?part=snippet&q=madonna_like_a_virgin&maxResults=50&key=[Your Youtube API key]. This returns detailed search results in JSON format.
Full documentation can be found here: https://developers.google.com/youtube/v3/docs
You can get your key via your Google Developer console. Don't forget to activate the Youtube data API in this console!
Right is disponible library HERE
 

MarcoRome

Expert
Licensed User
Longtime User
Hi Rick.
You can see this for next Result:

pageToken
The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved.

Look THIS

And dont worry for my avatar is only little but good devil ;)
 

Payne

New Member
Licensed User
Longtime User
I am b4a v7.8 and android 6.0.1
I ran the demo "YouTubeFeed_Sample.zip" and got following error.
Could anyone help ?

java.lang.NoSuchMethodError: No static method Msgbox(Ljava/lang/String;Ljava/lang/String;Lanywheresoftware/b4a/BA;)V in class Lanywheresoftware/b4a/keywords/Common; or its super classes (declaration of 'anywheresoftware.b4a.keywords.Common' appears in /data/app/com.njdude.youtube.feed.sample-2/base.apk)
at com.njdude.youtube.feed.sample.customyoutubefeed._hc_responseerror(customyoutubefeed.java:451)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:186)
at anywheresoftware.b4a.BA$2.run(BA.java:360)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5451)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:102)
 
Top