'Play public Vimeo video automatically and detect playback finish

I want to integrate some Vimeo videos in my Android application (in java). I have seen that there is an official SDK: https://github.com/vimeo/vimeo-networking-java

Following the steps I have managed to obtain the Video object and from here the HTML code. I have tried to display the video in a WebView, but nothing appears (solved, see edit below).

public void onSuccess(@NonNull VimeoResponse.Success<Video> success)
{
    String html = success.getData().getEmbed().getHtml();
    vimeoWebView.loadData(html, "text/html", "utf-8");
}

There is no an example in embed step, only this comment: display the html however you wish.

I would like to be able to view the video and control its playback, being able to start its playback automatically without user interaction and detecting when it ends. Is it possible?

Edit:

I have managed to display the iframe by enabling javascript in the WebView:

protected void onCreate(Bundle savedInstanceState)
{
    ...
    vimeoWebView = findViewById(R.id.vimeoWebView);
    WebSettings webSettings = vimeoWebView.getSettings();
    webSettings.setJavaScriptEnabled(true);
}


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source