当前位置: 首页>>代码示例>>C#>>正文


C# IPlayer.Play方法代码示例

本文整理汇总了C#中IPlayer.Play方法的典型用法代码示例。如果您正苦于以下问题:C# IPlayer.Play方法的具体用法?C# IPlayer.Play怎么用?C# IPlayer.Play使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IPlayer的用法示例。


在下文中一共展示了IPlayer.Play方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Execute

        public PlayResponse Execute(PlayRequest PlayRequest)
        {
            _currentPlayer = ((_currentPlayer != null) && _currentPlayer.Equals(_realPlayer1)) ? _realPlayer2 : _realPlayer1;

            PlayResponse response = _currentPlayer.Play(PlayRequest);
            
            return response;
        }
开发者ID:AvetisG,项目名称:TicTacToe.NET,代码行数:8,代码来源:RealPlayerVsRealPlayer.cs

示例2: Execute

        public PlayResponse Execute(PlayRequest PlayRequest)
        {
            _currentPlayer = ((_currentPlayer != null) && _currentPlayer.Equals(_realPlayer)) ? _AIPlayer : _realPlayer;
            PlayResponse response = _currentPlayer.Play(PlayRequest);

            if (!response.PlayerWon)
            {
                _currentPlayer = ((_currentPlayer != null) && _currentPlayer.Equals(_realPlayer)) ? _AIPlayer : _realPlayer;

                PlayRequest request = new PlayRequest();
                request.TicTacToeBoard = response.TicTacToeBoard;

                response = _currentPlayer.Play(request);
            }

            return response;
        }
开发者ID:AvetisG,项目名称:TicTacToe.NET,代码行数:17,代码来源:RealPlayerVsAIPlayer.cs

示例3: PlayerModule

        public PlayerModule(IPlayer player)
        {
            Get["/"] = _ => View["Index", new IndexViewModel {NowPlaying = player.NowPlaying, Playlist = player.Playlist}];

            Post["/play"] = _ =>
                            {
                                player.Play();
                                return HttpStatusCode.OK;
                            };

            Post["/stop"] = _ =>
                            {
                                player.Stop();
                                return HttpStatusCode.OK;
                            };

            Post["/next"] = _ =>
                            {
                                player.Next();
                                return HttpStatusCode.OK;
                            };

            Post["/prev"] = _ =>
                            {
                                player.Previous();
                                return HttpStatusCode.OK;
                            };

            Post["/voldown"] = _ =>
                               {
                                   player.VolumeDown();
                                   return HttpStatusCode.OK;
                               };

            Post["/volup"] = _ =>
                             {
                                 player.VolumeUp();
                                 return HttpStatusCode.OK;
                             };

            Get["/now"] = _ => player.NowPlaying;
        }
开发者ID:vorou,项目名称:play.NET,代码行数:42,代码来源:PlayerModule.cs

示例4: Play

 private static Task<PlayedGameInfo> Play(Game game, IPlayer player)
 {
     return Task.Run(() => player.Play(game));
 }
开发者ID:Erop147,项目名称:ICFPC_2015,代码行数:4,代码来源:Program.cs

示例5: VideoStartup

		void VideoStartup(IVideoInfo iVideo) {
			playerEngine = new HostedPlayer();
			
			var account = AccountManager.Instance.CurrentAccount;
			UserNameToken usToken = null;
			if (!account.IsAnonymous) {
				usToken = new UserNameToken(account.Name, account.Password);
			}
			playerEngine.SetMetadataReciever(new MetadataFramer((stream) => {
				using (Disposable.Create(() => stream.Dispose())) {
					var xml = new XmlDocument();
					try {
						xml.Load(stream);
						if (xml.DocumentElement != null && xml.DocumentElement.HasChildNodes) {
							
							//TODO: possible incorrect behaviour when multiple instances of odm are running
							if (AppDefaults.visualSettings.EventsCollect_IsEnabled) {
								try {
									using (var sw = AppDefaults.MetadataFileInfo.AppendText()) {
										using (var xw = XmlWriter.Create(sw, new XmlWriterSettings() { Indent = true, CloseOutput = false })) {
											xml.DocumentElement.WriteTo(xw);
										}
										sw.WriteLine();
										sw.WriteLine("<!--------------------------------------------------------------------------------!>");
									}
								} catch {
									//swallow error
								}
							}

							MetadataReceived(xml);
						}
					} catch (Exception err) {

						//TODO: possible incorrect behaviour when multiple instances of odm are running
						if (AppDefaults.visualSettings.EventsCollect_IsEnabled) {
							try {
								using (var sw = AppDefaults.MetadataFileInfo.AppendText()) {
									sw.WriteLine("<!---------------------------------------------------------------------------------");
									sw.WriteLine("ERROR: {0}", err.Message);
									sw.WriteLine("---------------------------------------------------------------------------------!>");
								}
							} catch {
								//swallow error
								dbg.Error(err);
							}
						}

						dbg.Error(err);
					}
				}
			}));
			var vs = AppDefaults.visualSettings;
			MediaStreamInfo.Transport medtranp = MediaStreamInfo.Transport.Tcp;
			switch(vs.Transport_Type){
				case TransportProtocol.http:
					medtranp = MediaStreamInfo.Transport.Http;
					break;
				case TransportProtocol.rtsp:
					medtranp = MediaStreamInfo.Transport.Tcp;
					break;
				case TransportProtocol.tcp:
					medtranp = MediaStreamInfo.Transport.Tcp;
					break;
				case TransportProtocol.udp:
					medtranp = MediaStreamInfo.Transport.Udp;
					break;
			}
			
			MediaStreamInfo mstreamInfo = new MediaStreamInfo(iVideo.MediaUri, medtranp, usToken);
			playerEngine.Play(mstreamInfo, this);

			disposables.Add(playerEngine);
		}
开发者ID:zzilla,项目名称:ONVIF-Device-Manager,代码行数:74,代码来源:MetadataSettingsView.xaml.cs

示例6: Execute

 public override void Execute(IPlayer player, params string[] parameters)
 {
     player.Play();
 }
开发者ID:timgroote,项目名称:Subsane,代码行数:4,代码来源:Play.cs

示例7: VideoStartup

		void VideoStartup(Model model) {
			player = new HostedPlayer();
			var res = model.encoderResolution;
			videoBuff = new VideoBuffer(res.width, res.height);
			player.SetVideoBuffer(videoBuff);

			var account = AccountManager.Instance.CurrentAccount;
			UserNameToken utoken = null;
			if (!account.IsAnonymous) {
				utoken = new UserNameToken(account.Name, account.Password);
			}

			if (model.metadataReceiver != null) {
				player.SetMetadataReciever(model.metadataReceiver);
			}

			MediaStreamInfo.Transport transp;
			switch (model.streamSetup.transport.protocol) {
				case TransportProtocol.http:
					transp = MediaStreamInfo.Transport.Http;
					break;
				case TransportProtocol.rtsp:
					transp = MediaStreamInfo.Transport.Tcp;
					break;
				default:
					transp = MediaStreamInfo.Transport.Udp;
					break;
			}
			MediaStreamInfo mstrInfo = new MediaStreamInfo(model.mediaUri.uri, transp, utoken);
			disposables.Add(player.Play(mstrInfo, this));
			InitPlayback(videoBuff);
		}
开发者ID:zzilla,项目名称:ONVIF-Device-Manager,代码行数:32,代码来源:VideoPlayerView.xaml.cs

示例8: InvokePlayMethod

 protected override void InvokePlayMethod(IPlayer player)
 {
     try
     {
         player.Play((IGameStateForPlayer)this.CurrentGameState);
     }
     catch(Exception ex)
     {
         HaltGame(ex);
     }
 }
开发者ID:Bajena,项目名称:Checkers,代码行数:11,代码来源:CheckersModerator.cs

示例9: togglePlay

 void togglePlay(IPlayer player)
 {
     if (player.IsActive()) player.Pause();
     else player.Play();
 }
开发者ID:i-e-b,项目名称:JWSilverlight,代码行数:5,代码来源:HtmlInteraction.cs


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