Embed Video or link to Youtube Video on App Lab Project

@awei At the moment, AppLab does not allow you to embed videos and links to videos. However, I will pass this request on to the @code.org team. It may be available in future versions of appLab. I have also included a link to AppLab Docs which details all the functions available to the programming environment.

Just wanted to see if our students can now embed Video or link to Youtube or a link to any website.
Any updates?
I can’t seem to find any.

@princess_choi

AFAIK, this is option is still not available.

Happy Computing.
Andrea

Similarly, is there a way to include a link to a web page url in App Lab?

I don’t think so. I think last I heard, it was a security/safety risk - something like there was concern about monitoring what type of content was being linked off of apps. Perhaps someone in the engineering team can give an updated answer?

There is a way, but it’s not really ready for prime time and difficult to control. The write command will add text to the screen starting at the top.

write("<a href='http://code.org/csp'> go to CSP! </a>");

Example Project – updated

We’re working on arbitrary HTML insertion which would let you do things like embed videos, but there are security risks/hurdles associated that we have to wrangle. You’ll notice if you experiment with inserting html with the write command that it’s pretty locked down - the html is inspected and sanitized to avoid security holes. The debug console will tell what was stripped out. This makes it hard to control right now - like you can’t really position it or set styles.

“working on” means it’s high on the priority list for when major updates to App Lab happen which will happen, but at some indefinite point in the future. We know this is a feature people want, but that’s the news for now.

-Baker

3 Likes

Do we have the ability to link to a url and have it display?

Asking for a student

Hi @cshock,

Did you see Baker’s post above? That explains one way to get a link in an app. Does that help?

KT

Hi:
Just had my CSD workshop (newbie)…thought I heard a discussion across the room that inserting a video or video URL was possible…but from this thread now not sure. Does the code.org app allow now?
Thank you!

At this point, the status has not changed. Keep checking this thread for an update.

???
The example project doesn’t have the mentioned code.
Am I blind? Wanted an example.

Weird. Don’t know how that happened. I have fixed the link.

1 Like

it still is not working

Thanks much for this code. Is there a way it can be modified to name the screen that it should go to? The current write command always goes to the home screen.

Hi Baker!
Yes, embedding URLs is definitely something students want to be able to do. I had several questions about it for the final projects.
Thank you for the sample code!

Hi terence.stone25
Any updates to inserting a URL and embedding video in AppLab?

Hi @kerryb,

I don’t see the ability to embed a video, but it seems possible to insert a URL in AppLab (under the UI Controls toolbox)…
image
(The documentation doesn’t seem to be working for me at the moment, but the block seems pretty self-explanatory.)

Don’t suppose a work around has been developed to open an online video within a screen widget or a canvas or something?

Nothing so far. Because an app lab “app” is really running as a web page, the only way I can think to do this is through some sort of iFrame… which sounds like it would get ugly fast.

If this changes we’ll let you know!

Thanks for the reply,

That’s what I thought. When I use the Open URL block, is there any switch which will stop the pop-up asking the user if they OK to leave the Code.org site? In other words, to simply go straight to the website (in my case to a YouTube video)?