I am using WebView for playing video in my Xamarin.Forms project. On iPhone the video is playing in fullscreen, but I need to play the video within the WebView without going to fullscreen.
I have this issue only on the iPhone. On Android, Windows, and iPad devices the video is playing without fullscreen.
Case 1: Normal WebView
<WebView
x:Name="web_view"
HorizontalOptions="FillAndExpand"
VerticalOptions="FillAndExpand"/>
web_view.Source = videoUrl;
Case 2: Custom webview
On some part, I am using a custom WebView. In this case the video is also being played in full-screen mode.
public class MyWebView : WebView
{
public static readonly BindableProperty UrlProperty = BindableProperty.Create(
propertyName: "Url",
returnType: typeof(string),
declaringType: typeof(MyWebView),
defaultValue: default(string));
public string Url
{
get { return (string)GetValue(UrlProperty); }
set { SetValue(UrlProperty, value); }
}
}
In the above 2 cases, I need to play the video without full-screen mode on the iPhone.