Skip to content

Commit bfd15df

Browse files
authored
Add chart to readme
1 parent ced7e1e commit bfd15df

1 file changed

Lines changed: 49 additions & 0 deletions

File tree

README.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,3 +108,52 @@ This is an early attempt a the above approaches to reduce latency for live playb
108108
## Contributions
109109

110110
Since, in theory, this small library is helpful to anybody using VideoJS's HTTP Streaming, if we all band together we should be able to work out bugs and improving this so all of us have something that helps us with our respective projects.
111+
112+
## Diagram
113+
114+
Follow the chart to see how the different decisions are made.
115+
116+
```mermaid
117+
flowchart TD
118+
A[Latency Occurs] --> B[User behind live edge]
119+
B --> C[Compensator Enabled]
120+
C --> D[Wait startup period]
121+
D --> E[Begin Monitoring]
122+
123+
E --> F{Paused or Timeout?}
124+
F -- Yes --> G[Do Nothing]
125+
F -- No --> H[Check Network State and Bandwidth]
126+
127+
H --> I{Network OK?}
128+
I -- No --> G
129+
I -- Yes --> J[Check Buffer Health]
130+
131+
J --> K{Buffer Healthy?}
132+
K -- No --> L[Stop Compensator and Timeout]
133+
K -- Yes --> M[Calculate Latency]
134+
135+
M --> N{High Latency?}
136+
N -- No --> O{Low Latency?}
137+
O -- Yes --> P[Stop Compensator]
138+
O -- No --> Q[Keep Monitoring]
139+
N -- Yes --> R{Can Jump to Live?}
140+
141+
R -- Yes --> S[Jump Forward]
142+
R -- No --> T{Buffer and Bandwidth OK?}
143+
T -- No --> L
144+
T -- Yes --> U[Speed Up Playback]
145+
U --> Q
146+
147+
S --> Q
148+
149+
L --> W[Timeout Active]
150+
W --> X[Wait and Resume Monitoring]
151+
152+
subgraph Buffering Handling
153+
Y[Buffering Event]
154+
Y --> Z[Increase Buffer Counter]
155+
Z --> AA{Counter Limit?}
156+
AA -- Yes --> AB[Disable Compensator]
157+
AA -- No --> AC[Start Timeout]
158+
end
159+
```

0 commit comments

Comments
 (0)