本文整理汇总了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;
}
示例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;
}
示例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;
}
示例4: Play
private static Task<PlayedGameInfo> Play(Game game, IPlayer player)
{
return Task.Run(() => player.Play(game));
}
示例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);
}
示例6: Execute
public override void Execute(IPlayer player, params string[] parameters)
{
player.Play();
}
示例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);
}
示例8: InvokePlayMethod
protected override void InvokePlayMethod(IPlayer player)
{
try
{
player.Play((IGameStateForPlayer)this.CurrentGameState);
}
catch(Exception ex)
{
HaltGame(ex);
}
}
示例9: togglePlay
void togglePlay(IPlayer player)
{
if (player.IsActive()) player.Pause();
else player.Play();
}