From c144acd64ad2f61e242ff41adea595095dd9b643 Mon Sep 17 00:00:00 2001 From: "joogab.yun" Date: Thu, 9 Jan 2025 16:44:46 +0900 Subject: [PATCH] [NUI] Add IsAutoRotationEnabled, IsLetterBoxEnabled --- .../src/internal/Interop/Interop.VideoView.cs | 14 ++++++ .../src/public/BaseComponents/VideoView.cs | 50 +++++++++++++++++++ 2 files changed, 64 insertions(+) diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.VideoView.cs b/src/Tizen.NUI/src/internal/Interop/Interop.VideoView.cs index e84cdaa3988..943177366eb 100755 --- a/src/Tizen.NUI/src/internal/Interop/Interop.VideoView.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.VideoView.cs @@ -66,6 +66,20 @@ internal static partial class VideoView [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_VideoView_Backward")] public static extern void Backward(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_VideoView_SetAutoRotationEnabled")] + public static extern void SetAutoRotationEnabled(global::System.Runtime.InteropServices.HandleRef jarg1, bool jarg2); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_VideoView_IsAutoRotationEnabled")] + [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] + public static extern bool IsAutoRotationEnabled(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_VideoView_SetLetterBoxEnabled")] + public static extern void SetLetterBoxEnabled(global::System.Runtime.InteropServices.HandleRef jarg1, bool jarg2); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_VideoView_IsLetterBoxEnabled")] + [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] + public static extern bool IsLetterBoxEnabled(global::System.Runtime.InteropServices.HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_VideoView_FinishedSignal")] public static extern global::System.IntPtr FinishedSignal(global::System.Runtime.InteropServices.HandleRef jarg1); diff --git a/src/Tizen.NUI/src/public/BaseComponents/VideoView.cs b/src/Tizen.NUI/src/public/BaseComponents/VideoView.cs index 42534a02006..ee6b630e66d 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/VideoView.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/VideoView.cs @@ -143,6 +143,8 @@ internal static object GetInternalResourceUrlProperty(BindableObject bindable) private FinishedCallbackDelegate videoViewFinishedCallbackDelegate; private EventHandler videoViewFinishedEventHandler; + private bool isAutoRotationEnabled = false; + private bool isLetterBoxEnabled = false; static VideoView() @@ -447,6 +449,54 @@ public string ResourceUrl } } + /// + /// Enables auto rotation of the video based on the orientation of the video contents. + /// + /// This feature is supported only when underlay is false. + [EditorBrowsable(EditorBrowsableState.Never)] + public bool IsAutoRotationEnabled + { + get + { + isAutoRotationEnabled = (bool)Interop.VideoView.IsAutoRotationEnabled(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return isAutoRotationEnabled; + } + set + { + if (value != isAutoRotationEnabled) + { + Interop.VideoView.SetAutoRotationEnabled(SwigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + isAutoRotationEnabled = value; + } + } + } + + /// + /// Enables letter box of the video based on the aspect of the video contents. + /// + /// This feature is supported only when underlay is false. + [EditorBrowsable(EditorBrowsableState.Never)] + public bool IsLetterBoxEnabled + { + get + { + isLetterBoxEnabled = (bool)Interop.VideoView.IsLetterBoxEnabled(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return isLetterBoxEnabled; + } + set + { + if (value != isLetterBoxEnabled) + { + Interop.VideoView.SetLetterBoxEnabled(SwigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + isLetterBoxEnabled = value; + } + } + } + /// /// Starts the video playback. ///