Embed And Play Youtube Video In Android Webview

In this android tutorial we are going to learn how to embed and play Youtube video in android WebView. There are some situations where you may want to embed video in your android application, the simplest way to achieve this is to embed the video code in your android WebView.

You can check my previous tutorial on how to load external web page inside Android WebView[i][/i]

There are so many problems associated with this concept.

1. The video is hard to go full screen

2. when the video stops playing, it is difficult to restart the video again without reloading the WebView control.

To fix these problem, I wrote a tutorial that uses a custom WebView and chrome client. Feel free to check the tutorial How to play YouTube video inside Android WebView

Before we start, the first thing I will do is to list the environment and tools I used in this android tutorial but feel free to use whatever environment or tools you are familiar with.

Windows 7

Android Studio

Samsung Galaxy Fame Lite

Min SDK 14

Target SDK 19

To create a new android application project, following the steps as stipulated below.

Go to File menu

Click on New menu

Click on Android Application

Enter Project name: AndroidDictionaryApplication

Package: com.inducesmile.androiddictionaryapplication

Keep other default selections.

Continue to click on next button until Finish button is active, then click on Finish Button

Once you are done with creating your project, make sure you change the package name if you did not use the same package.
Embed And Play Youtube Video In Android Webview Embed And Play Youtube Video In Android Webview Reviewed by Unknown on 11:35:00 Rating: 5

No comments:

Powered by Blogger.