[HELP] Use activity starter to launch a youtube video related to the place entered by user

I need help. Lots of it. I made a Reddit post, if you want to read it for context. All you really need to know though is that I need to figure out some way to pull up a youtube video related to a topic chosen by the user. Here’s some code blocks that I’ve been messing around with:

Honestly, if I could just get the youtube search to work, I’d call it good. But using the url of YouTube search doesn’t work for some reason. I’m really close to giving up.

Anyway, I would really appreciate it if someone could give me some insight. Thanks

What you are attempting might not be permitted by YouTube or GooglePlay
Lista di Film and Sospensione app dal Play Store . If you are creating an app for your personal use, this might be OK.

Here is some old Forum advice that might help Spencer .

or something here

Does that advice work for you?


1 Like

Thank you so much for replying!

I’m able to launch a predetermined video using the method in the forum advice, but I can’t display a youtube search of a user’s string value.

Those code blocks open up the youtube app, but it doesn’t display the search option. It tries to display a video with the ending url of “results…=” which obviously returns an error.

This post that I found in the search you linked, seems to also be trying to accomplish the same type of thing I am, albeit a different approach. Unfortunately, the only response brings us full circle.

You mentioned that what I’m attempting might not be permitted the way I’m doing it, is there another approach using activity starter?

I’m convinced that there’s some complicated approach where you can do a background google search for a youtube video, return the url, use string splitter to separate the unique part from the rest of it, and then you can use the established method of a string joiner to join “vnd.youtube:” with the unique url of the video to display the video.

Thanks again for replying, your help is really appreciated!

What you are attempting might not be permitted at all Spencer. What you are doing with
YouTube is similar to an app that was not allowed on GooglePlay and elicited a rebuke.

Good luck with your experiments. I do not know how to do that. When you are successful, you might elicit a similar rebuke when you post to GooglePlay. The issue is a matter of YouTube protecting itself from how outside developers use its copyrighted property. YouTube wants users to search using its methods and get advertising in front of its users. Your proposed app would circumvent that..

Yeah, I give up. It’s too hard. Thanks for your help.

Not too hard Spencer; what you hope to do is probably impossible . YouTube does not want developers to provide access to their videos the way you would like to do it. They want users to use their facilities.

I know I'm late to the coding party but I had the some issues as you. With your blocks and others I found online I was able to get it working. When someone types anything I have it search YT,Flickr. And I have different buttons for the diff sites. I even added YT into the window so they don't have to leave the app, and if and only if they would like to use the YT app I have a button for that. Heres a pic of my blocks and hope this help you with whatever you need.

Please download and post each of those event block(s)/procedures here ...
(sample video)

Why that way?

The block-specific download as .png option creates a file that can be dragged from a file directory or from a board post directly into the Blocks Editor, and the Blocks Editor will load the blocks directly into the currently open project, without the need for the user to re-type the blocks.

It's an act of generosity of an author to his readers to provide them with draggable blocks.

See this post for an example of draggable and non-draggable blocks ...