Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

Youtube embedded in webview playback stops after second on ios device, but it plays on simulator

$
0
0

Hi,

I want to play a embedded youtube video in an Xamarin forms application. I have an article feed in which I sometimes want to display a youtube video.

My solutions works great on android and displays an inline youtube video in the given webview nicely. On iOS it switches to fullscreen. That is not preferred but not a problem. However on a device the playback stops after a second, on the simulator it plays without a hitch. Is there something I am missing?

My code:

 HtmlWebViewSource source = new HtmlWebViewSource();
                source.SetBinding(HtmlWebViewSource.HtmlProperty, "HTMLDesc");
                source.Html = $@"<html>
        <body>  
        <iframe style="" position: absolute; top: 0; left: 0; width: 100%; height: 100%;""  src=""{ Article.Youtube }"" frameborder=""0"" allowfullscreen>
        </iframe></body></html>";
                var webView= new WebView();
                webView.Source = source;
                someContentview.Content= WebView;

Kind regards,


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>