Exemple #1
0
        void axFlash_FlashCall(object sender, AxShockwaveFlashObjects._IShockwaveFlashEvents_FlashCallEvent e)
        {
            XmlDocument xmlDocument = new XmlDocument();

            xmlDocument.LoadXml(e.request);

            string commandName = xmlDocument.FirstChild.Attributes[0].Value;

            List <string> args  = new List <string>();
            XmlNodeList   nodes = xmlDocument.GetElementsByTagName("arguments");

            if (nodes.Count > 0)
            {
                XmlNodeList parameterNodes = nodes[0].ChildNodes;
                if (parameterNodes.Count > 0)
                {
                    foreach (XmlNode node in parameterNodes)
                    {
                        args.Add(node.InnerText);
                    }
                }
            }
            FlexCallbackCommand cmd = FlexCallbackCommandNames.GetCommand(commandName);

            if (cmd == FlexCallbackCommand.LoadComplete)
            {
                CallFlash(FlexCommand.Resize, new string[] { Width.ToString(), Height.ToString() });
                Resize += FlexControl_Resize;
            }
            if (FlashCallback != null)
            {
                FlashCallback(cmd, args);
            }
        }
		private void flex_FlashCallback(FlexCallbackCommand cmd, List<string> args)
		{
			if (FlashCallback != null)
			{
                FlashCallback(cmd, args);
			}
		}
 private void flex_FlashCallback(FlexCallbackCommand cmd, List <string> args)
 {
     if (FlashCallback != null)
     {
         FlashCallback(cmd, args);
     }
 }
Exemple #4
0
        public static string GetCommandName(FlexCallbackCommand command)
        {
            switch (command)
            {
            case FlexCallbackCommand.LoadComplete:
                return(LoadComplete);

            case FlexCallbackCommand.ReportStatus:
                return(ReportStatus);

            case FlexCallbackCommand.ScaleXDefault:
                return(ScaleXDefault);

            case FlexCallbackCommand.ScaleXMirror:
                return(ScaleXMirror);

            case FlexCallbackCommand.TakePicture:
                return(TakePicture);

            case FlexCallbackCommand.ExtendVideo:
                return(ExtendVideo);

            case FlexCallbackCommand.AudioStateChanged:
                return(AudioStateChanged);

            case FlexCallbackCommand.VideoStateChanged:
                return(VideoStateChanged);

            case FlexCallbackCommand.ZoomIn:
                return(ZoomIn);

            case FlexCallbackCommand.ZoomOut:
                return(ZoomOut);

            case FlexCallbackCommand.SetPlayPosition:
                return(SetPlayPosition);

            case FlexCallbackCommand.SetVolume:
                return(SetVolume);

            case FlexCallbackCommand.PlayMusic:
                return(PlayMusic);

            case FlexCallbackCommand.TogglePauseMusic:
                return(TogglePauseMusic);

            case FlexCallbackCommand.StopMusic:
                return(StopMusic);
            }
            return(None);
        }
Exemple #5
0
        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);
            }
        }
Exemple #6
0
 public static string GetCommandName(FlexCallbackCommand command)
 {
     switch (command)
     {
         case FlexCallbackCommand.LoadComplete:
             return LoadComplete;
         case FlexCallbackCommand.ReportStatus:
             return ReportStatus;
         case FlexCallbackCommand.ScaleXDefault:
             return ScaleXDefault;
         case FlexCallbackCommand.ScaleXMirror:
             return ScaleXMirror;
         case FlexCallbackCommand.TakePicture:
             return TakePicture;
         case FlexCallbackCommand.ExtendVideo:
             return ExtendVideo;
         case FlexCallbackCommand.AudioStateChanged:
             return AudioStateChanged;
         case FlexCallbackCommand.VideoStateChanged:
             return VideoStateChanged;
         case FlexCallbackCommand.ZoomIn:
             return ZoomIn;
         case FlexCallbackCommand.ZoomOut:
             return ZoomOut;
         case FlexCallbackCommand.SetPlayPosition:
             return SetPlayPosition;
         case FlexCallbackCommand.SetVolume:
             return SetVolume;
         case FlexCallbackCommand.PlayMusic:
             return PlayMusic;
         case FlexCallbackCommand.TogglePauseMusic:
             return TogglePauseMusic;
         case FlexCallbackCommand.StopMusic:
             return StopMusic;
     }
     return None;
 }
        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);
            }
        }