The invention discloses a
time shifting optimization method and
system based on the HLS protocol, and relates to the field of
Internet multimedia. The method includes the following steps: starting from a preset time point, with a media segment time length with a
fixed length as a fragment length, counting a fragment
sequence ID of each streaming media fragment; storing all streaming media fragments within a
time shifting range, grouping the streaming media fragments, dividing every continuous N streaming media fragments into one group, wherein each group of streaming media fragments forms a
time shifting index file; causing an HLS live broadcast program into a time shifting state by a
client via a broadcast control operation, adding time shifting additional information on the address of the live broadcast index file, and sending the time shifting index file to an HTTP streaming
media server; analyzing, by the HTTP streaming
media server, the time shifting additional information, and sending the corresponding time shifting index file to the
client; and requesting and playing, by the
client, the received streaming media fragments. By adoption of the time shifting optimization methodand
system, the bandwidth and time consumed by the transmission of the time shifting index file are reduced, which is conducive to improving the playing speed.