1 /** Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
16 // This File has been auto-generated by SWIG and then modified using DALi Ruby Scripts
17 //------------------------------------------------------------------------------
20 // This file was automatically generated by SWIG (http://www.swig.org).
23 // Do not make changes to this file unless you know what you are doing--modify
24 // the SWIG interface file instead.
25 //------------------------------------------------------------------------------
31 using System.Runtime.InteropServices;
32 using Tizen.NUI.BaseComponents;
35 /// VideoView is a control for video playback and display.
37 public class VideoView : View
39 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
41 internal VideoView(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.VideoView_SWIGUpcast(cPtr), cMemoryOwn)
43 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
46 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(VideoView obj)
48 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
51 protected override void Dispose(DisposeTypes type)
58 if(type == DisposeTypes.Explicit)
61 //Release your own managed resources here.
62 //You should release all of your own disposable objects here.
65 //Release your own unmanaged resources here.
66 //You should not access any managed member here except static instance.
67 //because the execution order of Finalizes is non-deterministic.
69 if (swigCPtr.Handle != global::System.IntPtr.Zero)
74 NDalicPINVOKE.delete_VideoView(swigCPtr);
76 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
83 /// Event arguments that passed via Finished signal
85 public class FinishedEventArgs : EventArgs
87 private VideoView _videoView;
90 /// The view for video playback and display.
92 public VideoView VideoView
106 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
107 private delegate void FinishedCallbackDelegate(IntPtr data);
108 private EventHandler<FinishedEventArgs> _videoViewFinishedEventHandler;
109 private FinishedCallbackDelegate _videoViewFinishedCallbackDelegate;
113 /// Event for Finished signal which can be used to subscribe/unsubscribe the event handler
114 /// (in the type of FinishedEventHandler-DaliEventHandler<object,FinishedEventArgs>) provided by the user.<br>
115 /// Finished signal is emitted when a video playback have finished.<br>
117 public event EventHandler<FinishedEventArgs> Finished
121 if (_videoViewFinishedEventHandler == null)
123 _videoViewFinishedCallbackDelegate = (OnFinished);
124 FinishedSignal().Connect(_videoViewFinishedCallbackDelegate);
126 _videoViewFinishedEventHandler += value;
130 _videoViewFinishedEventHandler -= value;
131 if (_videoViewFinishedEventHandler == null && FinishedSignal().Empty() == false)
133 FinishedSignal().Disconnect(_videoViewFinishedCallbackDelegate);
138 // Callback for VideoView Finished signal
139 private void OnFinished(IntPtr data)
141 FinishedEventArgs e = new FinishedEventArgs();
143 // Populate all members of "e" (FinishedEventArgs) with real data
144 e.VideoView = Registry.GetManagedBaseHandleFromNativePtr(data) as VideoView;
146 if (_videoViewFinishedEventHandler != null)
148 //here we send all data to user event handlers
149 _videoViewFinishedEventHandler(this, e);
153 internal class Property
155 internal static readonly int VIDEO = NDalicPINVOKE.VideoView_Property_VIDEO_get();
156 internal static readonly int LOOPING = NDalicPINVOKE.VideoView_Property_LOOPING_get();
157 internal static readonly int MUTED = NDalicPINVOKE.VideoView_Property_MUTED_get();
158 internal static readonly int VOLUME = NDalicPINVOKE.VideoView_Property_VOLUME_get();
162 /// Creates an initialized VideoView.
164 public VideoView() : this(NDalicPINVOKE.VideoView_New__SWIG_0(), true)
166 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
171 /// Creates an initialized VideoView.<br>
172 /// If the string is empty, VideoView will not display anything.<br>
174 /// <param name="url">The url of the video resource to display</param>
175 public VideoView(string url) : this(NDalicPINVOKE.VideoView_New__SWIG_1(url), true)
177 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
180 internal VideoView(VideoView videoView) : this(NDalicPINVOKE.new_VideoView__SWIG_1(VideoView.getCPtr(videoView)), true)
182 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
186 /// Starts the video playback.
190 NDalicPINVOKE.VideoView_Play(swigCPtr);
191 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
195 /// Pauses the video playback.
199 NDalicPINVOKE.VideoView_Pause(swigCPtr);
200 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
204 /// Stops the video playback.
208 NDalicPINVOKE.VideoView_Stop(swigCPtr);
209 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
213 /// Seeks forward by the specified number of milliseconds.
215 /// <param name="millisecond">The position for forward playback</param>
216 public void Forward(int millisecond)
218 NDalicPINVOKE.VideoView_Forward(swigCPtr, millisecond);
219 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
223 /// Seeks backward by the specified number of milliseconds.
225 /// <param name="millisecond">The position for backward playback</param>
226 public void Backward(int millisecond)
228 NDalicPINVOKE.VideoView_Backward(swigCPtr, millisecond);
229 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
232 internal VideoViewSignal FinishedSignal()
234 VideoViewSignal ret = new VideoViewSignal(NDalicPINVOKE.VideoView_FinishedSignal(swigCPtr), false);
235 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
240 /// video file url as string type or PropertyMap.
242 public PropertyMap Video
246 PropertyMap temp = new PropertyMap();
247 GetProperty(VideoView.Property.VIDEO).Get(temp);
252 SetProperty(VideoView.Property.VIDEO, new Tizen.NUI.PropertyValue(value));
257 /// looping status, true or false.
264 GetProperty(VideoView.Property.LOOPING).Get(out temp);
269 SetProperty(VideoView.Property.LOOPING, new Tizen.NUI.PropertyValue(value));
274 /// mute status, true or false.
281 GetProperty(VideoView.Property.MUTED).Get(out temp);
286 SetProperty(VideoView.Property.MUTED, new Tizen.NUI.PropertyValue(value));
291 /// left and right volume scalar as float type, PropertyMap with two values ( "left" and "right" ).
293 public PropertyMap Volume
297 PropertyMap temp = new PropertyMap();
298 GetProperty(VideoView.Property.VOLUME).Get(temp);
303 SetProperty(VideoView.Property.VOLUME, new PropertyValue(value));