question

Carl avatar image
Carl asked Mark Mullan Deactivated answered

Playing Embedded Video

We use Tutorial Videos to help Merchants use our product. These videos work fine with the Clover Mobile and Clover Mini but not at all with the Clover Station.

We noticed that our Video Intro on the App Market plays on all three Clover Devices. Can you share with us the code you use to show these App Market videos?

We would like all of our Merchants to be able use our Tutorials.

Thank You, Carl

10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Mark Mullan avatar image
Mark Mullan Deactivated answered

Hi Carl,

Something like this will do the trick. Make sure to use an embedded video link to direct merchants only to the videos you want them to see. Also, when using embedded videos, the layout_width and layout_height properties of the parent View cannot be wrap_content, or it will have 0x0 dimensions. For example, I made the WebView id video be 500dp x 500dp for test and show this video.

I'm no expert on the topic of best practices for video playback, so you'll have to play around with implementing different listeners, callbacks, etc. yourself. Hopefully this is a good jumping off point.

    WebView webView = (WebView) findViewById(R.id.video);
    webView.getSettings().setJavaScriptEnabled(true);

    webView.setWebViewClient(new WebViewClient());
    WebChromeClient webChromeClient = new WebChromeClient();
    webView.setWebChromeClient(webChromeClient);

    webView.loadUrl("https://www.youtube.com/embed/tKxtRnyqB6c");
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community