Skip to content

Commit 2ee0bc0

Browse files
committed
Update README.md
1 parent 95f5414 commit 2ee0bc0

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,18 @@ Please note that using videos from URLs requires ensuring that you have the righ
6161

6262
## Commands
6363

64+
### Handling Sequential Similar Commands
65+
66+
When using the video player controls in your SwiftUI application, it's important to understand how command processing works. Specifically, issuing two identical commands consecutively will result in the second command being ignored. This is due to the underlying implementation in SwiftUI that prevents redundant command execution to optimize performance and user experience.
67+
68+
### Common Scenario
69+
70+
For example, if you attempt to pause the video player twice in a row, the second pause command will have no effect because the player is already in a paused state. Similarly, sending two consecutive play commands will not re-trigger playback if the video is already playing.
71+
72+
### Handling Similar Commands
73+
74+
In cases where you need to re-issue a command that might appear redundant but is necessary under specific conditions, you must insert an `idle` command between the two similar commands. The `idle` command resets the command state of the player, allowing subsequent commands to be processed as new actions.
75+
6476
### Playback Commands
6577

6678
| Command | Description |

0 commit comments

Comments
 (0)