[summary of the invention]
Based on this, be necessary to provide a kind of direct playing and playback method that can improve the playback flexibility.
A kind of direct playing and playback method may further comprise the steps:
Live data fragment in the Preset Time before the current play time of buffer memory;
Receive the direct playing and playback request, according to said direct playing and playback acquisition request playback duration point;
Return the live data fragment according to said playback duration point.
In a preferred embodiment, the step that also comprises the play time that writes down each live data fragment after the step of the live data fragment in said buffer memory Preset Time.
In a preferred embodiment, the delay duration that comprises appointment in the said direct playing and playback request; Said step according to said direct playing and playback acquisition request playback duration point is: read the delay duration in the said direct playing and playback request, calculate the playback duration point according to current play time and said delay duration.
In a preferred embodiment, comprise the broadcast start time point of appointment in the said direct playing and playback request, said playback duration point is said broadcast start time point.
In a preferred embodiment, the said step that begins to return the live data fragment from the playback duration point is:
Judge whether the corresponding live data fragment of said playback duration point has buffer memory, if then begin to return the live data fragment, otherwise finish from said playback duration point.
In addition, also be necessary to provide a kind of direct playing and playback system that can improve the playback flexibility.
A kind of direct playing and playback system comprises client and server, and said client is used for sending the direct playing and playback request to said server; Said server comprises:
Cache module is used for the live data fragment in the current play time of the buffer memory Preset Time before;
Receiver module is used to receive the direct playing and playback request;
The time processing module is used for according to said direct playing and playback acquisition request playback duration point;
Sending module is used for returning the live data fragment according to said playback duration point.
In a preferred embodiment, said cache module also is used to write down the play time of each live data fragment.
In a preferred embodiment, the delay duration that comprises appointment in the direct playing and playback request that said user end to server sends; Said time processing module also is used for reading the delay duration of said direct playing and playback request, calculates the playback duration point according to current play time and said delay duration.
In a preferred embodiment, comprise the broadcast start time point of appointment in the direct playing and playback request that said user end to server sends, said playback duration point is said broadcast start time point.
In a preferred embodiment, said server also comprises:
Judge module is used to judge whether the corresponding live data fragment of said playback duration point has buffer memory, if then notify said sending module to begin to return the live data fragment from said playback duration point.
Above-mentioned direct playing and playback method and system; Through the live data fragment in the Preset Time before the current play time is carried out buffer memory; When receiving the direct playing and playback request,, begin to return the live data fragment from this playback duration point according to this acquisition request playback duration point; Can realize beginning to watch programme televised live, improve the flexibility of direct playing and playback from current play time certain fixed time point before.
[embodiment]
In one embodiment, as shown in Figure 1, a kind of direct playing and playback method may further comprise the steps:
Step S102, the live data fragment in the Preset Time before the current play time of buffer memory.
In step S102, the live data fragment in the Preset Time in the internal memory of server before the current play time of buffer memory.In a preferred embodiment, this Preset Time is one hour.In other embodiment, also can be hereof with the live data fragment buffer in the Preset Time before the current play time.
In one embodiment, the step that after step S102, also comprises the play time that writes down each live data fragment.For example, with form each the live data fragment of record of tabulation and the play time of correspondence.
Step S104 receives the direct playing and playback request, according to direct playing and playback acquisition request playback duration point.
In step S104, send the direct playing and playback request through user end to server, the user can specify and play time-delay when the request playback is live, and it is live promptly to specify how long beginning before the current play time to watch.
After the user specified and plays time-delay, client was added the mark of playing time-delay in the direct playing and playback request.In one embodiment, comprise the delay duration of appointment in the direct playing and playback request, then server is received when this broadcasts playback request, reads the delay duration in the direct playing and playback request, calculates the playback duration point according to current play time and delay duration.For example, the direct playing and playback request does
Http:// c.qq.com/1.flv? Delay=300, the delay duration that server reads in this direct playing and playback request is 300 seconds (promptly 5 minutes), then playback duration point is the difference of current play time and delay duration.For example, current play time is 12:00, and then playback duration point is 11:55.
In another embodiment, comprise the broadcast start time point in the direct playing and playback request, then playback duration point is exactly this broadcast start time point.Is for example, the direct playing and playback request: http://c.qq.com/1.flv? The broadcast start time point that begin=2010.11.12_12.30.00, server read in this direct playing and playback request is 2010.11.12_12.30.00, and then playback duration point also is 12:30.
Step S106 returns the live data fragment according to the playback duration point.
Among this embodiment, judge at first whether the corresponding live data fragment of playback duration point has buffer memory, if then begin to return the live data fragment, otherwise finish, direct playing and playback request failure from the playback duration point.For example; Buffer memory the live data fragment in half an hour before the current play time; 1 hour live data fragment before the user specifies when specifying the broadcast time-delay and reviews current play time; Since in the buffer memory only buffer memory the live data fragment before half an hour, can't return the live data fragment since the time point before 1 hour, so direct playing and playback request failure.In a preferred embodiment, the user can be set according to the Preset Time among the step S102 and only can select the broadcast time-delay in the Preset Time.
In one embodiment; As shown in Figure 2, a kind of direct playing and playback system comprises client 10 and server 20; Wherein, Client 10 is used for sending the direct playing and playback request to server 20, and server 20 comprises cache module 202, receiver module 204, time processing module 206 and sending module 208, wherein:
Cache module 202 is used for the live data fragment in the Preset Time before the current play time of buffer memory.
In a preferred embodiment, this Preset Time is one hour.In other embodiment, cache module 202 also can be with the live data fragment buffer in the Preset Time before the current play time hereof.
In one embodiment, cache module 202 also is used to write down the play time of each live data fragment.For example, with form each the live data fragment of record of tabulation and the play time of correspondence.
Receiver module 204 is used to receive the direct playing and playback request.
Among this embodiment, client 10 is sent the direct playing and playback requests to server 20, and the user can specify and play time-delay when the request playback is live, and it is live promptly to specify how long beginning before the current play time to watch.After the user specified and plays time-delay, client 10 was added the mark of playing time-delay in the direct playing and playback request.
Time processing module 206 is used for according to direct playing and playback acquisition request playback duration point.
In one embodiment, comprise the delay duration of appointment in the direct playing and playback request, then time processing module 206 is received when this broadcasts playback request, reads the delay duration in the direct playing and playback request, calculates the playback duration point according to current play time and delay duration.For example, the direct playing and playback request does
Http:// c.qq.com/1.flv? Delay=300, the delay duration that time processing module 206 reads in this direct playing and playback request is 300 seconds (promptly 5 minutes), then playback duration point is the difference of current play time and delay duration.For example, current play time is 12:00, and then playback duration point is 11:55.
In another embodiment, comprise the broadcast start time point in the direct playing and playback request, then playback duration point is exactly this broadcast start time point.For example; Is the direct playing and playback request: http://c.qq.com/1.flv? Begin=2010.11.12_12.30.00; The broadcast start time point that time processing module 206 reads in this direct playing and playback request is 2010.11.12_12.30.00, and then playback duration point also is 12:30.
Sending module 208 is used for returning the live data fragment according to the playback duration point.
In one embodiment; Server 20 also comprises the judge module (not shown); Judge module is used to judge whether the corresponding live data fragment of playback duration point has buffer memory, if then notify sending module 208 to begin to return the live data fragment from the playback duration point.For example; Buffer memory the live data fragment in half an hour before the current play time; 1 hour live data fragment before the user specifies when specifying the broadcast time-delay and reviews current play time; Since in the buffer memory only buffer memory the live data fragment before half an hour, can't return the live data fragment since the time point before 1 hour, so direct playing and playback request failure.
In a preferred embodiment, can the user be set according to Preset Time and only can select the broadcast time-delay in the Preset Time.For example, cache module 202 buffer memorys the live data fragment in 1 hour before the current play time, the user then is set only can selects to play time-delay smaller or equal to 1 hour.
Above-mentioned direct playing and playback method and system; Through the live data fragment in the Preset Time before the current play time of buffer memory; When the user asks playback live,, begin to return the live data fragment from this playback duration point according to direct playing and playback acquisition request playback duration point.Like this; The user can select to begin to review programme televised live from current play time certain time point before; Make when the user does not watch current programme televised live because of some reason, also can be through selecting to play delay time and watch leakage before to see live, the flexibility that has improved direct playing and playback.Because this method and system only need be stored the live data fragment in a bit of time before the current reproduction time, therefore can save memory space.
The above embodiment has only expressed several kinds of execution modes of the present invention, and it describes comparatively concrete and detailed, but can not therefore be interpreted as the restriction to claim of the present invention.Should be pointed out that for the person of ordinary skill of the art under the prerequisite that does not break away from the present invention's design, 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 accompanying claims.