remove unused variable
trim trailing spaces
follow HLS spec for live playlist seeking.
If the EXT-X-ENDLIST tag is not present and the client intends to play the media regularly (i.e. in playlist order at the nominal playback rate), the client SHOULD NOT choose a segment which starts less than three target durations from the end of the Playlist file