Android Code Snippet Youtube intent force orientation lanscape

Hi all, this is way to force the orientation of an intent youtube ( landscape )

B4X:
    Private i As Intent
    i.Initialize(i.ACTION_VIEW, "https://www.youtube.com/watch?v=XXXXXX" )
    i.putExtra("force_fullscreen",True)
    i.SetComponent("com.google.android.youtube/.UrlActivity")
    StartActivity(i)

By
Marco
 

Rick Harris

Well-Known Member
Licensed User
Hi all, this is way to force the orientation of an intent youtube ( landscape )

B4X:
    Private i As Intent
    i.Initialize(i.ACTION_VIEW, "https://www.youtube.com/watch?v=XXXXXX" )
    i.putExtra("force_fullscreen",True)
    i.SetComponent("com.google.android.youtube/.UrlActivity")
    StartActivity(i)

By
Marco
The command "force_autoplay" seems to work as well! I discovered this by experimenting (undocumented?).
B4X:
    Private i As Intent
    i.Initialize(i.ACTION_VIEW, "https://www.youtube.com/watch?v=XXXXXX" )
    i.putExtra("force_fullscreen",True)
    i.putExtra("force_autoplay",True)
    i.SetComponent("com.google.android.youtube/.UrlActivity")
    StartActivity(i)

Try this (Live TV from Amsterdam!):

B4X:
    Private i As Intent
    i.Initialize(i.ACTION_VIEW, "https://www.youtube.com/watch?v=YH3Nhp0R9t8" )
    i.putExtra("force_fullscreen",True)
    i.putExtra("force_autoplay",True)
    i.SetComponent("com.google.android.youtube/.UrlActivity")
    StartActivity(i)
 

victormedranop

Well-Known Member
Licensed User
Hi, what library do i need to work with INTENT
try your code but got error
Object Expected on
B4X:
 Private i As Intent
 

MarcoRome

Expert
Licensed User
No library.
When reporting Error , wrong or another things is necessary that we send more details possible, code that you use, etc.
In another way ISNT possible
 
Top