One real use of the state template that I have seen so far is a video player that can play online video.
You need to process games, pause, buffer, bind, search, and even other states.
When a player is in a playback state or paused, he responds to user interaction events.
When a player is in a βconnectedβ state, he may not have enough data to know the duration of the video, so the search bar should be turned off.
As soon as the player is connected, he will move to the buffering state. In the buffered state, the user can search or stop the video. But if he tries to pause or play the video, the command will be saved later, so when buffering is completed, the video will be paused or playback will start. and etc.
David source share