• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Video类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Video的典型用法代码示例。如果您正苦于以下问题:C# Video类的具体用法?C# Video怎么用?C# Video使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Video类属于命名空间,在下文中一共展示了Video类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Main

        internal static void Main()
        {
            // Create book
            var book = new Book("Microsoft", "CLR via C# 4", 10);
            book.Display();
            Console.WriteLine(new string('-', 60));

            // Create video
            var video = new Video("Stanley Kubrick", "A Clockwork Orange", 23, 92);
            video.Display();
            Console.WriteLine(new string('-', 60));

            // Make book borroable, then borrow and display
            Console.WriteLine("Making book borrowable:");
            var borrowableBook = new Borrowable(book);
            borrowableBook.BorrowItem("Nikolay Kostov");
            borrowableBook.BorrowItem("Ivaylo Kenov");
            borrowableBook.Display();
            Console.WriteLine(new string('-', 60));

            // Make video borrowable, then borrow and display
            Console.WriteLine("Making video borrowable:");
            var borrowableVideo = new Borrowable(video);
            borrowableVideo.BorrowItem("Nikolay Kostov");
            borrowableVideo.BorrowItem("Ivaylo Kenov");
            borrowableVideo.Display();
            Console.WriteLine(new string('-', 60));

            // Make only video buyable
            Console.WriteLine("Making video buyable:");
            var buyableAndBorrowableVideo = new Buyable(borrowableVideo, 15);
            buyableAndBorrowableVideo.Display();
            Console.WriteLine(new string('-', 60));
        }
开发者ID:darkyto,项目名称:C-Sharp-Stuctural-Design-Patterns,代码行数:34,代码来源:Program.cs


示例2: WebDriverRecorder

        public WebDriverRecorder(int fps) 
        {
            this.fps = fps;
            if (WebDriverTestBase.browser == WebDriverBrowser.Browser.Android)
            {
                this.screensize = new Size(300, 500);
            }
            else
            {
                this.screensize = new Size(1024,768);
            }
            
            this.frameDelayMs = 1000/fps;
            //Common.Log("The current dimensions are : " + screensize.Width + " x " + screensize.Height);
            video = new FlashScreenVideo(new FlashScreenVideoParameters(screensize.Width, screensize.Height, fps));

            screenshotGetter = new BackgroundWorker();
            screenshotGetter.DoWork += screenshotGetter_DoWork;
            screenshotGetter.WorkerSupportsCancellation = true;
            screenshotGetter.RunWorkerAsync();

            videoBuilder = new BackgroundWorker();
            videoBuilder.DoWork += videoBuilder_DoWork;
            videoBuilder.WorkerSupportsCancellation = true;
            videoBuilder.RunWorkerAsync();

        }
开发者ID:tokarthik,项目名称:ProtoTest.Golem,代码行数:27,代码来源:WebDriverRecorder.cs


示例3: OnVideoEncoded

 protected virtual void OnVideoEncoded(Video video)
 {
     if (VideoEncoded != null)
     {
         VideoEncoded(this, new VideoEventArgs() {Video = video});//EventArgs.Empty);
     }
 }
开发者ID:turhany,项目名称:advance-sharp-samples,代码行数:7,代码来源:VideoEncoder.cs


示例4: init

		private void init(string filename, Stream stream, ShaderVersions shaderVersion, ShaderFloatingPointQuality vsQuality, ShaderFloatingPointQuality psQuality, Loader.LoadedCallbackMethod loadedCallback)
		#endif
		{
			try
			{
				video = Parent.FindParentOrSelfWithException<Video>();

				#if WIN32
				shaderVersion = (shaderVersion == ShaderVersions.Max) ? video.Cap.MaxShaderVersion : shaderVersion;
				var code = getShaders(stream);
				vertex = new VertexShader(this, code[0], shaderVersion);
				pixel = new PixelShader(this, code[1], shaderVersion);
				#else
				await getReflections(filename);
				var code = getShaders(stream);
				vertex = new VertexShader(this, code[0]);
				pixel = new PixelShader(this, code[1]);
				#endif

				variables = new List<ShaderVariable>();
				resources = new List<ShaderResource>();
			}
			catch (Exception e)
			{
				FailedToLoad = true;
				Loader.AddLoadableException(e);
				Dispose();
				if (loadedCallback != null) loadedCallback(this, false);
				return;
			}

			Loaded = true;
			if (loadedCallback != null) loadedCallback(this, true);
		}
开发者ID:reignstudios,项目名称:ReignSDK,代码行数:34,代码来源:Shader.cs


示例5: Add

        public ActionResult Add(string t, string k, string d, string imageurl, string u, string um)
        {
            string result = "发布失败";

            if (Session["UserId"] == null)
            {
                return Content("长时间未操作,请重新登录。");
            }

            if (!string.IsNullOrEmpty(t) && !string.IsNullOrEmpty(k) && !string.IsNullOrEmpty(d) && !string.IsNullOrEmpty(imageurl) && !string.IsNullOrEmpty(u) && !string.IsNullOrEmpty(um))
            {
                Video video = new Video();
                video.Title = t;
                video.Keywords = k;
                video.Description = d;
                video.Thumbnail = imageurl;
                video.Url = u;
                video.UrlM = um;
                video.InsertTime = DateTime.Now;
                video.ViewTime = 0;

                VideoService videoService = new VideoService();
                if (videoService.AddVideo(video))
                {
                    result = "success";
                }
            }
            else
            {
                result = "必填项不能为空";
            }
            return Content(result);
        }
开发者ID:Oldsooh,项目名称:XGDG,代码行数:33,代码来源:VideoController.cs


示例6: VideoAnimation

 /*
  * Constructor
  */
 public VideoAnimation(Rectangle windowAreaRectangle, Video video)
 {
     this.windowAreaRectangle = windowAreaRectangle;
     this.video = video;
     videoPlayer = new VideoPlayer();
     videoPlayer.IsLooped = false;
 }
开发者ID:ruizz,项目名称:PangTang,代码行数:10,代码来源:VideoAnimation.cs


示例7: GetVideoImage

        public async Task<DynamicImageResponse> GetVideoImage(Video item, CancellationToken cancellationToken)
        {
            var isoMount = await MountIsoIfNeeded(item, cancellationToken).ConfigureAwait(false);

            try
            {
                // If we know the duration, grab it from 10% into the video. Otherwise just 10 seconds in.
                // Always use 10 seconds for dvd because our duration could be out of whack
                var imageOffset = item.VideoType != VideoType.Dvd && item.RunTimeTicks.HasValue &&
                                  item.RunTimeTicks.Value > 0
                                      ? TimeSpan.FromTicks(Convert.ToInt64(item.RunTimeTicks.Value * .1))
                                      : TimeSpan.FromSeconds(10);

                InputType type;

                var inputPath = MediaEncoderHelpers.GetInputArgument(item.Path, item.LocationType == LocationType.Remote, item.VideoType, item.IsoType, isoMount, item.PlayableStreamFileNames, out type);

                var stream = await _mediaEncoder.ExtractImage(inputPath, type, false, item.Video3DFormat, imageOffset, cancellationToken).ConfigureAwait(false);

                return new DynamicImageResponse
                {
                    Format = ImageFormat.Jpg,
                    HasImage = true,
                    Stream = stream
                };
            }
            finally
            {
                if (isoMount != null)
                {
                    isoMount.Dispose();
                }
            }
        }
开发者ID:Tensre,项目名称:MediaBrowser,代码行数:34,代码来源:VideoImageProvider.cs


示例8: DeleteVideo

 public void DeleteVideo(int videoID)
 {
     var video = new Video() { VideoID = videoID };
     _context.Videos.Attach(video);
     _context.Videos.Remove(video);
     _context.SaveChanges();
 }
开发者ID:smashdevcode,项目名称:windows-azure-demo,代码行数:7,代码来源:Repository.cs


示例9: Create

        public ActionResult Create(Video video, Frame frame)
        {
            video.Frame = frame;

            if (ModelState.IsValid)
            {
                if (video.SavedContentId.HasValue)
                {
                    Content content = db.Contents.Find(video.SavedContentId.Value);
                    video.Contents.Add(content);
                    db.Videos.Add(video);
                    db.SaveChanges();

                    return this.RestoreReferrer() ?? RedirectToAction("Index", "Frame");
                }
                else
                {
                    TempData["_newVideo"] = video;
                    return RedirectToAction("Upload", "Video");
                }
            }

            this.FillTemplatesSelectList(db, FrameTypes.Video, video.Frame.TemplateId);
            FillVideosSelectList();

            return View(video);
        }
开发者ID:Fivebread,项目名称:DisplayMonkey,代码行数:27,代码来源:VideoController.cs


示例10: GameVideo

 public GameVideo(Video video)
 {
     _video = video;
      _videoPlayer = new VideoPlayer();
      kinput = new KeyboardInput();
      gInput = new GamePadInput();
 }
开发者ID:robertg,项目名称:Soar,代码行数:7,代码来源:GameVideo.cs


示例11: PostVideo

        public async Task<IHttpActionResult> PostVideo(Video video)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            db.Videos.Add(video);

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateException)
            {
                if (VideoExists(video.VideoId))
                {
                    return Conflict();
                }
                else
                {
                    throw;
                }
            }

            return CreatedAtRoute("DefaultApi", new { id = video.VideoId }, video);
        }
开发者ID:linkin2016,项目名称:NoticeWebAPI,代码行数:27,代码来源:VideosController.cs


示例12: PutVideo

        public async Task<IHttpActionResult> PutVideo(string id, Video video)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            if (id != video.VideoId)
            {
                return BadRequest();
            }

            db.Entry(video).State = EntityState.Modified;

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!VideoExists(id))
                {
                    return NotFound();
                }
                else
                {
                    throw;
                }
            }

            return StatusCode(HttpStatusCode.NoContent);
        }
开发者ID:linkin2016,项目名称:NoticeWebAPI,代码行数:32,代码来源:VideosController.cs


示例13: CreateVideoEntity

        public void CreateVideoEntity(string embed,  VideoGallery gallery)
        {
            var embedCode = "";
            int pos = embed.LastIndexOf("/") + 1;
            embedCode = embed.Substring(pos, embed.Length - pos);

            VideoType videoType;

            if (embed.ToLower().Contains("youtu"))
            {
                videoType = VideoType.Youtube;
            }
            else if (embed.ToLower().Contains("vimeo"))
            {
                videoType = VideoType.Vimeo;
            }
            else
            {
                videoType = VideoType.Other;
            }

            var video = new Video
            {
                Embed = embedCode,
                VideoType = videoType,
                VideoGallery = gallery
            };

            this.CreateVideo(video);
        }
开发者ID:johannest09,项目名称:Xland2014,代码行数:30,代码来源:VideoService.cs


示例14: OnVideoEncoded

        protected void OnVideoEncoded(Video video)
        {
            if (videoEncoded != null)
                //videoEncoded(this, new VideoEventArgs() { Video = video  });
                videoEncoded(this, new VideoEventArgs() { Video = video });

        }
开发者ID:junaidameen,项目名称:Tutorials,代码行数:7,代码来源:VideoEncoder.cs


示例15: GetVideos

        public List<Video> GetVideos()
        {
            VideoData.videosDataTable DT = db.GetVideos();
            List<Video> videos = new List<Video>();
            foreach (var item in DT)
            {
                Video vid = new Video();
                vid.Id = item.Video_ID;
                if (item.Url == null)
                    vid.Url = "";
                else
                    vid.Url = item.Url;
                if (item.Description == null)
                    vid.Description = "No Description";
                else
                    vid.Description = item.Description;
                if (item.Name == null)
                    vid.Name = "No Name";
                else
                    vid.Name = item.Name;

                videos.Add(vid);
            }

            return videos;

        }
开发者ID:orenger,项目名称:Project---Autism,代码行数:27,代码来源:Video.cs


示例16: videoPlayerBox_MouseDown

        private void videoPlayerBox_MouseDown(object sender, MouseEventArgs e)
        {
            var file = new OpenFileDialog();

            if(file.ShowDialog() == DialogResult.OK) {

                // videoPlayerBox.Dock = DockStyle.None;

                video = new Video(file.FileName, true);
                video.Owner = videoPlayerBox;

                var size = new Size();
                size.Width = video.Size.Width;
                size.Height = video.Size.Height;
                Width = size.Width + 16;
                Height = size.Height + 38;

                string fileName = Path.GetFileNameWithoutExtension(file.FileName);
                Text = fileName;
                // video.Fullscreen = true;
                // System.Threading.Thread.Sleep(3000);
                // FormBorderStyle = FormBorderStyle.None;
                // WindowState = FormWindowState.Maximized;
                // TopMost = true;
            }
        }
开发者ID:msnijder30,项目名称:VideoPlayer,代码行数:26,代码来源:VideoPlayerUI.cs


示例17: LoadContent

 public override void LoadContent()
 {
     base.LoadContent();
     video = ScreenManager.Game.Content.Load<Video>("Video\\intro");
     videoPlayer = new VideoPlayer();
     videoPlayer.IsLooped = true;
 }
开发者ID:holtkampw,项目名称:UH-Sample-XNA-Project,代码行数:7,代码来源:MenuScreenTest.cs


示例18: check_pet_currentVideo

        public static Video check_pet_currentVideo(string _videolink, string _videotitle)
        {
            string url = _videolink;
            Video v = new Video(url, _videotitle);

            return v;
        }
开发者ID:ste26054,项目名称:Petroulette_windowsphone,代码行数:7,代码来源:Checker.cs


示例19: InsertOrUpdateVideo

 public void InsertOrUpdateVideo(Video video)
 {
     _context.Entry(video).State = video.VideoID == 0 ? EntityState.Added : EntityState.Modified;
     foreach (var videoAsset in video.Assets)
         _context.Entry(videoAsset).State = videoAsset.VideoAssetID == 0 ? EntityState.Added : EntityState.Modified;
     _context.SaveChanges();
 }
开发者ID:smashdevcode,项目名称:windows-azure-demo,代码行数:7,代码来源:Repository.cs


示例20: GetVideoFromHtml

        public static Video[] GetVideoFromHtml(string html)
        {
            List<Video> ret = new List<Video>();
            RegexOptions regexOptions = RegexOptions.Singleline;
            Regex reg = new Regex("<table class=\"videotextlist\">.+</table>(?=<!-- end of videotextlist -->)", regexOptions);
            var m = reg.Match(html);
            if (m.Success)
            {
                string table = m.Value;
                Regex reg_actress = new Regex("<tr( class=\"dimrow\")?>.+?</tr>", regexOptions);
                var ms = reg_actress.Matches(table);
                foreach (Match match in ms)
                {
                    Video v = new Video();
                    string tr_html = match.Value;
                    Regex _reg = new Regex("<a href=\".+\".+?>");
                    var _title_all = _reg.Match(tr_html).Value;
                    _reg = new Regex("(?<=href=\"\\./\\?v=).+?(?=\")");
                    v.JL_Id = _reg.Match(_title_all).Value;
                    _reg = new Regex("(?<=title=\").+?(?=\")");
                    var _code_name = _reg.Match(_title_all).Value;
                    _reg = new Regex("[A-Z0-9]{2,6}-[A-Z0-9]{2,6}");
                    v.Code = _reg.Match(_code_name).Value;
                    v.Name = _code_name.Substring(v.Code.Length + 1);
                    _reg = new Regex("(?<=<td>)\\d{4}-\\d{2}-\\d{2}");
                    v.IssueDate = DateTime.Parse(_reg.Match(tr_html).Value);

                    ret.Add(v);
                }
            }
            return ret.ToArray();
        }
开发者ID:Matrixbirds,项目名称:javlibspider,代码行数:32,代码来源:Video.cs



注:本文中的Video类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# VideoInfo类代码示例发布时间:2022-05-24
下一篇:
C# Vessel类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap