Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NUI] Add IsAutoRotationEnabled, IsLetterBoxEnabled #6573

Open
wants to merge 1 commit into
base: DevelNUI
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/Tizen.NUI/src/internal/Interop/Interop.VideoView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
50 changes: 50 additions & 0 deletions src/Tizen.NUI/src/public/BaseComponents/VideoView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ internal static object GetInternalResourceUrlProperty(BindableObject bindable)

private FinishedCallbackDelegate videoViewFinishedCallbackDelegate;
private EventHandler<FinishedEventArgs> videoViewFinishedEventHandler;
private bool isAutoRotationEnabled = false;
private bool isLetterBoxEnabled = false;


static VideoView()
Expand Down Expand Up @@ -447,6 +449,54 @@ public string ResourceUrl
}
}

/// <summary>
/// Enables auto rotation of the video based on the orientation of the video contents.
/// </summary>
/// <note> This feature is supported only when underlay is false. </note>
[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;
}
}
}

/// <summary>
/// Enables letter box of the video based on the aspect of the video contents.
/// </summary>
/// <note> This feature is supported only when underlay is false. </note>
[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;
}
}
}

/// <summary>
/// Starts the video playback.
/// </summary>
Expand Down
Loading