Has anyone passed a URI to a youtube intent?

vb1992

Well-Known Member
Licensed User
Longtime User
Has anyone successfully passed a URI to a youtube intent?


B4X:
Dim Intent1 As Intent
Intent1.Initialize(Intent1.ACTION_VIEW, "http://m.youtube.com/watch?v=zLDIcIrZO8Y")
Intent1.SetComponent("com.google.android.youtube/.PlayerActivity")
StartActivity(Intent1) 


'intent1.PutExtra("android.intent.extra.TEXT", "http://www.youtube.com/watch?v=zLDIcIrZO8Y")

'Uri.parse("http://www.youtube.com/watch?v=cxLG2wtE7TM")))
'Uri.parse("vnd.youtube://" + video_id);
 
Last edited:

vb1992

Well-Known Member
Licensed User
Longtime User
got it working:


B4X:
Dim Intent1 As Intent
   Intent1.Initialize(Intent1.ACTION_VIEW, "http://m.youtube.com/watch?v=zLDIcIrZO8Y")
   Intent1.SetComponent("com.google.android.youtube/.WatchActivity")
 
   intent1.PutExtra("","http://m.youtube.com/watch?v=zLDIcIrZO8Y")
   StartActivity(Intent1)
 
Upvote 0

MDEnt

Member
Licensed User
Longtime User
How would a random URI be passed to the intent? In other words - someone is viewing a YouTube page in a webview and could click on any particular video to launch YouTube?
 
Upvote 0
Top