[summary of the invention]
Based on this, be necessary to provide a kind of direct playing and playback method that can improve playback flexibility.
A kind of direct playing and playback method, comprises the following steps:
Broadcast data fragment in Preset Time before buffer memory current play time point;
Receive direct playing and playback request, according to described direct playing and playback acquisition request playback duration point;
Broadcast data fragment is returned according to described playback duration point.
In a preferred embodiment, the step of the play time recording each broadcast data fragment is also comprised after the step of the broadcast data fragment in described buffer memory Preset Time.
In a preferred embodiment, the delay duration of specifying is comprised in described direct playing and playback request; The described step according to described direct playing and playback acquisition request playback duration point is: read the delay duration in described direct playing and playback request, calculate playback duration point according to current play time point and described delay duration.
In a preferred embodiment, comprise the broadcasting start time point of specifying in described direct playing and playback request, described playback duration point is described broadcasting start time point.
In a preferred embodiment, the described step returning broadcast data fragment from playback duration point is:
Judge whether the broadcast data fragment that described playback duration point is corresponding has buffer memory, if so, then from described playback duration point, return broadcast data fragment, otherwise terminate.
In addition, there is a need to provide a kind of direct playing and playback system that can improve playback flexibility.
A kind of direct playing and playback system, comprises client and server, and described client is used for sending direct playing and playback request to described server; Described server comprises:
Cache module, for the broadcast data fragment in the Preset Time before buffer memory current play time point;
Receiver module, for receiving direct playing and playback request;
Time-triggered protocol module, for according to described direct playing and playback acquisition request playback duration point;
Sending module, for returning broadcast data fragment according to described playback duration point.
In a preferred embodiment, described cache module is also for recording the play time of each broadcast data fragment.
In a preferred embodiment, the delay duration of specifying is comprised in the direct playing and playback request that described user end to server sends; Described time-triggered protocol module also for reading the delay duration in described direct playing and playback request, calculates playback duration point according to current play time point and described delay duration.
In a preferred embodiment, comprise the broadcasting start time point of specifying in the direct playing and playback request that described user end to server sends, described playback duration point is described broadcasting start time point.
In a preferred embodiment, described server also comprises:
Judge module, for judging whether the broadcast data fragment that described playback duration point is corresponding has buffer memory, if so, then notifies that described sending module returns broadcast data fragment from described playback duration point.
Above-mentioned direct playing and playback method and system, by the broadcast data fragment in the Preset Time before current play time point is carried out buffer memory, when receiving direct playing and playback request, according to this acquisition request playback duration point, broadcast data fragment is returned from this playback duration point, can realize watching programme televised live from certain fixed time point before current play time point, improve the flexibility of direct playing and playback.
[embodiment]
In one embodiment, as shown in Figure 1, a kind of direct playing and playback method, comprises the following steps:
Step S102, the broadcast data fragment in the Preset Time before buffer memory current play time point.
In step s 102, the broadcast data fragment in the Preset Time in the internal memory of server before buffer memory current play time point.In a preferred embodiment, this Preset Time is one hour.In other examples, also can by the broadcast data fragment buffer memory in the Preset Time before current play time point hereof.
In one embodiment, the step of the play time recording each broadcast data fragment is also comprised after step s 102.Such as, the play time of each broadcast data fragment and correspondence is recorded in the form of a list.
Step S104, receives direct playing and playback request, according to direct playing and playback acquisition request playback duration point.
In step S104, send direct playing and playback request by user end to server, user, when asking playback live, can specify broadcast time-delay, namely specify from before current play time point how long watch live.
After user specifies broadcast time-delay, client adds the mark of broadcast time-delay in direct playing and playback request.In one embodiment, comprise the delay duration of specifying in direct playing and playback request, then server receives this when broadcasting playback request, reads the delay duration in direct playing and playback request, calculates playback duration point according to current play time point and delay duration.Such as, direct playing and playback request is
http:// c.qq.com/1.flv? delay=300, the server delay duration read in this direct playing and playback request is 300 seconds (namely 5 minutes), then playback duration point is the difference of current play time point and delay duration.Such as, current play time point is 12:00, then playback duration point is 11:55.
In another embodiment, comprise broadcasting start time point in direct playing and playback request, then playback duration point is exactly this broadcasting start time point.Does is such as, direct playing and playback request: http://c.qq.com/1.flv? begin=2010.11.12_12.30.00, the server broadcasting start time point read in this direct playing and playback request is 2010.11.12_12.30.00, then playback duration point is also 12:30.
Step S106, returns broadcast data fragment according to playback duration point.
In this embodiment, first judge whether the broadcast data fragment that playback duration point is corresponding has buffer memory, if so, then from playback duration point, return broadcast data fragment, otherwise terminate, direct playing and playback request failure.Such as, broadcast data fragment before buffer memory current play time point in half an hour, the broadcast data fragment of 1 hour before user specifies when specifying broadcast time-delay and reviews current play time point, due to the broadcast data fragment in buffer memory only before buffer memory half an hour, broadcast data fragment cannot be returned, therefore direct playing and playback request failure from the time point before 1 hour.In a preferred embodiment, the broadcast time-delay that user only can select in Preset Time can be set according to the Preset Time in step S102.
In one embodiment, as shown in Figure 2, a kind of direct playing and playback system, comprise client 10 and server 20, wherein, client 10 is for sending direct playing and playback request to server 20, and server 20 comprises cache module 202, receiver module 204, time-triggered protocol module 206 and sending module 208, wherein:
Cache module 202 is for the broadcast data fragment in the Preset Time before buffer memory current play time point.
In a preferred embodiment, this Preset Time is one hour.In other examples, cache module 202 also can by the broadcast data fragment buffer memory in the Preset Time before current play time point hereof.
In one embodiment, cache module 202 is also for recording the play time of each broadcast data fragment.Such as, the play time of each broadcast data fragment and correspondence is recorded in the form of a list.
Receiver module 204 is for receiving direct playing and playback request.
In this embodiment, client 10 sends direct playing and playback request to server 20, and user, when asking playback live, can specify broadcast time-delay, namely specify from before current play time point how long watch live.After user specifies broadcast time-delay, client 10 adds the mark of broadcast time-delay in direct playing and playback request.
Time-triggered protocol module 206 is for according to direct playing and playback acquisition request playback duration point.
In one embodiment, comprise the delay duration of specifying in direct playing and playback request, then time-triggered protocol module 206 receives this when broadcasting playback request, reads the delay duration in direct playing and playback request, calculates playback duration point according to current play time point and delay duration.Such as, direct playing and playback request is
http:// c.qq.com/1.flv? delay=300, time-triggered protocol module 206 delay duration read in this direct playing and playback request is 300 seconds (namely 5 minutes), then playback duration point is the difference of current play time point and delay duration.Such as, current play time point is 12:00, then playback duration point is 11:55.
In another embodiment, comprise broadcasting start time point in direct playing and playback request, then playback duration point is exactly this broadcasting start time point.Such as, does is direct playing and playback request: http://c.qq.com/1.flv? begin=2010.11.12_12.30.00, the time-triggered protocol module 206 broadcasting start time point read in this direct playing and playback request is 2010.11.12_12.30.00, then playback duration point is also 12:30.
Sending module 208 is for returning broadcast data fragment according to playback duration point.
In one embodiment, server 20 also comprises judge module (not shown), judge module, for judging whether the broadcast data fragment that playback duration point is corresponding has buffer memory, if so, then notifies that sending module 208 returns broadcast data fragment from playback duration point.Such as, broadcast data fragment before buffer memory current play time point in half an hour, the broadcast data fragment of 1 hour before user specifies when specifying broadcast time-delay and reviews current play time point, due to the broadcast data fragment in buffer memory only before buffer memory half an hour, broadcast data fragment cannot be returned, therefore direct playing and playback request failure from the time point before 1 hour.
In a preferred embodiment, the broadcast time-delay that user only can select in Preset Time can be set according to Preset Time.Such as, the broadcast data fragment before cache module 202 buffer memory current play time point in 1 hour, then arrange user broadcast time-delay only can be selected to be less than or equal to 1 hour.
Above-mentioned direct playing and playback method and system, by the broadcast data fragment in the Preset Time before buffer memory current play time point, when user asks playback live, according to direct playing and playback acquisition request playback duration point, from this playback duration point, return broadcast data fragment.Like this, user can select to review programme televised live from certain time point before current play time point, make user because when some reason does not watch current programme televised live, also by select broadcast time-delay watch before leak see live, improve the flexibility of direct playing and playback.Because the method and system only need to store the broadcast data fragment in a bit of time before current play time, therefore memory space can be saved.
The above embodiment only have expressed several execution mode of the present invention, and it describes comparatively concrete and detailed, but therefore can not be interpreted as the restriction to the scope of the claims of the present invention.It should be pointed out that for the person of ordinary skill of the art, without departing from the inventive concept of the premise, can also make some distortion and improvement, these all belong to protection scope of the present invention.Therefore, the protection range of patent of the present invention should be as the criterion with claims.