scientiffic scientiffic - 10 months ago 88
Android Question

Problems with Vimeo Player in Android App's WebView

In my Android app, I created a WebView to play Vimeo videos. When I load the activity, the correct preview of the vimeo video appears, but when I attempt to play it, I get the following screen:

enter image description here

Sometimes the audio from the video plays, but I never get the video. Here is what I have in my activity:

Log.d(TAG, "adding viemo");
final WebView vimeoPlayer = new WebView(MediaPreview.this);
vimeoPlayer.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
vimeoPlayer.getSettings().setUserAgentString("Android Mozilla/5.0 AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30");
vimeoPlayer.setWebChromeClient(new WebChromeClient());
vimeoPlayer.setWebViewClient(new WebViewClient());
vimeo_url = mediaURL + "?player_id=player&title=0&byline=0&portrait=0&api=1&maxheight=480&maxwidth=800";
Log.d(TAG, "vimeo_url: " + vimeo_url);
// vimeoPlayer.loadDataWithBaseURL("", vimeo_url, "text/html", "UTF-8", null);

I haven't seen any definitive examples of working Vimeo players in Android apps, so if anyone has gotten this to work, would greatly appreciate your help!

Answer Source

Everything looks pretty good to me not sure why it won't play for you, have you checked this out : ?