Youtube and the activity starter

1,071 views
Skip to first unread message

Toni Schuh

unread,
Jan 21, 2015, 11:11:09 AM1/21/15
to mitappinv...@googlegroups.com
Hey Guys!

I am making an app, which starts the phones Youtube app out of a webviewer. To do this i followed PAEs example in this post: https://groups.google.com/forum/#!searchin/mitappinventortest/html$20call/mitappinventortest/Ez5RVlP8LVw/jn2a2oY87isJ
But i think the following will also apply to the use of the activity starter at all and not only from the webviewer.

In the documentation and in tutorials the given structure for opening the Youtube app with the activity starter is like that:

Action: android.intent.action.VIEW
ActivityPackage: com.google.android.youtube
ActivityClass: com.google.android.youtube.PlayerActivity
DataUri: http://www.youtube.com/watch?v=8ADwPLSFeY8


But this example allways leads to a 601: No corresponding activity Error.

Leaving Package and Class in the activity starter empty did half the trick: Now there is a pop-up which let you choose the App you want to start. In this case it asked if you want to use the Chrome Browser, the native android browser or the Youtube app. But i wanted to start the Youtube app instantly, without the question dialog.

What i did was:

Action: android.intent.action.VIEW
ActivityPackage:
ActivityClass:
DataUri: vnd.youtube:5Yn6fR7CAD0


So setting the Action and the DataUri with vnd. rather than http:// did the trick for me.
As i have only one device to test this behaviour (Galaxy S4, Android 4.4.2) and very little coding and AI2 experience i would like to ask you to comment on what i did and maybe even confirm that this is working on other devices/android versions.


Thx & have a nice day! :-)




Taifun

unread,
Jan 21, 2015, 11:21:18 AM1/21/15
to mitappinv...@googlegroups.com
yes, this is the way to do it
Taifun

Toni Schuh

unread,
Jan 21, 2015, 11:58:06 AM1/21/15
to mitappinv...@googlegroups.com
It makes me a little bit sad, that the answer is allready there. Two days of googling and searching this forum only brought examples with the http in the datauri, while it didn't show your snippet nor the posts in this forum you got it from (probably cause i searched for things like activity starter, youtube, youtube package, etc - and not for 'forcing youtube into fullscreen').
As i found other threads in this forum mainly saying that it is not possible to do it (and totaly not possible using a webviewer), i strongly recommend to update the documentation of the use of the activitystarter together with youtube.

But thx for answering my post and providing an actual usefull link anyway :-)

Taifun

unread,
Jan 21, 2015, 12:12:37 PM1/21/15
to mitappinv...@googlegroups.com
thank you, yes, the documentation needs an update, but only MIT can do this... http://ai2.appinventor.mit.edu/reference/other/activitystarter.html
Taifun
Reply all
Reply to author
Forward
0 new messages