* limitations under the License.
*
*/
+using System;
+using System.ComponentModel;
+using System.Runtime.InteropServices;
+using Tizen.NUI.Binding;
namespace Tizen.NUI.BaseComponents
{
-
- using System;
- using System.Runtime.InteropServices;
-
/// <summary>
/// VideoView is a control for video playback and display.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public class VideoView : View
{
- private global::System.Runtime.InteropServices.HandleRef swigCPtr;
-
- internal VideoView(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.VideoView_SWIGUpcast(cPtr), cMemoryOwn)
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty VideoProperty = BindableProperty.Create(nameof(Video), typeof(PropertyMap), typeof(VideoView), null, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
{
- swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
- }
-
- internal static global::System.Runtime.InteropServices.HandleRef getCPtr(VideoView obj)
+ var videoView = (VideoView)bindable;
+ if (newValue != null)
+ {
+ Tizen.NUI.Object.SetProperty((HandleRef)videoView.SwigCPtr, VideoView.Property.VIDEO, new Tizen.NUI.PropertyValue((PropertyMap)newValue));
+ }
+ }),
+ defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
{
- return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
- }
-
- /// <summary>
- /// Dispose.
- /// </summary>
- /// <param name="type">DisposeTypes</param>
- /// <since_tizen> 3 </since_tizen>
- protected override void Dispose(DisposeTypes type)
+ var videoView = (VideoView)bindable;
+ PropertyMap temp = new PropertyMap();
+ Tizen.NUI.Object.GetProperty((HandleRef)videoView.SwigCPtr, VideoView.Property.VIDEO).Get(temp);
+ return temp;
+ }));
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty LoopingProperty = BindableProperty.Create(nameof(Looping), typeof(bool), typeof(VideoView), false, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
{
- if(disposed)
+ var videoView = (VideoView)bindable;
+ if (newValue != null)
{
- return;
+ Tizen.NUI.Object.SetProperty((HandleRef)videoView.SwigCPtr, VideoView.Property.LOOPING, new Tizen.NUI.PropertyValue((bool)newValue));
}
-
- if(type == DisposeTypes.Explicit)
+ }),
+ defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
+ {
+ var videoView = (VideoView)bindable;
+ bool temp = false;
+ Tizen.NUI.Object.GetProperty((HandleRef)videoView.SwigCPtr, VideoView.Property.LOOPING).Get(out temp);
+ return temp;
+ }));
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty MutedProperty = BindableProperty.Create(nameof(Muted), typeof(bool), typeof(VideoView), false, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
+ {
+ var videoView = (VideoView)bindable;
+ if (newValue != null)
{
- //Called by User
- //Release your own managed resources here.
- //You should release all of your own disposable objects here.
+ Tizen.NUI.Object.SetProperty((HandleRef)videoView.SwigCPtr, VideoView.Property.MUTED, new Tizen.NUI.PropertyValue((bool)newValue));
}
-
- //Release your own unmanaged resources here.
- //You should not access any managed member here except static instance.
- //because the execution order of Finalizes is non-deterministic.
-
- if (_videoViewFinishedCallbackDelegate != null)
+ }),
+ defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
+ {
+ var videoView = (VideoView)bindable;
+ bool temp = false;
+ Tizen.NUI.Object.GetProperty((HandleRef)videoView.SwigCPtr, VideoView.Property.MUTED).Get(out temp);
+ return temp;
+ }));
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty VolumeProperty = BindableProperty.Create(nameof(Volume), typeof(PropertyMap), typeof(VideoView), null, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
+ {
+ var videoView = (VideoView)bindable;
+ if (newValue != null)
{
- FinishedSignal().Disconnect(_videoViewFinishedCallbackDelegate);
+ Tizen.NUI.Object.SetProperty((HandleRef)videoView.SwigCPtr, VideoView.Property.VOLUME, new Tizen.NUI.PropertyValue((PropertyMap)newValue));
}
-
- if (swigCPtr.Handle != global::System.IntPtr.Zero)
+ }),
+ defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
+ {
+ var videoView = (VideoView)bindable;
+ PropertyMap temp = new PropertyMap();
+ Tizen.NUI.Object.GetProperty((HandleRef)videoView.SwigCPtr, VideoView.Property.VOLUME).Get(temp);
+ return temp;
+ }));
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty UnderlayProperty = BindableProperty.Create(nameof(Underlay), typeof(bool), typeof(VideoView), false, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
+ {
+ var videoView = (VideoView)bindable;
+ if (newValue != null)
{
- if (swigCMemOwn)
- {
- swigCMemOwn = false;
- NDalicPINVOKE.delete_VideoView(swigCPtr);
- }
- swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
+ Tizen.NUI.Object.SetProperty((HandleRef)videoView.SwigCPtr, VideoView.Property.UNDERLAY, new Tizen.NUI.PropertyValue((bool)newValue));
+ }
+ }),
+ defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
+ {
+ var videoView = (VideoView)bindable;
+ bool temp = false;
+ Tizen.NUI.Object.GetProperty((HandleRef)videoView.SwigCPtr, VideoView.Property.UNDERLAY).Get(out temp);
+ return temp;
+ }));
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty ResourceUrlProperty = BindableProperty.Create(nameof(ResourceUrl), typeof(string), typeof(VideoView), string.Empty, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
+ {
+ var videoView = (VideoView)bindable;
+ if (newValue != null)
+ {
+ Tizen.NUI.Object.SetProperty((HandleRef)videoView.SwigCPtr, VideoView.Property.VIDEO, new Tizen.NUI.PropertyValue((string)newValue));
}
+ }),
+ defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
+ {
+ var videoView = (VideoView)bindable;
+ string temp;
+ Tizen.NUI.Object.GetProperty((HandleRef)videoView.SwigCPtr, VideoView.Property.VIDEO).Get(out temp);
+ return temp;
+ }));
- base.Dispose(type);
+ private FinishedCallbackDelegate videoViewFinishedCallbackDelegate;
+ private EventHandler<FinishedEventArgs> videoViewFinishedEventHandler;
+
+ /// <summary>
+ /// Creates an initialized VideoView.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
+ public VideoView() : this(Interop.VideoView.New(), true)
+ {
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// <summary>
- /// Event arguments that passed via the finished signal.
+ /// Creates an initialized VideoView.<br />
+ /// If the string is empty, VideoView will not display anything.<br />
/// </summary>
- public class FinishedEventArgs : EventArgs
+ /// <param name="url">The URL of the video resource to display.</param>
+ /// <since_tizen> 3 </since_tizen>
+ public VideoView(string url) : this(Interop.VideoView.New(url), true)
{
- private VideoView _videoView;
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
- /// <summary>
- /// The view for video playback and display.
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- public VideoView VideoView
- {
- get
- {
- return _videoView;
- }
- set
- {
- _videoView = value;
- }
- }
+ /// <summary>
+ /// Creates an initialized VideoView.<br />
+ /// If the string is empty, VideoView will not display anything.<br />
+ /// </summary>
+ /// <param name="swCodec">Video rendering by H/W codec if false.</param>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public VideoView(bool swCodec) : this(Interop.VideoView.New(swCodec), true)
+ {
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
+ /// <summary>
+ /// Creates an initialized VideoView.<br />
+ /// If the string is empty, VideoView will not display anything.<br />
+ /// </summary>
+ /// <param name="url">The URL of the video resource to display.</param>
+ /// <param name="swCodec">Video rendering by H/W codec if false.</param>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public VideoView(string url, bool swCodec) : this(Interop.VideoView.New(url, swCodec), true)
+ {
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
- [UnmanagedFunctionPointer(CallingConvention.StdCall)]
- private delegate void FinishedCallbackDelegate(IntPtr data);
- private EventHandler<FinishedEventArgs> _videoViewFinishedEventHandler;
- private FinishedCallbackDelegate _videoViewFinishedCallbackDelegate;
+ /// <summary>
+ /// Hidden API (Inhouse API).
+ /// Using Uri class to provide safe service and secure API.
+ /// Creates an initialized VideoView.
+ /// If the string is empty, VideoView will not display anything.
+ /// </summary>
+ /// <param name="uri">The URI of the video resource to display.</param>
+ /// <param name="swCodec">Video rendering by H/W codec if false.</param>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public VideoView(Uri uri, bool swCodec) : this(Interop.VideoView.New((uri == null) ? String.Empty : uri.AbsoluteUri, swCodec), true)
+ {
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
+ internal VideoView(VideoView videoView) : this(Interop.VideoView.NewVideoView(VideoView.getCPtr(videoView)), true)
+ {
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
+ internal VideoView(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
+ {
+ }
+ [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+ private delegate void FinishedCallbackDelegate(IntPtr data);
/// <summary>
/// Event for the finished signal which can be used to subscribe or unsubscribe the event handler
{
add
{
- if (_videoViewFinishedEventHandler == null)
+ if (videoViewFinishedEventHandler == null)
{
- _videoViewFinishedCallbackDelegate = (OnFinished);
- FinishedSignal().Connect(_videoViewFinishedCallbackDelegate);
+ videoViewFinishedCallbackDelegate = (OnFinished);
+ FinishedSignal().Connect(videoViewFinishedCallbackDelegate);
}
- _videoViewFinishedEventHandler += value;
+ videoViewFinishedEventHandler += value;
}
remove
{
- _videoViewFinishedEventHandler -= value;
- if (_videoViewFinishedEventHandler == null && FinishedSignal().Empty() == false)
+ videoViewFinishedEventHandler -= value;
+ if (videoViewFinishedEventHandler == null && FinishedSignal().Empty() == false)
{
- FinishedSignal().Disconnect(_videoViewFinishedCallbackDelegate);
+ FinishedSignal().Disconnect(videoViewFinishedCallbackDelegate);
}
}
}
- // Callback for VideoView Finished signal
- private void OnFinished(IntPtr data)
+ /// <summary>
+ /// Video file setting type of PropertyMap.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
+ public PropertyMap Video
{
- FinishedEventArgs e = new FinishedEventArgs();
-
- // Populate all members of "e" (FinishedEventArgs) with real data
- e.VideoView = Registry.GetManagedBaseHandleFromNativePtr(data) as VideoView;
-
- if (_videoViewFinishedEventHandler != null)
+ get
{
- //here we send all data to user event handlers
- _videoViewFinishedEventHandler(this, e);
+ return (PropertyMap)GetValue(VideoProperty);
+ }
+ set
+ {
+ SetValue(VideoProperty, value);
+ NotifyPropertyChanged();
}
}
- internal new class Property
+ /// <summary>
+ /// The looping status, true or false.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
+ public bool Looping
{
- internal static readonly int VIDEO = NDalicPINVOKE.VideoView_Property_VIDEO_get();
- internal static readonly int LOOPING = NDalicPINVOKE.VideoView_Property_LOOPING_get();
- internal static readonly int MUTED = NDalicPINVOKE.VideoView_Property_MUTED_get();
- internal static readonly int VOLUME = NDalicPINVOKE.VideoView_Property_VOLUME_get();
- internal static readonly int UNDERLAY = NDalicPINVOKE.VideoView_Property_UNDERLAY_get();
+ get
+ {
+ return (bool)GetValue(LoopingProperty);
+ }
+ set
+ {
+ SetValue(LoopingProperty, value);
+ NotifyPropertyChanged();
+ }
}
/// <summary>
- /// Creates an initialized VideoView.
+ /// The mute status, true or false.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- public VideoView() : this(NDalicPINVOKE.VideoView_New__SWIG_0(), true)
+ public bool Muted
{
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-
+ get
+ {
+ return (bool)GetValue(MutedProperty);
+ }
+ set
+ {
+ SetValue(MutedProperty, value);
+ NotifyPropertyChanged();
+ }
}
/// <summary>
- /// Creates an initialized VideoView.<br />
- /// If the string is empty, VideoView will not display anything.<br />
+ /// The left and the right volume scalar as float type, PropertyMap with two values ( "left" and "right" ).
/// </summary>
- /// <param name="url">The URL of the video resource to display.</param>
/// <since_tizen> 3 </since_tizen>
- public VideoView(string url) : this(NDalicPINVOKE.VideoView_New__SWIG_1(url), true)
+ public PropertyMap Volume
{
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-
+ get
+ {
+ return (PropertyMap)GetValue(VolumeProperty);
+ }
+ set
+ {
+ SetValue(VolumeProperty, value);
+ NotifyPropertyChanged();
+ }
}
- internal VideoView(VideoView videoView) : this(NDalicPINVOKE.new_VideoView__SWIG_1(VideoView.getCPtr(videoView)), true)
+
+ /// <summary>
+ /// Video rendering by underlay, true or false.<br />
+ /// This shows video composited underneath the window by the system. This means it may ignore rotation of the video-view.
+ /// </summary>
+ /// <since_tizen> 4 </since_tizen>
+ public bool Underlay
{
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ get
+ {
+ return (bool)GetValue(UnderlayProperty);
+ }
+ set
+ {
+ SetValue(UnderlayProperty, value);
+ NotifyPropertyChanged();
+ }
}
/// <summary>
- /// [Obsolete("Please do not use! this will be deprecated")]
+ /// Video file URL as string type.
/// </summary>
- /// <param name="handle"></param>
- /// <returns></returns>
- [Obsolete("Please do not use! this will be deprecated")]
- public new static VideoView DownCast(BaseHandle handle)
+ /// <since_tizen> 4 </since_tizen>
+ public string ResourceUrl
{
- VideoView ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as VideoView;
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
+ get
+ {
+ return (string)GetValue(ResourceUrlProperty);
+ }
+ set
+ {
+ SetValue(ResourceUrlProperty, value);
+ NotifyPropertyChanged();
+ }
}
/// <summary>
/// <since_tizen> 3 </since_tizen>
public void Play()
{
- NDalicPINVOKE.VideoView_Play(swigCPtr);
+ Interop.VideoView.Play(SwigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// <since_tizen> 3 </since_tizen>
public void Pause()
{
- NDalicPINVOKE.VideoView_Pause(swigCPtr);
+ Interop.VideoView.Pause(SwigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// <since_tizen> 3 </since_tizen>
public void Stop()
{
- NDalicPINVOKE.VideoView_Stop(swigCPtr);
+ Interop.VideoView.Stop(SwigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// <since_tizen> 3 </since_tizen>
public void Forward(int millisecond)
{
- NDalicPINVOKE.VideoView_Forward(swigCPtr, millisecond);
+ Interop.VideoView.Forward(SwigCPtr, millisecond);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// <since_tizen> 3 </since_tizen>
public void Backward(int millisecond)
{
- NDalicPINVOKE.VideoView_Backward(swigCPtr, millisecond);
+ Interop.VideoView.Backward(SwigCPtr, millisecond);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
+ /// <summary>
+ /// Get native player handle.
+ /// <example>
+ /// How to get native player handle
+ /// <code>
+ /// VideoView videoView = new VideoView();
+ /// videoView.ResourceUrl = "some video path";
+ /// var handle = videoView.NativeHandle;
+ /// if(handle.IsInvalid == false)
+ /// {
+ /// IntPtr nativeHandle = handle.DangerousGetHandle();
+ /// // do something with nativeHandle
+ /// }
+ /// </code>
+ /// </example>
+ /// </summary>
+ /// <since_tizen> 9 </since_tizen>
+ public SafeHandle NativeHandle
+ {
+ get
+ {
+ return new NUI.SafeNativePlayerHandle(this);
+ }
+ }
+
internal VideoViewSignal FinishedSignal()
{
- VideoViewSignal ret = new VideoViewSignal(NDalicPINVOKE.VideoView_FinishedSignal(swigCPtr), false);
+ VideoViewSignal ret = new VideoViewSignal(Interop.VideoView.FinishedSignal(SwigCPtr), false);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
/// <summary>
- /// Video file URL as string type or PropertyMap.
+ /// Dispose.
/// </summary>
+ /// <param name="type">DisposeTypes</param>
/// <since_tizen> 3 </since_tizen>
- public PropertyMap Video
+ protected override void Dispose(DisposeTypes type)
{
- get
+ if (disposed)
{
- PropertyMap temp = new PropertyMap();
- GetProperty(VideoView.Property.VIDEO).Get(temp);
- return temp;
+ return;
}
- set
+
+ //Release your own unmanaged resources here.
+ //You should not access any managed member here except static instance.
+ //because the execution order of Finalizes is non-deterministic.
+
+ if (this != null && videoViewFinishedCallbackDelegate != null)
{
- SetProperty(VideoView.Property.VIDEO, new Tizen.NUI.PropertyValue(value));
+ FinishedSignal().Disconnect(videoViewFinishedCallbackDelegate);
}
+
+ base.Dispose(type);
}
- /// <summary>
- /// The looping status, true or false.
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- public bool Looping
+ /// This will not be public opened.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
{
- get
- {
- bool temp = false;
- GetProperty(VideoView.Property.LOOPING).Get(out temp);
- return temp;
- }
- set
+ Interop.VideoView.DeleteVideoView(swigCPtr);
+ }
+
+ // Callback for VideoView Finished signal
+ private void OnFinished(IntPtr data)
+ {
+ if (videoViewFinishedEventHandler != null)
{
- SetProperty(VideoView.Property.LOOPING, new Tizen.NUI.PropertyValue(value));
+ FinishedEventArgs e = new FinishedEventArgs();
+
+ // Populate all members of "e" (FinishedEventArgs) with real data
+ e.VideoView = Registry.GetManagedBaseHandleFromNativePtr(data) as VideoView;
+ //here we send all data to user event handlers
+ videoViewFinishedEventHandler(this, e);
}
}
/// <summary>
- /// The mute status, true or false.
+ /// Event arguments that passed via the finished signal.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- public bool Muted
+ public class FinishedEventArgs : EventArgs
{
- get
- {
- bool temp = false;
- GetProperty(VideoView.Property.MUTED).Get(out temp);
- return temp;
- }
- set
+ private VideoView videoView;
+
+ /// <summary>
+ /// The view for video playback and display.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
+ public VideoView VideoView
{
- SetProperty(VideoView.Property.MUTED, new Tizen.NUI.PropertyValue(value));
+ get
+ {
+ return videoView;
+ }
+ set
+ {
+ videoView = value;
+ }
}
}
+ internal new class Property
+ {
+ internal static readonly int VIDEO = Interop.VideoView.VideoGet();
+ internal static readonly int LOOPING = Interop.VideoView.LoopingGet();
+ internal static readonly int MUTED = Interop.VideoView.MutedGet();
+ internal static readonly int VOLUME = Interop.VideoView.VolumeGet();
+ internal static readonly int UNDERLAY = Interop.VideoView.UnderlayGet();
+ }
+
+ internal System.IntPtr GetNativePlayerHandle()
+ {
+ var ret = Interop.VideoView.GetNativePlayerHandle(SwigCPtr);
+ NUILog.Debug($"NativePlayerHandle=0x{ret:X}");
+ return ret;
+ }
+ }
+
+ /// <summary>
+ /// Contains and encapsulates Native Player handle.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ [Obsolete("This has been deprecated in API9 and will be removed in API11. Use VideoView.NativeHandle instead.")]
+ public class SafeNativePlayerHandle : SafeHandle
+ {
/// <summary>
- /// The left and the right volume scalar as float type, PropertyMap with two values ( "left" and "right" ).
+ /// Constructor, null handle is set.
/// </summary>
- /// <since_tizen> 3 </since_tizen>
- public PropertyMap Volume
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public SafeNativePlayerHandle() : base(global::System.IntPtr.Zero, false)
{
- get
- {
- PropertyMap temp = new PropertyMap();
- GetProperty(VideoView.Property.VOLUME).Get(temp);
- return temp;
- }
- set
+ }
+
+ /// <summary>
+ /// Constructor, Native player handle is set to handle.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public SafeNativePlayerHandle(VideoView videoView) : base(global::System.IntPtr.Zero, false)
+ {
+ if (videoView != null)
{
- SetProperty(VideoView.Property.VOLUME, new PropertyValue(value));
+ SetHandle(videoView.GetNativePlayerHandle());
}
}
/// <summary>
- /// Video rendering by underlay, true or false.<br />
- /// This shows video composited underneath the window by the system. This means it may ignore rotation of the video-view.
+ /// Null check if the handle is valid or not.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
- public bool Underlay
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override bool IsInvalid
{
get
{
- bool temp = false;
- GetProperty(VideoView.Property.UNDERLAY).Get(out temp);
- return temp;
- }
- set
- {
- SetProperty(VideoView.Property.UNDERLAY, new PropertyValue(value));
+ return handle == global::System.IntPtr.Zero;
}
}
-
+ /// <summary>
+ /// Release handle itself.
+ /// </summary>
+ /// <returns>true when released successfully.</returns>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ protected override bool ReleaseHandle()
+ {
+ SetHandle(global::System.IntPtr.Zero);
+ return true;
+ }
}
-
-}
\ No newline at end of file
+}