Example #1
0
 public static bool CreateVideoSprite(AxAPlayer3Lib.AxPlayer player, List <Sprite2D> sprite)
 {
     try
     {
         lock (RunTimeData.VideoSprite)
         {
             if (sprite.Any(m => m.IsOnly))
             {
                 foreach (Sprite2D s in RunTimeData.VideoSprite.Where(m => m.IsOnly))
                 {
                     player.SetConfig((int)APlayerSprite2DConfig.SpriteDelete, s.Id.ToString());
                 }
                 RunTimeData.VideoSprite.RemoveAll(m => m.IsOnly);
             }
             foreach (var s in sprite)
             {
                 s.Id = player.SetConfig((int)APlayerSprite2DConfig.SpriteAdd, s.ToString());
                 player.SetConfig((int)APlayerSprite2DConfig.SpritePosition, s.Left + ";" + s.Top);
                 RunTimeData.VideoSprite.Add(s);
             }
         }
         return(true);
     }
     catch
     {
         return(false);
     }
 }
Example #2
0
        private void SetPlayerConfig(AxAPlayer3Lib.AxPlayer axPlayer, PlayerConfig playerConfig, string value)
        {
            if (axPlayer == null)
            {
                return;
            }

            axPlayer.SetConfig((int)playerConfig, value);
        }
Example #3
0
        private void ScreenShot()
        {
            var fileName = System.IO.Path.Combine(ScreenShotSavePath,
                                                  System.IO.Path.GetFileNameWithoutExtension(CurrentVideoItem.Path)
                                                  + DateTime.Now.ToString("HH_mm_ss")
                                                  + ScreenShotExtension);

            player.SetConfig((int)PlayerConfig.SnapshotImage, fileName);
        }
Example #4
0
 public static bool DeleteVideoSprite(AxAPlayer3Lib.AxPlayer player)
 {
     try
     {
         lock (RunTimeData.VideoSprite)
         {
             foreach (var s in RunTimeData.VideoSprite.Where(m => m.IsNeedRemove))
             {
                 player.SetConfig((int)APlayerSprite2DConfig.SpriteDelete, s.Id.ToString());
             }
             RunTimeData.VideoSprite.RemoveAll(m => m.IsNeedRemove);
         }
         return(true);
     }
     catch
     {
         return(false);
     }
 }
Example #5
0
 private static void time_tick(object sender, EventArgs e)
 {
     timer.Enabled = false;
     player.SetConfig(602, "0");
 }
Example #6
0
 private static void time_tick(object sender, EventArgs e)
 {
     timer.Enabled = false;
     player.SetConfig(602, "0");//激活视频叠加图功能, 1-激活, 0-不激活
 }