public virtual void DrawUI(Rect rect) { if (m_PlayingClip != null) { Texture image = GetAssetPreviewTexture(m_PlayingClip); if (image != null) { GetImageAppropriateSize(image, out var targetVideoSize); GUILayout.Label("", GUILayout.Width(targetVideoSize.x), GUILayout.Height(targetVideoSize.y)); Rect videoRect = new Rect(rect.x + 10, rect.y + 10, targetVideoSize.x, targetVideoSize.y); if (GUI.Button(videoRect, "")) { VideoWindow.ShowVideo(this.GetTrickOverViewInfo().VideoPath, delegate { Resources.FindObjectsOfTypeAll <AllTrickOverViewEditorWindow>()[0].Focus(); }); } EditorGUI.DrawPreviewTexture(videoRect, image); Rect playIconRect = new Rect(videoRect.center - new Vector2(25, 25), new Vector2(50, 50)); GUI.DrawTexture(playIconRect, m_PlayVideoIcon); EditorGUIUtility.AddCursorRect(videoRect, MouseCursor.Link); } return; } if (m_PreviewPic != null) { GetImageAppropriateSize(m_PreviewPic, out var targetVideoSize); GUILayout.Label("", GUILayout.Width(targetVideoSize.x), GUILayout.Height(targetVideoSize.y)); EditorGUI.DrawTextureTransparent( new Rect(rect.x + 10, rect.y + 10, targetVideoSize.x, targetVideoSize.y), m_PreviewPic, ScaleMode.ScaleToFit); } }
private void Image_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { //查看视频 VideoWindow v = new VideoWindow(Obj.SelectedAreaID); v.Show(); }
private void initializeVideoWindow() { try { if ((videoWindow == null) || (videoWindow.IsDisposed)) { if (videoWindow != null) { // videoWindow.Closing -= VideoWindowOnClosing; } videoWindow = new VideoWindow(); // videoWindow.Closing += VideoWindowOnClosing; if (!videoWindow.VlcPlayerControl.IsInitialized) { videoWindow.VlcPlayerControl.Initialize(this); } // // videoWindow.VlcPlayerControl.StateChanged += vlc_onStateChanged; // videoWindow.VlcPlayerControl.PositionChanged += vlc_onPositionChanged; //videoWindow.VlcPlayerControl.EndReached += vlc_onEndReached; // } } catch (Exception erd) { gCls.show_error(erd.Message.ToString()); return; } }
public void UpdateVideoWindow(VideoChannel videoChannel, VideoWindow videoWindow, bool isCapture) { var item = ParticipantItems.Where(p => p.IsMatch(videoChannel)).SingleOrDefault(); if (item != null) { if (isCapture) { if (item.CaptureVideoWindow == null) { item.CaptureVideoWindow = videoWindow; item.CaptureVideoWindowOriginHeight = videoWindow.Height; item.CaptureVideoWindowOriginWidth = videoWindow.Width; } } else { if (item.RenderVideoWindow == null) { item.RenderVideoWindow = videoWindow; item.RenderVideoWindowOriginHeight = videoWindow.Height; item.RenderVideoWindowOriginWidth = videoWindow.Width; } } } }
private void SetWindowPosition(VideoWindow videoWindow) { var point = new Point(0, 0); var size = new Size(VideoWidth, VideoHeight); if (videoWindow.Height != VideoHeight) { VideoOriginHeight = videoWindow.Height; } if (videoWindow.Width != VideoWidth) { VideoOriginWidth = videoWindow.Width; } videoWindow.SetWindowPosition((int)point.X, (int)point.Y, (int)size.Width, (int)size.Height); if (VideoOriginHeight == 0 || VideoOriginWidth == 0) { } else { var actualHeight = (int)Math.Floor(new decimal((VideoOriginHeight * VideoWidth / VideoOriginWidth))) + 12; size.Height = actualHeight; point.Y = (VideoHeight - actualHeight) / 2; } //videoWindow.SetWindowPosition((int)point.X, (int)point.Y, (int)size.Width, (int)size.Height); }
/// <summary> /// Shows the specified video window in the specified panel. /// </summary> private static void ShowVideo(Panel videoPanel, VideoWindow videoWindow) { //Win32 constants: WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS; const long lEnableWindowStyles = 0x40000000L | 0x02000000L | 0x04000000L; //Win32 constants: WS_POPUP| WS_CAPTION | WS_SIZEBOX const long lDisableWindowStyles = 0x80000000 | 0x00C00000 | 0x00040000L; const int OATRUE = -1; try { //sets the properties required for the native video window to draw itself videoWindow.Owner = videoPanel.Handle.ToInt32(); videoWindow.SetWindowPosition(0, 0, videoPanel.Width, videoPanel.Height); //gets the current window style to modify it long currentStyle = videoWindow.WindowStyle; //disables borders, sizebox, close button currentStyle = currentStyle & ~lDisableWindowStyles; //enables styles for a child window currentStyle = currentStyle | lEnableWindowStyles; //updates the current window style videoWindow.WindowStyle = (int)currentStyle; //updates the visibility videoWindow.Visible = OATRUE; } catch (Exception exception) { Console.WriteLine(exception); } }
private void DragStarted(object sender, System.Windows.Controls.Primitives.DragStartedEventArgs e) { VideoWindow.Pause(); if (timer != null) { timer.Stop(); } }
//엘리베이터 사용. 엘리베이터선택패널의 예 버튼에 연결 public void UseElevator() { SoundManger.instance.musicSource.volume = .1f; UnityEngine.Video.VideoPlayer videoPlayer; videoPlayer = GameObject.Find(items["elevator"].name).GetComponent <UnityEngine.Video.VideoPlayer>(); videoPlayer.Play(); VideoWindow.SetActive(true); videoPlayer.loopPointReached += VideoOver; }
public void VideoOver(UnityEngine.Video.VideoPlayer vp) { vp.Stop(); VideoWindow.SetActive(false); GameManager.GetInstance().hp.GetComponent <Slider>().value -= 10f; dialog.text = "화재시 엘리베이터를 사용하면 위험합니다!"; dialogPanel.SetActive(true); }
private void PlayButton(object sender, RoutedEventArgs e) { VideoWindow.Play(); if (timer != null) { timer.Start(); } }
private void StopButton(object sender, RoutedEventArgs e) { VideoWindow.Stop(); if (timer != null) { timer.Stop(); } }
private void mainContainer_Click(object sender, RoutedEventArgs e) { VideoWindow videoView = new VideoWindow() { VideoID = VideoID }; videoView.Show(); }
private void MediaOpened(object sender, RoutedEventArgs e) { TimerSlider.Maximum = VideoWindow.NaturalDuration.TimeSpan.TotalSeconds; timer = new DispatcherTimer(); timer.Interval = TimeSpan.FromSeconds(1); timer.Tick += Timer_Tick; FullTimeOfVideo.Content = VideoWindow.NaturalDuration.TimeSpan.ToString(@"hh\:mm\:ss"); VideoWindow.Play(); VideoWindow.Pause(); }
private void SetParticipantVideoWindow(VideoChannel channel, VideoWindow window) { var model = ParticipantCollection.GetItem(channel); if (model != null && model != LocalParticipantVideoModel) { model.View = window; RemoteConnectParticipantVideoModel = model; } }
/// <summary> /// 历史监测记录 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void itemVideo_Click(object sender, RoutedEventArgs e) { MenuItem item = sender as MenuItem; if (item != null && item.Tag != null) { string AreaId = item.Tag.ToString(); VideoWindow v = new VideoWindow(AreaId); v.Show(); } }
private static void RaiseVideoAvailable(VideoWindow videoWindow, VideoDirection direction) { // Gets the current window style and modifies it long currentStyle = videoWindow.WindowStyle; currentStyle = currentStyle & ~lDisableWindowStyles; currentStyle = currentStyle | lEnableWindowStyles; videoWindow.WindowStyle = (int)currentStyle; videoWindow.Height = 100; videoWindow.Width = 100; _incomingVideoStreamStarted = true; OnVideoAvailabilityChanged(new LyncVideoWindow(videoWindow), direction, true); // Allow any listeners to attach the video window, then make visible videoWindow.Visible = OATRUE; }
public static void ShowVideo(string videoAssetPath, Action onVideoWindowClose = null) { var window = (VideoWindow)ScriptableObject.CreateInstance <VideoWindow>(); window.playingClip = AssetDatabase.LoadAssetAtPath <VideoClip>(videoAssetPath); window.previewID = VideoUtil.PlayPreview(window.playingClip); Vector2 size = new Vector2(window.playingClip.width * videoClipSizeScale, window.playingClip.height * videoClipSizeScale); window.maxSize = window.minSize = size; window.position = VideoUtil.GetMainWindowCenteredPosition(size); window.titleContent = new GUIContent("VideoWindow"); window.ShowPopup(); window.Focus(); window.onVideoWindowClosed = onVideoWindowClose; instance = window; }
private void Reset() { if (IsPopupVideo) { if (_videoWindow == null) { _videoWindow = transform.GetComponentInChildren <VideoWindow>(); } if (_player == null) { _player = FindObjectOfType <VideoPlayerView>(); } _videoWindow.Hide(); _videoShown = false; } }
public void ShowVideoWindow() { try { VideoIPField.Clear(); VideoPortField.Clear(); VideoUIDField.Clear(); VideoPwdField.Clear(); VideoStatusBar.ClearStatus(); VideoWindow.Title = "云视讯设置"; var parms = new BUser().GetSysParams(30000001); if (parms.Count > 0) { var param1 = parms.Find(p => p.ParaData == 0); if (param1 != null) { VideoIPField.Text = param1.ParaDisplay; } var param2 = parms.Find(p => p.ParaData == 1); if (param2 != null) { VideoPortField.Text = param2.ParaDisplay; } var param3 = parms.Find(p => p.ParaData == 2); if (param3 != null) { VideoUIDField.Text = param3.ParaDisplay; } var param4 = parms.Find(p => p.ParaData == 3); if (param4 != null) { VideoPwdField.Text = param4.ParaDisplay; } } VideoWindow.Show(); } catch (Exception err) { WebUtility.WriteLog(EnmSysLogLevel.Error, EnmSysLogType.Exception, err.ToString(), Page.User.Identity.Name); WebUtility.ShowMessage(EnmErrType.Error, err.Message); } }
private void ShowVideo(System.Windows.Forms.Panel videoPanel, VideoWindow videoWindow) { //Win32 constants: WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS| WS_VISIBLE; const long lEnableWindowStyles = 0x40000000L | 0x02000000L | 0x04000000L | 0x10000000L; //Win32 constants: WS_POPUP| WS_CAPTION | WS_SIZEBOX const long lDisableWindowStyles = 0x80000000 | 0x00C00000 | 0x00040000L; const int OATRUE = -1; //gets the current window style to modify it if (_windowStyle == 0) { long currentStyle = videoWindow.WindowStyle; //disables borders, sizebox, close button currentStyle = currentStyle & ~lDisableWindowStyles; //enables styles for a child window currentStyle = currentStyle | lEnableWindowStyles; _windowStyle = currentStyle; } _log.Debug("ShowVideo videoPanel:{0} windowStyle:{1}", videoPanel.Handle.ToInt32(), _windowStyle); try { videoWindow.Owner = videoPanel.Handle.ToInt32(); SetWindowPosition(videoWindow); //WindowStyle的文章太多,出错就是在这里,默认0不错。 //videoWindow.WindowStyle = 0; videoWindow.WindowStyle = (int)_windowStyle; videoWindow.Visible = OATRUE; } catch (Exception exception) { _log.ErrorException("ShowVideo", exception); } }
private void OpenImage() { ClientTweet tweet = selectTweet; if (tweet == null) { return; } if (tweet.originalTweet == null) { return; } if (tweet.isMedia == false) { return; } string url = string.Empty; foreach (ClientMedia item in tweet.dicPhoto.Values) { if (item.type == "photo") { url = item.display_url; ImageWindow win = new ImageWindow(tweet, url); win.Show(); break; } } for (int i = 0; i < tweet.mediaEntities.media.Count; i++) { if (tweet.mediaEntities.media[i].type == "animated_gif" || tweet.mediaEntities.media[i].type == "video") { VideoWindow win = new VideoWindow(tweet); win.Show(); break; } } }
private void Setup() { if (IsPopupVideo) { if (_videoWindow == null) { _videoWindow = transform.GetComponentInChildren <VideoWindow>(); } if (_player == null) { _player = FindObjectOfType <VideoPlayerView>(); } _player.OnStop += Reset; _player.OnEnd += Reset; _videoWindow.Hide(); } Reset(); SetName(Names); }
private void contextClick_Video(object sender, RoutedEventArgs e) { ClientTweet tweet = selectTweet; if (tweet == null) { return; } MenuItem item = sender as MenuItem; if (item == null) { return; } string url = item.Header.ToString(); VideoWindow window = new VideoWindow(selectTweet); window.Show(); //if(tweet.tweetMovie.display_url==url) //{ // System.Diagnostics.Process.Start(tweet.tweetMovie.expanded_url); // TweetInstence.AddTweet(ePanel.eOpen, tweet); //} //foreach(ClientMedia media in tweet.dicPhoto.Values) //{ // if(media.display_url==url) // { // System.Diagnostics.Process.Start(media.expanded_url); // TweetInstence.AddTweet(ePanel.eOpen, tweet); // break; // } //} //VideoWindow win = new VideoWindow(tweet, item.Header.ToString()); //win.Show(); }
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(VideoWindow obj) { return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; }
private static void ShowWindow() { VideoWindow.ShowVideo("Assets/Editor/Examples/Example_15_SubWindowDock/SubWindowDockVideo.mp4"); }
public VideoWindow getVideoWindow() { VideoWindow ret = new VideoWindow(pjsua2PINVOKE.VideoPreview_getVideoWindow(swigCPtr), true); return(ret); }
private void DragCompleted(object sender, System.Windows.Controls.Primitives.DragCompletedEventArgs e) { VideoWindow.Play(); timer.Start(); }
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(VideoWindow obj) { return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr); }
// private bool enabled; (ya existe en la clase padre // Use this for initialization void Start() { x = 0; y = 0; width = 500; height = 400; xMenu = x; yMenu = y; widthMenu = width/3; heightMenu = height; enabled = true; xPanel=xMenu + widthMenu; yPanel=y; widthPanel = width - (x+widthMenu); heightPanel = height; title = "Menu de configuracion"; videoPanel = new VideoWindow(xPanel,yPanel,widthPanel, heightPanel, "Video", gSkin); audioPanel = new AudioWindow(xPanel,yPanel,widthPanel, heightPanel, "Audio", gSkin); socialNetworkPanel = new SocialNetworkWindow(xPanel,yPanel,widthPanel, heightPanel, "Redes Sociales", gSkin); //menuPanel = new TabWindow(xMenu,yMenu,widthMenu, heightMenu, "", gSkin); currentPanel = Panel.Video; }
private void flex_FlashCallback(FlexCallbackCommand cmd, List<string> args) { UserViewModel uvm = DataContext as UserViewModel; if (uvm != null && uvm.RoomWindowVM != null) switch (cmd) { case FlexCallbackCommand.ReportStatus: IsEnabled = true; if (args != null && args.Count == 1) { if (args[0] == FlexStatusStrings.ConnectSucceed) { RtmpConnectSuccessful(); } else { //TODO Connect Red5 failed. } } break; case FlexCallbackCommand.LoadComplete: IsEnabled = true; break; case FlexCallbackCommand.VideoStateChanged: int vState = 0; if (uvm.IsMe() && args.Count > 0) { if (int.TryParse(args[0], out vState)) { uvm.RoomWindowVM.RoomClient.VideoStateChanged(uvm.RoomWindowVM.RoomVM.Id, vState); } } break; case FlexCallbackCommand.AudioStateChanged: int aState = 0; if (args.Count > 0) { if (int.TryParse(args[0], out aState)) { uvm.RoomWindowVM.RoomClient.AudioStateChanged(uvm.RoomWindowVM.RoomVM.Id,aState); switch (aState) { case FlexCallbackCommandNames.AV_State_Normal: if (uvm.IsMe()) { uvm.RoomWindowVM.StartAudioRecording(); } else { uvm.RoomWindowVM.StartAudioPlaying(uvm.Id); } break; case FlexCallbackCommandNames.AV_State_Paused: if (uvm.IsMe()) { uvm.RoomWindowVM.PauseAudioRecording(); } else { uvm.RoomWindowVM.StopAudioPlaying(uvm.Id); } break; case FlexCallbackCommandNames.AV_State_Resumed: if (uvm.IsMe()) { uvm.RoomWindowVM.StartAudioRecording(); } else { uvm.RoomWindowVM.StartAudioPlaying(uvm.Id); } break; default: break; } } } break; case FlexCallbackCommand.TakePicture: break; case FlexCallbackCommand.ExtendVideo: VideoWindowViewModel vm = new VideoWindowViewModel(uvm); vm.Initialize(); VideoWindow window = new VideoWindow(vm,false); window.Topmost = true; window.Show(); break; } if (FlashCallback != null) { FlashCallback(cmd, args); } }
private void User_ActiveEvent(int id, string name, int command) { if (command == ElementCommands.InfoModule) { Connection.SendMessage(new MessageClass(Connection.ID, id, Commands.GetInfo, 0)); } if (command == ElementCommands.SendModule) { Random r = new Random(); int gid = -1; bool ok = true; while (ok) { ok = false; gid = r.Next(1, Int32.MaxValue / 2); for (int i = 0; i < Setupers.Count; i++) { if (gid == Setupers[i].ID) { ok = true; } } } var setup = new SetupWindow(gid, id, name, Connection); Setupers.Add(setup); setup.Owner = this; setup.CloseEvent += (SetupWindow window) => { Setupers.Remove(window); GC.Collect(); }; setup.Show(); } if (command == ElementCommands.VideoModule) { Random r = new Random(); int gid = -1; bool ok = true; while (ok) { ok = false; gid = r.Next(1, Int32.MaxValue / 2); for (int i = 0; i < VideoWindows.Count; i++) { if (gid == VideoWindows[i].ID) { ok = true; } } } var video = new VideoWindow(gid, id, name, Connection); VideoWindows.Add(video); video.CloseEvent += (VideoWindow window) => { VideoWindows.Remove(window); GC.Collect(); }; video.Show(); } if (command == ElementCommands.FileModule) { Random r = new Random(); int gid = -1; bool ok = true; while (ok) { ok = false; gid = r.Next(1, Int32.MaxValue / 2); for (int i = 0; i < VideoWindows.Count; i++) { if (gid == VideoWindows[i].ID) { ok = true; } } } var fileWindow = new FileWindow(gid, id, name, Connection); FileWindows.Add(fileWindow); fileWindow.CloseEvent += (FileWindow window) => { FileWindows.Remove(window); GC.Collect(); }; fileWindow.Show(); } }
private static void RaiseVideoUnavailable(VideoWindow videoWindow, VideoDirection direction) { _incomingVideoStreamStarted = false; OnVideoAvailabilityChanged(new LyncVideoWindow(videoWindow), direction, false); }
public LyncVideoWindow(VideoWindow lyncVideoObject) { LyncObject = lyncVideoObject; }
public VideoWindowHost(VideoWindow videoWindow, double width, double height) { this._videoWindow = videoWindow; this._width = (int)width; this._height = (int)height; }
private void Window_Loaded(object sender, RoutedEventArgs e) { VideoWindow.ScrubbingEnabled = true; VideoWindow.Stop(); }
/// <summary> /// Shows the specified video window in the specified panel. /// </summary> private void ShowVideo(Panel videoPanel, VideoWindow videoWindow) { Dispatcher.BeginInvoke((Action)(() => { try { var window = new VideoWindowHost(videoWindow, 300, 300); videoPanel.Children.Add(window); } catch (Exception exception) { Console.WriteLine("ConversationWindow Error:" + exception); } })); }
/// <summary> /// Shows the specified video window in the specified panel. /// </summary> private static void ShowVideo(IntPtr parentHandle, Rectangle bounds, VideoWindow videoWindow) { //Win32 constants: WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS; const long lEnableWindowStyles = 0x40000000L | 0x02000000L | 0x04000000L; //Win32 constants: WS_POPUP| WS_CAPTION | WS_SIZEBOX const long lDisableWindowStyles = 0x80000000 | 0x00C00000 | 0x00040000L; const int OATRUE = -1; try { //sets the properties required for the native video window to draw itself var handle = (IntPtr.Size == 4) ? parentHandle.ToInt32() : parentHandle.ToInt64(); videoWindow.Owner = handle; videoWindow.SetWindowPosition(bounds.X, bounds.Y, bounds.Width, bounds.Height); //gets the current window style to modify it long currentStyle = videoWindow.WindowStyle; //disables borders, sizebox, close button currentStyle = currentStyle & ~lDisableWindowStyles; //enables styles for a child window currentStyle = currentStyle | lEnableWindowStyles; //updates the current window style videoWindow.WindowStyle = (int)currentStyle; //updates the visibility videoWindow.Visible = OATRUE; } catch (Exception exception) { Console.WriteLine(exception); } }
// Use this for initialization void Start() { smartFox = SmartFoxConnection.Connection; width = 500; height = 400; x = (Screen.width / 2) - width / 2; Debug.Log("x " + x); y = (Screen.height / 2) - height / 2; Debug.Log("y " + y); xMenu = x; Debug.Log("xMenu " + xMenu); yMenu = y; Debug.Log("yMenu " + yMenu); widthMenu = width / 3; Debug.Log("widthMenu " + widthMenu); heightMenu = height; Debug.Log("heightMenu " + heightMenu); xPanel = xMenu + widthMenu; Debug.Log("xPanel " + xPanel); yPanel = y; Debug.Log("yPanel " + yPanel); widthPanel = (width) - (widthMenu); Debug.Log("widthPanel " + widthPanel); heightPanel = height; Debug.Log("heightPanel " + heightPanel); title = "Menu de configuracion"; videoPanel = new VideoWindow(xPanel,yPanel,widthPanel, heightPanel, "Video", gSkin); jugabilidadPanel = new JugabilidadWindow(xPanel,yPanel,widthPanel, heightPanel, "Video", gSkin); audioPanel = new AudioWindow(xPanel,yPanel,widthPanel, heightPanel, "Audio", gSkin); socialNetworkPanel = new SocialNetworkWindow(xPanel,yPanel,widthPanel, heightPanel, "Redes Sociales", gSkin); videoCallPanel = new VideoCallWindow(xPanel,yPanel,widthPanel, heightPanel, "Video Llamada", gSkin); //menuPanel = new TabWindow(xMenu,yMenu,widthMenu, heightMenu, "", gSkin); currentPanel = Panel.Video; enable = false; Debug.Log(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> termino start"); }