You can make your own playlist file in memory and only ever join it with data received from the web server. When the stream is paused, you still need to update the playlist. When resuming playback, the player software will still know its current position in the stream.
Just keep in mind that there is no guarantee that older segments will be available. Often, when you service HLS from a CDN, a lifetime of only a few minutes is used. After this period of time, the CDN will simply give 404. This may or may not be relevant in your case; it depends on who controls the network infrastructure.
source share