示例#1
0
 public void dropVideoOnCanvas(string filename, Point pos, int count)
 {
     FileType type = GetFileType(filename);
     if (type == FileType.Video)
     {
         Dispatcher.adopt(() =>
         {
             var placeHolderMe = new MediaElement
             {
                 Source = new Uri(filename, UriKind.Relative),
                 Width = 200,
                 Height = 200,
                 LoadedBehavior = MediaState.Manual
             };
             var placeHolder = new Video { MediaElement = placeHolderMe, VideoSource = placeHolderMe.Source };
             InkCanvas.SetLeft(placeHolder, pos.X);
             InkCanvas.SetTop(placeHolder, pos.Y);
             var animationPulse = new DoubleAnimation
                                      {
                                          From = .3,
                                          To = 1,
                                          Duration = new Duration(TimeSpan.FromSeconds(1)),
                                          AutoReverse = true,
                                          RepeatBehavior = RepeatBehavior.Forever
                                      };
             placeHolder.BeginAnimation(OpacityProperty, animationPulse);
             placeHolder.tag(new MeTLLib.DataTypes.ImageTag
                               {
                                   author = Globals.me,
                                   id = generateId(),
                                   privacy = privacy,
                                   zIndex = -1
                               });
             MeTLLib.ClientFactory.Connection().UploadAndSendVideo(new MeTLStanzas.LocalVideoInformation
             (currentSlide, Globals.me, target, privacy, placeHolder, filename, false));
             Children.Remove(placeHolder);
         });
     }
 }