美文网首页
Android WebView中video标签支持

Android WebView中video标签支持

作者: InnoTech | 来源:发表于2018-01-16 17:27 被阅读0次

1.启用Activity的硬件加速

[Activity(Label = "MyApp", HardwareAccelerated =true, Icon = "@drawable/icon", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]

    public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity

    {

2.设置MediaPlaybackRequiresUserGesture为false

                 Control.Settings.AllowUniversalAccessFromFileURLs = true;

                Control.Settings.BuiltInZoomControls = false;

                Control.Settings.LoadsImagesAutomatically = true;

                Control.Settings.JavaScriptCanOpenWindowsAutomatically = false;

                Control.Settings.SetSupportZoom(false);

                Control.Settings.JavaScriptCanOpenWindowsAutomatically = false;

                Control.Settings.JavaScriptEnabled = true;

                Control.Settings.MediaPlaybackRequiresUserGesture = false;

                Control.Settings.DefaultTextEncodingName = "utf-8";

                Control.Settings.DisplayZoomControls = false;

相关文章

网友评论

      本文标题:Android WebView中video标签支持

      本文链接:https://www.haomeiwen.com/subject/utqeoxtx.html