How do you prevent the user from seeking over adverts introduced in HLS using the EXT-X-DISCONTINUITY tag?

StackOverflow https://stackoverflow.com/questions/9507237

  •  14-11-2019
  •  | 
  •  

Question

I need to setup HLS streaming to serve files to iOS devices. After reading the specification posted on ietf.org I am confused on how you make sure adverts are not skipped... so:

How do you prevent the user from seeking over adverts introduced in HLS using the EXT-X-DISCONTINUITY tag?

It seems easy enough to insert the ad videos, but can't the user just skip them by seeking?

Was it helpful?

Solution

From the server side/playlist side, you could introduce a mechanism to not serve the content faster than clock time. Serving the segments would become an active script that performs some sort of clock validation.

The algorithm to disallow seeking past commercials, but still allow seeking within the content would be somewhat difficult to write. If you assume the viewer won't predict when a commercial is coming, then as soon as the first advertisement segment is requested, a countdown could be started. Until the end of the countdown, http requests outside of the commercial break could be made to return an error, or even the advertisement segments. This would probably wreak havoc on the player's seek bar, however.

What might be easier/more reliable is to write your own video player app.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top