CN108156152B - Method, apparatus, storage medium and the terminal device Streaming Media downloading and played - Google Patents
Method, apparatus, storage medium and the terminal device Streaming Media downloading and played Download PDFInfo
- Publication number
- CN108156152B CN108156152B CN201711407544.XA CN201711407544A CN108156152B CN 108156152 B CN108156152 B CN 108156152B CN 201711407544 A CN201711407544 A CN 201711407544A CN 108156152 B CN108156152 B CN 108156152B
- Authority
- CN
- China
- Prior art keywords
- streaming media
- offline
- fragment
- decruption key
- media fragment
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/04—Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
- H04L63/0428—Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/06—Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/08—Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
- H04L9/0816—Key establishment, i.e. cryptographic processes or cryptographic protocols whereby a shared secret becomes available to two or more parties, for subsequent use
- H04L9/0819—Key transport or distribution, i.e. key establishment techniques where one party creates or otherwise obtains a secret value, and securely transfers it to the other(s)
- H04L9/0822—Key transport or distribution, i.e. key establishment techniques where one party creates or otherwise obtains a secret value, and securely transfers it to the other(s) using key encryption key
Abstract
The present invention proposes a kind of method, apparatus, storage medium and terminal device Streaming Media downloading and played, wherein, method for down loading includes: downloading and parses raw media file, obtains the encryption format of the download address of Streaming Media fragment, the download address of the decruption key of the Streaming Media fragment and the Streaming Media fragment;In turn, Streaming Media fragment is downloaded according to the information of parsing, and the Streaming Media fragment downloaded is stored in media storage area;And the download address according to encryption format and decruption key, download decryption key;Then the decruption key of streaming media fragment carries out being encrypted and stored at a key storage area again;The offline media file that offline play operation is carried out for being supplied to player is finally generated according to the storage address of the data of downloading.Using the present invention, it can be avoided files in stream media and be distributed and played out in other equipment or other players.
Description
Technical field
The present invention relates to multimedia audio-video processing technology field more particularly to the sides of a kind of Streaming Media downloading and broadcasting
Method, device, storage medium and terminal device
Background technique
HLS (HTTP Live Streaming) is the adaptive technique of the dynamic code rate of Apple Inc..It includes one
M3U8 index file, TS media (audio and/or video) slicing files and KEY encrypt string file, and entire encrypted media file is
The index file of one text formatting, suffix name are generally .M3U8.TS Streaming Media slicing files in file describe each stream
The length and broadcasting timing, M3U8 index file of media slicing record the download address and KEY encryption of each Streaming Media fragment point
String file records the download address of the decruption key of each Streaming Media fragment, and default is not supported to play offline.Player is broadcast online
When putting, M3U8 formatted file is downloaded from network server first, parses length, the download address of each Streaming Media fragment, with
And the download address of each Streaming Media fragment decruption key downloads each Streaming Media fragment then according to playing sequence according to this
With corresponding decruption key, and broadcasting is decrypted using corresponding decryption key.
For at present, the offline broadcasting of HLS encrypted media file is realized, from disclosed data and from the point of view of realizing, be probably
Following steps:
1. downloading M3U8 formatted file;
2. parsing M3U8 formatted file, it is (every in array to generate the array Segments comprising Streaming Media burst information
It include Streaming Media fragment duration, fragment download address, decruption key download address in a element);
3. the corresponding Streaming Media fragment of each element downloaded in Segments array according to this is corresponding with the Streaming Media fragment
Decruption key;
4. the corresponding Streaming Media fragment that the decruption key of the Streaming Media fragment obtained using downloading is obtained downloading carries out
Decryption;
5. storing the Streaming Media fragment after decryption into individual catalogue Folder;
6. local build a HTTP server;
7. generating a new M3U8 formatted file, local is write as in the extraction address of each Streaming Media fragment in file
The form of the URL (Uniform Resource Locator, uniform resource locator) of HTTP server;
8. being saved in newly-generated M3U8 formatted file in catalogue Folder identical with local Streaming Media fragment.
But above-mentioned offer scheme, it has the disadvantage in that
1. due to the Streaming Media fragment of original encryption be during being downloaded and stored in local after being first decrypted again
Store in local particular category, once thus cause user to find the catalogue for storing offline HLS media file, so that it may nothing
The media file is distributed in limitation.
2. the local purpose for having built a HTTP server is to provide Streaming Media point for newly-generated M3U8 formatted file
The format of the extraction address of piece, increases the complexity of software entirety, and therefore bring CPU, memory, battery consumption.
Summary of the invention
The embodiment of the present invention provides a kind of stream media downloading method, device, storage medium and terminal device and Streaming Media
Playback method, device, storage medium and terminal device, can be avoided Streaming Media be distributed in other equipment or other players into
Row plays.
In a first aspect, the embodiment of the invention provides a kind of methods of Streaming Media downloading, comprising:
The downloading request for responding the Streaming Media, downloads the raw media file of the Streaming Media, wherein the original matchmaker
Body file include the download address of Streaming Media fragment, the Streaming Media fragment decruption key download address and the Streaming Media
The encryption format of fragment;
The Streaming Media fragment, and the Streaming Media fragment that will be downloaded are downloaded according to the download address of the Streaming Media fragment
It is stored in media storage area;
According to the decryption of the encryption format of Streaming Media fragment described in the raw media file and the Streaming Media fragment
The download address of key downloads the decruption key of the Streaming Media fragment;
The decruption key of the Streaming Media fragment of downloading is encrypted, and by the solution of the Streaming Media fragment of encryption
Close key storage is in a key storage area;And
According to the Streaming Media fragment be stored in the media storage area address and the Streaming Media fragment decryption it is close
Key is stored in the address in the key storage area, generates offline media file, wherein the offline media file is for being supplied to
Player carries out offline play operation.
With reference to first aspect, the present invention is in the first embodiment of first aspect, the downloading Streaming Media point
The decruption key of piece, comprising:
Whether the encryption format for judging the Streaming Media fragment is default encryption format;
If so, downloading the decryption of the Streaming Media fragment according to the download address of the decruption key of the Streaming Media fragment
Key;
If it is not, carrying out splicing to the download address of the decruption key of the Streaming Media fragment, and according to stitching portion
Download address after reason downloads the decruption key of the Streaming Media fragment.
The first embodiment with reference to first aspect, the present invention are described in second of embodiment of first aspect
Splicing is carried out to the download address of the decruption key of the Streaming Media fragment, is specifically included:
When the encryption format for determining the Streaming Media fragment is the first extended format, by the decryption of the Streaming Media fragment
The download address of key is spliced with extended address;
When the encryption format for determining the Streaming Media fragment is the second extended format, according to the raw media file
Mark obtains timeliness token, and the download address of the decruption key of the Streaming Media fragment and the timeliness token are spliced.
With reference to first aspect, for the present invention in the third embodiment of first aspect, the key storage area includes using
Access storage areas is forbidden at family, and
The decruption key of the Streaming Media fragment of described pair of downloading encrypts, and by the solution of the media piece of encryption
Close key storage is in a key storage area, comprising:
Forbid reading equipment identities identification code in access storage areas from the user;And
It is encrypted, and will added according to decruption key of the equipment identities identification code to the Streaming Media fragment of downloading
The decruption key of the Streaming Media fragment after close is stored in the user and forbids access storage areas.
In the first embodiment with reference to first aspect, the present invention is in the 4th kind of embodiment of first aspect, institute
It states and forbids reading equipment identities identification code in access storage areas from the user, comprising:
Judge that the user forbids whether access storage areas is stored with equipment identities identification code;
If it is not, then generating an equipment identities identification code according to identification code security algorithm, and it is stored in the user and forbids
Access storage areas;
If so, then forbidding reading the equipment identities identification code in access storage areas from the user.
With reference to first aspect, the present invention in the 5th kind of embodiment of first aspect, record by the offline media file
Address be all made of local file path format.
With reference to first aspect, the present invention is in the 6th kind of embodiment of first aspect, the method also includes:
While generating the offline media file, the encryption lattice of the Streaming Media fragment of the offline media file are identified
Formula is offline formats.
Second of embodiment with reference to first aspect, the present invention are described in the 7th kind of embodiment of first aspect
First extended format includes PlayerBinding format;Second extended format includes Token format.
Second aspect, the embodiment of the present invention provide a kind of method of streaming media playing, comprising:
The offline playing request for responding the Streaming Media imports the offline media file of the Streaming Media;The offline matchmaker
Body file is the file generated according to the stream media downloading method that any one embodiment of first aspect provides;
The address of media storage area is stored according to the Streaming Media fragment that the offline media file is recorded, from the media
The Streaming Media fragment is extracted in memory block;
The decruption key for the Streaming Media fragment recorded according to the offline media file is stored in key storage area
The decruption key is extracted from the key storage area in address;
Decryption oprerations are executed to the decruption key;
Decryption oprerations are executed to the Streaming Media fragment according to the decruption key after decryption, and play the Streaming Media after decryption
Fragment.
In conjunction with second aspect, for the present invention in the first embodiment of second aspect, the key storage area includes using
Access storage areas is forbidden at family, and the decruption key is to forbid the equipment identities extracted in access storage areas to know according to from the user
Made of other code encrypts it;And
It is described that decryption oprerations are executed to the decruption key, it specifically includes: and
Forbid access storage areas extract equipment identity code from the user;
The decruption key is decrypted according to the equipment identities identification code.
In conjunction with second aspect, the present invention is in second of embodiment of second aspect, the flow media playing method, also
Include:
When receiving the request for deleting the offline media file, by the offline media file, the offline media
The decruption key of the Streaming Media fragment of the Streaming Media fragment of file and the offline media file is deleted.
The third aspect, the embodiment of the present invention provide a kind of device of Streaming Media downloading, comprising:
Original document download module, the downloading for the Streaming Media are requested, and the original media text of the Streaming Media is downloaded
Part;Wherein, the raw media file include the download address of Streaming Media fragment, the Streaming Media fragment decruption key under
The encryption format of set address and the Streaming Media fragment;
Streaming Media fragment download module downloads the Streaming Media point for the download address according to the Streaming Media fragment
Piece, and the Streaming Media fragment downloaded is stored in media storage area;
Decruption key download module, for the encryption format of Streaming Media fragment according to the raw media file and
The download address of the decruption key of the Streaming Media fragment downloads the decruption key of the Streaming Media fragment;
Decryption key encryption module, the decruption key for the Streaming Media fragment to downloading encrypt, and will add
The decruption key of the Streaming Media fragment after close is stored in a key storage area;And
Off-line files generation module, for being stored in address and the institute of the media storage area according to the Streaming Media fragment
The decruption key for stating Streaming Media fragment is stored in the address in the key storage area, generates offline media file;The offline matchmaker
Body file carries out offline play operation for being supplied to player.
The function can also execute corresponding software realization by hardware realization by hardware.The hardware or
Software includes one or more modules corresponding with above-mentioned function.
It is described to deposit including processor and memory in the structure of the device of Streaming Media downloading in a possible design
Reservoir is used to store the program for supporting the device of Streaming Media downloading to execute the method that Streaming Media is downloaded in above-mentioned first aspect, described
Processor is configurable for executing the program stored in the memory.The device of the Streaming Media downloading can also include logical
Believe interface, the device and other equipment or communication for Streaming Media downloading.
Fourth aspect, the embodiment of the invention provides a kind of computer readable storage mediums, download for stored stream media
Device used in computer software instructions comprising for executing the method that Streaming Media in above-mentioned first aspect is downloaded as stream matchmaker
Program involved in the device of body downloading.
5th aspect, the embodiment of the present invention provide a kind of device of streaming media playing, comprising:
Off-line files import modul imports the offline media text of the Streaming Media for the playing request of the Streaming Media
Part;The offline media file is the stream media downloading method provided according to any one embodiment of first aspect
The file of generation;
Decryption playing module, the broadcasting timing of the Streaming Media fragment for being recorded according to the offline media file, one by one
Streaming media fragment executes decryption play operation;Wherein, decryption playing module includes:
Streaming Media fragment extraction unit, the Streaming Media fragment for being recorded according to the offline media file are stored in
The Streaming Media fragment is extracted in the address of media storage area from the media storage area;
The decryption of decruption key extraction unit, the Streaming Media fragment for being recorded according to the offline media file is close
Key is stored in the address in key storage area, extracts the decruption key from the key storage area;
Decryption key decryption unit, for executing decryption oprerations to the decruption key;
Streaming Media fragment decrypts broadcast unit, for being held according to the decruption key after decryption to the Streaming Media fragment
Row decryption oprerations, and play the Streaming Media fragment after decryption.
The function can also execute corresponding software realization by hardware realization by hardware.The hardware or
Software includes one or more modules corresponding with above-mentioned function.
It is described to deposit including processor and memory in the structure of the device of streaming media playing in a possible design
Reservoir is used to store the program for supporting the device of streaming media playing to execute the method for streaming media playing in above-mentioned first aspect, described
Processor is configurable for executing the program stored in the memory.The device of the streaming media playing can also include logical
Believe interface, the device and other equipment or communication for streaming media playing.
6th aspect, the embodiment of the invention provides a kind of computer readable storage mediums, play for stored stream media
Device used in computer software instructions comprising for executing the method for streaming media playing in above-mentioned second aspect as stream matchmaker
Program involved in the device that body plays.
Any one technical solution in above-mentioned technical proposal have the following advantages that or the utility model has the advantages that
Downloading request based on user's streaming media, the ground that the embodiment of the present invention is recorded according to the raw media file of downloading
The decruption key of Streaming Media fragment and the downloading Streaming Media fragment is downloaded in location one by one, and the Streaming Media fragment downloaded is direct
It is stored, rather than directly the Streaming Media fragment downloaded is decrypted using decruption key, be then not necessarily to after decryption again
Stored stream media fragment is encrypted to guarantee the safety of Streaming Media fragment, the cumbersome of streaming media fragment encryption storage can be reduced
Property;On the other hand, the decruption key downloaded is subjected to encryption storage, so that even if Streaming Media fragment is replicated other terminals and sets
Standby or other players, and decruption key is decrypted since decryption mechanisms can not be obtained, and can not be close using decrypting
The Streaming Media fragment is decrypted in key, so that Streaming Media be avoided to be played by other terminal devices or the distribution of other players.With
And it since key to be decrypted is small compared to Streaming Media fragment, under the premise of guaranteeing Streaming Media safety, is carried out using to decruption key
Cipher mode can greatly improve encryption efficiency.
Above-mentioned general introduction is merely to illustrate that the purpose of book, it is not intended to be limited in any way.Except foregoing description
Schematical aspect, except embodiment and feature, by reference to attached drawing and the following detailed description, the present invention is further
Aspect, embodiment and feature, which will be, to be readily apparent that.
Detailed description of the invention
In the accompanying drawings, unless specified otherwise herein, otherwise indicate the same or similar through the identical appended drawing reference of multiple attached drawings
Component or element.What these attached drawings were not necessarily to scale.It should be understood that these attached drawings depict only according to the present invention
Disclosed some embodiments, and should not serve to limit the scope of the present invention.
Fig. 1 is the flow diagram of the method for the Streaming Media downloading that first embodiment of the invention provides;
Fig. 2 is the process signal of the method for the downloading of the decruption key for the Streaming Media fragment that second embodiment of the invention provides
Figure;
Fig. 3 is the process of the method for the encryption storage of the decruption key for the Streaming Media fragment that third embodiment of the invention provides
Schematic diagram;
Fig. 4 is the flow diagram of the method for the streaming media playing that fourth embodiment of the invention provides;
Fig. 5 is the structural schematic diagram of the device for the Streaming Media downloading that fifth embodiment of the invention provides;
Fig. 6 is the structural schematic diagram of the device for the streaming media playing that sixth embodiment of the invention provides;
Fig. 7 is the structural schematic diagram for the terminal device that seventh embodiment of the invention provides.
Specific embodiment
Hereinafter, certain exemplary embodiments are simply just described.As one skilled in the art will recognize that
Like that, without departing from the spirit or scope of the present invention, described embodiment can be modified by various different modes.
Therefore, attached drawing and description are considered essentially illustrative rather than restrictive.
The embodiment of the present invention, which is directed to can be avoided Streaming Media, to be dispensed in other mobile devices or other players
The solution of broadcasting.In the application environment of streaming media on demand or the player of live streaming, for example, being based on matter of time or network
The problem of signal etc., the data that streaming media can be all provided for user are downloaded storage to carry out the subsequent behaviour played offline
Make scheme.Generally, user operates in player interface generates the request instruction that specified Streaming Media is downloaded in request, player root
The encryption file of Streaming Media is correspondingly downloaded according to the request instruction, is based on this, a kind of audio-video encapsulation format that apple proposes,
HLS protocol (file suffixes .M3U8) is supported encryption, can be supported extensively on the apples platform such as Mac, iOS.
The embodiment of the present invention is expected that by the raw media file download process and executes the downloading of corresponding Streaming Media
On the one hand the offline broadcasting of Streaming Media is realized in operation, it is whole by other movements on the other hand to can be avoided locally downloading Streaming Media
End or the distribution of other players play, i.e., realization files in stream media is specific to a certain user and uses.So-called raw media file is
Refer to, the index file of a text formatting, suffix name is generally .M3U8, a Streaming Media each is described in this document
Broadcasting timing, playing duration and the download address of Streaming Media fragment, and decruption key for decrypting the Streaming Media fragment
Download address, this document can be played device parsing identification, player made to be able to carry out the downloading or extraction of corresponding Streaming Media
To carry out subsequent play operation.The Streaming Media of meaning of the embodiment of the present invention includes video, audio or audio-video.The present invention is implemented
The core concept of example are as follows: downloading raw media file is simultaneously parsed, and the broadcasting of each Streaming Media fragment of Streaming Media is obtained
Timing, the download address of each Streaming Media fragment are distinguished under one-to-one decruption key with each Streaming Media fragment
The encryption format of the Streaming Media fragment of set address and the raw media file.Then, it is downloaded respectively often according to the information obtained
The decruption key of one Streaming Media fragment and each Streaming Media fragment;And then stored stream media fragment, and matchmaker is flowed to each
The decruption key of body fragment carries out encryption storage, finally by Streaming Media fragment in the storage address of local and the solution of Streaming Media fragment
Broadcasting timing between the storage address and Streaming Media fragment of key generates the file that a suffix is .M3U8, i.e., offline matchmaker
Body file, the offline media file is identical as raw media file format, the form and raw media file of the content recorded
Unanimously, the corresponding offline broadcasting of Streaming Media progress is extracted according to offline media file for being supplied to player.The present invention is implemented
Streaming Media fragment and non-decrypting rear storage of the example by downloading storage, and it is encrypted to before storing decruption key
Operation, it is possible to prevente effectively from Streaming Media is distributed to this feelings that can smoothly play when other terminal devices or other players
Condition occurs.The expansion description for dividing embodiment to carry out technical solution below.
Implement one
Referring to Fig. 1, the embodiment of the present invention one provides a kind of method of Streaming Media downloading, can be loaded by terminal device
Player executes, including step S110 is to step S150, specific as follows:
S110 responds the downloading request of the Streaming Media, downloads the raw media file of the Streaming Media;The original matchmaker
Body file include Streaming Media fragment download address, with the download address of the decruption key of the Streaming Media fragment and the stream matchmaker
The encryption format of body fragment.
In embodiments of the present invention, downloading request is generated from user to terminal device touch-control, which may include wait ask
Ask mark and the download time, the downloading information such as storage region of the raw media file of downloading, the downloading memory block can be with
Subsequent media storage area is consistent, can also be inconsistent.The technical scheme is that the solution party proposed based on HLS protocol
Case, thus the raw media file for being based on HLS protocol offer below is described, if it will be understood that any other agreement
The technical effect reached using the equally achievable embodiment of the present invention of this programme is also in the protection scope of technical solution of the present invention
Within.The raw media file is preferably based on the file of HLS protocol generation, can be identified and be solved by dedicated player
Analysis.It generally, include TS Streaming Media slicing files, M3U8 index file and KEY before not parsing in the raw media file
Encrypt string file;Wherein, TS Streaming Media slicing files record the length of each Streaming Media fragment and play timing, M3U8 index text
Part records the download address of each Streaming Media fragment point and KEY encrypts the decruption key that string file records each Streaming Media fragment
Download address, default supports offline play.
Further, player carries out parsing to raw media file and generates an array, each of array member
Element corresponds to a Streaming Media fragment, element include the broadcasting timing of the corresponding Streaming Media fragment of the element, download address and its
The download address of decruption key;It even further include the playing duration of Streaming Media fragment.At the same time, the data of the array can be deposited
Be stored in an index file index, index file index in addition to the information comprising each of above-mentioned array element it
Afterwards, then including the corresponding download state of each element, the download state includes not downloading, downloading, downloading completion.
S120 downloads the Streaming Media fragment, and the stream matchmaker that will be downloaded according to the download address of the Streaming Media fragment
Body fragment is stored in media storage area.
In embodiments of the present invention, Streaming Media fragment can be downloaded one by one according to the broadcasting timing between Streaming Media fragment,
It can be according to network condition, such as the situation unimpeded in network, select the multiple Streaming Media fragments of Parallel download.The media are deposited
Storage area can be the local storage of the default of player setting, be also possible to the memory block of user's selection.The Streaming Media point
The download address of piece can refer to the access address of a server, and the specified area of the server is logged in by the access address
Extract corresponding data in domain.After a Streaming Media fragment downloading is completed and is stored in a media storage area, to index text
The information that Streaming Media fragment is corresponded in part index is modified, including the modification of download state and storage address, for example, will
The download address of the Streaming Media fragment of original record is revised as the Streaming Media fragment and is stored in the media depositing in index file
Address in storage area.
In embodiments of the present invention, the Streaming Media fragment of downloading is not necessarily to be deposited again after the decryption for first passing through decruption key
Storage, thus making the Streaming Media being stored in media storage area is that can reinforce safety, even if can in encrypted state
It is reproduced in other terminal devices, it is also desirable to spend time energy to look for corresponding decruption key and correctly be decrypted it
The Streaming Media fragment being replicated can be just played afterwards.
S130, according to the encryption format of Streaming Media fragment described in the raw media file and the Streaming Media fragment
The download address of decruption key downloads the decruption key of the Streaming Media fragment.
HLS protocol supports KEYFORMAT attribute field, for marking since 5.0 in the decruption key of Streaming Media fragment
Know the format of the decruption key, certainly, which is also the encryption format that can be used to indicate that the Streaming Media fragment.In the present invention
In embodiment, it can be belonged to by inquiring the KEYFORMAT of the decruption key of the Streaming Media fragment of its record in array analytically
The information of property field, thus learn the encryption format of Streaming Media fragment, the encryption lattice for the Streaming Media fragment that usual Streaming Media includes
Formula is all identical.
S140 encrypts the decruption key of the Streaming Media fragment of downloading, and the Streaming Media of encryption is divided
The decruption key of piece is stored in a key storage area.
In embodiments of the present invention, by the combination of step S20 and step S40, Streaming Media can further be reinforced
Safety, even if Streaming Media fragment and decruption key are replicated distribution, but since decruption key was encrypted, then adopting
The decruption key streaming media fragment being encrypted with this is decrypted, and cannot achieve the decryption of the Streaming Media fragment,
To which the Streaming Media fragment can not play in other players or other terminal devices.
In addition, after decruption key be encrypted and stored in key storage area, it can also be to index above-mentioned
File index modifies, and specifically, the download state for identifying or modifying the decruption key is to have downloaded, and by index file
The download address of the decruption key of index original record is revised as the ground that the decruption key is stored in the key storage area
Location.
S150 is stored in the address of the media storage area and the solution of the Streaming Media fragment according to the Streaming Media fragment
Close key storage generates offline media file in the address in the key storage area;The offline media file is for being supplied to
Player carries out offline play operation.
Certainly, the offline media file can also include and state the broadcasting timing and playing duration of Streaming Media fragment, make
Player can be according to playing timing playing stream media fragment one by one.
In embodiments of the present invention, when the downloading of each Streaming Media fragment and its decruption key for being recorded in index file
State is that index text can be all modified whenever having downloaded a Streaming Media fragment or decruption key due to such as aforementioned when having downloaded
The mark of part and corresponding address, thus the storage address of each Streaming Media fragment and each can be recorded according to index file
The storage address of the decruption key of a Streaming Media fragment generates offline media file according to HLS protocol, the offline media file
Format is identical as raw media file format, the formatted file for being also .M3U8 for suffix, which is preferably stored in
In the local zone of Streaming Media fragment storage, i.e. media storage area.Preferably, the address that the offline media file is recorded is equal
Using local file path format, avoids locally building HTTP server, reduce the expense of terminal device.
Further, while generating the offline media file, the Streaming Media point of the offline media file is identified
The encryption format of piece is offline formats.Since the structure composed of offline media file and raw media file is almost the same, equal energy
Device is played to be identified, but the operation that is executed when importing player of offline media file should be play operation without
To execute down operation as aforementioned similar raw media file, thus in order to solve the technical problem, by directly modifying or
The encryption format for identifying the Streaming Media fragment of the offline media file is offline formats, so that player recognizes the media of importing
File can directly execute play operation when being offline formats.
The method of Streaming Media downloading provided in an embodiment of the present invention, according under the address of the raw media file of downloading record
Then the decruption key of current-carrying media slicing and the Streaming Media fragment directly stores the Streaming Media fragment downloaded,
Rather than directly the Streaming Media fragment downloaded is decrypted using decruption key, it is not necessary that storage stream matchmaker is encrypted after decryption again
Body fragment guarantees the safety of Streaming Media fragment, can reduce the cumbersome property of streaming media fragment encryption storage;On the other hand, will
The decruption key downloaded carries out encryption storage, so that even if Streaming Media fragment is replicated other terminal devices or other broadcastings
Device, and decruption key is decrypted since decryption mechanisms can not be obtained, and can not be using decruption key to the Streaming Media
Fragment is decrypted, so that Streaming Media be avoided to be played by other terminal devices or the distribution of other players.And due to be decrypted
Key is small compared to Streaming Media fragment, under the premise of guaranteeing Streaming Media safety, carries out cipher mode using to decruption key, can
Greatly improve encryption efficiency.
Embodiment two
Referring to Fig. 2, the decryption that the embodiment of the present invention provides a kind of Streaming Media fragment is close on the basis of above-mentioned implementation one
The method of key downloading, specifically includes step S131 to step S133:
S131 judges whether the encryption format of Streaming Media fragment described in the raw media file is default encryption lattice
Formula.By taking HLS protocol as an example, the encryption format for the Streaming Media fragment supported includes three kinds of encryption formats, specifically includes Basic lattice
Formula, PlayerBinding format and Token format, wherein Basic format is default form, and other two format is extension lattice
Formula, and for supporting the raw media file of Basic format, the address of the decruption key for the Streaming Media fragment recorded is complete
Address or address without additional use condition, can be directly according to the address download decryption key, thus, when judging one when downloading
When the encryption format of the Streaming Media fragment of a raw media file is the default encryption format of HLS protocol, step can be directly executed
Rapid S132.In addition, for the raw media file of non-HLS protocol, if the default encryption format of its Streaming Media fragment can be supported
Decruption key is directly downloaded, and can directly execute step S132, and technical solution of the present invention is not necessarily limited to HLS protocol
It just may be implemented, other agreements are also feasible.
S132, if so, downloading the Streaming Media fragment according to the download address of the decruption key of the Streaming Media fragment
Decruption key.
S133, if it is not, carrying out splicing to the download address of the decruption key of the Streaming Media fragment, and according to spelling
Connecing treated, download address downloads the decruption key of the Streaming Media fragment.
It is described as in the previous example, if the encryption format of Streaming Media fragment is non-Basic format, as PlayerBinding format
With Token format, at this point, raw media file record Streaming Media fragment decruption key address be imperfect address or
Have the address of additional use condition, then at this time to download decryption key, then need to the download address of the decruption key into
Row processing, allows to according to treated that download address can download corresponding decruption key, in this way, above by encryption lattice
The download address of the setting and decruption key of formula is further processed, and can make primary flow media file also available safety
Property protection.
Due to the non-basic format of encryption format, including two kinds of formats, and the downloading that the decryption of the two format identification (FID)s is close
The workability setting rule of address is also different, is below the first extension lattice with PlayerBinding format specifically
Formula is specifically described the processing mode of the download address of decruption key by taking the second extended format of Token format as an example:
For PlayerBinding encryption format, the download address for the decruption key that raw media file is recorded is
It is incomplete, it needs the designated position in the download address, such as the centre or tail portion of the download address, to fix in splicing
Character string, and character string is related to the terminal device or login account number that user currently makes, thus when the judgement Streaming Media fragment
Encryption format be the first extended format (PlayerBinding format) when, will be under the decruption key of the Streaming Media fragment
Set address is spliced with extended address, can get the download address of complete decruption key.
For Token encryption format, the download address for the decruption key that raw media file is recorded is complete, or
Person thinks that it to be imperfect, needs the condition setting of Use Limitation, needs the download address to combine a timeliness token common
Using can just download corresponding decruption key, thus when the encryption format for determining the Streaming Media fragment is the second extended format
When (Token format), timeliness token is obtained according to the mark of the raw media file, and by the decryption of the Streaming Media fragment
The download address of key and the timeliness token splice.It is compared using the download address of Token encryption format setting decruption key
In PlayerBinding encryption format, have the characteristics that timeliness, keeps the downloading of decruption key safer.
Embodiment three
Referring to Fig. 3, the embodiment of the present invention provides a kind of Streaming Media on the basis of this upper embodiment one and embodiment two
The method of the decryption key encryption storage of fragment, specifically includes step S141 and step S142:
S141 forbids reading equipment identities identification code in access storage areas from the user.
User forbids access storage areas to refer to that being provided with the anti-of some region in the memory or memory of terminal device asks
Permission, limitation user directly access the user and forbid access storage areas, and user can not therefrom directly read data, i.e., can not read
Equipment identities identification code is taken, but provides and reads permission to the player of terminal device.The equipment identities identification code is this
Terminal device is different from the mark of other terminal devices, for example, equipment Serial Number.
But also can there are equipment identities to know code such case in the presence of the terminal device is not stored, thus, it is asked to solve this
Topic, the specific implementation procedure of the step are as follows:
Judge that the user forbids whether access storage areas is stored with equipment identities identification code;
If it is not, then generating an equipment identities identification code according to identification code security algorithm, and it is stored in the user and forbids
Access storage areas;
If so, then forbidding reading the equipment identities identification code in access storage areas from the user.
Thus, it through the above scheme can be when user forbids access storage areas not to be stored with equipment identities identification code
It waits, a corresponding identification code is generated by an identification security algorithm, is stored in the memory block, and then subsequent read again is facilitated to set
It can be read directly when standby identity code.
S142 is encrypted according to decruption key of the equipment identities identification code to the Streaming Media fragment of downloading,
And the decruption key of the Streaming Media fragment of encryption is stored in the user and forbids access storage areas.
In embodiments of the present invention, equipment identities are utilized and know code to decryption key encryption, so that even if decruption key quilt
Other terminal devices are extracted, also because the equipment identities identification code of other terminal devices is had any different in the equipment body of this terminal device
Part identification code, can not also be decrypted decruption key, and then can not be to the Streaming Media fragment for being extracted to other terminal devices
Broadcasting is decrypted, Streaming Media is further prevented to be dispensed to the broadcasting of other terminal devices.
Example IV
Referring to Fig. 4, the media text that any embodiment in one, embodiment two and implementation three generates through the foregoing embodiment
Part will imported into player according to the broadcasting demand of user and carry out offline play operation, i.e., in the absence of a network,
The broadcasting of Streaming Media can be realized by the local data for reading Streaming Media.Specifically, the embodiment of the present invention provides a kind of stream matchmaker
The method that body plays, including step S210 and step S220:
S210 responds the playing request of the Streaming Media, imports the offline media file of the Streaming Media;The offline matchmaker
Body file is the file that the method for the Streaming Media downloading provided according to embodiment one to any one embodiment of embodiment three generates.
In embodiments of the present invention, offline media file is imported in player, is can be by by offline media file
The path that is locally stored be passed to player, player can obtain the offline media file according to this path.Obtain offline media
It is parsed after file, resolving is consistent with the resolving of raw media file above-mentioned, and details are not described herein.
It is obtained in an index file index after parsing, index file index, which records each Streaming Media fragment and is stored in media, to be deposited
The address of storage area, each Streaming Media fragment decruption key be stored in the address in key storage area, the offline media file
Encryption format and each Streaming Media fragment broadcasting timing;It further include each corresponding download state of Streaming Media fragment,
The download state includes not downloading, downloading, download and one of complete, but under recorded of the offline media file
Load state is generally the state that downloading is completed.
S220 is stored in the address of media storage area according to the Streaming Media fragment that the offline media file is recorded, from institute
It states and extracts the Streaming Media fragment in media storage area.
The decruption key of S230, the Streaming Media fragment recorded according to the offline media file are stored in key storage
The decruption key is extracted from the key storage area in the address in area.
S240 executes decryption oprerations to the decruption key.
In embodiments of the present invention, it generates media file and importing medium file plays out, be all based on the same end
The same special player of end equipment so just can successfully carry out the broadcasting work of media file, because media file
Generting machanism be distributed in order to avoid its corresponding Streaming Media copy to other terminal devices or other kinds of player into
Row play, since other types player does not generate the mechanism of the media file, also not according to the playback of media files its
The mechanism of corresponding Streaming Media, then other kinds of player is can not to distribute to play the media text that previous embodiment generates
Part.
When the key storage area includes that user forbids access storage areas, the decruption key is prohibited according to from the user
The equipment identities identification code only extracted in access storage areas it is encrypted made of when, then execute step S240 process,
Specifically:
Forbid access storage areas extract equipment identity code from the user;
The decruption key is decrypted according to the equipment identities identification code.
Due to decruption key be encrypted by equipment identities identification code either based on equipment identities identification code into
Row encryption, rather than what the specific key pair decruption key in addition provided was encrypted, then without adding when decryption
Expense is decrypted decruption key to obtain the specific key, can be directly based upon the equipment identities identification code of this equipment
It is decrypted, first safety, second without considering the peace of the specific key in the encryption and decrypting process of decruption key
Full problem of transmission.Certainly, any embodiment of the invention can also set a specific key pair decruption key carry out encryption or
Decryption, is not limited to the preferred equipment identities identification code of above-mentioned offer.
S250 executes decryption oprerations to the Streaming Media fragment according to the decruption key after decryption, and plays decryption
Streaming Media fragment afterwards.
Since during generating off-line files, the process of download decryption key is the encryption according to raw media file
What format came, when encryption format is the first extended format or the second extended format, need to the download address of decruption key into
It just can be used after the processing of row once.In fact, being decrypted close when the encryption lattice of raw media file are above two format
Key is encrypted one layer before being downloaded, then the decruption key after decryption described in step S250, the decryption
Key is except in addition to executing the decryption oprerations in step S240, continuation executes the second decryption oprerations again.As for second decryption oprerations
Realization, can specifically be held by the process that the encryption format of media file is changed to offline formats in previous embodiment
Row process: when the encryption format of raw media file is default encryption format, the encryption format for revising media file is first
Offline formats;When the encryption format of raw media file is non-default encryption format, the encryption format for revising media file is
Second offline formats.To which whether executing the condition of the second decryption oprerations after executing step S240 is to judge media file
Encryption format whether be non-default encryption format, if so, execute the second decryption oprerations;If it is not, then continuing to execute step
S250。
Preferably, the offline media file also records the broadcasting timing of each Streaming Media fragment, and then is being solved
Data after analysis, according to the broadcasting timing for each Streaming Media fragment that the offline media file is recorded, one by one streaming media
Fragment executes above step S220 to step S250, until completing the broadcasting of the last one Streaming Media fragment.
In embodiments of the present invention, it since the Streaming Media fragment is to be in decrypted state, can directly play, thus in order to
It avoids distributing, often plays a Streaming Media fragment, the stream matchmaker fragment decrypted played in caching is directly deleted.
When receiving the request of the deletion offline media file of user, by the offline media file, it is described from
The Streaming Media fragment of line media file is from the decruption key of the Streaming Media fragment of the described and described offline media file from corresponding
Memory block in delete.
Embodiment five
Referring to Fig. 5, the embodiment of the present invention provides a kind of device of Streaming Media downloading, which can realize above-mentioned implementation one
To the stream media downloading method for implementing the offer of three any embodiments comprising:
Original document download module 110, the downloading for responding the Streaming Media are requested, and the original of the Streaming Media is downloaded
Media file;The raw media file includes the decruption key of the download address of Streaming Media fragment, the Streaming Media fragment
The encryption format of download address and the Streaming Media fragment;
Streaming Media fragment download module 120 downloads the Streaming Media for the download address according to the Streaming Media fragment
Fragment, and the Streaming Media fragment downloaded is stored in media storage area;
Decruption key download module 130, the encryption lattice for the Streaming Media fragment according to the raw media file
The download address of the decruption key of formula and the Streaming Media fragment, downloads the decruption key of the Streaming Media fragment;
Decryption key encryption module 140, the decruption key for the Streaming Media fragment to downloading encrypt, and will
The Streaming Media fragment of encryption is stored in a key storage area;
Off-line files generation module 150, for being stored in the address of the media storage area according to the Streaming Media fragment
It is stored in the address in the key storage area with the decruption key of the Streaming Media fragment, generates offline media file;It is described from
Line media file carries out offline play operation for being supplied to player.
In conjunction with the embodiments five, in the first embodiment of the embodiment of the present invention five, the decruption key download module 130
It specifically includes:
Encryption format judging unit, for judging whether the encryption format of the Streaming Media fragment is default encryption format;
Key download unit, for if so, according to the download address of the decruption key of the Streaming Media fragment, described in downloading
The decruption key of Streaming Media fragment;
Key handling unit, for if it is not, splicing to the download address of the decruption key of the Streaming Media fragment
It handles, and downloads the decruption key of the Streaming Media fragment according to the download address after splicing.
Five the first embodiment in conjunction with the embodiments, the present invention are described in second of embodiment of embodiment five
Key handling unit, specifically includes:
First splicing unit, for when the encryption format for determining the Streaming Media fragment is the first extended format,
The download address of the decruption key of the Streaming Media fragment is spliced with extended address;
Second splicing unit, for when the encryption format for determining the Streaming Media fragment is the second extended format,
Timeliness token is obtained according to the mark of the raw media file, and by the download address of the decruption key of the Streaming Media fragment
Splice with the timeliness token.
Preferably, first extended format includes PlayerBinding format;Second extended format includes
Token format.
In conjunction with the embodiments five, for the present invention in the third embodiment of embodiment five, the key storage area includes using
Access storage areas is forbidden at family, then the decryption key encryption module 140 specifically includes:
Identification code acquiring unit reads equipment identities identification code for forbidding from the user in access storage areas;And
Key encrypts storage unit, for according to the equipment identities identification code decryption to the Streaming Media fragment respectively
Key is encrypted, and the decruption key of the Streaming Media fragment of encryption is stored in the user and forbids access storage areas.
In conjunction with the embodiments in five the first embodiment, the present invention is in the 4th kind of embodiment of embodiment five, institute
Identification code acquiring unit is stated, is specifically included:
Judging unit is stored, for judging that the user forbids whether access storage areas is stored with equipment identities identification code;
Identification code generation unit, be used for if it is not, then according to identification code security algorithm generate an equipment identities identification code, and
It is stored in the user and forbids access storage areas;
Identification code reading unit, for if so, then forbidding reading the equipment identities in access storage areas from the user
Identification code.
Preferably, the address that the offline media file is recorded is all made of local file path format.
Preferably, described device further include:
Format revises module, for identifying the offline media file while generating the offline media file
The encryption format of Streaming Media fragment is offline formats.
The function can also execute corresponding software realization by hardware realization by hardware.The hardware or
Software includes one or more modules corresponding with above-mentioned function.
Embodiment six
Referring to Fig. 6, the embodiment of the present invention provides a kind of device of streaming media playing, example IV offer can be realized
The method of streaming media playing, specifically includes:
Off-line files import modul 210 imports the offline of the Streaming Media for responding the playing request of the Streaming Media
Media file;The offline media file is the text that the method for the Streaming Media downloading provided according to aforementioned any embodiment generates
Part;
Streaming Media fragment extraction module 220, the Streaming Media fragment for being recorded according to the offline media file are stored in
The Streaming Media fragment is extracted in the address of media storage area from the media storage area;
Decruption key extraction module 230, the solution of the Streaming Media fragment for being recorded according to the offline media file
Close key storage extracts the decruption key from the key storage area in the address in key storage area;
Decryption key decryption module 240, for executing decryption oprerations to the decruption key;
Streaming Media fragment decrypts playing module 250, for being divided according to the decruption key after decryption the Streaming Media
Piece executes decryption oprerations, and plays the Streaming Media fragment after decryption.
In conjunction with the embodiments six, for the present invention in the first embodiment of embodiment six, the key storage area includes using
Access storage areas is forbidden at family, and the decruption key is to forbid the equipment identities extracted in access storage areas to know according to from the user
Made of other code encrypts it;And the decryption key decryption module 240 includes:
Identification code extraction unit, for forbidding access storage areas extract equipment identity code from the user;And
Cipher key decryption unit, for the decruption key to be decrypted according to the equipment identities identification code.
In conjunction with the embodiments six, the present invention is in second of embodiment of embodiment six, the streaming medium playing device, also
Include:
Data removing module, for when receiving the request for deleting the media file, by the media file, described
The Streaming Media fragment of media file is stored from the decruption key of the Streaming Media fragment of the described and described media file from corresponding
It is deleted in area.
The function can also execute corresponding software realization by hardware realization by hardware.The hardware or
Software includes one or more modules corresponding with above-mentioned function.
Embodiment seven
The embodiment of the present invention five provides a kind of terminal device, as shown in fig. 7, the equipment includes: memory 21 and processor
22, the computer program that can be run on processor 22 is stored in memory 21.Processor 22 executes the computer program
The flow media playing method in stream media downloading method and above-described embodiment in Shi Shixian above-described embodiment.21 He of memory
The quantity of processor 22 can be one or more.
The equipment further include:
Communication interface 23, for the communication between memory 21 and processor 22.
Memory 21 may include high speed RAM memory, it is also possible to further include nonvolatile memory (non-volatile
Memory), a for example, at least magnetic disk storage.
If memory 21, processor 22 and the independent realization of communication interface 23, memory 21, processor 22 and communication are connect
Mouth 23 can be connected with each other by bus and complete mutual communication.The bus can be industry standard architecture
(ISA, Industry Standard Architecture) bus, external equipment interconnection (PCI, Peripheral
Component) bus or extended industry-standard architecture (EISA, Extended Industry Standard
Component) bus etc..The bus can be divided into address bus, data/address bus, control bus etc..For convenient for expression, Fig. 6
In only indicated with a thick line, it is not intended that an only bus or a type of bus.
Optionally, in specific implementation, if memory 21, processor 22 and communication interface 23 are integrated in chip piece
On, then memory 21, processor 22 and communication interface 23 can complete mutual communication by internal interface.
In the description of this specification, reference term " one embodiment ", " some embodiments ", " example ", " specifically show
The description of example " or " some examples " etc. means specific features, structure, material or spy described in conjunction with this embodiment or example
Point is included at least one embodiment or example of the invention.Moreover, particular features, structures, materials, or characteristics described
It may be combined in any suitable manner in any one or more of the embodiments or examples.In addition, without conflicting with each other, this
The technical staff in field can be by the spy of different embodiments or examples described in this specification and different embodiments or examples
Sign is combined.
In addition, term " first ", " second " are used for descriptive purposes only and cannot be understood as indicating or suggesting relative importance
Or implicitly indicate the quantity of indicated technical characteristic." first " is defined as a result, the feature of " second " can be expressed or hidden
It include at least one this feature containing ground.In the description of the present invention, the meaning of " plurality " is two or more, unless otherwise
Clear specific restriction.
Any process described otherwise above or method description are construed as in flow chart or herein, and expression includes
It is one or more for realizing specific logical function or process the step of executable instruction code module, segment or portion
Point, and the range of the preferred embodiment of the present invention includes other realization, wherein can not press shown or discussed suitable
Sequence, including according to related function by it is basic simultaneously in the way of or in the opposite order, Lai Zhihang function, this should be of the invention
Embodiment person of ordinary skill in the field understood.
Expression or logic and/or step described otherwise above herein in flow charts, for example, being considered use
In the order list for the executable instruction for realizing logic function, may be embodied in any computer-readable medium, for
Instruction execution system, device or equipment (such as computer based system, including the system of processor or other can be held from instruction
The instruction fetch of row system, device or equipment and the system executed instruction) it uses, or combine these instruction execution systems, device or set
It is standby and use.For the purpose of this specification, " computer-readable medium ", which can be, any may include, stores, communicates, propagates or pass
Defeated program is for instruction execution system, device or equipment or the dress used in conjunction with these instruction execution systems, device or equipment
It sets.
Computer-readable medium described in the embodiment of the present invention can be computer-readable signal media or computer can
Read storage medium either the two any combination.The more specific example of computer readable storage medium is at least (non-poor
Property list to the greatest extent) include the following: there is the electrical connection section (electronic device) of one or more wirings, portable computer diskette box (magnetic
Device), random access memory (RAM), read-only memory (ROM), erasable edit read-only storage (EPROM or flash
Memory), fiber device and portable read-only memory (CDROM).In addition, computer readable storage medium even can be with
It is the paper or other suitable media that can print described program on it, because can be for example by paper or the progress of other media
Optical scanner is then edited, interpreted or is handled when necessary with other suitable methods and is described electronically to obtain
Program is then stored in computer storage.
In embodiments of the present invention, computer-readable signal media may include in a base band or as carrier wave a part
The data-signal of propagation, wherein carrying computer-readable program code.The data-signal of this propagation can use a variety of
Form, including but not limited to electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media is also
It can be any computer-readable medium other than computer readable storage medium, which can send, pass
It broadcasts or transmits for instruction execution system, input method or device use or program in connection.Computer can
The program code for reading to include on medium can transmit with any suitable medium, including but not limited to: wirelessly, electric wire, optical cable, penetrate
Frequently (Radio Frequency, RF) etc. or above-mentioned any appropriate combination.
It should be appreciated that each section of the invention can be realized with hardware, software, firmware or their combination.Above-mentioned
In embodiment, software that multiple steps or method can be executed in memory and by suitable instruction execution system with storage
Or firmware is realized.It, and in another embodiment, can be under well known in the art for example, if realized with hardware
Any one of column technology or their combination are realized: having a logic gates for realizing logic function to data-signal
Discrete logic, with suitable combinational logic gate circuit specific integrated circuit, programmable gate array (PGA), scene
Programmable gate array (FPGA) etc..
Those skilled in the art are understood that realize all or part of step that above-described embodiment method carries
It suddenly is that relevant hardware can be instructed to complete by program, the program can store in a kind of computer-readable storage medium
In matter, which when being executed, includes the steps that one or a combination set of embodiment of the method.
It, can also be in addition, each functional unit in each embodiment of the present invention can integrate in a processing module
It is that each unit physically exists alone, can also be integrated in two or more units in a module.Above-mentioned integrated mould
Block both can take the form of hardware realization, can also be realized in the form of software function module.The integrated module is such as
Fruit is realized and when sold or used as an independent product in the form of software function module, also can store in a computer
In readable storage medium storing program for executing.The storage medium can be read-only memory, disk or CD etc..
The above description is merely a specific embodiment, but scope of protection of the present invention is not limited thereto, any
Those familiar with the art in the technical scope disclosed by the present invention, can readily occur in its various change or replacement,
These should be covered by the protection scope of the present invention.Therefore, protection scope of the present invention should be with the guarantor of the claim
It protects subject to range.
Claims (16)
1. a kind of method of offline Streaming Media downloading characterized by comprising
The offline downloading request of response, according to the mark downloading original media text of the raw media file in the offline downloading request
Part;The raw media file includes the downloading of the broadcasting timing, each Streaming Media fragment of each Streaming Media fragment
Address, the download address that one-to-one decruption key is distinguished with each described Streaming Media fragment and the raw media file
Streaming Media fragment encryption format;
According to the download address of each Streaming Media fragment, downloads each described Streaming Media fragment and be stored in media and deposit
Storage area;
Decryption according to the encryption format of the Streaming Media fragment of the raw media file and each Streaming Media fragment is close
The download address of key downloads the decruption key of each Streaming Media fragment;
The decruption key of each Streaming Media fragment is carried out to be encrypted and stored at a key storage area;
The address of the media storage area, each Streaming Media fragment are stored according to each described Streaming Media fragment
Decruption key is stored in the address in the key storage area and the broadcasting timing of each Streaming Media fragment, generates offline matchmaker
Body file;The offline media file carries out offline play operation for being supplied to player;The offline media file is recorded
Address be all made of local file path format;Wherein, the offline play operation includes extracting institute from the key storage area
State the decruption key of Streaming Media fragment and to the decruption key after the decryption key decryption, and utilization decryption to the stream matchmaker
The decryption of body fragment.
2. the method for offline Streaming Media downloading as described in claim 1, which is characterized in that described according to the original media text
The download address of the decruption key of the encryption format of the Streaming Media fragment of part and each Streaming Media fragment is downloaded described every
The decruption key of one Streaming Media fragment, specifically includes:
Whether the encryption format for judging the Streaming Media fragment of the raw media file is default encryption format;
If so, downloading described each Streaming Media point according to the download address of the decruption key of each Streaming Media fragment
The decruption key of piece;
If it is not, carrying out splicing to the download address of the decruption key of each Streaming Media fragment, and according to splicing
Download address that treated downloads the decruption key of each Streaming Media fragment.
3. the method for offline Streaming Media downloading as claimed in claim 2, which is characterized in that described to each described Streaming Media
The download address of the decruption key of fragment carries out splicing, specifically includes:
When determining the encryption format of Streaming Media fragment of the raw media file is the first extended format, will it is described each
The download address of the decruption key of Streaming Media fragment is spliced with extended address;
When determining the encryption format of Streaming Media fragment of the raw media file is the second extended format, according to described original
The mark of media file obtains timeliness token, and by the download address of the decruption key of each Streaming Media fragment with it is described
The splicing of timeliness token.
4. the method for offline Streaming Media downloading as described in claim 1, which is characterized in that the key storage area includes user
Forbid access storage areas, then the decruption key to each Streaming Media fragment, which carries out being encrypted and stored at a key, deposits
Storage area specifically includes:
Forbid reading equipment identities identification code in access storage areas from the user;
The decruption key of each Streaming Media fragment is encrypted respectively according to the equipment identities identification code, and will be added
Decruption key after close is stored in the user and forbids access storage areas.
5. the method for offline Streaming Media downloading as claimed in claim 4, which is characterized in that described to forbid accessing from the user
Equipment identities identification code is read in memory block, is specifically included:
Judge that the user forbids whether access storage areas is stored with equipment identities identification code;
If it is not, then generating an equipment identities identification code according to identification code security algorithm, and it is stored in the user and forbids accessing
Memory block;
If so, then forbidding reading the equipment identities identification code in access storage areas from the user.
6. the method for offline Streaming Media downloading as described in claim 1, which is characterized in that the method also includes:
While generating the offline media file, the encryption format for identifying the Streaming Media fragment of the offline media file is
Offline formats.
7. the method for Streaming Media downloading as claimed in claim 3 offline, which is characterized in that first extended format includes
PlayerBinding format;Second extended format includes Token format.
8. a kind of method of offline streaming media playing characterized by comprising
Offline playing request is responded, the offline media is imported according to the offline media file identification in the offline playing request
File;The offline media file is to generate according to claim 1 to offline stream media downloading method described in 7 any one
File;
According to the broadcasting timing for each Streaming Media fragment that the offline media file is recorded, streaming media fragment is executed one by one
Play operation is decrypted below:
The address of media storage area is stored according to the Streaming Media fragment that the offline media file is recorded, from the media
The Streaming Media fragment is extracted in memory block;
The decruption key for the Streaming Media fragment recorded according to the offline media file is stored in the address in key storage area,
The decruption key is extracted from the key storage area;
Decryption oprerations are executed to the decruption key;
Decryption oprerations are executed to the Streaming Media fragment according to the decruption key after decryption, and play the Streaming Media after decryption
Fragment.
9. the method for offline streaming media playing as claimed in claim 8, which is characterized in that the key storage area includes user
Forbid access storage areas, the decruption key is to forbid the equipment identities extracted in access storage areas to identify according to from the user
Made of code encrypts it;It is then described that decryption oprerations are executed to the decruption key, it specifically includes:
Forbid access storage areas extract equipment identity code from the user;
The decruption key is decrypted according to the equipment identities identification code.
10. the method for offline streaming media playing as claimed in claim 8, which is characterized in that the offline streaming media playing side
Method, further includes:
When receiving the request for deleting the offline media file, by the offline media file, the offline media file
Each Streaming Media fragment and the decruption key of each Streaming Media fragment of the offline media file deposited from accordingly
It is deleted in storage area.
11. a kind of device of offline Streaming Media downloading characterized by comprising
Original document download module, for responding offline downloading request, according to the original media text in the offline downloading request
The mark of part downloads raw media file;The raw media file includes the broadcasting timing, described of each Streaming Media fragment
The download address of each Streaming Media fragment, the downloading that one-to-one decruption key is distinguished with each described Streaming Media fragment
The encryption format of the Streaming Media fragment of address and the raw media file;
Streaming Media fragment download module, for the download address according to each Streaming Media fragment, downloading it is described each
Streaming Media fragment is simultaneously stored in media storage area;
Decruption key download module, for according to the encryption format of the Streaming Media fragment of the raw media file and described each
The download address of the decruption key of a Streaming Media fragment downloads the decruption key of each Streaming Media fragment;
Decryption key encryption module carries out being encrypted and stored at one close for the decruption key to each Streaming Media fragment
Key memory block;
Off-line files generation module, for being stored in the address, described of media storage area according to each described Streaming Media fragment
The decruption key of each Streaming Media fragment is stored in the address in key storage area and the broadcasting timing of each Streaming Media fragment,
Generate offline media file;The offline media file carries out offline play operation for being supplied to player;The offline matchmaker
The address that body file is recorded is all made of local file path format;Wherein, the offline play operation includes depositing from the key
Storage area extracts the decruption key of the Streaming Media fragment and to the decryption key decryption, and utilizes the decruption key after decryption
The Streaming Media fragment is decrypted.
12. a kind of terminal device for realizing the downloading of offline Streaming Media, which is characterized in that the terminal device includes:
One or more processors;
Storage device, for storing one or more programs;
When one or more of programs are executed by one or more of processors, so that one or more of processors
The method for realizing the offline Streaming Media downloading as described in any in claim 1-7.
13. a kind of computer readable storage medium, is stored with computer program, which is characterized in that the program is held by processor
The method of the offline Streaming Media downloading as described in any in claim 1-7 is realized when row.
14. a kind of device of offline streaming media playing characterized by comprising
Off-line files import modul, for responding offline playing request, according to the offline media text in the offline playing request
Part mark imports the offline media file;The offline media file be according to claim 1 to described in 7 any one from
The file that line stream media downloading method generates;
Decryption playing module, the broadcasting timing of each Streaming Media fragment for being recorded according to the offline media file, by
A streaming media fragment executes decryption play operation;Wherein, decryption playing module includes:
Streaming Media fragment extraction unit, the Streaming Media fragment for being recorded according to the offline media file are stored in media
The Streaming Media fragment is extracted in the address of memory block from the media storage area;
The decruption key of decruption key extraction unit, the Streaming Media fragment for being recorded according to the offline media file is deposited
It is stored in the address in key storage area, extracts the decruption key from the key storage area;
Decryption key decryption unit, for executing decryption oprerations to the decruption key;
Streaming Media fragment decrypts broadcast unit, for executing solution to the Streaming Media fragment according to the decruption key after decryption
Close operation, and play the Streaming Media fragment after decryption.
15. a kind of terminal device for realizing offline streaming media playing, which is characterized in that the terminal device includes:
One or more processors;
Storage device, for storing one or more programs;
When one or more of programs are executed by one or more of processors, so that one or more of processors
The method for realizing the offline streaming media playing as described in any in claim 8-10.
16. a kind of computer readable storage medium, is stored with computer program, which is characterized in that the program is held by processor
The method of the offline streaming media playing as described in any in claim 8-10 is realized when row.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711407544.XA CN108156152B (en) | 2017-12-22 | 2017-12-22 | Method, apparatus, storage medium and the terminal device Streaming Media downloading and played |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711407544.XA CN108156152B (en) | 2017-12-22 | 2017-12-22 | Method, apparatus, storage medium and the terminal device Streaming Media downloading and played |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108156152A CN108156152A (en) | 2018-06-12 |
CN108156152B true CN108156152B (en) | 2019-08-02 |
Family
ID=62464405
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201711407544.XA Active CN108156152B (en) | 2017-12-22 | 2017-12-22 | Method, apparatus, storage medium and the terminal device Streaming Media downloading and played |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108156152B (en) |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108924596B (en) * | 2018-08-28 | 2020-11-13 | 苏州科达科技股份有限公司 | Media data transmission method, device and storage medium |
CN109446234B (en) * | 2018-10-12 | 2021-10-19 | Oppo广东移动通信有限公司 | Data processing method and device and electronic equipment |
CN111857739B (en) * | 2019-04-29 | 2023-06-09 | 深圳市优必选科技有限公司 | Method and device for storing program of Scratch measurement and control board |
CN111050213B (en) * | 2020-01-17 | 2022-08-26 | 北京达佳互联信息技术有限公司 | Video playing method and device, electronic equipment and storage medium |
CN111586442B (en) * | 2020-04-23 | 2022-05-20 | 深圳奇迹智慧网络有限公司 | Stream media encryption method and device, computer equipment and storage medium |
CN112291617A (en) * | 2020-09-11 | 2021-01-29 | 深圳市华曦达科技股份有限公司 | Audio and video offline playing method and device and electronic equipment |
Family Cites Families (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102143129B (en) * | 2010-05-26 | 2015-03-18 | 华为软件技术有限公司 | Method and system for realizing service protection in hyper text transmission protocol (HTTP) streaming transmission |
CN103826159B (en) * | 2013-12-04 | 2017-12-19 | Tcl集团股份有限公司 | The local offline player method and terminal of a kind of M3U8 format videos |
CN103686333B (en) * | 2013-12-19 | 2018-04-20 | 深圳市九洲电器有限公司 | A kind of audio and video guard method and audio-video terminal |
CN104618799B (en) * | 2014-02-10 | 2018-01-09 | 腾讯科技(北京)有限公司 | Video broadcasting method and device |
CN105592355A (en) * | 2014-10-24 | 2016-05-18 | 中兴通讯股份有限公司 | Method for realizing encrypted video processing, and mobile terminal |
CN106375834B (en) * | 2016-08-31 | 2019-08-02 | 广州易方信息科技股份有限公司 | A kind of offline playback method of online encrypted slice video and device based on iOS operating system |
CN106331751B (en) * | 2016-08-31 | 2019-05-31 | 广州易方信息科技股份有限公司 | A kind of online encrypted slice video broadcasting method based on iOS operating system |
CN106657162B (en) * | 2017-03-01 | 2020-01-10 | 北京东大正保科技有限公司 | Online streaming media playing method, streaming media downloading method and offline playing method |
-
2017
- 2017-12-22 CN CN201711407544.XA patent/CN108156152B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN108156152A (en) | 2018-06-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108156152B (en) | Method, apparatus, storage medium and the terminal device Streaming Media downloading and played | |
CN101682740B (en) | Content download system, content download method, content supplying apparatus, content supplying method, content receiving apparatus, content receiving method | |
US9047593B2 (en) | Non-destructive media presentation derivatives | |
US8875310B2 (en) | System and method of protecting digital media contents | |
CN104363271B (en) | Document breakpoint transmission method and device | |
CN101635000B (en) | Content playing device for retrieving and binding lacking content from the internet as copyright free sample | |
CN106534053A (en) | Authority control method of media file, server and equipment | |
CN103888527B (en) | data sharing method and device | |
CN101002469A (en) | Content start control device | |
CN109120998B (en) | Media data transmission method, device and storage medium | |
CN102197410A (en) | Method and system for creating and sharing bookmarks of media content | |
CN104618799B (en) | Video broadcasting method and device | |
WO2022037011A1 (en) | Method and device for providing video information | |
CN106464950A (en) | Method of delivering and protecting media content | |
US20220284130A1 (en) | Content Playlist Integrity | |
CN103956175B (en) | Playing method and equipment of multi-media files | |
DE102012218436A1 (en) | Distribute Licensed Content to Multiple Units | |
CN108024144A (en) | Video broadcasting method, terminal and computer-readable recording medium | |
CN104469477B (en) | Media resource method for pushing and device | |
WO2016062092A1 (en) | Method and mobile terminal for processing encrypted video | |
US9226041B2 (en) | Method and device for imposing usage constraints of digital content | |
CN108235152A (en) | The transmission method of DRM application systems and DRM private datas | |
CN108377429A (en) | A kind of demolition of video flowing and take out frame method | |
CN113014956B (en) | Video playing method and device | |
CN106454409A (en) | Encrypting method and device of multimedia document |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |