Ejemplo n.º 1
0
        public VideoNodeState SetState(MediaElementState mediaState, IVideoNode context)
        {
            if (_states.ContainsKey(mediaState + "State"))
            {
                return(_states[mediaState + "State"]);
            }

            switch (mediaState)
            {
            case MediaElementState.Buffering:
                var bufferingState = new BufferingState(this, context);
                _states.Add(bufferingState.GetType().Name, bufferingState);
                return(bufferingState);

            case MediaElementState.Playing:
                var playingState = new PlayingState(this, context);
                _states.Add(playingState.GetType().Name, playingState);
                return(playingState);

            case MediaElementState.Stopped:
                var stoppedState = new StoppedState(this, context);
                _states.Add(stoppedState.GetType().Name, stoppedState);
                return(stoppedState);

            case MediaElementState.Opening:
                var openingState = new OpeningState(this, context);
                _states.Add(openingState.GetType().Name, openingState);
                return(openingState);

            case MediaElementState.Paused:
                var pausedState = new PausedState(this, context);
                _states.Add(pausedState.GetType().Name, pausedState);
                return(pausedState);

            default:
                return(null);
            }
        }
Ejemplo n.º 2
0
 protected VideoNodeState(VideoNodeStateFactory factory, IVideoNode context)
 {
     Factory = factory;
     Context = context;
 }
Ejemplo n.º 3
0
 public BufferingState(VideoNodeStateFactory factory, IVideoNode context) : base(factory, context)
 {
 }
Ejemplo n.º 4
0
 public BufferingState(VideoNodeStateFactory factory, IVideoNode context) : base(factory, context)
 {
 }
Ejemplo n.º 5
0
 public StoppedState(VideoNodeStateFactory factory, IVideoNode context)
     : base(factory, context)
 {
 }
Ejemplo n.º 6
0
 protected VideoNodeState(VideoNodeStateFactory factory, IVideoNode context)
 {
     Factory = factory;
     Context = context;
 }
Ejemplo n.º 7
0
 public PausedState(VideoNodeStateFactory factory, IVideoNode context)
     : base(factory, context)
 {
 }