B4A Library YouTube library

socialnetis

Active Member
Licensed User
Longtime User
Erel, do you think it would be possible to wrap the YouTubePlayerView? I've tried but the activity in which you want to use the view needs to extend the YouTubeBaseActivity.
 

Buks

Member
Licensed User
Longtime User
I get an error:
Compiling generated Java code. 0.47
Convert byte code - optimized dex. Error
A referenced library is missing: youtubeandroidplayerapi
 

Vincenzo Fabiano

Member
Licensed User
Longtime User
When i try to play some Video, Youtube app crash! Why? With other video i have no problem.. Sorry for my bad english.

Video Problem = ?v=SOeOPlsXh3s

Test Phone = Galaxy s4 and Sony Miro.


EDIT: App no more crashes but YouTube report: "Si è verificato un errore con la rete (500)"
 
Last edited:

Vincenzo Fabiano

Member
Licensed User
Longtime User
Sorry Erel, problem is solved! Google change our services (api key), and YouTube Api were disabled! (Service now is called Google Cloude)
 

Ratna Fang

Member
Licensed User
Longtime User
hi erel,
is it possible to retrieve image thumbnail, title, and video ID from a given youtube playlist ID?

i'm searching the way to make a listview based on a PlaylistID
 

Ratna Fang

Member
Licensed User
Longtime User
thanks alot, erel
i'll learn more from your example, imagedownloader or flickrviewer
 

Shahid Saeed

Active Member
Licensed User
Longtime User

I am in a similar situation, I am using a splash screen, and app is setup for Full Screen portrait mode, when you play a video it opens in landscape full screen and when quit video the APP restarts and this time stays at splash screen.

I have tried to handle through pause sub, resume sub but no luck; Here is the code for your reference:

B4X:
Sub Activity_Create(FirstTime As Boolean)
   
    pnllist.Initialize
    BayanCList.Initialize
   
    If FirstTime Then   
    isFirst = True   
    End If
   
    SplashTimer.Initialize("SplashTimer", 4000)
    SplashTimer.Enabled = True
    Activity.LoadLayout("spalsh")
   
End Sub
Sub Activity_Resume   
    If isFirst = False Then   
        Dim pnl As Panel = BayanList.GetPanel(posBayan-1)
        If pnllist.Size > 0 Then
        For i = 0 To pnllist.Size-1
            Dim p As Panel = pnllist.Get(i)
            p.Color = Colors.Transparent
        Next
        End If
        pnl.Color = pnlBG       
    End If   
End Sub

Sub Activity_Pause (UserClosed As Boolean)
    If UserClosed = True Then
    Activity.Finish
    End If
    posBayan = posBayan
    isFirst = False    
End Sub

Sub SplashTimer_Tick   
    SplashTimer.Enabled = False
    DoEvents
    Activity.RemoveAllViews
    DoEvents
    Activity.LoadLayout("Main")
End Sub
 

Shahid Saeed

Active Member
Licensed User
Longtime User
can i view youtube in fullscreen??
Yes, you can view YouTube in full screen mode.

Full Screen view
B4X:
Sub PlayVideo_Click
 YouTube.StartVideo("AIzaSyxxxxxxxx-xxxx-xxxxxxxxxxxx", _"0xdZXOM_Otc", 0, True, True)
End Sub

Lightbox Portrait view
B4X:
Sub PlayVideo_Click
 YouTube.StartVideo("AIzaSyxxxxxxxx-xxxx-xxxxxxxxxxxx", _"0xdZXOM_Otc", 0, False, True)
End Sub
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…