iOS Question Porting Class Youtube from B4A to B4i

MarcoRome

Expert
Licensed User
Longtime User
I would like to make available the Youtube V3 class of the existing library currently in B4a (Library YouTube V3) in order to have a compatible class (B4X) for B4A / B4i.
The class works perfectly in the B4A environment but in B4i I have the following error:


The code is:

B4X:
'Class module
Private Sub Class_Globals
 
   ....
     
    Type SearchVideo( _
       publishedAt(100) As String, title(100) As String, description(100) As String, _
      urlpicture(100) As String, urldefaultpicture(100) As String, urlmediumpicture(100) As String, idVideo(100) As String, totalResults As Int, TotalChannel As Int, _
      nextpage(100) As String, prevpage(100) As String )

......

    Private SVideo As SearchVideo
 
End Sub

Public Sub SearchVideo(maxresult As Int, search As String, order As String, regionCode As String, videoDuration As String, Module As Object, EventName As String )
  
    Dim su As StringUtils
    search = su.EncodeUrl(search, "UTF8")
  
    SVideo.Initialize  '<----- THE ERROR IS HERE
    If order = "" Then
        order = "relevance"
    End If
    If videoDuration = "" Then
        videoDuration = "any"
    End If
    If regionCode = "" Then
        Dim job1 As HttpJob
        job1.Initialize("searchvideo1", Me)
        job1.Download("https://www.googleapis.com/youtube/v3/search?part=id,snippet&order="& order &"&maxResults="& maxresult &"&videoDuration="& videoDuration &"&q="& search &"&key=" & keyvalue)
    Else
        Dim job1 As HttpJob
        job1.Initialize("searchvideo1", Me)
        job1.Download("https://www.googleapis.com/youtube/v3/search?part=id,snippet&order="& order &"&maxResults="& maxresult &"&videoDuration="& videoDuration &"&regionCode="& regionCode &"&q="& search &"&key=" & keyvalue)
    End If
'    Dim job1 As HttpJob
    '    job1.Initialize("search", Me)
'    job1.Download("https://www.googleapis.com/youtube/v3/search?part=id,snippet&maxResults="& maxresult &"&q="& search &"&key=" & keyvalue)
    'job1.GetRequest.SetHeader("Accept", "application/json")
    MN = Module
    EN = EventName
End Sub



Simply when i initialize
Any help ?
Thank you
Marco
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…