Showing posts with label video. Show all posts
Showing posts with label video. Show all posts

Wednesday, May 30, 2012

How to play embed you tube video in web view

How to play embed you tube video in web view  

Note: this is applicable in HTML-5 browser supported devices only 

myWebView = (WebView) findViewById( R.id.webview_compontent );

String playVideo= "<html><body>Youtube video .. <br> <iframe class=\"youtube-player\" type=\"text/html\" width=\"640\" height=\"385\" src=\"http://www.youtube.com/embed/bIPcobKMB94\" frameborder=\"0\"></body></html>"

myWebView.loadData(playVideo, "text/html", "utf-8");

Friday, March 23, 2012

How to play video in fullscreen in android?


ANDROID

How to play video in fullscreen in android?

Hello all……
Someone has been asking me how to play a video in android in fullscreen. Then I made some surfing in the internet and found a solution.
You can check out how to play a video in android here and to check whether the video has completed playing here.
The only change was to do in the xml.
This is the xml code of the layout containing the videoview.
?
Drag and copy the code
01
02
03
04
05
06
07
08
09
10
11
12
13
<?xml version="1.0" encoding="utf-8"?>
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
           android:layout_width="fill_parent"
           android:layout_height="fill_parent" >
   <VideoView android:id="@+id/myvideoview"
             android:layout_width="fill_parent"
             android:layout_alignParentRight="true"
             android:layout_alignParentLeft="true"
             android:layout_alignParentTop="true"
             android:layout_alignParentBottom="true"
             android:layout_height="fill_parent">
    </VideoView>
 </RelativeLayout>