From 910967bcbbcd51c7396e5ebfdb388ce3595d619f Mon Sep 17 00:00:00 2001
From: huayongxu <49056704+huayongxu@users.noreply.github.com>
Date: Tue, 2 Feb 2021 17:23:25 +0800
Subject: [PATCH] [NUI] Add a VideoHoleEnabled property into WebView. (#2606)
Video hole is used for playing videos with high quality in WebView.
This patch is to add a VideoHoleEnabled property.
---
.../src/internal/Interop/Interop.WebView.cs | 3 ++
src/Tizen.NUI/src/internal/WebView/WebView.cs | 34 ++++++++++++++++++++++
2 files changed, 37 insertions(+)
diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.WebView.cs b/src/Tizen.NUI/src/internal/Interop/Interop.WebView.cs
index f617cfb..075db2c 100755
--- a/src/Tizen.NUI/src/internal/Interop/Interop.WebView.cs
+++ b/src/Tizen.NUI/src/internal/Interop/Interop.WebView.cs
@@ -60,6 +60,9 @@ namespace Tizen.NUI
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_Property_TITLE_get")]
public static extern int TitleGet();
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_Property_VIDEO_HOLE_ENABLED_get")]
+ public static extern int VideoHoleEnabledGet();
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_GetFavicon")]
public static extern global::System.IntPtr GetFavicon(global::System.Runtime.InteropServices.HandleRef jarg1);
diff --git a/src/Tizen.NUI/src/internal/WebView/WebView.cs b/src/Tizen.NUI/src/internal/WebView/WebView.cs
index cef021b..4488926 100755
--- a/src/Tizen.NUI/src/internal/WebView/WebView.cs
+++ b/src/Tizen.NUI/src/internal/WebView/WebView.cs
@@ -169,6 +169,7 @@ namespace Tizen.NUI
internal static readonly int ScrollSize = Interop.WebView.ScrollSizeGet();
internal static readonly int ContentSize = Interop.WebView.ContentSizeGet();
internal static readonly int Title = Interop.WebView.TitleGet();
+ internal static readonly int VideoHoleEnabled = Interop.WebView.VideoHoleEnabledGet();
}
private static readonly BindableProperty UrlProperty = BindableProperty.Create(nameof(Url), typeof(string), typeof(WebView), string.Empty, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
@@ -243,6 +244,22 @@ namespace Tizen.NUI
return title;
});
+ private static readonly BindableProperty VideoHoleEnabledProperty = BindableProperty.Create(nameof(VideoHoleEnabled), typeof(bool), typeof(WebView), true, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var webview = (WebView)bindable;
+ if (newValue != null)
+ {
+ Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.VideoHoleEnabled, new Tizen.NUI.PropertyValue((bool)newValue));
+ }
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var webview = (WebView)bindable;
+ bool temp;
+ Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.VideoHoleEnabled).Get(out temp);
+ return temp;
+ });
+
///
/// Creates a WebView.
///
@@ -488,6 +505,23 @@ namespace Tizen.NUI
}
///
+ /// Whether video hole is enabled or not.
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool VideoHoleEnabled
+ {
+ get
+ {
+ return (bool)GetValue(VideoHoleEnabledProperty);
+ }
+ set
+ {
+ SetValue(VideoHoleEnabledProperty, value);
+ NotifyPropertyChanged();
+ }
+ }
+
+ ///
/// Event for the PageLoadStarted signal which can be used to subscribe or unsubscribe the event handler.
/// This signal is emitted when page loading has started.
///
--
2.7.4