Embed one or more YouTube videos​ in Sketchware App

Embedding a YouTube video in Sketchware Android App is very easy using iframe. YouTube itself provides the iframe code for embedding youtube videos.

To insert a YouTube video in your app, insert a webview in View area, at a location you want to display the YouTube video. You can insert more webview widgets, one for each video you want to display.

Set the layout_height of all webview widgets to wrap_content.

After that in Logic area, in On activity create event, use webview loadUrl block. In the space for Url, write the following code as shown in image below:
data:text/html, <iframe width="100%" height="" src="http://www.youtube.com/embed/5aMQZ7mSgD4" frameborder="0"></iframe>

Replace the highlighted code with your YouTube video id, and change height and width of iframe as per your requirement.

Save and Run the App. Your app will display your YouTube videos at your desired location.

Komentar

Cara pembuatan Apps paling Populer

Create Stopwatch App in Android using Sketchware

How to enable download in webview in Sketchware apps?

TextInputLayout in Sketchware

Create Stopwatch App in Android using Sketchware

How to integrate Admob Ads in Sketchware project using AIDE?

How to find and​ highlight a word in a text field in Sketchware?

Code for implementing Notifications in Sketchware

A Flash Light App in Sketchware

Create a Stopwatch App using Chronometer in Sketchware

Create app to save all passwords, protected using voice key