How to play Vimeo Video in Android app

URAndroid picture URAndroid · Mar 14, 2013 · Viewed 7.6k times · Source

Is there any way to play Vimeo Video in WebView or VideoView in Android. Any source code for playing Vimeo will be helpful for me. Please help.

Answer

ismail uzunok picture ismail uzunok · Nov 28, 2014

Add WebView to your layout

<WebView
    android:id="@+id/webView1"
    android:layout_width="400dp"
    android:layout_height="400dp" />

Then add

@Override
protected void onCreate(Bundle savedInstanceState)
{
   webView1.loadData("<iframe src=\"http://player.vimeo.com/video/"+VIDEO_ID+"\" width=\"180px\" height=\"180px\" frameborder=\"0\" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>", "text/html", "utf-8");
}