| 1 |
there are two different kind of streams: 1. media files 2. live radio/television |
| 2 |
|
| 3 |
The difference cannot reliably be determined by the backend so the application has to tell the |
| 4 |
frontend. |
| 5 |
|
| 6 |
This is the expected behaviour: |
| 7 |
1. media files |
| 8 |
============== |
| 9 |
function | prev. state | action | new state |
| 10 |
---------+-------------+----------------------------------------------------------------+---------- |
| 11 |
ctor | | | Loading |
| 12 |
---------+-------------+----------------------------------------------------------------+---------- |
| 13 |
setUrl | Loading | refill buffers | Loading |
| 14 |
| Stopped | refill buffers | Loading |
| 15 |
---------+-------------+----------------------------------------------------------------+---------- |
| 16 |
play | Loading | continue buffering | Buffering |
| 17 |
| Stopped | start playing | Playing |
| 18 |
| Buffering | continue buffering | Buffering |
| 19 |
| Playing | | Playing |
| 20 |
| Paused | continue playback | Playing |
| 21 |
---------+-------------+----------------------------------------------------------------+---------- |
| 22 |
pause | Loading | | Loading |
| 23 |
| Stopped | | Stopped |
| 24 |
| Buffering | continue buffering | Paused |
| 25 |
| Playing | pause output and fill buffers to the max | Paused |
| 26 |
| Paused | | Paused |
| 27 |
---------+-------------+----------------------------------------------------------------+---------- |
| 28 |
stop | Loading | | Loading |
| 29 |
| Stopped | | Stopped |
| 30 |
| Buffering | restart buffering from the beginning of the file | Loading |
| 31 |
| Playing | stop output and refill buffers from the beginning of the file | Loading |
| 32 |
| Paused | restart buffering from the beginning of the file | Loading |
| 33 |
|
| 34 |
events |
| 35 |
function | prev. state | event | new state |
| 36 |
---------+-------------+----------------------------------------------------------------+---------- |
| 37 |
| Buffering | when the buffers are filled start playing | Playing |
| 38 |
| Loading | when buffers are filled | Stopped |
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
2. live stream |
| 43 |
============== |
| 44 |
function | prev. state | action | new state |
| 45 |
---------+-------------+----------------------------------------------------------------+---------- |
| 46 |
ctor | | | Loading |
| 47 |
---------+-------------+----------------------------------------------------------------+---------- |
| 48 |
setUrl | Loading | | Stopped |
| 49 |
| Stopped | | Stopped |
| 50 |
---------+-------------+----------------------------------------------------------------+---------- |
| 51 |
play | Loading | | Error |
| 52 |
| Stopped | start buffering | Buffering |
| 53 |
| Buffering | continue buffering | Buffering |
| 54 |
| Playing | | Playing |
| 55 |
| Paused | continue playback | Playing |
| 56 |
---------+-------------+----------------------------------------------------------------+---------- |
| 57 |
pause | Loading | | Error |
| 58 |
| Stopped | | Stopped |
| 59 |
| Buffering | continue buffering | Paused |
| 60 |
| Playing | pause output and fill (ring-)buffers to the max | Paused |
| 61 |
| Paused | | Paused |
| 62 |
---------+-------------+----------------------------------------------------------------+---------- |
| 63 |
stop | Loading | | Error |
| 64 |
| Stopped | | Stopped |
| 65 |
| Buffering | clear buffers | Stopped |
| 66 |
| Playing | stop output and clear buffers | Stopped |
| 67 |
| Paused | clear buffers | Stopped |
| 68 |
|
| 69 |
events |
| 70 |
function | prev. state | event | new state |
| 71 |
---------+-------------+----------------------------------------------------------------+---------- |
| 72 |
| Buffering | when the buffers are filled start playing | Playing |