WO2014090015A1 - 下载并播放媒体文件的方法、系统、客户端、服务器及存储介质 - Google Patents

下载并播放媒体文件的方法、系统、客户端、服务器及存储介质 Download PDF

Info

Publication number
WO2014090015A1
WO2014090015A1 PCT/CN2013/084384 CN2013084384W WO2014090015A1 WO 2014090015 A1 WO2014090015 A1 WO 2014090015A1 CN 2013084384 W CN2013084384 W CN 2013084384W WO 2014090015 A1 WO2014090015 A1 WO 2014090015A1
Authority
WO
WIPO (PCT)
Prior art keywords
media file
fragment
client
server
playing
Prior art date
Application number
PCT/CN2013/084384
Other languages
English (en)
French (fr)
Inventor
廖海珍
Original Assignee
腾讯科技(深圳)有限公司
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by 腾讯科技(深圳)有限公司 filed Critical 腾讯科技(深圳)有限公司
Publication of WO2014090015A1 publication Critical patent/WO2014090015A1/zh
Priority to US14/736,122 priority Critical patent/US9871843B2/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/60Network streaming of media packets
    • H04L65/75Media network packet handling
    • H04L65/764Media network packet handling at the destination 
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/238Interfacing the downstream path of the transmission network, e.g. adapting the transmission rate of a video stream to network bandwidth; Processing of multiplex streams
    • H04N21/2387Stream processing in response to a playback request from an end-user, e.g. for trick-play
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/60Network streaming of media packets
    • H04L65/70Media network packetisation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/60Network streaming of media packets
    • H04L65/75Media network packet handling
    • H04L65/762Media network packet handling at the source 
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/25Management operations performed by the server for facilitating the content distribution or administrating data related to end-users or client devices, e.g. end-user or client device authentication, learning user preferences for recommending movies
    • H04N21/262Content or additional data distribution scheduling, e.g. sending additional data at off-peak times, updating software modules, calculating the carousel transmission frequency, delaying a video stream transmission, generating play-lists
    • H04N21/26258Content or additional data distribution scheduling, e.g. sending additional data at off-peak times, updating software modules, calculating the carousel transmission frequency, delaying a video stream transmission, generating play-lists for generating a list of items to be played back in a given order, e.g. playlist, or scheduling item distribution according to such list
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/433Content storage operation, e.g. storage operation in response to a pause request, caching operations
    • H04N21/4331Caching operations, e.g. of an advertisement for later insertion during playback
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/83Generation or processing of protective or descriptive data associated with content; Content structuring
    • H04N21/845Structuring of content, e.g. decomposing content into time segments
    • H04N21/8456Structuring of content, e.g. decomposing content into time segments by decomposing the content in the time domain, e.g. in time segments
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/60Network streaming of media packets
    • H04L65/61Network streaming of media packets for supporting one-way streaming services, e.g. Internet radio
    • H04L65/611Network streaming of media packets for supporting one-way streaming services, e.g. Internet radio for multicast or broadcast
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/60Network streaming of media packets
    • H04L65/61Network streaming of media packets for supporting one-way streaming services, e.g. Internet radio
    • H04L65/612Network streaming of media packets for supporting one-way streaming services, e.g. Internet radio for unicast
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/482End-user interface for program selection
    • H04N21/4825End-user interface for program selection using a list of items to be played back in a given order, e.g. playlists

Definitions

  • the present invention relates to the field of network information transmission technologies, and in particular, to a method, system, client, server, and storage medium for downloading and playing media files.
  • the present invention provides a method, system, client, server, and storage medium for downloading and playing a media file, which can easily and quickly play an undownloaded media file.
  • the method for downloading and playing a media file which is provided by the embodiment of the present invention, runs on a client, and includes the steps of: initiating a request for acquiring a media file from a server; according to the received download list information from the server The sequence of the shards is initiated to the server a request for each fragment of the media file; acquiring each fragment of the media file returned by the server; and playing according to the received playback instruction of the media file according to the sequence of the segments Each slice of the media file returned by the server.
  • the embodiment of the present invention further provides a method for downloading and playing a media file, running on a server, including the following steps: After receiving a request for obtaining a media file from a client, the media file is divided into a plurality of fragments, and each segment is stored. And forming a download list information of each slice, and further sending the download list information of the each slice to the client; according to the received request for obtaining each fragment of the media file from the client, Returning each slice of the media file to the client.
  • the embodiment of the present invention further provides a client that includes: a file obtaining module, configured to initiate a request for obtaining a media file to a server;
  • a fragment obtaining module configured to initiate, according to a sequence of the received shards in the download list information from the server, a request for acquiring each shard of the media file; acquiring the server Each slice of the returned media file;
  • a playing module configured to play, according to the received play instruction of the media file, each slice of the media file returned by the server according to a sequence of the respective fragments.
  • An embodiment of the present invention provides a corresponding server, including:
  • a fragmentation module configured to, after receiving a request for obtaining a media file from a client, divide the media file into a plurality of fragments, store each fragment, and form download list information of each fragment, and further The downloaded download list information of the fragment is sent to the client;
  • a fragment returning module configured to return, according to the received request for obtaining each fragment of the media file from the client, each fragment of the media file to the client.
  • a system for downloading and playing a media file includes a server and a client, where the client is used to initiate a request for obtaining a media file to the server; Determining the sequence of the pieces of the media file in the download list information of the server, and requesting the server to obtain each fragment of the media file; acquiring each fragment of the media file returned by the server; And playing, according to the received play instruction of the media file, each of the media files returned by the server according to a sequence of the respective segments Fragmentation.
  • the server is configured to, after receiving a request for obtaining a media file from a client, split the media file into a plurality of shards, store each shard and form download list information of each shard, and further The downloading list information of the fragment is sent to the client, and is configured to return each fragment of the media file to the client according to the received request for obtaining each fragment of the media file from the client. .
  • the embodiment of the present invention further provides one or more storage media including computer executable instructions for executing a method of downloading and playing a media file running on a client, the method comprising the following steps:
  • each slice of the media file returned by the server is played according to the sequence of the respective fragments.
  • the present invention also provides one or more storage media containing computer executable instructions for executing a method of downloading and playing a media file running on a server, characterized in that the method comprises the following steps :
  • the present invention divides the media file into a plurality of shards by the server, stores the shards and forms the download list information of each shard, and initiates the acquisition of the media file according to the sequence of each shard in the download list information.
  • Each fragment is requested by the client, and when the client receives the playback instruction of the media file, each fragment of the media file is played in sequence according to each fragment.
  • Due to the optimized download method for sharding media files and the method for playing shards Not only the download method is optimized, but also the media file can be played in the order of the slice. Even if the other slices of the media file are not downloaded, the downloaded slice can be played normally, so that the user can play the downloaded image at any time. Part of the media file, the purpose of playing the undownloaded media files simply and quickly.
  • FIG. 1 is a flow chart showing the steps of a method for downloading and playing a media file according to an embodiment of the present invention
  • FIG. 2 is a flow chart showing the steps of a method for downloading and playing a media file according to another embodiment of the present invention
  • FIG. 1 is a flow chart showing the steps of a method for downloading and playing a media file according to an embodiment of the present invention.
  • a method for downloading and playing a media file according to an embodiment of the present invention may include the following steps S101-S109:
  • Step S101 The client initiates a request for obtaining a media file to the server.
  • the media file can be a file such as music or video.
  • the client can be a mobile client such as a mobile phone.
  • Step S103 After receiving the request for obtaining the media file from the client, the server divides the media file into a plurality of shards, stores each shard and forms download list information of each shard, and further downloads the download list information of each shard. Sent to the client.
  • the segmentation method of dividing the media file into a plurality of slices may be a method of performing average segmentation according to the media file capacity size or any other segmentation method. If the average partitioning method is used, if the media file is 128MB and is divided into two fragments, the size of each fragment is 64MB.
  • the download list information of each slice includes information such as a URL (Uniform/Universal Resource Locator, also referred to as a web address) stored in each slice.
  • a URL Uniform/Universal Resource Locator, also referred to as a web address
  • Step S105 The client initiates a request for obtaining each fragment of the media file to the server according to the sequence of the received shards in the download list information from the server.
  • Step S107 The server returns each fragment of the media file to the client according to the received request for obtaining the fragment of the media file from the client.
  • the order of playback of the pieces For example, the shard of the beginning of the media file is the first shard, and the shards are sequentially arranged in the order of playing time, and the remaining shards are the second shard, the third shard, and the like.
  • Step S109 The client acquires each fragment of the media file returned by the server, and according to the playback instruction of the received media file, plays the media file returned by the server according to the sequence of each fragment.
  • Each shard Each shard.
  • the shards are independent of each other, they can be played independently. Therefore, when other shards are not downloaded, the downloaded shards can also be played independently.
  • the server divides the media file into a plurality of shards, stores each shard and forms download list information of each shard, and the client sequentially processes the shards according to the shards in the download list information.
  • the server initiates a request for obtaining each fragment of the media file.
  • the client receives the playback instruction of the media file, the client plays the respective segments of the media file according to the sequence of each fragment. Film.
  • the optimized downloading method for segmenting media files and the playing method for playing the segments are not only optimized for the downloading method, but also the media files can be played in the order of the tiles, even if other segments of the media files are not After downloading, the downloaded shards can also be played normally, so that the user can play some of the downloaded media files at any time, and the purpose of playing the undownloaded media files simply and quickly is achieved.
  • FIG. 2 is a flow chart showing the steps of a method for downloading and playing a media file according to another embodiment of the present invention.
  • Figure 2 is an improvement on the basis of Figure 1.
  • a method for downloading and playing a media file according to an embodiment of the present invention may include the following steps S201-S225:
  • Step S201 The client initiates a request for obtaining a media file to the server.
  • the media file can be a file such as music or video.
  • the client can be a mobile client such as a mobile phone.
  • Step S203 The server determines whether the capacity of the media file is greater than a preset value. If yes, proceed to step S205. If not, the media file is taken as a fragment and proceeds to step S209.
  • the server can calculate the capacity of the media file and determine whether the capacity of the media file is greater than a preset value (for example, a preset value of 120 MB or the like).
  • the preset value can be set according to actual needs.
  • Step S205 The server divides the media file into a plurality of shards, stores each shard and forms download list information of each shard, and further sends the download list information of each shard to the client.
  • the segmentation method of dividing the media file into a plurality of slices may be a method of performing average segmentation according to the media file capacity size or any other segmentation method. If the average partitioning method is used, if the media file is 128MB, if it is divided into two fragments, the size of each fragment is 64MB.
  • the download list information of each slice includes information such as a URL (Uniform/Universal Resource Locator, also referred to as a web address) stored in each slice.
  • a URL Uniform/Universal Resource Locator, also referred to as a web address
  • Step S207 The client receives and stores the download list information of each fragment, and initiates a request for acquiring each fragment of the media file to the server according to the sequence of the received shards in the download list information from the server.
  • the playback time of the pieces is in order.
  • the shard of the beginning of the media file is the first shard, and the shards are sequentially arranged in the order of playing time, and the remaining shards are the second shard, the third shard, and so on.
  • Step S209 The server returns the fragments of the media file to the client in turn according to the received request for obtaining the fragmentation of the media file from the client.
  • the server in this step uses the media file as a fragment, and returns the fragment (that is, the media file) to the client, that is, the server. Return the media file to the client.
  • Step S211 The client acquires each fragment of the media file returned by the server, and after receiving the playback instruction of the media file, determines whether the last play record of the media file is stored, and if yes, proceeds to step S213. If no, proceed to step S215.
  • the last play record is pre-stored in the memory of the client, and the last play record can record the play position information such as the last play time, the last play progress, and which slice was last played. For example, when the client user opens the media file and selects to play, a play command of the media file is issued.
  • Step S213 determining to play from the position recorded by the last play record of the media file, using the position recorded by the last play record as the initial play position, and finding the slice where the position recorded in the last play record is located Go to step S217.
  • Step S215 determining to play from the start position of the media file, using the start position of the media file as the initial play position, and finding the slice where the start position of the media file is located, and proceeding to step S217.
  • the fragment where the media file begins to be located is the first fragment.
  • Step S217 Read the found fragment, and determine whether the read fragment is complete. If it is complete, proceed to step S219. If not, proceed to step S221.
  • the read fragment it can be judged whether the read fragment is complete by judging whether the read fragment includes a terminator. Specifically, if the read fragment includes a terminator, it is determined that the read fragment is complete, and if the read fragment does not include the terminator, it is determined that the read fragment is incomplete.
  • Step S219 The read slice is played from the initial play position, and step S222 is performed.
  • the initial playback position is the position recorded in the last play record
  • playback is performed from the playback position recorded in the last play record of the slice. If the initial playback position is the opening of the media file The start position is played from the beginning of the media file.
  • Step S221 When reading the found fragment, skipping the verification information of the found fragment, reading only the media information of the found fragment, and performing the playback reading from the initial playback position.
  • the media information of the slice stops playing until there is no media information.
  • the verification information can be stored in the file header of the fragment.
  • the verification information of the file header may include information such as time information of the fragment, size of the fragmentation, and the like. For example, the time information of the fragments in the verification information can be displayed on the playback interface for the user to view. If the shard is incomplete, the check information for the header of the shard is usually incomplete.
  • the media information of the slice is media data that can be played.
  • the initial playback position of the media information of the read fragment is the initial playback position of the media file, that is, if the initial playback position is the position recorded by the last play record, the playback position recorded from the last play record of the slice Play at the place. If the initial playback position is the start position of the media file, playback is performed from the beginning of the media file.
  • Step S222 Before the currently played fragment is played, find the next fragment, and read the next fragment found, to determine whether the next fragment is complete. If it is complete, proceed to step S223, if not complete. Then, proceed to step S225.
  • the currently played fragment is the fragment currently being played.
  • a period of time for example, 10 minutes
  • How to play, in order to prepare for the next shard in advance, the purpose is mainly to ensure smooth playback.
  • Step S223 When the currently played segment is finished playing, the next segment is played, and step S222 is performed.
  • Step S225 When reading the next fragment, skip the verification information of the next fragment, and read only the media information of the next fragment, and when the currently played fragment is finished playing, read the The media information of the next slice is played until the media information is not available.
  • the verification information can be stored in the file header of the fragment.
  • the present invention divides the media file into a plurality of shards by the server, stores each shard and forms download list information of each shard, and the client sequentially sends the shards to the server according to the shards of the download list information.
  • a request for obtaining each fragment of the media file is initiated.
  • each fragment of the media file is played in sequence according to each fragment.
  • determining whether the last play record of the media file is stored in the memory, and if stored, the position recorded by the last play record is taken as the initial play position, and the slice in which the position recorded in the last play record is located is found.
  • the starting position of the media file is taken as the initial playing position, and the shard of the beginning position of the media file is found.
  • Read the found fragment to determine whether the read fragment is complete. If it is complete, play the read fragment from the initial playback position. If it is not complete, the media information of the slice read is played from the initial playback position. Since the optimized downloading method for sharding media files and the playing method for downloading complete and incomplete shards are adopted, not only the downloading method is optimized, but also the media files can be played in the sharding order, even in other points of the media files.
  • the downloaded shards and incomplete shards can also be played normally, so that the user can play some of the downloaded media files at any time, and the simple and quick playback of the undownloaded media files is achieved. the goal of. And after playing the currently played shards, the next shard can be played smoothly, so that there is no pause in play pause and intermittent, which ensures the user's good feelings during entertainment and enhances the media.
  • the playback quality of the file improves the user's playback experience on the media file.
  • FIG. 3 is a main structural block diagram of a system for downloading and playing a media file according to an embodiment of the present invention.
  • an embodiment of the present invention provides a client 311, where the client 311 includes:
  • a file obtaining module 301 configured to initiate a request for obtaining a media file to the server;
  • the fragment obtaining module 305 is configured to initiate, according to a sequence of the received shards in the download list information from the server, a request for acquiring each shard of the media file to the server; and acquiring the media file returned by the server Individual shards;
  • the playing module 309 is configured to play each fragment of the media file returned by the server according to the playback instruction of the received media file according to the sequence of each fragment.
  • the playing module 309 is further configured to: determine whether the last play record of the media file is stored; if the last play record of the media file is stored, determine the position recorded by the last play record as the initial play position, and find the last time Playing the segment where the recorded position is recorded; if the last play record of the media file is not stored, determining the start position of the media file as the initial play position, and finding the slice where the start position of the media file is located; The found fragment, and judge whether the read fragment is complete; and if it is determined that the read fragment is complete, the broadcast starts from the initial playback position. The read slice is placed.
  • the playing module 309 is further configured to: after determining whether the read fragment is complete, if it is determined that the read fragment is incomplete, skipping the check of the found fragment when reading the found fragment Information, only the media information of the found slice is read, and the media information of the slice read is played from the initial play position.
  • the playing module 309 is further configured to: after receiving the play instruction of the media file, find the next slice before the currently played slice is finished, and read the next slice found, and determine the next slice. is it complete;
  • next slice is played when the currently played slice is finished playing.
  • next fragment is incomplete, when the next fragment is read, the verification information of the next fragment is skipped, and only the media information of the next fragment is read, when the currently played fragment is played. , playing the media information of the next slice read.
  • the embodiment of the present invention further provides a server 321, which includes:
  • the fragmentation module 303 is configured to, after receiving the request for acquiring the media file from the client, divide the media file into a plurality of fragments, store each fragment and form download list information of each fragment, and further Download list information is sent to the client;
  • the fragment returning module 307 is configured to sequentially return each fragment of the media file to the client according to the received request for obtaining each fragment of the media file from the client.
  • the fragmentation module 303 is further configured to determine whether the capacity of the media file is greater than a preset value
  • the media file is divided into several fragments
  • the system for downloading and playing media files includes a client 311 and a server 321 .
  • the client 311 includes a file obtaining module 301, a fragment obtaining module 305, and a playing module 309.
  • the server 321 includes a fragmentation module 305 and a fragmentation return module 307.
  • the file obtaining module 301 can be configured on the client for initiating a request for obtaining a media file from the server.
  • Media files can be files such as music, videos, and so on.
  • the fragmentation module 303 can be disposed in the server, and is configured to receive the acquisition medium from the client. After the request of the volume file, the media file is divided into a plurality of shards, each shard is stored and the download list information of each shard is formed, and the download list information of each shard is further sent to the client.
  • the fragmentation module 303 is further configured to determine whether the capacity of the media file is greater than a preset value, and if the value is greater than the preset value, the media file is divided into a plurality of fragments, and if not greater than the preset value, the media file is used as A shard is returned to the client.
  • the fragmentation obtaining module 305 may be configured to be configured to be used by the client to initiate a request for acquiring each fragment of the media file to the server according to the sequence of the received fragments in the download list information from the server; Each slice of the media file returned by the server.
  • the fragment returning module 307 may be disposed in the server, and configured to sequentially return each fragment of the media file to the client according to the received request for obtaining each fragment of the media file from the client.
  • the playing module 309 can be configured on the client, and is configured to play each fragment of the media file returned by the server according to the sequence of the shards according to the received playback command of the media file.
  • the playing module 309 is further configured to determine whether a last play record of the media file is stored in the memory, and if the last play record of the media file is stored, determine that the position recorded from the last play record of the media file is Play, the position recorded in the last play record is used as the initial play position, and the slice where the last play record is recorded is found; if the last play record of the media file is not stored, it is determined as the slave file The beginning position of the playback, the beginning position of the media file as the initial playback position, find the fragment where the beginning of the media file is located; read the found fragment, determine whether the read fragment is complete; , the read slice is played from the initial playback position.
  • the playing module 309 is further configured to: if it is incomplete, skip the search information of the found fragment when reading the found fragment, and only read the media information of the found fragment.
  • the media information of the slice read is played from the initial playback position.
  • the playing module 309 is further configured to find the next shard before the currently played shard is finished, and read the next shard that is found to determine whether the next shard is complete; if complete, then When the currently playing segment is finished playing, the next segment is played; if it is not complete, when the next segment is read, the verification information of the next segment is skipped, and only the media information of the next segment is read. Playing now When the shard is played, the media information of the next shard read is played.
  • the present invention divides the media file into a plurality of shards by the server, stores each shard and forms download list information of each shard, and the client sequentially sends the shards to the server according to the shards of the download list information.
  • a request for acquiring each fragment of the media file is initiated.
  • the client receives the playback instruction of the media file, the fragments of the media file are played in sequence according to each fragment. And determining whether the last play record of the media file is stored in the memory, and if stored, the position recorded by the last play record is used as the initial play position, and the slice of the position recorded by the last play record is found.
  • the starting position of the media file is used as the initial playback position, and the slice where the start position of the media file is located is found. Read the found fragment to determine whether the read fragment is complete. If it is complete, play the read fragment from the initial playback position. If it is not complete, the media information of the slice read is played from the initial playback position. Since the optimized downloading method for sharding media files and the playing method for downloading complete and incomplete shards are adopted, not only the downloading method is optimized, but also the media files can be played in the sharding order, even in other points of the media files.
  • the downloaded shards and incomplete shards can also be played normally, so that the user can play some of the downloaded media files at any time, and the simple and quick playback of the undownloaded media files is achieved. the goal of. And after the currently played shards are played, the next shard can be played smoothly, so that there is no pause in play pause and intermittent, which ensures the user's good feelings during entertainment and enhances the media.
  • the playback quality of the file improves the user's playback experience on the media file.
  • embodiments of the present invention also provide one or more storage media containing computer executable instructions for executing a method of downloading and playing a media file running on a client, the method comprising the steps of: Initiating a request to obtain a media file from the server;
  • each slice of the media file returned by the server is played according to the sequence of the respective fragments.
  • Embodiments of the present invention further provide another one or more storage media including computer executable instructions for executing a method of downloading and playing a media file running on a server, the method comprising the steps of:

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Databases & Information Systems (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

本发明涉及下载并播放媒体文件的方法、系统、客户端、服务器及存储介质,其中下载并播放媒体文件的系统包括:客户端用于向服务器发起获取媒体文件的请求;根据下载列表信息的各个分片先后顺序向服务器发起获取媒体文件各个分片的请求;获取所述服务器所返回的所述媒体文件的各个分片;以及接收到媒体文件的播放指令时,则按照各个分片先后顺序播放媒体文件的各个分片;所述服务器用于将媒体文件分割为若干分片,存储各个分片以形成各个分片的下载列表信息,并将各个分片的下载列表信息发送给客户端;依次将媒体文件的各个分片返回给客户端。本发明能够简单、快捷地播放未下载完的媒体文件。

Description

说 明 书
下载并播放媒体文件的方法、 系统、 客户端、 服务器及存储介质 本专利申请要求于 2012年 12月 13 日提交的、 申请号为 201210538686.0, 申请人为腾讯科技(深圳 )有限公司、 发明名称为"下载并播放媒体文件的方法 及系统 "的中国专利申请的优先权, 该申请的全文以引用的方式并入本申请中。
技术领域
本发明涉及网络信息传输技术领域, 尤其涉及下载并播放媒体文件的方法、 系统、 客户端、 服务器及存储介质。
背景技术
目前, 随着网络技术的飞速发展, 各种媒体文件, 例如数字音乐、 视频文 件等是互联网中相当热门的传播信息。 由于这些媒体文件通常存储在网站中, 并以网络为传播途径, 因此, 使用者若要将所需要的媒体文件下载到本地, 则 需要从网站上找到所需要的媒体文件, 然后对媒体文件直接进行下载, 以便在 本地欣赏媒体文件的播放内容。
然而, 在这种下载方法中, 如果由于网络原因或其他原因导致媒体文件没 有下载完, 则在本地将无法对未下载完的媒体文件进行播放, 若要播放此媒体 文件, 则需要等待媒体文件下载完成后才能进行播放, 从而大大降低了使用者 对媒体文件的播放体验、 无法确保使用者娱乐休闲时的优良感受。
发明内容
因此, 本发明提供下载并播放媒体文件的方法、 系统、 客户端、 服务器及 存储介质, 能够简单、 快捷地播放未下载完的媒体文件。
具体地, 本发明实施例提出的一种下载并播放媒体文件的方法, 运行于客 户端, 包括步骤: 向服务器发起获取媒体文件的请求; 根据所接收的来自所述 服务器的下载列表信息中的所述各个分片的先后顺序, 向所述服务器发起获取 所述媒体文件各个分片的请求; 获取所述服务器所返回的所述媒体文件的各个 分片; 根据所接收到的所述媒体文件的播放指令, 按照所述各个分片的先后顺 序, 播放由所述服务器所返回的所述媒体文件的各个分片。
本发明实施例还提供一种下载并播放媒体文件的方法, 运行于服务器, 包 括步骤: 在接收到来自客户端的获取媒体文件的请求后, 将所述媒体文件分割 为若干分片, 存储各个分片并且形成各个分片的下载列表信息, 并进一步将所 述各个分片的下载列表信息发送给所述客户端; 根据接收到的来自所述客户端 的所述获取媒体文件各个分片的请求, 将所述媒体文件的各个分片返回给所述 客户端。
根据本发明实施例提供的方法, 本发明实施例还提供一种客户端包括: 文件获取模块, 用于向服务器发起获取媒体文件的请求;
分片获取模块, 用于根据所接收的来自所述服务器的下载列表信息中的所 述各个分片的先后顺序, 向所述服务器发起获取所述媒体文件各个分片的请求; 获取所述服务器所返回的所述媒体文件的各个分片;
播放模块, 用于根据所接收到的所述媒体文件的播放指令, 按照所述各个 分片的先后顺序, 播放由所述服务器所返回的所述媒体文件的各个分片。
本发明实施例提供对应的一种服务器, 包括:
分片模块, 用于在接收到来自客户端的获取媒体文件的请求后, 将所述媒 体文件分割为若干分片, 存储各个分片并且形成各个分片的下载列表信息, 并 进一步将所述各个分片的下载列表信息发送给所述客户端;
分片返回模块, 用于根据接收到的来自所述客户端的所述获取媒体文件各 个分片的请求, 将所述媒体文件的各个分片返回给所述客户端。
另外, 本发明实施例提出的一种下载并播放媒体文件的系统, 所述系统包 括服务器和客户端, 其中所述客户端用于向服务器发起获取媒体文件的请求; 用于根据所接收的来自所述服务器的下载列表信息中的所述各个分片的先后顺 序, 向所述服务器发起获取所述媒体文件各个分片的请求; 获取所述服务器所 返回的所述媒体文件的各个分片; 根据所接收到的所述媒体文件的播放指令, 按照所述各个分片的先后顺序播放由所述服务器所返回的所述媒体文件的各个 分片。
其中所述服务器用于在接收到来自客户端的获取媒体文件的请求后, 将所 述媒体文件分割为若干分片, 存储各个分片并且形成各个分片的下载列表信息, 并进一步将所述各个分片的下载列表信息发送给所述客户端; 用于根据接收到 的来自所述客户端的所述获取媒体文件各个分片的请求, 将所述媒体文件的各 个分片返回给所述客户端。
本发明实施例还提供一个或多个包含计算机可执行指令的存储介质, 所述 计算机可执行指令用于执行一种运行于客户端的下载并播放媒体文件的方法, 所述方法包括以下步骤:
向服务器发起获取媒体文件的请求;
根据所接收的来自所述服务器的下载列表信息中的所述各个分片的先后顺 序, 向所述服务器发起获取所述媒体文件各个分片的请求; 获取所述服务器所 返回的所述媒体文件的各个分片;
根据所接收到的所述媒体文件的播放指令, 按照所述各个分片的先后顺序, 播放由所述服务器所返回的所述媒体文件的各个分片。
本发明还提供一个或多个包含计算机可执行指令的存储介质, 所述计算机 可执行指令用于执行一种运行于服务器的下载并播放媒体文件的方法, 其特征 在于, 所述方法包括以下步骤:
在接收到来自客户端的获取媒体文件的请求后, 将所述媒体文件分割为若 干分片, 存储各个分片并且形成各个分片的下载列表信息, 并进一步将所述各 个分片的下载列表信息发送给所述客户端;
根据接收到的来自所述客户端的所述获取媒体文件各个分片的请求, 将所 述媒体文件的各个分片返回给所述客户端。
由上述可知, 本发明通过由服务器将媒体文件分割为若干分片, 存储各个 分片并且形成各个分片的下载列表信息, 以及根据下载列表信息中的各个分片 先后顺序向服务器发起获取媒体文件各个分片的请求, 并且由客户端在接收到 媒体文件的播放指令时, 则按照各个分片先后顺序播放媒体文件的各个分片。 由于采用对媒体文件进行分片的优化下载方法以及对分片进行播放的方法, 从 而不仅优化了下载方法, 也能够按照分片顺序播放媒体文件, 即使在媒体文件 的其他分片未下载完时, 下载完的分片也可以正常播放, 这样用户就可以随时 播放已经下载完的部分媒体文件, 达到了简单、 快捷地播放未下载完的媒体文 件的目的。
上述说明仅是本发明技术方案的概述, 为了能够更清楚了解本发明的技术 手段, 能够依照说明书的内容予以实施本发明, 并且为了让本发明的上述和其 他目的、 特征和优点能够更明显易懂, 以下特举较佳实施例, 并配合附图, 详 细说明 ¾口下。
附图说明
图 1是本发明实施例提出的下载并播放媒体文件的方法的步骤流程图; 图 2是本发明另一实施例提出的下载并播放媒体文件的方法的步骤流程图; 图 3是本发明实施例提出的下载并播放媒体文件的系统的主要架构框图。
具体实施方式
为更进一步阐述本发明为达成预定发明目的所采取的技术手段及功效, 以 下结合附图及较佳实施例, 对依据本发明提出的下载并播放媒体文件的方法、 系统、 客户端、 服务器及存储介质的具体实施方式、 结构、 特征及功效, 详细 说明 ¾口后。
有关本发明的前述及其他技术内容、 特点及功效, 在以下配合参考图式的 较佳实施例详细说明中将可被清楚的呈现。 通过具体实施方式的说明, 可对本 而所附图式仅是提供参考与说明之用, 并非用来对本发明加以限制。
图 1 是本发明实施例提出的下载并播放媒体文件的方法的步骤流程图。 请 参阅图 1 , 本发明实施例的下载并播放媒体文件的方法可包括以下步骤 S101-S109:
步骤 S101 : 客户端向服务器发起获取媒体文件的请求。 本步骤中, 媒体文件可以为音乐、 视频等文件。 客户端可以为手机等移动 客户端。
步骤 S103: 服务器在接收到来自客户端的获取媒体文件的请求后, 将媒体 文件分割为若干分片, 存储各个分片并且形成各个分片的下载列表信息, 并进 一步将各个分片的下载列表信息发送给所述客户端。
本步骤中, 将媒体文件分割为若干分片的分割方法可以为按照媒体文件容 量大小进行平均分割的方法或其他任意分割方法。 若采用平均分割的方法可以 为若媒体文件为 128MB , 被分割为两分片, 则每个分片的容量大小就为 64MB。
其中, 各个分片的下载列表信息包括各个分片所存储的 URL ( Uniform/Universal Resource Locator, 统一资源定位符, 也被称为网页地址)等 信息。
步骤 S105: 客户端根据所接收的来自服务器的下载列表信息中的各个分片 的先后顺序, 向服务器发起获取媒体文件各个分片的请求。
步骤 S107: 服务器根据接收到的来自所述客户端的获取媒体文件各个分片 的请求, 依次将媒体文件的各个分片返回给所述客户端。 件的播放时间上的先后顺序)。 例如, 媒体文件的开始位置所在的分片为第一个 分片, 将各个分片按照播放时间顺序依次排列, 其余分片依次为第二个分片、 第三个分片等。
步骤 S109: 客户端获取所述服务器所返回的所述媒体文件的各个分片并且 根据所接收到的媒体文件的播放指令, 按照各个分片的先后顺序, 播放由所述 服务器所返回的媒体文件的各个分片。
本步骤中, 由于各个分片是相互独立的, 即可以独立播放的, 因此, 在其 他分片未下载完时, 下载完的分片也可以独立进行播放。
在本发明实施例中, 本发明由服务器通过将媒体文件分割为若干分片, 存 储各个分片并且形成各个分片的下载列表信息, 由客户端根据下载列表信息中 的各个分片先后顺序向服务器发起获取媒体文件各个分片的请求, 该客户端接 收到媒体文件的播放指令时, 则按照各个分片先后顺序播放媒体文件的各个分 片。 由于采用对媒体文件进行分片的优化下载方法及对分片进行播放的播放方 法, 从而不仅优化了下载方法, 此外, 也能够按照分片顺序播放媒体文件, 即 使在媒体文件的其他分片未下载完时, 下载完的分片也可以正常播放, 这样用 户就可以随时播放已经下载完的部分媒体文件, 达到了简单、 快捷地播放未下 载完的媒体文件的目的。
图 2是本发明另一实施例提供的下载并播放媒体文件的方法的步骤流程图。 图 2是在图 1的基础上改进而来的。请参阅图 2, 本发明实施例的下载并播放媒 体文件的方法可包括以下步骤 S201-S225:
步骤 S201 : 客户端向服务器发起获取媒体文件的请求。
本步骤中, 媒体文件可以为音乐、 视频等文件。 客户端可以为手机等移动 客户端。
步骤 S203: 服务器判断媒体文件的容量是否大于一预设值, 若是, 则进行 步骤 S205 , 若否, 则将媒体文件作为一个分片并进行步骤 S209。
本步骤中, 服务器可以计算媒体文件的容量大小, 并判断媒体文件的容量 是否大于预设值(例如预设值为 120MB等数值)。 预设值可以根据实际需要而 进行设定。
步骤 S205: 服务器将媒体文件分割为若干分片, 存储各个分片并且形成各 个分片的下载列表信息, 并进一步将各个分片的下载列表信息发送给客户端。
本步骤中, 将媒体文件分割为若干分片的分割方法可以为按照媒体文件容 量大小进行平均分割的方法或其他任意分割方法。 若采用平均分割的方法即若 媒体文件为 128MB , 若分割为两分片, 则每个分片的容量大小就为 64MB。
其中, 各个分片的下载列表信息包括各个分片所存储的 URL ( Uniform/Universal Resource Locator, 统一资源定位符, 也被称为网页地址)等 信息。
步骤 S207: 客户端接收并存储各个分片的下载列表信息, 并根据所接收的 来自服务器的下载列表信息中的各个分片的先后顺序, 向服务器发起获取媒体 文件各个分片的请求。 件的播放时间先后顺序)。例如,媒体文件的开始位置所在的分片为第一个分片, 将各个分片按照播放时间顺序依次排列, 其余分片依次为第二个分片、 第三个 分片等。
步骤 S209: 服务器根据接收到的来自客户端的获取媒体文件各个分片的请 求, 依次将媒体文件的各个分片返回给客户端。
其中, 若步骤 S203中所获取媒体文件的容量小于预设值时, 则本步骤中的 服务器将媒体文件作为一个分片, 并将此分片 (即此媒体文件)返回给客户端, 即服务器将媒体文件返回给客户端。
步骤 S211 : 客户端获取所述服务器所返回的所述媒体文件的各个分片并且 在接收到媒体文件的播放指令之后, 则判断是否存储有媒体文件的上次播放记 录, 若是, 则进行步骤 S213 , 若否, 则进行步骤 S215。
本步骤中, 客户端的存储器中预先存储上次播放记录, 上次播放记录可以 记录上次的播放时间、 上次播放进度、 上次播放到哪一个分片等播放位置信息。 例如当客户端用户打开媒体文件选择播放时, 则会发出媒体文件的播放指令。
步骤 S213 : 确定为从媒体文件的上次播放记录所记录的位置处进行播放, 将上次播放记录所记录的位置作为初始播放位置, 并且查找到上次播放记录所 记录的位置所在的分片, 进行步骤 S217。
步骤 S215: 确定为从媒体文件的开始位置进行播放, 将媒体文件的开始位 置作为初始播放位置, 查找到媒体文件的开始位置所在的分片, 进行步骤 S217。
本步骤中, 媒体文件的开始位置所在的分片为第一个分片。
步骤 S217: 读取所查找到的分片, 并且判断读取的分片是否完整, 若完整, 则进行步骤 S219 , 若不完整, 则进行步骤 S221。
本步骤中, 可以通过判断读取的分片是否包括结束符而判断读取的分片是 否完整。 具体地, 若读取的分片包括结束符, 则判断为读取的分片完整, 若读 取的分片未包括结束符, 则判断为读取的分片不完整。
步骤 S219: 从初始播放位置开始播放读取的分片, 进行步骤 S222。
本步骤中, 若初始播放位置为上次播放记录所记录的位置, 则从此分片的 上次播放记录所记录的播放位置处进行播放。 若初始播放位置为媒体文件的开 始位置, 则从媒体文件的开始位置进行播放。
步骤 S221 : 在读取所查找到的分片时, 跳过查找到的分片的校验信息, 仅 读取所查找到的分片的媒体信息, 并且从初始播放位置进行播放读取的分片的 媒体信息, 直到没有媒体信息时则停止播放。
本步骤中, 校验信息可以存放在分片的文件头内。 文件头的校验信息可以 包括分片的时间信息、 分片容量大小等信息。 例如校验信息中的分片的时间信 息可以显示在播放界面上以供用户查看。 若分片不完整, 则分片的文件头的校 验信息通常也不完整。 分片的媒体信息为可以播放的媒体数据。 所读取的分片 的媒体信息的初始播放位置即媒体文件的初始播放位置, 即若初始播放位置为 上次播放记录所记录的位置, 则从此分片的上次播放记录所记录的播放位置处 进行播放。 若初始播放位置为媒体文件的开始位置, 则从媒体文件的开始位置 进行播放。
步骤 S222: 在当前播放的分片播放完毕前, 查找到下一个分片, 并且读取 查找到的下一个分片, 判断下一个分片是否完整, 若完整, 则进行步骤 S223 , 若不完整, 则进行步骤 S225。
本步骤中, 当前播放的分片为目前正在播放的分片。 在当前播放的分片播 放完毕前的一段时间 (例如 10分钟), 查找到再读取下一个分片并判断下一个 分片是否完整, 而且设定好在分片完整与不完整的条件下如何进行播放, 以提 前做好播放下一个分片的准备工作, 其目的主要是为了保证播放的流畅。
步骤 S223 : 当前播放的分片播放完毕时,播放下一个分片,进行步骤 S222。 步骤 S225: 读取下一个分片时, 跳过此下一个分片的校验信息, 仅读取此 下一个分片的媒体信息, 在当前播放的分片播放完毕时, 对所读取的这个下一 个分片的媒体信息进行播放, 直到没有媒体信息时则停止播放。
本步骤中, 校验信息可以存放在分片的文件头内。
在本发明实施例中, 本发明通过由服务器将媒体文件分割为若干分片, 存 储各个分片并且形成各个分片的下载列表信息, 由客户端根据下载列表信息的 各个分片先后顺序向服务器发起获取媒体文件各个分片的请求, 在客户端接收 到媒体文件的播放指令时, 则按照各个分片先后顺序播放媒体文件的各个分片。 并且还判断存储器中是否存储有媒体文件的上次播放记录, 若存储有, 则将上 次播放记录所记录的位置作为初始播放位置, 并且查找到上次播放记录所记录 的位置所在的分片, 若未存储, 则将媒体文件的开始位置作为初始播放位置, 并且查找到媒体文件的开始位置所在的分片。 读取所查找到的分片, 判断读取 的分片是否完整, 若完整, 从初始播放位置开始播放读取的分片。 若不完整, 则从初始播放位置进行播放读取的分片的媒体信息。 由于采用对媒体文件进行 分片的优化下载方法及下载完整与不完整分片的播放方法, 从而不仅优化了下 载方法, 此外, 也能够按照分片顺序播放媒体文件, 即使在媒体文件的其他分 片未下载完时, 下载完的分片和下载不完整的分片也可以正常播放, 这样用户 就可以随时播放已经下载完的部分媒体文件, 达到了简单、 快捷地播放未下载 完的媒体文件的目的。 并且在播放完当前播放的分片后, 还能够顺畅地播放下 一个分片, 从而不会产生播放停顿、 断续的不稳定现象, 进而确保了使用者娱 乐休闲时的优良感受、 提升了媒体文件的播放品质、 提升了使用者对媒体文件 的播放体验。
图 3是本发明实施例提出的下载并播放媒体文件的系统的主要架构框图。 参阅图 3本发明实施例提供了客户端 311 , 该客户端 311包括:
文件获取模块 301 , 用于向服务器发起获取媒体文件的请求;
分片获取模块 305 ,用于根据所接收的来自服务器的下载列表信息中的各个 分片的先后顺序, 向服务器发起获取媒体文件各个分片的请求; 获取所述服务 器所返回的所述媒体文件的各个分片;
播放模块 309 , 用于根据所接收到的媒体文件的播放指令,按照各个分片的 先后顺序, 播放由服务器返回的媒体文件的各个分片。
播放模块 309还用于: 判断是否存储有媒体文件的上次播放记录; 若存储有媒体文件的上次播放记录, 则确定上次播放记录所记录的位置作 为初始播放位置, 并且查找到上次播放记录所记录的位置所在的分片; 若未存 储有媒体文件的上次播放记录, 则确定媒体文件的开始位置作为初始播放位置, 并且查找到媒体文件的开始位置所在的分片; 读取所查找到的分片, 并且判断 读取的分片是否完整; 并且若确定读取的分片完整, 则从初始播放位置开始播 放所述读取的分片。
播放模块 309还用于在判断读取的分片是否完整之后, 若确定读取的分片 不完整, 则在读取所查找到的分片时, 跳过所查找到的分片的校验信息, 仅读 取所查找到的分片的媒体信息, 并且从初始播放位置进行播放读取的分片的媒 体信息。
播放模块 309还用于在接收到媒体文件的播放指令之后, 在当前播放的分 片播放完毕之前, 查找到下一个分片, 并且读取所查找到的下一个分片, 判断 下一个分片是否完整;
若确定下一个分片完整, 则在当前播放的分片播放完毕时, 播放该下一个 分片; 或者
若确定下一个分片不完整, 则在读取下一个分片时, 跳过下一个分片的校 验信息, 仅读取下一个分片的媒体信息, 在当前播放的分片播放完毕时, 对所 读取的下一个分片的媒体信息进行播放。
本发明实施例还提供了服务器 321 , 该服务器 321包括:
分片模块 303 , 用于在接收到来自客户端的获取媒体文件的请求后, 将媒体 文件分割为若干分片, 存储各个分片并且形成各个分片的下载列表信息, 并进 一步将各个分片的下载列表信息发送给所述客户端;
分片返回模块 307 ,用于根据接收到的来自客户端的获取媒体文件各个分片 的请求, 依次将媒体文件的各个分片返回给所述客户端。
分片模块 303还用于判断媒体文件的容量是否大于一预设值;
若大于所述预设值, 则将媒体文件分割为若干分片;
若不大于所述预设值, 则将媒体文件作为一个分片并且返回给该客户端。 请参阅图 3 , 下载并播放媒体文件的系统包括客户端 311和服务器 321。 客 户端 311包括文件获取模块 301、分片获取模块 305、播放模块 309。服务器 321 包括分片模块 305、 分片返回模块 307。
更具体地, 文件获取模块 301 , 可以设置于客户端, 用于向服务器发起获取 媒体文件的请求。 媒体文件可以为音乐、 视频等文件。
分片模块 303 , 可以设置于服务器内, 其用于在接收到来自客户端的获取媒 体文件的请求后, 将媒体文件分割为若干分片, 存储各个分片并且形成各个分 片的下载列表信息, 并进一步将各个分片的下载列表信息发送给所述客户端。
此外, 分片模块 303 , 还用于判断媒体文件的容量是否大于一预设值, 若大 于预设值, 则将媒体文件分割为若干分片, 若不大于预设值, 则将媒体文件作 为一个分片返回给客户端。
分片获取模块 305 , 可以设置于客户端, 用于根据所接收的来自所述服务器 的下载列表信息中的各个分片的先后顺序, 向所述服务器发起获取媒体文件各 个分片的请求; 获取所述服务器所返回的所述媒体文件的各个分片。
分片返回模块 307 , 可以设置于服务器内, 用于根据接收到的来自所述客户 端的获取媒体文件各个分片的请求, 依次将媒体文件的各个分片返回给所述客 户端。
播放模块 309 , 可以设置于客户端, 用于根据所接收到的媒体文件的播放指 令, 按照各个分片的先后顺序, 播放由服务器返回的媒体文件的各个分片。
此外,播放模块 309 ,还用于判断存储器中是否存储有媒体文件的上次播放 记录, 若存储有媒体文件的上次播放记录, 则确定为从媒体文件的上次播放记 录所记录的位置处进行播放, 将上次播放记录所记录的位置作为初始播放位置 , 查找到上次播放记录所记录的位置所在的分片; 若未存储有媒体文件的上次播 放记录, 则确定为从媒体文件的开始位置进行播放, 将媒体文件的开始位置作 为初始播放位置, 查找到媒体文件的开始位置所在的分片; 读取所查找到的分 片, 判断所读取的分片是否完整; 若完整, 则从初始播放位置开始播放读取的 分片。
此外, 播放模块 309 , 还用于判断若不完整, 则在读取所查找到的分片时, 跳过查找到的分片的校验信息, 仅读取查找到的分片的媒体信息, 从初始播放 位置进行播放读取的分片的媒体信息。
此外, 播放模块 309 , 还用于在当前播放的分片播放完毕前, 查找到下一个 分片, 读取所查找到的下一个分片, 判断下一个分片是否完整; 若完整, 则在 当前播放的分片播放完毕时, 播放下一个分片; 若不完整, 则读取下一个分片 时, 跳过下一个分片的校验信息, 仅读取下一个分片的媒体信息, 在当前播放 的分片播放完毕时, 对读取的下一个分片的媒体信息进行播放。
在本发明实施例中, 本发明通过由服务器将媒体文件分割为若干分片, 存 储各个分片并且形成各个分片的下载列表信息, 由客户端根据下载列表信息的 各个分片先后顺序向服务器发起获取媒体文件各个分片的请求, 客户端接收到 媒体文件的播放指令时, 则按照各个分片先后顺序播放媒体文件的各个分片。 并且还判断存储器中是否存储有媒体文件的上次播放记录, 若存储有, 则将上 次播放记录所记录的位置作为初始播放位置, 查找到上次播放记录所记录的位 置所在的分片, 若未存储, 则将媒体文件的开始位置作为初始播放位置, 查找 到媒体文件的开始位置所在的分片。 读取所查找到的分片, 判断读取的分片是 否完整, 若完整, 从初始播放位置开始播放读取的分片。 若不完整, 则从初始 播放位置进行播放读取的分片的媒体信息。 由于采用对媒体文件进行分片的优 化下载方法及下载完整与不完整分片的播放方法, 从而不仅优化了下载方法, 此外, 也能够按照分片顺序播放媒体文件, 即使在媒体文件的其他分片未下载 完时, 下载完的分片和下载不完整的分片也可以正常播放, 这样用户就可以随 时播放已经下载完的部分媒体文件, 达到了简单、 快捷地播放未下载完的媒体 文件的目的。 并且在当前播放的分片播放完毕后, 还能够顺畅地播放下一个分 片, 从而不会产生播放停顿、 断续的不稳定现象, 进而确保了使用者娱乐休闲 时的优良感受、 提升了媒体文件的播放品质、 提升了使用者对媒体文件的播放 体验。 本领域普通技术人员可以理解的是, 实现上述实施例方法中的全部或部分 流程, 是可以通过计算机程序来控制相关的硬件来完成, 所述的程序可存储于 计算机可读取存储介质中, 该程序在执行时, 可包括如上述各方法的实施例的 流程。 其中, 所述的存储介质可为磁碟、 光盘、 只读存储记忆体(Read-Only Memory, ROM )或随机存储记忆体 ( Random Access Memory, RAM )等。
因此, 本发明实施例还提供一个或多个包含计算机可执行指令的存储介质, 计算机可执行指令用于执行一种运行于客户端的下载并播放媒体文件的方法, 方法包括以下步骤: 向服务器发起获取媒体文件的请求;
根据所接收的来自所述服务器的下载列表信息中的所述各个分片的先后顺 序, 向所述服务器发起获取所述媒体文件各个分片的请求;
获取所述服务器所返回的所述媒体文件的各个分片;
根据所接收到的所述媒体文件的播放指令, 按照所述各个分片的先后顺序, 播放由所述服务器所返回的所述媒体文件的各个分片。
本发明实施例还提供另外的一个或多个包含计算机可执行指令的存储介 质, 计算机可执行指令用于执行一种运行于服务器的下载并播放媒体文件的方 法, 方法包括以下步骤:
在接收到来自客户端的获取媒体文件的请求后, 将所述媒体文件分割为若 干分片, 存储各个分片并且形成各个分片的下载列表信息, 并进一步将所述各 个分片的下载列表信息发送给所述客户端;
根据接收到的来自所述客户端的所述获取媒体文件各个分片的请求, 依次 将所述媒体文件的各个分片返回给所述客户端。
以上所述, 仅是本发明的较佳实施例而已, 并非对本发明作任何形式上的 限制, 虽然本发明已以较佳实施例揭露如上, 然而并非用以限定本发明, 任何 熟悉本专业的技术人员, 在不脱离本发明技术方案范围内, 当可利用上述揭示 的技术内容作出些许更动或修饰而形成等同变化的等效实施例, 但凡是未脱离 单修改、 等同变化与修饰, 均仍属于本发明技术方案的范围内。

Claims

权 利 要 求 书
1. 一种下载并播放媒体文件的方法, 运行于客户端, 其特征在于, 包括步 骤:
向服务器发起获取媒体文件的请求;
根据所接收的来自所述服务器的下载列表信息中的所述各个分片的先后顺 序, 向所述服务器发起获取所述媒体文件各个分片的请求; 获取所述服务器所 返回的所述媒体文件的各个分片;
根据所接收到的所述媒体文件的播放指令, 按照所述各个分片的先后顺序, 播放由所述服务器所返回的所述媒体文件的各个分片。
2. 根据权利要求 1所述的下载并播放媒体文件的方法, 其特征在于, 在接 收到所述媒体文件的播放指令之后, 还包括步骤:
判断是否存储有所述媒体文件的上次播放记录;
若存储有所述媒体文件的上次播放记录, 则确定所述上次播放记录所记录 的位置作为初始播放位置, 并且查找到所述上次播放记录所记录的位置所在的 分片;
若未存储有所述媒体文件的上次播放记录, 则确定所述媒体文件的开始位 置作为初始播放位置, 并且查找到所述媒体文件的开始位置所在的分片;
读取所查找到的所述分片, 并且判断所述读取的分片是否完整; 以及 若确定所述读取的分片完整, 则从所述初始播放位置开始播放所述读取的 分片。
3. 根据权利要求 2所述的下载并播放媒体文件的方法, 其特征在于, 在所 述判断所述读取的分片是否完整之后, 还包括步骤:
若确定所述读取的分片不完整, 则在读取所查找到的所述分片时, 跳过所 查找到的所述分片的校验信息, 仅读取所查找到的所述分片的媒体信息, 并且 从所述初始播放位置进行播放所述读取的分片的媒体信息。
4. 根据权利要求 2所述的下载并播放媒体文件的方法, 其特征在于, 在接 收到所述媒体文件的播放指令之后, 还包括步骤:
在当前播放的分片播放完毕之前, 查找到下一个分片, 并且读取所查找到 的所述下一个分片, 判断所述下一个分片是否完整; 若确定所述下一个分片完整, 则在当前播放的分片播放完毕时, 播放该下 一个分片; 或者
若确定所述下一个分片不完整, 则在读取所述下一个分片时, 跳过所述下 一个分片的校验信息, 仅读取所述下一个分片的媒体信息, 在当前播放的分片 播放完毕时, 对所读取的所述下一个分片的媒体信息进行播放。
5. 一种下载并播放媒体文件的方法, 运行于服务器, 其特征在于, 包括步 骤:
在接收到来自客户端的获取媒体文件的请求后, 将所述媒体文件分割为若 干分片, 存储各个分片并且形成各个分片的下载列表信息, 并进一步将所述各 个分片的下载列表信息发送给所述客户端;
根据接收到的来自所述客户端的所述获取媒体文件各个分片的请求, 依次 将所述媒体文件的各个分片返回给所述客户端。
6. 根据权利要求 5所述的下载并播放媒体文件的方法, 其特征在于, 所述 将所述媒体文件分割为若干分片, 还包括步骤:
判断所述媒体文件的容量是否大于一预设值;
若大于所述预设值, 则将所述媒体文件分割为若干分片;
若不大于所述预设值, 则将所述媒体文件作为一个分片并且返回给该客户 端。
7. 一种客户端, 其特征在于, 包括:
文件获取模块, 用于向服务器发起获取媒体文件的请求;
分片获取模块, 用于根据所接收的来自所述服务器的下载列表信息中的所 述各个分片的先后顺序, 向所述服务器发起获取所述媒体文件各个分片的请求; 获取所述服务器所返回的所述媒体文件的各个分片;
播放模块, 用于根据所接收到的所述媒体文件的播放指令, 按照所述各个 分片的先后顺序, 播放由所述服务器所返回的所述媒体文件的各个分片。
8. 根据权利要求 7所述的客户端, 其特征在于, 所述播放模块还用于: 判断是否存储有所述媒体文件的上次播放记录;
若存储有所述媒体文件的上次播放记录, 则确定所述上次播放记录所记录 的位置作为初始播放位置, 并且查找到所述上次播放记录所记录的位置所在的 分片;
若未存储有所述媒体文件的上次播放记录, 则确定所述媒体文件的开始位 置作为初始播放位置, 并且查找到所述媒体文件的开始位置所在的分片;
读取所查找到的所述分片, 并且判断所述读取的分片是否完整; 并且 若确定所述读取的分片完整, 则从所述初始播放位置开始播放所述读取的 分片。
9. 根据权利要求 8所述的客户端, 其特征在于, 所述播放模块还用于 在判断所述读取的分片是否完整之后, 若确定所述读取的分片不完整, 则 在读取所查找到的所述分片时, 跳过所查找到的所述分片的校验信息, 仅读取 所查找到的所述分片的媒体信息, 并且从所述初始播放位置进行播放所述读取 的分片的媒体信息。
10. 根据权利要求 8所述的客户端, 其特征在于, 所述播放模块还用于在接 收到所述媒体文件的播放指令之后, 在当前播放的分片播放完毕之前, 查找到 下一个分片, 并且读取所查找到的所述下一个分片, 判断所述下一个分片是否 完整;
若确定所述下一个分片完整, 则在当前播放的分片播放完毕时, 播放该下 一个分片; 或者
若确定所述下一个分片不完整, 则在读取所述下一个分片时, 跳过所述下 一个分片的校验信息, 仅读取所述下一个分片的媒体信息, 在当前播放的分片 播放完毕时, 对所读取的所述下一个分片的媒体信息进行播放。
11. 一种服务器, 其特征在于, 包括:
分片模块, 用于在接收到来自客户端的获取媒体文件的请求后, 将所述媒 体文件分割为若干分片, 存储各个分片并且形成各个分片的下载列表信息, 并 进一步将所述各个分片的下载列表信息发送给所述客户端;
分片返回模块, 用于根据接收到的来自所述客户端的所述获取媒体文件各 个分片的请求, 依次将所述媒体文件的各个分片返回给所述客户端。
12. 根据权利要求 11所述的服务器, 其特征在于, 所述分片模块还用于判 断所述媒体文件的容量是否大于一预设值;
若大于所述预设值, 则将所述媒体文件分割为若干分片;
若不大于所述预设值, 则将所述媒体文件作为一个分片并且返回给该客户 端。
13. 一种下载并播放媒体文件的系统, 其特征在于, 所述系统包括服务器和 客户端, 其中所述客户端用于向服务器发起获取媒体文件的请求; 用于根据所 接收的来自所述服务器的下载列表信息中的所述各个分片的先后顺序, 向所述 服务器发起获取所述媒体文件各个分片的请求; 获取所述服务器所返回的所述 媒体文件的各个分片; 根据所接收到的所述媒体文件的播放指令, 按照所述各 个分片的先后顺序播放由所述服务器所返回的所述媒体文件的各个分片。
其中所述服务器用于在接收到来自客户端的获取媒体文件的请求后, 将所 述媒体文件分割为若干分片, 存储各个分片并且形成各个分片的下载列表信息, 并进一步将所述各个分片的下载列表信息发送给所述客户端; 用于根据接收到 的来自所述客户端的所述获取媒体文件各个分片的请求, 依次将所述媒体文件 的各个分片返回给所述客户端。
14. 一个或多个包含计算机可执行指令的存储介质,所述计算机可执行指令 用于执行一种运行于客户端的下载并播放媒体文件的方法, 其特征在于, 所述 方法包括以下步骤:
向服务器发起获取媒体文件的请求;
根据所接收的来自所述服务器的下载列表信息中的所述各个分片的先后顺 序, 向所述服务器发起获取所述媒体文件各个分片的请求; 获取所述服务器所 返回的所述媒体文件的各个分片;
根据所接收到的所述媒体文件的播放指令, 按照所述各个分片的先后顺序, 播放由所述服务器所返回的所述媒体文件的各个分片。
15. 一个或多个包含计算机可执行指令的存储介质,所述计算机可执行指令 用于执行一种运行于服务器的下载并播放媒体文件的方法, 其特征在于, 所述 方法包括以下步骤:
在接收到来自客户端的获取媒体文件的请求后, 将所述媒体文件分割为若 干分片, 存储各个分片并且形成各个分片的下载列表信息, 并进一步将所述各 个分片的下载列表信息发送给所述客户端;
根据接收到的来自所述客户端的所述获取媒体文件各个分片的请求, 依次 将所述媒体文件的各个分片返回给所述客户端。
PCT/CN2013/084384 2012-12-13 2013-09-27 下载并播放媒体文件的方法、系统、客户端、服务器及存储介质 WO2014090015A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US14/736,122 US9871843B2 (en) 2012-12-13 2015-06-10 Method and system for downloading and playing media file, client, server, and storage medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201210538686.0A CN103873926B (zh) 2012-12-13 2012-12-13 下载并播放媒体文件的方法及系统
CN201210538686.0 2012-12-13

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US14/736,122 Continuation US9871843B2 (en) 2012-12-13 2015-06-10 Method and system for downloading and playing media file, client, server, and storage medium

Publications (1)

Publication Number Publication Date
WO2014090015A1 true WO2014090015A1 (zh) 2014-06-19

Family

ID=50911992

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/084384 WO2014090015A1 (zh) 2012-12-13 2013-09-27 下载并播放媒体文件的方法、系统、客户端、服务器及存储介质

Country Status (3)

Country Link
US (1) US9871843B2 (zh)
CN (1) CN103873926B (zh)
WO (1) WO2014090015A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110290186A (zh) * 2016-12-20 2019-09-27 北京并行科技股份有限公司 一种适用于多超算中心文件传输的系统及方法

Families Citing this family (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6357813B2 (ja) * 2014-03-12 2018-07-18 富士通株式会社 配信方法、リソース取得方法、配信サーバ、及び端末装置
CN104066015B (zh) * 2014-07-04 2017-06-23 三星电子(中国)研发中心 移动终端的流媒体播放方法及装置
CN106937180A (zh) * 2015-12-31 2017-07-07 幸福在线(北京)网络技术有限公司 一种虚拟现实视频的播放方法及装置
GB2549323B (en) * 2016-04-15 2022-06-15 Grass Valley Ltd Methods of distributing media files, and file distribution systems for distributing media files
CN106231440A (zh) * 2016-07-22 2016-12-14 华为技术有限公司 一种流媒体文件分片下载方法、装置及终端
CN106303563B (zh) * 2016-08-19 2020-04-14 腾讯科技(深圳)有限公司 流媒体在线播放方法、装置、执行终端以及存储介质
CN106791988B (zh) * 2016-11-23 2020-05-26 海信视像科技股份有限公司 多媒体数据轮播方法和终端
CN106777171B (zh) * 2016-12-22 2020-11-03 北京小度互娱科技有限公司 用于输出分片媒体文件的方法和装置
CN108495190B (zh) * 2018-01-29 2021-08-20 北京奇艺世纪科技有限公司 一种在线视频的点播控制方法和装置
CN110855748B (zh) * 2019-10-21 2022-04-12 中国电子科技集团公司第二十九研究所 基于ftp的遥感影像数据自动规范化处理方法、装置及介质
CN110730376A (zh) * 2019-10-24 2020-01-24 上海二三四五网络科技有限公司 一种通过接口代理实现视频预加载的控制方法及装置
CN113067858A (zh) * 2021-03-15 2021-07-02 大众问问(北京)信息科技有限公司 一种车机中通用媒体服务的提供方法、装置及设备
CN114422831B (zh) * 2022-01-20 2024-03-19 北京奇艺世纪科技有限公司 媒体播放方法及装置、电子设备和可读存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1829309A (zh) * 2005-02-28 2006-09-06 英保达股份有限公司 快速开启已中断数字化影片的方法
CN101325720A (zh) * 2008-07-24 2008-12-17 中兴通讯股份有限公司 一种数据容错终端及方法
CN101997890A (zh) * 2009-08-28 2011-03-30 中国移动通信集团公司 一种p2p流媒体下载方法、系统及装置
WO2012009135A1 (en) * 2010-06-28 2012-01-19 Hulu Llc Method and apparatus for providing streaming media programs and targeted advertisements compatibly with http live streaming

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020156912A1 (en) * 2001-02-15 2002-10-24 Hurst John T. Programming content distribution
CN100556129C (zh) * 2006-08-22 2009-10-28 腾讯科技(深圳)有限公司 一种对等连接流媒体直播系统和装置
US20100169303A1 (en) * 2008-12-31 2010-07-01 David Biderman Playlists for real-time or near real-time streaming
US9137278B2 (en) * 2010-04-08 2015-09-15 Vasona Networks Inc. Managing streaming bandwidth for multiple clients
US9721254B2 (en) * 2010-06-28 2017-08-01 Hulu, LLC Method and apparatus for providing streaming media programs and targeted advertisements using multiple advertisement version segments
US20120297430A1 (en) * 2011-05-20 2012-11-22 Marcin Morgos Central controller to manage network resources across a group of playback devices to control streaming video quality across the group of playback devices
GB2492538B (en) * 2011-06-30 2014-06-04 Nds Ltd Distributing audio video content
CN103650451B (zh) * 2011-07-07 2016-10-19 瑞典爱立信有限公司 网络容量优化的自适应http流播
US9253233B2 (en) * 2011-08-31 2016-02-02 Qualcomm Incorporated Switch signaling methods providing improved switching between representations for adaptive HTTP streaming
WO2013058684A1 (en) * 2011-10-17 2013-04-25 Telefonaktiebolaget L M Ericsson (Publ) Method for adaptive streaming, local storing and post-storing quality increase of a content file
CN104471955B (zh) * 2012-07-05 2017-08-11 谷歌科技控股有限责任公司 将视频内容提供到多个媒体装置的方法以及服务器

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1829309A (zh) * 2005-02-28 2006-09-06 英保达股份有限公司 快速开启已中断数字化影片的方法
CN101325720A (zh) * 2008-07-24 2008-12-17 中兴通讯股份有限公司 一种数据容错终端及方法
CN101997890A (zh) * 2009-08-28 2011-03-30 中国移动通信集团公司 一种p2p流媒体下载方法、系统及装置
WO2012009135A1 (en) * 2010-06-28 2012-01-19 Hulu Llc Method and apparatus for providing streaming media programs and targeted advertisements compatibly with http live streaming

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110290186A (zh) * 2016-12-20 2019-09-27 北京并行科技股份有限公司 一种适用于多超算中心文件传输的系统及方法
CN110290186B (zh) * 2016-12-20 2021-09-07 北京并行科技股份有限公司 一种适用于多超算中心文件传输的系统及方法

Also Published As

Publication number Publication date
US20150281308A1 (en) 2015-10-01
CN103873926A (zh) 2014-06-18
CN103873926B (zh) 2017-03-22
US9871843B2 (en) 2018-01-16

Similar Documents

Publication Publication Date Title
WO2014090015A1 (zh) 下载并播放媒体文件的方法、系统、客户端、服务器及存储介质
AU2003230315B2 (en) System and method for synchronous reproduction of local and remote content in a communication network
US20170034263A1 (en) Synchronized Playback of Streamed Audio Content by Multiple Internet-Capable Portable Devices
JP5161342B2 (ja) データ記憶装置を管理するためのメカニズム及び方法
TWI233046B (en) System and method for reproducing information stored on a data recording medium in an interactive networked environment
JP2008160581A5 (zh)
WO2017140786A1 (en) System and method for client-initiated playlist shuffle in a media content environment
WO2009033345A1 (fr) Procédé pour télécharger et lire simultanément des supports en flux de transfert hypertexte
JP2009277338A (ja) メディアファイルの自動選択
TWI448125B (zh) 多媒體檔案分享方法及系統
WO2015169172A1 (zh) 网络视频播放的方法和装置
JP2009543439A (ja) パフォーマンス意識のあるピアツーピアのコンテンツオンデマンド・サービスのための対話的再生装置のサポート
CN105323597B (zh) Mp4文件播放方法、处理方法和装置以及播放系统
WO2017113717A1 (zh) 视频播放方法、视频播放器及电子装置
WO2014048198A1 (zh) 倍速播放方法、装置及系统
WO2014059942A1 (zh) 网络应用平台系统及网络应用平台的接入方法
CN107896334A (zh) 进行直播的方法和装置
CN110198494A (zh) 一种视频播放方法、装置、设备和存储介质
WO2022001445A1 (zh) 视频推送、播放方法、装置、系统及存储介质
CN106407353B (zh) 一种播放动画的方法和装置
WO2017080152A1 (zh) 一种同步数据的方法和装置
US9348903B2 (en) Methods, devices and computer readable mediums for a music recognition game
KR20150005576A (ko) 컨텐츠 다운로드를 위한 시스템 및 방법
CN107484040A (zh) 一种实现网络加速的方法
US20110113338A1 (en) Information output apparatus and method and program

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 13862957

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 23.10.2015)

122 Ep: pct application non-entry in european phase

Ref document number: 13862957

Country of ref document: EP

Kind code of ref document: A1