public void Handle(MediaControlEvent message)
        {
            if (message.Source == Media.Source.Viewer)
            {
                var idx = Rallies.IndexOf(Manager.ActiveRally);
                switch (message.Ctrl)
                {
                case Media.Control.Previous:
                    var rallyP = idx - 1 >= 0 ? Rallies[idx - 1] : null;
                    if (rallyP != null)
                    {
                        RallySelected(rallyP);
                    }
                    break;

                case Media.Control.Next:
                    if (Rallies.Count() != 0)
                    {
                        var rallyN = idx + 1 < Rallies.Count ? Rallies[idx + 1] : Rallies[0];
                        if (rallyN != null && rallyN != Rallies[0])
                        {
                            RallySelected(rallyN);
                        }
                        else if (rallyN != null && rallyN == Rallies[0])
                        {
                            Events.PublishOnUIThread(new MediaControlEvent(Media.Control.Pause, Media.Source.Viewer));
                        }
                    }
                    else
                    {
                        Events.PublishOnUIThread(new MediaControlEvent(Media.Control.Stop, Media.Source.Viewer));
                    }
                    break;

                case Media.Control.Stop:

                default:
                    break;
                }
            }
        }
Ejemplo n.º 2
0
        public void Handle(MediaControlEvent message)
        {
            if (message.Source == Media.Source.Viewer)
            {
                switch (message.Ctrl)
                {
                case Media.Control.Stop:
                    IsPlaying = false;
                    break;

                case Media.Control.Pause:
                    IsPlaying = false;
                    break;

                case Media.Control.Play:
                    IsPlaying = true;
                    break;

                default:
                    break;
                }
            }
        }