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,