Method, apparatus, and system for synchronizing media playback
By obtaining and sending the index files and sharding information of the media, the synchronization problem at the beginning of the video is solved, ensuring that the content of multiple terminals is consistent when broadcasting, and improving the user experience.
Patent Information
- Application Number
- PCT/CN2024/079459
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-06-15
- Filing Date
- 2024-02-29
- Publication Date
- 2024-12-19
AI Technical Summary
The existing synchronous viewing technology cannot ensure the synchronization of multiple terminals when the video starts to play, resulting in poor user experience.
By obtaining the index file and shard information of the media, the start-up instructions are determined and sent to other terminal devices to enable them to start-up synchronously at the start of the video.
It realizes the synchronous start of videos by multiple terminals, improving the user's synchronous viewing or listening media experience.
Smart Images

Figure CN2024079459_19122024_PF_FP_ABST
Abstract
Description
Method, device and system for synchronous media playback
[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on June 15, 2023, with application number 202310714713.3 and application name “A method, device and system for synchronous playback of media”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The embodiments of the present application relate to the field of multimedia technology, and more particularly to a method, device, and system for synchronously playing media. Background Art
[0003] With the growth of bandwidth and improvements in hardware performance, multiple users can now watch the same video or listen to the same audio on their own devices, for example, watching a football game or a movie together, achieving a similar experience to watching or listening together in real life. This simultaneous viewing of the same video is called cloud viewing or synchronized viewing. The following uses synchronized viewing as an example to describe this.
[0004] In order to ensure that users participating in synchronized viewing have a high-quality viewing experience, it is necessary to synchronize the video content viewed by different users as much as possible during the movie playback process. The existing technical solutions for synchronized viewing are that after the movie starts playing, the party initiating the synchronized viewing (called the master) sends its current playback progress information to the party invited to participate in the synchronized viewing (called the controlled party). Then, if the controlled party determines that synchronization adjustment is needed, it adjusts the playback progress of the video content played by the controlled party to keep it synchronized with the video content played by the master.
[0005] Existing methods for synchronously playing media cannot solve the synchronization problem at the beginning of playing (i.e., when starting to play). In other words, there is still a problem of being out of sync at the beginning of playing, and the asynchronous playing content at the beginning of playing will make the user experience poor.
[0006] Summary of the Invention
[0007] The embodiments of the present application provide a method, device, and system for synchronous media playback, which can ensure synchronous playback on multiple terminals, thereby improving the user experience of synchronously watching or listening to media.
[0008] To achieve the above objectives, the present invention adopts the following technical solutions:
[0009] In the first aspect, an embodiment of the present application provides a method for synchronously playing media, the method comprising: a first terminal device obtaining a first media index file and second fragment information of the media, the first media index file being obtained by the first terminal device from a first index file server, and the second fragment information being fragment information in a second media index file of the media obtained by the second terminal device from a second index file server; and the first terminal device determining, based on the first media index file and the second fragment information, start indication information, the start indication information being used to indicate the media content to be played starting when playing the media; and then the first terminal device sending the start indication information to the second terminal device, so that the second terminal device starts playing the media according to the start indication information. In this method, the first terminal device can indicate the media content to be played starting to the second terminal device through the start indication information, thereby ensuring that the first terminal device and the second terminal device start playing the same media content when playing the media synchronously, and ensuring that multiple terminals start playing synchronously, thereby improving the user's experience of synchronously watching or listening to media.
[0010] In one possible implementation, the method for synchronous media playback provided in an embodiment of the present application further includes: the first terminal device playing the media according to the start indication information. Because both the first terminal device and the second terminal device play the same media according to the start indication information, this ensures that the first and second terminal devices start playing the same media content when playing the media synchronously, ensuring synchronous playback on multiple terminals, thereby improving the user's experience of synchronously viewing or listening to the media.
[0011] In one possible implementation, the second segment information is the second serial number of the latest media segment in the second media index file, and the start indication information includes the third serial number of the media segment where the media content to be played is located, and the third serial number is less than or equal to the first serial number, and less than or equal to the second serial number, and the first serial number is the serial number of the latest segment of the first media index file. Then the above-mentioned first terminal device plays the media according to the start indication information specifically including: the first terminal device starts playing from the media segment with the third serial number according to the serial number of the media segment downloaded from the first media server corresponding to the first index file server. The start indication information indicates the serial number of the media segment, so that the first terminal device can directly determine the media segment to be played starting from the serial number, and can quickly and efficiently obtain the media segment.
[0012] In one possible implementation, the second segment information is the second start timestamp of the latest media segment in the second media index file, and the start indication information includes a third start timestamp of the media segment containing the media content to be played, the third start timestamp being no later than the first start timestamp and no later than the second start timestamp, and the first start timestamp being the start timestamp of the latest segment in the first media index file; or, the start indication information includes a first offset of the start timestamp of the media content to be played relative to the start timestamp of the media, the first offset being less than or equal to the offset of the first start timestamp relative to the start timestamp of the media, and less than or equal to the offset of the second start timestamp relative to the start timestamp of the media. The first terminal device then determines the fourth sequence number based on the third start timestamp or the first offset, and starts playing the media segment with the fourth sequence number based on the sequence numbers of the media segments downloaded from the first index file server corresponding to the first media server.
[0013] In a possible implementation, the second segment information is segment information of the media segment indicated in the second media index file. The start indication information includes first start indication information and second start indication information.
[0014] Among them, the first start indication information includes the serial number of the first target media segment where the media content to be played is located and the second offset of the start time of the media content to be played relative to the start time of the first target media segment. The first target media segment is one of the media segments indicated by the first media index file. Then, the first terminal device plays the media according to the start indication information specifically including: the first terminal device downloads the first target media segment from the first media server, and starts playing from the first media content in the first target media segment. The first media content is the media content corresponding to the fourth timestamp indicated by the second offset.
[0015] In one possible implementation, the second fragment information is the fragment information of the media fragment indicated in the second media index file, and the start indication information includes a fourth offset of the start time of the media content to be played back relative to the start time of the media, and the fourth offset is less than or equal to the offset of the start timestamp of the first target media fragment relative to the start timestamp of the media, and less than or equal to the offset of the start timestamp of the second target media fragment relative to the start timestamp of the media. Then, the first terminal device plays the media according to the start indication information specifically including: the first terminal device determines the fifth serial number according to the fourth offset, and starts playing the second media content in the media fragment with the fifth serial number according to the serial number of the media fragment downloaded by the first media server, where the second media content is the media content corresponding to the fifth timestamp indicated by the fourth offset.
[0016] In summary, the content of the start indication information is diverse, for example, it can be the serial number of the above-mentioned media segment, the start timestamp of the media segment, or a related offset, and the user can flexibly select it according to actual needs.
[0017] In one possible implementation, the start indication information also includes start time information, which indicates the system time at which playback of the media content begins. The first terminal device then plays the media according to the start indication information, specifically by starting to play the downloaded media segment when the system time reaches the time indicated by the start time information. By configuring the system time at which the media content begins playback, the terminal device plays the media according to the configured system time, further ensuring synchronized playback across multiple terminals.
[0018] In one possible implementation, before the first terminal device obtains the first media index file and the second fragment information, the method for synchronously playing media provided in an embodiment of the present application also includes: the first terminal device sends a synchronous playback request to the second terminal device, and the synchronous playback request is used to request the second terminal device to play the media synchronously with the first terminal device.
[0019] In one possible implementation, the first terminal device obtaining the second media fragment information specifically includes: the first terminal device receiving the second media fragment information from the second terminal device. Alternatively, the first terminal device determines the second media fragment information based on the first media index file, location information of the first index file server, and location information of the second index file server.
[0020] In one possible implementation, the first terminal device determines the second fragment information based on the first media index file, the location information of the first index file server, and the location information of the second index file server. Specifically, the first terminal device determines the second fragment information based on the location information of the first index file server and the location information of the second index file server; and determines the second fragment information based on the first media index file and the delay between the first index file server and the second index file server. In this implementation, the second terminal device does not need to send the second fragment information to the first terminal device; the first terminal device determines the second fragment information independently, which can save the second terminal device's overhead.
[0021] In a second aspect, an embodiment of the present application provides a method for synchronously playing media, the method comprising: a second terminal device sends second fragment information of the media to a first terminal device, the second fragment information being fragment information in a second media index file of the media obtained by the second terminal device from a second index file server; and the second terminal device receives start indication information of the media from the first terminal device, the start indication information being used to indicate the media content to be played starting when playing the media, the start indication information being determined based on the first media index file and the second fragment information of the media, the first media index file being obtained by the first terminal device from the first index file server; and then the second terminal device plays the media according to the start indication information. In this method, the second terminal device plays the media according to the start indication information indicated by the first terminal device, so that the first terminal device and the second terminal device can ensure that the media content played starting when playing the media synchronously is the same, and can ensure that multiple terminals start playing synchronously, thereby improving the user's experience of synchronously watching or listening to media.
[0022] In one possible implementation, the second segment information is the second serial number of the latest media segment in the second media index file, and the start indication information includes the third serial number of the media segment where the media content to be played is located, and the third serial number is less than or equal to the first serial number and less than or equal to the second serial number, and the first serial number is the serial number of the latest segment of the first media index file. Then the above-mentioned second terminal device plays the media according to the start indication information specifically including: the second terminal device starts playing from the media segment with the third serial number according to the serial number of the media segment downloaded from the second media server corresponding to the second index file server. The start indication information indicates the serial number of the media segment, so that the first terminal device can directly determine the media segment to be played starting from the serial number, and can quickly and efficiently obtain the media segment.
[0023] In one possible implementation, the second segment information is the second start timestamp of the latest media segment in the second media index file, and the start indication information includes the third start timestamp of the media segment where the media content to be played is located, and the third start timestamp is no later than the first start timestamp and no later than the second start timestamp, and the first start timestamp is the start timestamp of the latest segment in the first media index file; or, the start indication information includes the first offset of the start time of the media content to be played relative to the start time of the media, and the first offset is less than or equal to the offset of the first start timestamp relative to the start timestamp of the media, and less than or equal to the offset of the second start timestamp relative to the start timestamp of the media. Then the above-mentioned second terminal device plays the media according to the start indication information specifically including: the second terminal device determines the fourth sequence number according to the third start timestamp or the first offset, and starts playing from the media segment with the fourth sequence number according to the media segment sequence number downloaded from the second media server.
[0024] In one possible implementation, the second fragment information is fragment information of a media fragment indicated in a second media index file, and the start indication information includes the serial number of the second target media fragment containing the media content to be played initially and a third offset of the start time of the media content to be played initially relative to the start time of the second target media fragment, where the second target media fragment is one of the media fragments indicated in the second media index file. Then, the second terminal device playing the media according to the start indication information specifically includes: the second terminal device downloading the second target media fragment from the second media server and starting to play the third media content in the second target media fragment, where the third media content is the media content corresponding to the sixth timestamp indicated by the third offset.
[0025] In one possible implementation, the second fragment information is the fragment information of the media fragment indicated in the second media index file, and the start indication information includes a fourth offset of the start time of the media content to be played back relative to the start time of the media, and the fourth offset is less than or equal to the offset of the start timestamp of the first target media fragment relative to the start timestamp of the media, and less than or equal to the offset of the start timestamp of the second target media fragment relative to the start timestamp of the media. The first target media fragment is one of the media fragments indicated by the first media index file, and the media fragment is the media fragment where the media content to be played back is located. Then the second terminal device plays the media according to the start indication information specifically including: determining the sixth serial number according to the fourth offset, and starting to play the fourth media content in the media fragment with the sixth serial number according to the serial number of the media fragment downloaded by the second media server, where the fourth media content is the media content corresponding to the seventh timestamp indicated by the fourth offset.
[0026] In summary, the content of the start indication information is diverse, for example, it can be the serial number of the above-mentioned media segment, the start timestamp of the media segment, or a related offset, and the user can flexibly select it according to actual needs.
[0027] In one possible implementation, the start indication information also includes start time information, which indicates the system time at which playback of the media content begins. The second terminal device then plays the media according to the start indication information, specifically by starting playback of the downloaded media segment when the system time reaches the time indicated by the start time information. By configuring the system time at which the media content begins playback, the terminal device plays the media according to the configured system time, further ensuring synchronized playback of media across multiple terminals.
[0028] In one possible implementation, before the second terminal device sends the second fragment information of the media to the first terminal device, the method for synchronously playing media provided in an embodiment of the present application also includes: the second terminal device receives a synchronous playback request sent by the first terminal device, and the synchronous playback request is used to request the second terminal device to play the media synchronously with the first terminal device.
[0029] In a third aspect, an embodiment of the present application provides a terminal device, referred to as a first terminal device, comprising an acquisition module, a determination module, and a sending module. The acquisition module is configured to acquire a first media index file and second fragment information of a media, wherein the first media index file is acquired by the first terminal device from a first index file server, and the second fragment information is fragment information in a second media index file of the media acquired by the second terminal device from a second index file server; the determination module is configured to determine, based on the first media index file and the second fragment information, start indication information, wherein the start indication information is configured to indicate the media content to be started when playing the media; and the sending module is configured to send the start indication information to the second terminal device.
[0030] In a possible implementation, the first terminal device further includes a media output module, which is configured to play the media according to the start indication information.
[0031] In one possible implementation, the second fragment information is the second sequence number of the latest media fragment in the second media index file. The start indication information includes the third sequence number of the media fragment containing the media content to be played initially, where the third sequence number is less than or equal to the first sequence number and less than or equal to the second sequence number, and the first sequence number is the sequence number of the latest fragment in the first media index file. The media output module is specifically configured to start playing the media fragment with the third sequence number based on the sequence numbers of the media fragments downloaded from the first media server corresponding to the first index file server.
[0032] In one possible implementation, the second segment information is the second start timestamp of the latest media segment in the second media index file, and the start indication information includes the third start timestamp of the media segment where the media content to be played is located, and the third start timestamp is not later than the first start timestamp and is not later than the second start timestamp, and the first start timestamp is the start timestamp of the latest segment of the first media index file; or, the start indication information includes the first offset of the start timestamp of the media content to be played relative to the start timestamp of the media, and the first offset is less than or equal to the offset of the first start timestamp relative to the start timestamp of the media, and less than or equal to the offset of the second start timestamp relative to the start timestamp of the media. The above-mentioned acquisition module is also specifically used to determine the fourth serial number based on the third start timestamp or the first offset, and the media output module is specifically used to start playing from the media segment with the fourth serial number based on the serial number of the media segment downloaded from the first index file server corresponding to the first media server.
[0033] In a possible implementation, the second segment information is segment information of the media segment indicated in the second media index file, and the start indication information includes first start indication information and second start indication information.
[0034] The first start broadcast indication information includes a sequence number of a first target media segment containing the media content to be played initially and a second offset of the start time of the media content to be played initially relative to the start time of the first target media segment. The first target media segment is one of the media segments indicated by the first media index file. The acquisition module is further configured to download the first target media segment from the first media server. The media output module is specifically configured to start playing the first media content in the first target media segment. The first media content is the media content corresponding to the fourth timestamp indicated by the second offset.
[0035] In one possible implementation, the second fragment information is the fragment information of the media fragment indicated in the second media index file, and the start indication information includes a fourth offset of the start time of the media content to be played relative to the start time of the media, and the fourth offset is less than or equal to the offset of the start timestamp of the first target media fragment relative to the start timestamp of the media, and less than or equal to the offset of the start timestamp of the second target media fragment relative to the start timestamp of the media. The acquisition module is also used to determine the fifth sequence number based on the fourth offset, and the media output module is specifically used to start playing the second media content in the media fragment with the fifth sequence number based on the sequence number of the media fragment downloaded from the first media server; the second media content is the media content corresponding to the fifth timestamp indicated by the fourth offset.
[0036] In one possible implementation, the start indication information further includes start time information, which indicates the system time for starting to play the media content. The media output module is further configured to start playing the downloaded media segment when the system time reaches the time indicated by the start time information.
[0037] In a possible implementation, the sending module is further configured to send a synchronous play request to the second terminal device, where the synchronous play request is used to request the second terminal device to play the media synchronously with the first terminal device.
[0038] In a possible implementation, the first terminal device further includes a receiving module, which is configured to receive second fragment information of the media from the second terminal device.
[0039] In a possible implementation, the acquisition module is specifically configured to determine the second fragment information according to the first media index file, location information of the first index file server, and location information of the second index file server.
[0040] In one possible implementation, the acquisition module is specifically configured to determine the time delay between the first index file server and the second index file server based on the location information of the first index file server and the location information of the second index file server; and to determine the second fragment information based on the first media index file and the time delay between the first index file server and the second index file server.
[0041] In a fourth aspect, an embodiment of the present application provides a terminal device, wherein the second terminal device includes a sending module, a receiving module, and a media output module. The sending module is configured to send second fragment information of the media to the first terminal device, where the second fragment information is fragment information in a second media index file of the media obtained by the second terminal device from a second index file server; the receiving module is configured to receive start indication information of the media from the first terminal device, where the start indication information is used to indicate the media content to be played starting when playing the media, where the start indication information is determined based on the first media index file of the media and the second fragment information, where the first media index file is obtained by the first terminal device from the first index file server; and the media output module is configured to play the media according to the start indication information.
[0042] In one possible implementation, the first terminal device further includes an acquisition module. The second fragment information is the second serial number of the latest media fragment in the second media index file, and the start indication information includes the third serial number of the media fragment containing the media content to be played initially, wherein the third serial number is less than or equal to the first serial number and less than or equal to the second serial number, and the first serial number is the serial number of the latest fragment of the first media index file. The media output module is then specifically configured to start playing the media fragment with the third serial number according to the serial number of the media fragment downloaded from the second media server corresponding to the second index file server.
[0043] In one possible implementation, the second segment information is the second start timestamp of the latest media segment in the second media index file, and the start indication information includes a third start timestamp of the media segment containing the media content to be played, the third start timestamp being no later than the first start timestamp and no later than the second start timestamp, the first start timestamp being the start timestamp of the latest segment in the first media index file; or, the start indication information includes a first offset of the start time of the media content to be played relative to the start time of the media, the first offset being less than or equal to the offset of the first start timestamp relative to the start timestamp of the media, and less than or equal to the offset of the second start timestamp relative to the start timestamp of the media. Then, the acquisition module is used to determine the fourth sequence number based on the third start timestamp or the first offset, and start playing the media segment with the fourth sequence number based on the sequence numbers of the media segments downloaded from the second media server.
[0044] In one possible implementation, the second segment information is segment information of a media segment indicated in a second media index file. The start indication information includes the sequence number of the second target media segment containing the media content to be played initially and a third offset of the start time of the media content to be played initially relative to the start time of the second target media segment. The second target media segment is one of the media segments indicated in the second media index file. The acquisition module is then configured to download the second target media segment from the second media server. The media output module is specifically configured to start playing the third media content in the second target media segment. The third media content is the media content corresponding to the sixth timestamp indicated by the third offset.
[0045] In one possible implementation, the second fragment information is the fragment information of the media fragment indicated in the second media index file, and the start indication information includes a fourth offset of the start time of the media content to be played relative to the start time of the media. The fourth offset is less than or equal to the offset of the start timestamp of the first target media fragment relative to the start timestamp of the media, and less than or equal to the offset of the start timestamp of the second target media fragment relative to the start timestamp of the media. The first target media fragment is the media fragment containing the media content to be played initially in the first media index file. The acquisition module is used to determine the sixth sequence number based on the fourth offset, and the media output module is specifically used to start playing the fourth media content in the media fragment with the sixth sequence number based on the sequence number of the media fragment downloaded from the second media server. The fourth media content is the media content corresponding to the seventh timestamp indicated by the fourth offset.
[0046] In one possible implementation, the start indication information further includes start time information, which indicates the system time for starting to play the media content. The media output module is further configured to start playing the downloaded media segment when the system time reaches the time indicated by the start time information.
[0047] In a possible implementation, the receiving module is further configured to receive a synchronous playback request sent by the first terminal device, where the synchronous playback request is used to request the second terminal device to play the media synchronously with the first terminal device.
[0048] In a fifth aspect, an embodiment of the present application provides a terminal device comprising a memory and at least one processor connected to the memory, the memory being used to store computer program code, the computer program code comprising computer instructions, which, when executed by at least one processor, enables the terminal device to execute the method described in the first aspect and any one of its possible implementations, or to execute the method described in the second aspect and any one of its possible implementations.
[0049] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer instructions are stored. When the computer instructions are run on a computer, the method described in the first aspect and any one of its possible implementations is executed, or the method described in the second aspect and any one of its possible implementations is executed.
[0050] In the seventh aspect, an embodiment of the present application provides a computer program product, which includes computer instructions. When the computer instructions are run on a computer, the method described in the first aspect and any one of its possible implementations is executed, or the method described in the second aspect and any one of its possible implementations is executed.
[0051] In the eighth aspect, an embodiment of the present application provides a chip system, comprising: a processor for calling and running a computer program from a memory, so that a terminal device equipped with the chip system executes the method described in the first aspect and any one of its possible implementations, or executes the method described in the second aspect and any one of its possible implementations.
[0052] In a ninth aspect, an embodiment of the present application provides a communication system, comprising a first terminal device, a second terminal device, a first index file server, a second index file server, a first media server, and a second media server. The first terminal device is configured to execute the method of any one of the first aspect and its possible implementations, and the second terminal device is configured to execute the method of any one of the second aspect and its possible implementations.
[0053] It should be understood that the beneficial effects achieved by the technical solutions of the third to ninth aspects of this application and the corresponding possible implementation methods can be referred to the technical effects of the first aspect, the second aspect and their corresponding possible implementation methods mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] FIG1 is a schematic diagram of the architecture of a streaming media transmission system provided in an embodiment of the present application;
[0055] FIG2 is a schematic diagram of a media index file in the HLS transmission protocol provided in an embodiment of the present application;
[0056] FIG3 is a schematic diagram of a content distribution network provided in an embodiment of the present application;
[0057] FIG4 is a schematic diagram of the architecture of a system for synchronously playing media provided in an embodiment of the present application;
[0058] FIG5 is a schematic diagram of the hardware structure of a mobile phone provided in an embodiment of the present application;
[0059] FIG6 is a schematic diagram of a method for synchronously playing media provided in an embodiment of the present application;
[0060] FIG7 is a schematic diagram of the architecture of another system for synchronously playing media provided in an embodiment of the present application;
[0061] FIG8 is a second schematic diagram of a method for synchronously playing media provided in an embodiment of the present application;
[0062] FIG9 is a third schematic diagram of a method for synchronously playing media provided in an embodiment of the present application;
[0063] FIG10 is a fourth schematic diagram of a method for synchronously playing media provided in an embodiment of the present application;
[0064] FIG11 is a fifth schematic diagram of a method for synchronously playing media provided in an embodiment of the present application;
[0065] FIG12 is a schematic diagram of a structure of a first terminal device according to an embodiment of the present application;
[0066] FIG13 is a second structural diagram of a first terminal device provided in an embodiment of the present application;
[0067] FIG14 is a schematic diagram of a structure of a second terminal device according to an embodiment of the present application;
[0068] FIG15 is a second structural diagram of a second terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0069] The term "and / or" in this article is merely a description of the association relationship between associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.
[0070] The terms "first" and "second" and the like in the description and claims of the embodiments of the present application are used to distinguish different objects rather than to describe a specific order of objects.
[0071] In the embodiments of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of this application should not be interpreted as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.
[0072] In the description of the embodiments of the present application, unless otherwise specified, “plurality” means two or more.
[0073] First, some concepts and background knowledge involved in a method, device, and system for synchronous media playback provided in an embodiment of the present application are explained.
[0074] 1. Synchronous media playback
[0075] Synchronous media playback on multiple devices allows multiple people to simultaneously watch or listen to the same media (e.g., video, audio, etc.) across multiple devices and / or locations. This allows multiple users in different locations to simultaneously watch the same video or listen to the same audio on their respective devices. Synchronous viewing of multiple people simultaneously is called synchronized viewing, which creates a similar experience to watching a movie together in real life.
[0076] It should be noted that the media in the embodiments of the present application includes video and / or audio, which may also be called streaming media, video and audio stream, or other names, which are not limited here.
[0077] 2. HLS and DASH transport protocols
[0078] HTTP live streaming (HLS) and dynamic adaptive streaming over HTTP (DASH) are both streaming media network transmission protocols based on HTTP, where HTTP is a hypertext transfer protocol.
[0079] Referring to the architectural diagram of the streaming media transmission system shown in Figure 1, both the HLS transmission protocol and the DASH transmission protocol are applicable to the system. The system includes a server 101, a distribution component 102 and a client 103. The server 101 includes a media encoder and a stream segmenter.
[0080] Combined with Figure 1, the basic principles of media transmission based on HLS and DASH are:
[0081] The server 101 receives media (which can be a video stream or an audio stream) input from an audio / visual device (such as a microphone or a camera). The media encoder of the server 101 then encodes the streaming media into a format suitable for transmission by the distribution component 102 at different bit rates. The stream splitter then splits the encoded media stream into multiple small media files (which can be TS files or FMP4 files), also known as media fragments. The media files are sequentially sent to the server of the distribution component 102 for storage. Media files of different bit rates are used as backup media files for selection by the client 103. The size of the media fragments is determined by the configuration. For example, the time length of each fragment can be 2 seconds, 4 seconds, 6 seconds, etc.
[0082] Furthermore, the stream splitter creates an index file containing pointers to these small media files. For example, it writes the playback addresses (such as uniform resource locators (URLs)) of these media files in the playback order into an index file, and also stores this index file on the server of the distribution component 102. Optionally, the stream splitter can also encrypt each media file it generates and generate a corresponding key file, which is also stored on the server of the distribution component 102.
[0083] The distribution component 102 sends the index file of the media requested by the client 103 to the client 103 via HTTP. The client 103 then selects a media file with an appropriate bitrate from among alternative media files of different bitrates for the same media content based on its own bandwidth and performance limitations. The client then downloads the media file from the server of the distribution component 102 and plays it. Specifically, after selecting a media file with an appropriate bitrate based on the index file, the client 103 sends the URL of the media file to the distribution component 102, which then sends the media file corresponding to the URL to the client 103.
[0084] It should be understood that in the HLS transmission protocol, the index file of the multiple media files of the above-mentioned media is an m3u8 file, and in the DASH transmission protocol, the index file is an MPD file.
[0085] Among them, the media index file (i.e., m3u8 file) in the HLS transmission protocol is a hierarchical index file, including a primary index file and a secondary index file, wherein the primary index file is called the master index file (Master Playlist) and the secondary index file is the rate index file. Specifically, the master index file stores the address of the rate index file (Media Playlist), such as the URL of the rate index file, and each rate index file URL corresponds to a rate index file. The rate index file stores the address of each media file (or media fragment) of the media at a certain bit rate, such as the URL of the media fragment.
[0086] The media index file (i.e., MPD file) in the DASH transmission protocol stores the address of each media file at all bit rates, without the concept of hierarchy.
[0087] With reference to FIG2 , the following briefly introduces the usage principle of the media index file by taking the media index file (i.e., m3u8 file) in the HLS transmission protocol as an example.
[0088] After the client obtains the URL of the media's main index file, it obtains the main index file according to its URL, and then obtains the URL of the bitrate index file corresponding to a certain bitrate from the main index file according to actual needs. Then, based on the URL of the bitrate index file, it obtains the bitrate index file (including the URL of each media segment at that bitrate), and then obtains the URL of the video segment from the bitrate index file. Then, it downloads and plays the video segment according to the URL of the video segment.
[0089] 3. Content delivery network (CDN)
[0090] The distribution component in Figure 1 above can be CDN. CDN is a virtual network built on the existing network using CDN technology. The core point of CDN is to cache resources (such as data) on each CDN node of CDN. When users access, they can obtain the required resources nearby through the CDN node they access. In this way, network congestion can be reduced and the response speed and hit rate of user access can be improved.
[0091] A multi-level CDN can be built within a management domain (or business management domain), such as a two-level CDN or a three-level CDN.
[0092] The embodiment of the present application is introduced by taking a three-level CDN as an example. As shown in FIG3 , a three-level CDN divides the management domain into three layers according to location, namely, a CDN center layer, a CDN regional layer, and a CDN edge layer. The CDN center layer includes a central node, the CDN regional layer includes one or more regional nodes, and the CDN edge layer includes one or more edge nodes.
[0093] In an embodiment of the present application, CDN nodes within a specified range of an area can be uniformly managed, and the uniformly managed area can be understood as a business management domain. Usually, a province is regarded as a business management domain. For example, in one implementation method, the CDN center layer corresponds to a prefecture-level city in a province, the CDN regional layer corresponds to the urban area other than the prefecture-level city, and the CDN edge layer corresponds to the county. Generally speaking, for the same business, the central node in the business management domain segments the media and sends it to the next level node. Therefore, the size of the media segments at different levels in the same business management domain is the same. However, the central nodes in different business management domains may have different sizes for media segments.
[0094] Optionally, each node in the CDN (also referred to as a CDN node) may be implemented by one or more servers.
[0095] In CDN, the central node has functions such as load balancing, content distribution, and scheduling. In conjunction with Figure 3, in an embodiment of the present application, the central node continuously obtains media from the content provider, and the server in the central node encodes the media according to different bit rates and divides it into media segments (the server of the central node performs the function of the server in Figure 1 above), saves the media segments in the central node, and continuously adds the address of the media segment to the bit rate index file corresponding to the media segment to update the bit rate index file. In addition, the central node also sends the media segment to the regional node of the next layer. Similarly, the regional node also stores the media segment and updates the bit rate index file in the regional node; thereafter, the regional node sends the media segment to the edge node of the next layer, and the regional node stores the media segment and updates the bit rate index file in the regional node.
[0096] Optionally, different servers in the CDN have different functions. For example, each CDN node includes an index file server and a media server, wherein the index file service area is used to store the above-mentioned media index files (including the main index file and the bitrate index file, i.e., the m3u8 file, or the MPD file), and the media server is used to store the media files of the media.
[0097] In the scenario of synchronized viewing, when multiple clients (i.e., multiple terminal devices) play media in sync, the user's viewing experience is better. Existing synchronized viewing technology solutions all adjust the progress of multiple clients to the same level after the media starts playing, that is, during the media playback process, to ensure synchronization.
[0098] In the existing technology, a synchronization group including a master terminal (the party that initiates synchronized viewing) and a controlled terminal (the party invited to participate in synchronized viewing) can be established through a synchronization server. The synchronization server receives the playback progress information (timestamp of the media content) reported by the master terminal and the playback progress information reported by the controlled terminal in real time, and then calculates the error in the playback progress between the controlled terminal and the master terminal. If the error exceeds a preset threshold, the synchronization server notifies the controlled terminal to adjust the playback progress so that the progress of the controlled terminal is consistent with the progress of the media content played by the master terminal, thereby achieving synchronization.
[0099] The above method is a method for synchronizing media content during synchronized movie watching, which can only solve the problem of asynchronization during synchronized movie watching. However, there is still the problem of inconsistent media content being played during synchronized movie watching.
[0100] Specifically, in combination with the above content, referring to Figure 3 above, if the duration of each media segment is 2 seconds, the central node saves the media segment and synchronously updates its bitrate index file 1. The regional node server located in the regional layer periodically (usually 1-2 seconds) obtains bitrate index file 1 from the central node. If it is determined that bitrate index file 1 has been updated, it obtains the new media segment from the central node according to the newly added address and saves it, and simultaneously updates its bitrate index file 2. The edge node located in the edge area periodically (usually 1-2 seconds) obtains bitrate index file 2 from the regional node. If it is determined that bitrate index file 2 has been updated, it obtains the new media segment from the regional node according to the newly added address and saves it, and simultaneously updates its bitrate index file 3.
[0101] It should be understood that there is a certain amount of latency between CDN nodes at different tiers. For example, regional nodes have a 2-3 second latency compared to central nodes, and edge nodes also have a 2-3 second latency compared to regional nodes. Therefore, when clients access CDNs at different tiers, they will receive different bitrate index files, and thus different media segments. For example, taking the example of a 2-second delay between CDN nodes, at a certain moment, the central node has saved 5 media fragments (such as fragment 1, fragment 2, fragment 3, fragment 4, and fragment 5), the regional node may only save 4 media fragments (such as fragment 1, fragment 2, fragment 3, and fragment 4), and the edge node may only save 3 media fragments (such as fragment 1, fragment 2, and fragment 3). Then, the client accessing the central node can obtain 5 media fragments, and the bitrate index file includes the addresses of the 5 media fragments. The client accessing the regional node can obtain 4 media fragments, and the bitrate index file includes the addresses of the 4 media fragments. The client accessing the edge node can obtain 3 media fragments, and the bitrate index file includes the addresses of the 3 media fragments.
[0102] As an example, when a client starts to access a live broadcast service, after the client obtains the bitrate index file from the index file server in the CDN node it accesses, in order to ensure the continuity of media playback, the client usually starts from the media segment indicated by the third-to-last or fourth-to-last address in the bitrate index file, downloads the media segment from the media server of the CDN node and plays it. Taking the download starting from the third-to-last media segment as an example, for example, at the same time, the client accessing the central node starts downloading from media segment No. 3 (3 is the serial number of the media segment), the client accessing the regional node starts downloading from media segment No. 2, and the client accessing the edge node starts downloading from media segment No. 1.
[0103] Based on the above content, in the scenario of synchronous movie watching, when the CDN nodes accessed by each client participating in the synchronous movie watching are located in different CDN layers, each client starts playing different media segments. Continuing with the above example, the media segment started by the client accessing the central node is media segment 3, and the media segment started by the client accessing the edge node is media segment 1, a difference of 2 media segments. The size of the media segment is 2 seconds. It can be seen that the media content started by the client accessing the central node and the client accessing the edge node differs by 4 seconds. When the duration of the media segment is longer, the difference in the multimedia content started is even greater. As a result, the pictures viewed at the start of the broadcast are different, affecting the user experience.
[0104] In summary, in the scenario of synchronous viewing, ensuring that all terminal devices participating in the synchronous viewing are synchronized when starting the broadcast is an urgent problem to be solved.
[0105] In response to the above problems, the embodiments of the present application propose a method, device and system for synchronous playback of media, in which the main control party participating in synchronous viewing (referred to as the first terminal device) obtains the first media index file of the media from the index file server of the first CDN node to which the first terminal device is connected, and obtains the fragment information (referred to as the second fragment information) in the second media index file of the media obtained by the second terminal device from the index file server of the second CDN node to which it is connected; then the first terminal device determines the start indication information based on the first media index file and the second fragment information, and the start indication information is used to indicate the media content to be played when playing the media; then the first terminal device sends the start indication information to the second terminal device, so that the second terminal device starts playing the media according to the start indication information. In this method, the first terminal device can indicate the media content to be played to the second terminal device through the start indication information, so that the first terminal device and the second terminal device can ensure that the media content to be played is the same when playing the media synchronously, that is, the method can ensure the synchronous start of multiple terminals, thereby improving the user's experience of watching or listening to media synchronously.
[0106] Figure 4 is a schematic diagram of the architecture of a system for synchronous media playback provided by an embodiment of the present application, the system including multiple terminal devices (such as a first terminal device 401 and a second terminal device 402), a first CDN node 403 (including a first index file server and a first media server), a second CDN node 404 (including a second index file server and a second media server), a server 405 and a content provider 406. Optionally, the index file server and the media server in the first CDN node 403 and the second CDN node 404 can be separately or jointly provided. The index file server user generates, saves and distributes index files (such as MPD files, m3u8 files), and the index file server can also be referred to as an index file distribution function. The media server is used to distribute media fragments, which can also be referred to as a fragment distribution function.
[0107] The content provider 406 is used to provide media (such as video stream) to the server 405. The server 405 includes multiple media resources. Optionally, the server 405 can be an Internet Protocol Television (IPTV) platform.
[0108] First CDN node 403 is the CDN node accessed by first terminal device 401, and second CDN node 404 is the CDN node accessed by second terminal device 402. First CDN node 403 and second CDN node 404 can be CDN nodes in the same administrative domain or in different administrative domains. When first CDN node 403 and second CDN node 404 are CDN nodes in the same administrative domain, the first CDN node and second CDN node can be CDN nodes at the same level or at different levels, which is not limited in this embodiment of the present application.
[0109] If the server 405 is an IPTV platform, the first terminal device 401 and the second terminal device 402 are terminal devices that run IPTV applications (such as IPTV App), for example, set-top boxes, mobile phones (mobile phones have IPTV SDK), etc. For example, the first terminal device 401 in Figure 1 is a set-top box, and the second terminal device 402 is a mobile phone. It is understandable that after the set-top box is started, a menu combining graphics and text, i.e., an electronic program guide (EPG) can be displayed on the TV screen connected to the set-top box, through which users can quickly select the media programs they need to watch. Similarly, after the mobile phone starts the IPTV application, the mobile phone interface can also display the EPG for the user to select media programs.
[0110] Before synchronously playing the media, the first terminal device 401 and the second terminal device 402 need to authenticate with the server 405 (such as an IPTV platform) respectively, thereby establishing a communication connection with the server 405 (see the dotted line in Figure 4).
[0111] Based on the architecture of Figure 4, in one implementation, the first terminal device 401 can initiate synchronous media playback (for example, synchronous movie watching) to the second terminal device 402, and then execute the method for synchronous media playback provided in the embodiment of the present application, so that the first terminal device 401 and the second terminal device 402 can achieve synchronous start and play when synchronously watching movies or synchronously listening to audio.
[0112] It should be noted that a communication connection needs to be established between the first terminal device 401 and the second terminal device 402. Optionally, the communication connection is a communication connection established between the first terminal device 401 and the second terminal device 402 before the first terminal device 401 decides to initiate synchronous media playback, such as real-time communications (RTC). Alternatively, the communication connection is an instant messaging connection established between the first terminal device 401 and the second terminal device 402 after the first terminal device 401 decides to initiate synchronous media playback. FIG4 does not show the communication connection between the first terminal device 401 and the second terminal device 402.
[0113] It should be understood that the server 405, the first CDN node 403, and the second CDN node 404 communicate with the first terminal device 401 and the second terminal device 402 respectively through the bearer network.
[0114] Optionally, the first terminal device 401 and the second terminal device 402 may be a set-top box, a mobile phone, a tablet computer, or a personal computer (Ultra-mobile Personal Computer, UMPC), etc. Alternatively, they may be other desktop devices, laptop devices, handheld devices, wearable devices, smart home devices, and vehicle-mounted devices, such as netbooks, smart watches, smart cameras, netbooks, personal digital assistants (Personal Digital Assistant, PDA), portable multimedia players (Portable Multimedia Player, PMP), dedicated media players, or AR (augmented reality) / VR (virtual reality) devices, etc. The embodiments of the present application do not limit the specific type and structure of the terminal devices.
[0115] Taking a mobile phone as an example, FIG5 is a schematic diagram of the hardware structure of a mobile phone 500 provided in an embodiment of the present application. The mobile phone 500 includes a processor 510, an external memory interface 520, an internal memory 521, a universal serial bus (USB) interface 530, a charging management module 540, a power management module 541, a battery 542, an antenna 1, an antenna 2, a mobile communication module 550, a wireless communication module 560, an audio module 570, a speaker 570A, a receiver 570B, a microphone 570C, an earphone interface 570D, a sensor module 580, a button 590, a motor 591, an indicator 592, a camera 593, a display 594, and a subscriber identification module (SIM) card interface 595. The sensor module 580 may include a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor 280L, a bone conduction sensor, etc.
[0116] It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the mobile phone 500. In other embodiments of the present application, the mobile phone 500 may include more or fewer components than shown, or may combine or separate certain components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0117] The processor 510 may include one or more processing units. For example, the processor 510 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). Different processing units may be independent devices or integrated into one or more processors.
[0118] The controller may be the nerve center and command center of the mobile phone 500. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
[0119] Processor 510 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 510 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 510. If processor 510 needs to use the same instruction or data again, it can directly access it from the memory. This avoids duplicate accesses, reduces processor 510 latency, and thus improves system efficiency.
[0120] In some embodiments, the processor 510 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface.
[0121] It is understood that the interface connection relationship between the modules illustrated in the embodiment of the present application is merely an illustrative illustration and does not constitute a structural limitation on the mobile phone 500. In other embodiments of the present application, the mobile phone 500 may also adopt a different interface connection method from the above embodiment, or a combination of multiple interface connection methods.
[0122] The charging management module 540 is configured to receive charging input from a charger. While charging the battery 542 , the charging management module 540 can also power the electronic device through the power management module 541 .
[0123] The power management module 541 is used to connect the battery 542, the charging management module 540, and the processor 510. The power management module 541 receives input from the battery 542 and / or the charging management module 540 to provide power to the processor 510, the internal memory 521, the external memory, the display 594, the camera 593, and the wireless communication module 560.
[0124] The wireless communication function of the mobile phone 500 can be implemented through the antenna 1, the antenna 2, the mobile communication module 550, the wireless communication module 560, the modem processor and the baseband processor.
[0125] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals.
[0126] The mobile communication module 550 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the mobile phone 500. The mobile communication module 550 can include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc.
[0127] The wireless communication module 560 can provide wireless communication solutions for application on the mobile phone 500, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication technology (NFC), infrared technology (IR), etc.
[0128] In some embodiments, antenna 1 of mobile phone 500 is coupled to mobile communication module 550 , and antenna 2 is coupled to wireless communication module 560 , so that mobile phone 500 can communicate with the network and other devices through wireless communication technology.
[0129] Mobile phone 500 implements display functions through a GPU, display screen 594, and an application processor. The GPU is a microprocessor for image processing that connects display screen 594 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 510 may include one or more GPUs that execute program instructions to generate or modify display information.
[0130] Display screen 594 is used to display images, videos, etc. Display screen 594 includes a display panel. In some embodiments, mobile phone 500 may include 1 or N display screens 594, where N is a positive integer greater than 1.
[0131] The mobile phone 500 can realize the shooting function through the ISP, the camera 593, the video codec, the GPU, the display 594 and the application processor.
[0132] The ISP processes data fed back by the camera 593. For example, when taking a photo, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, which is then passed to the ISP for processing and converted into a visible image. The ISP can also perform algorithmic optimization on image noise, brightness, and skin tone. The ISP can also optimize parameters such as exposure and color temperature of the captured scene. In some embodiments, the ISP can be located within the camera 593.
[0133] The camera 593 is used to capture still images or videos. In some embodiments, the mobile phone 500 may include 1 or N cameras 593, where N is a positive integer greater than 1.
[0134] DSP is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals (such as audio signals, etc.).
[0135] Video codecs are used to compress or decompress digital video. Mobile phone 500 may support one or more video codecs. This allows mobile phone 500 to play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, and MPEG4.
[0136] NPU is a neural-network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn.
[0137] The external memory interface 520 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the mobile phone 500. The external memory card communicates with the processor 510 via the external memory interface 520 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.
[0138] The internal memory 521 can be used to store computer executable program codes, which include instructions. The processor 510 executes various functional applications and data processing of the mobile phone 500 by running the instructions stored in the internal memory 521. The internal memory 521 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area can store data created during the use of the mobile phone 500 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 521 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0139] The mobile phone 500 can implement audio functions such as music playback and recording through the audio module 570, speaker 570A, receiver 570B, microphone 570C, headphone jack 570D, and application processor.
[0140] The audio module 570 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 570 can also be used to encode and decode audio signals. In some embodiments, the audio module 570 can be provided in the processor 510, or some functional modules of the audio module 570 can be provided in the processor 510.
[0141] The speaker 570A, also called a "horn," is used to convert audio electrical signals into sound signals. The mobile phone 500 can listen to music or make hands-free calls through the speaker 570A.
[0142] The receiver 570B, also called the "earpiece", is used to convert the audio electrical signal into a sound signal. When the mobile phone 500 receives a call or a voice message, the voice can be heard by placing the receiver 570B close to the ear.
[0143] Microphone 570C, also known as a "microphone" or "speaker," is used to convert sound signals into electrical signals. When making a call or sending a voice message, a user can speak by placing their mouth close to microphone 570C to input the sound signal into microphone 570C.
[0144] The headphone jack 570D is used to connect wired headphones.
[0145] Keys 590 include a power button, a volume button, etc. Keys 590 may be mechanical keys or touch keys. Mobile phone 500 may receive key inputs and generate key signal inputs related to user settings and function control of mobile phone 500.
[0146] Motor 591 can generate vibration prompts. Motor 591 can be used for incoming call vibration prompts and can also be used for touch vibration feedback.
[0147] Indicator 592 can be an indicator light, which can be used to indicate charging status, power changes, messages, missed calls, notifications, etc.
[0148] SIM card interface 595 is used to connect a SIM card. A SIM card can be connected to or disconnected from mobile phone 500 by inserting or removing it from SIM card interface 595. Mobile phone 500 may support one or N SIM card interfaces, where N is a positive integer greater than one.
[0149] It is understood that in the embodiments of the present application, the mobile phone 500 can perform some or all of the steps in the embodiments of the present application. These steps or operations are merely examples, and the mobile phone 500 can also perform other operations or variations of various operations. In addition, the various steps can be performed in a different order than those presented in the embodiments of the present application, and it is possible that not all operations in the embodiments of the present application need to be performed. The various embodiments of the present application can be implemented individually or in any combination, and the present application is not limited thereto.
[0150] Based on the above, the method for synchronous media playback provided by an embodiment of the present application is described in detail below. As shown in FIG6 , taking the example of a first terminal device initiating synchronous media playback to a second terminal device, the method for synchronous media playback provided by an embodiment of the present application includes:
[0151] S601: A first terminal device sends a synchronous play request to a second terminal device. Correspondingly, the second terminal device receives the synchronous play request, where the synchronous play request is used to request the second terminal device to play media synchronously with the first terminal device.
[0152] Optionally, the media played synchronously by the first terminal device and the second terminal device can be video or audio. That is, the user of the first terminal device can watch videos, such as movies, variety shows, sports games, news, etc., synchronously with the user of the second terminal device. The user of the first terminal device can also listen to audio, such as music or books, synchronously with the user of the second terminal device.
[0153] In an embodiment of the present application, when a first terminal device decides to initiate synchronous playback of media to a second terminal device, the first terminal device selects the media to be synchronously played and sends a synchronous playback request to the second terminal device. The synchronous playback request carries the address information of the media to be synchronously watched or listened to. For example, the synchronous playback request includes the URL of the media index file. In the HLS transmission protocol, the URL of the media index file is the URL of the main index file; in the DASH transmission protocol, the URL of the media index file is the URL of the MPD file.
[0154] S602: The first terminal device obtains a first media index file of the media from a first index file server.
[0155] It should be understood that the first index file server is located in the first CDN node accessed by the first terminal device. The first media index file is a media index file for the media stored in the first index file server. The first media index file includes media fragment information (which may be referred to as first fragment information), for example, URLs of media fragments at the first bitrate stored by sequence number. After the user selects a suitable bitrate (such as the first bitrate) on the first terminal device, the first index file server returns the media index file corresponding to the first bitrate to the first terminal device.
[0156] When the media transmission protocol is the HLS transmission protocol, the above-mentioned first media index file is the bit rate index file of the media; when the media transmission protocol is the DASH transmission protocol, the above-mentioned first media index file is the MPD file of the media.
[0157] S603: The second terminal device obtains a second media index file of the media from a second index file server. The second index file server is located in a second CDN node connected to the second terminal device.
[0158] S604: The first terminal device obtains second fragment information of the media.
[0159] It should be understood that the second fragment information is the fragment information in the second index file of the media obtained by the second terminal device from the second index file server, and the second media index file is the media index file of the media stored in the second index file server. Similarly, the second media index file includes the URL of the media fragment at the second bitrate.
[0160] The first bit rate and the second bit rate may be the same or different. The size of the media segments stored in the first CDN node may be the same or different from the size of the media segments stored in the second CDN node.
[0161] Optionally, the second fragment information may be any one of the following A1-A3:
[0162] A1, the second fragment information is the second serial number of the latest media fragment in the second media index file;
[0163] A2. The second fragment information is the second starting timestamp of the latest media fragment in the second media index file; or
[0164] A3. The second fragment information is the fragment information of the media fragment indicated in the second media index file.
[0165] It should be understood that the serial numbers of the media segments are sorted from small to large to indicate the order in which the media segments are played. For example, the serial number of the media segment played first is smaller than the serial number of the media segment played later. The start timestamp of the media segment indicates the time point at which the media segment starts playing in the entire media. For example, the start playing time point of the media is 00:00:00 (representing 0 hours, 0 minutes, 0 seconds), and the start playing time point of a media segment in the media is 00:00:10 (representing 0 hours, 0 minutes, 10 seconds).
[0166] In an embodiment of the present application, the manner in which the first terminal device obtains the second fragment information of the media includes the following manner 1 or manner 2.
[0167] Method 1: The first terminal device receives the second segment information of the media from the second terminal device.
[0168] In an embodiment of the present application, after the second terminal device receives the synchronous playback request sent by the first terminal device, the second terminal device requests the second media index file of the media from the second index file server. For example, after the user selects a suitable bitrate (such as the second bitrate) on the second terminal device, the second index file server returns the media index file corresponding to the second bitrate to the second terminal device. The second terminal device then sends the second fragment information (such as the sequence number of the latest fragment, the start timestamp of the latest fragment, or the second media index file) to the first terminal device based on the second media index file.
[0169] Method 2: The first terminal device determines the second fragment information according to the first media index file, the location information of the first CDN node or the first index file server, and the location information of the second CDN node or the second index file server.
[0170] In an embodiment of the present application, the second terminal device does not need to send the information of the media in the second index file server (such as a media index file, etc.) to the first terminal device. The first terminal device determines the second fragment information based on the first media index file obtained from the first index file server, the location information of the first CDN node or the first index file server to which the first terminal device is connected obtained from the server (such as an IPTV platform), and the location information of the second CDN node or the second index file server to which the second terminal device is connected. Among them, the location of the first CDN node is usually the same as the location of the first index server, and the location of the second CDN node is usually the same as the location of the second index file server. The following describes the process of determining the second fragment information using the location information of the CDN node as an example.
[0171] If the first CDN node and the second CDN node are located in the same management domain (for example, in the same province), and the size of the media segment in the first CDN node is the same as the size of the media segment in the second CDN node, the first terminal device can determine the second segment information based on the first media index file, the location information of the first CDN node, and the location information of the second CDN node.
[0172] If the first CDN node and the second CDN node do not belong to the same management domain, and / or the size of the media segment in the first CDN node is different from the size of the media segment in the second CDN node, the first terminal device needs to determine the second segment information based on the first media index file, the location information of the first CDN node, the location information of the second CDN node and more information (such as the size of the media segment in each CDN, the estimated relevant parameters of the media segment, etc.).
[0173] In this embodiment of the application, a detailed process of determining the second fragment information is described by taking the case where the first CDN node and the second CDN node are located in the same management domain and the size of the media fragment in the first CDN node is the same as the size of the media fragment in the second CDN node as an example.
[0174] That is, the above-mentioned method 2 specifically includes the following S1-S2.
[0175] S1. The first terminal device determines the delay between the first CDN node and the second CDN node based on the location information of the first CDN node and the location information of the second CDN node.
[0176] The time delay between the first CDN node and the second CDN node is used to determine the number of fragments that differ between the latest fragment in the first CDN node and the latest fragment in the second CDN node.
[0177] Combining the CDN architecture diagram shown in Figure 3 and the relevant descriptions of CDN, it can be seen that there is a certain delay between CDN nodes at different levels within the same administrative domain, while there is no delay (or the delay is negligible) between CDN nodes at the same level within the same administrative domain. For example, the delay between a central node and a regional node may be 2 seconds, the delay between a regional node and an edge node is 2 seconds, and the delay between a central node and an edge node is 4 seconds.
[0178] S2. The first terminal device determines the second fragment information according to the first media index file and the delay between the first CDN node and the second CDN node.
[0179] In the embodiment of the present application, the number of fragments that differ between the media fragments in the first CDN node and the media fragments in the second CDN node is calculated based on the time delay between the first CDN node and the second CDN node. Then, based on the media fragments indicated by the first media index file and the number of fragments that differ, the second fragment information in the second media index file can be determined. Compared with the above-mentioned method 1, in method 2, the second terminal device does not need to send the second fragment information to the first terminal device. The first terminal device determines the second fragment information independently, which can save the second terminal device's overhead.
[0180] For example, referring to FIG3 , assuming that the size of a media segment in an administrative domain is 2 seconds, the first CDN node is a central node, the second CDN node is a regional node, and the first media index file includes segment information of 5 media segments. The sequence numbers of these 5 media segments are 1, 2, 3, 4, and 5, respectively. The delay between the first CDN node and the second CDN node is 2 seconds. Then, there is a difference of 1 media segment between the first CDN node and the second CDN node, that is, the media segment in the first CDN node is 1 more than the media segment in the second CDN node. Therefore, The second media index file can be determined based on the first media index file. The second media index file includes 4 media segments with serial numbers 1, 2, 3, and 4, respectively. The serial number of the latest segment in the first media index file is 5, and the serial number of the latest segment in the second media index file is 4. The time point corresponding to the start timestamp of the latest segment in the first media index file is 00:00:08 (indicating 0 hours, 0 minutes, and 8 seconds), and the time point corresponding to the start timestamp of the latest segment in the second media index file is 00:00:06 (indicating 0 hours, 0 minutes, and 6 seconds).
[0181] Assume again that the size of the media segment in the management domain is 2 seconds, the first CDN node is the central node, the second CDN node is the edge node, the first media index file includes 5 media segments, and the serial numbers are 1, 2, 3, 4, and 5, respectively. The delay between the first CDN node and the second CDN node is 4 seconds. Then, there is a difference of 2 media segments between the first CDN node and the second CDN node, that is, the media segment in the first CDN node is 2 more than the media segment in the second CDN node. Therefore, based on the first media index file, the second media index file can be determined. The second media index file includes 3 media segments, and the serial numbers are 1, 2, and 3, respectively; the serial number of the latest segment in the first media index file is 5, and the serial number of the latest segment in the second media index file is 3; the time point corresponding to the start timestamp of the latest segment in the first media index file is 00:00:08 (indicating 0 hours, 0 minutes, and 8 seconds), and the time point corresponding to the start timestamp of the latest segment in the second media index file is 00:00:04 (indicating 0 hours, 0 minutes, and 4 seconds).
[0182] S605: The first terminal device determines, according to the first media index file and the second fragment information, start indication information, where the start indication information is used to indicate the media content to be played initially when playing the media.
[0183] It should be noted that the size of the media segments in the first CDN node and the size of the media segments in the second CDN node may be the same or different.
[0184] In an embodiment of the present application, when the size of the media segment in the first CDN node is the same as the size of the media segment in the second CDN node, the above-mentioned second segment information can be the above-mentioned A1 or A2, then the determination of the start indication information in the above-mentioned S605 can include the following three implementation methods (implementation method 1 to implementation method 3).
[0185] Implementation 1: The first terminal device determines the start playback instruction information based on the first media index file and the second fragment information. Specifically, the first terminal device determines a third sequence number based on the sequence number of the latest fragment in the first media index file (hereinafter referred to as the first sequence number) and the sequence number of the latest fragment in the second media index file (i.e., the second sequence number). The third sequence number is the sequence number of the media fragment containing the media content to be played initially. Note that the third sequence number is less than or equal to the first sequence number and less than or equal to the second sequence number.
[0186] That is, the start indication information includes the serial number of the media segment where the media content to be played initially is located, that is, the third serial number.
[0187] Example 1, assuming that the serial number of the latest segment in the first media index file obtained by the first terminal device is 6, and the serial number of the latest segment in the second media index file obtained by the second terminal device is 4. If there is no need to retain the media segments for safety buffering, the first terminal device determines the media segment with the smallest serial number as the media segment to be played initially (i.e., the third serial number), that is, the media content to be played initially is the media segment with serial number 4. At this time, the third serial number is less than the first serial number, and the third serial number is equal to the second serial number. If the media segments for safety buffering are retained, the third serial number is determined based on the number of media segments for safety buffering retained and the smallest serial number. For example, if two media segments need to be retained as safety buffers, then playback starts from the third-to-last media segment starting from the smallest serial number, that is, playback starts from the media segment with serial number 2, that is, the media content to be played initially is the media segment with serial number 2.
[0188] Implementation method 2: The first terminal device determines the start indication information based on the first media index file and the second fragment information. Specifically, the first terminal device determines a third start timestamp based on the start timestamp of the latest fragment in the first media index file (hereinafter referred to as the first start timestamp) and the start timestamp of the latest media fragment in the second media index file (i.e., the second start timestamp). The third start timestamp is the start timestamp of the media fragment containing the media content to be played. It should be noted that the third start timestamp is no later than the first start timestamp and no later than the second start timestamp.
[0189] That is, the start indication information includes the third start timestamp of the media segment containing the media content to be played. It should be understood that the size of the timestamp indicates the early or late time. Generally, a smaller timestamp indicates an earlier time, while a larger timestamp indicates a later time. Therefore, when comparing timestamps, the comparison can be described as a magnitude relationship or a time relationship.
[0190] Example 2: Assume that the start timestamp of the latest segment in the first media index file indicates that the start playback time of the latest segment is 00:00:10 (indicating 0 hours, 0 minutes, and 10 seconds), and the start timestamp of the latest segment in the second media index file indicates that the start playback time of the latest segment is 00:00:06 (indicating 0 hours, 0 minutes, and 6 seconds), and the segment size is 2 seconds. If there is no need to retain the media segments for safe buffering, the first terminal device determines the media segment with the earliest start timestamp (or the smallest start timestamp) as the timestamp of the media content to start playback (i.e., the third timestamp), that is, the time point corresponding to the start timestamp of the media content to start playback is 00:00:06. At this time, the third start timestamp is less than the first timestamp, and the third timestamp is equal to the second timestamp. If it is necessary to retain the media segment for safety buffering, the third starting timestamp is determined based on the duration of the media content of the retained safety buffer and the minimum starting timestamp. For example, if it is necessary to retain 4 seconds of media content as a safety buffer, the playback is started 4 seconds back from the end time of the media segment corresponding to the minimum starting timestamp (00:00:06 is the start time corresponding to the minimum starting timestamp, and the end time of the media segment corresponding to the start timestamp is 00:00:08), that is, the playback is started from the timestamp corresponding to the time point 00:00:04, that is, the starting timestamp of the media content to be played is the timestamp corresponding to 00:00:04. At this time, the third starting timestamp is smaller than the first timestamp and smaller than the second timestamp.
[0191] Implementation method 3: The first terminal device determines the start indication information based on the first media index file and the second fragment information, including: the first terminal device determines a first offset of the start timestamp of the media content to be played back relative to the start timestamp of the media based on the start timestamp of the media, the start timestamp of the latest fragment of the first media index file (i.e., the first start timestamp), and / or the start timestamp of the latest fragment of the second media index file (i.e., the second start timestamp). It should be noted that the first offset is less than or equal to the offset of the first start timestamp relative to the start timestamp of the media, and less than or equal to the offset of the second start timestamp relative to the start timestamp of the media.
[0192] That is, the start indication information includes a first offset of the start timestamp of the media content to be played back relative to the start timestamp of the media. The start timestamp of the media content to be played back when the media is played back synchronously can be determined by the first offset and the start timestamp of the media.
[0193] Example 3: Similar to the example in the second implementation method described above, assuming that the starting time point corresponding to the start timestamp of the media is 00:00:00 (indicating 0 hours, 0 minutes, 0 seconds), the starting timestamp of the latest segment in the first media index file indicates that the starting playback time point of the latest segment is 00:00:10 (indicating 0 hours, 0 minutes, 10 seconds), and the starting timestamp of the latest segment in the second media index file indicates that the starting playback time point of the latest segment is 00:00:06 (indicating 0 hours, 0 minutes, 6 seconds), and the segment size is 2 seconds. If there is no need to retain the media segments for safety buffering, the time point corresponding to the start timestamp of the media content to be played is determined to be 00:00:06, and the offset of the start timestamp of the media content to be played back relative to the start timestamp of the entire media is 6 seconds, that is, the first offset is 6 seconds. At this time, the first offset is less than the offset of the first start timestamp relative to the start timestamp of the media (10 seconds), and the first offset is equal to the offset of the second start timestamp relative to the start timestamp of the media (6 seconds). If it is necessary to retain media segments for safety buffering (for example, retaining 4 seconds of media content as a safety buffer), the starting timestamp of the media content to be played is determined to be the timestamp corresponding to 00:00:04, and the offset of the starting timestamp of the media content to be played back relative to the starting timestamp of the entire media is 4 seconds, that is, the first offset is 4 seconds. At this time, the first offset is smaller than the offset of the first starting timestamp relative to the starting timestamp of the media (10 seconds), and the first offset is also smaller than the offset of the second starting timestamp relative to the starting timestamp of the media (6 seconds).
[0194] In an embodiment of the present application, when the size of the media segment in the first CDN node is different from that in the media segment in the second CDN node, the above-mentioned second segment information can be the above-mentioned A3 (the second segment information is the segment information of the media segment indicated in the second media index file), then the determination of the start indication information in the above-mentioned S605 can include the following two implementation methods (Implementation Method 4-Implementation Method 5).
[0195] Implementation 4: The start indication information determined by the first terminal device includes first start indication information and second start indication information. The first start indication information is used to indicate to the first terminal device the media content to start playing when playing the media, and the second start indication information is used to indicate to the second terminal device the media content to start playing when playing the media.
[0196] Optionally, the first terminal device determines the first start indication information based on the first media index file and the second fragment information, which specifically includes: the first terminal device determines the start timestamp of the video content to be started based on the start timestamp of the latest fragment in the first media index file and the start timestamp of the latest fragment in the second media index file, and then determines the media fragment (called the first target media fragment, which is one of the media fragments indicated by the first media index file) in which the media content is located and the second offset of the start time of the media content relative to the start time of the first target media fragment based on the start timestamp of the media content.
[0197] That is, the first start indication information includes the sequence number of the first target media segment where the media content to be played initially is located and the second offset of the start time of the media content to be played initially relative to the start time of the first target media segment.
[0198] Optionally, the first terminal device determines the second start indication information based on the first media index file and the second fragment information, specifically including: the first terminal device determines the start timestamp of the video content to be started based on the start timestamp of the latest fragment in the first media index file and the start timestamp of the latest fragment in the second media index file, and then determines the media fragment (called the second target media fragment, which is one of the media fragments indicated by the second media index file) where the media content is located and a third offset of the start time of the media content relative to the start time of the second target media fragment based on the start timestamp of the media content.
[0199] That is, the second start indication information includes the sequence number of the second target media segment where the media content to be played initially is located and a third offset of the start time of the media content to be played initially relative to the start time of the second target media segment.
[0200] Example 4: Assume that the size of the media segment in the first CDN node is 4 seconds, the size of the media segment in the second CDN node is 3 seconds, the first media index file includes 5 media segments, wherein the time point corresponding to the start timestamp of the latest segment is 00:00:16, and the second media index file includes 6 media segments, wherein the time point corresponding to the start timestamp of the latest segment is 00:00:15. If the first terminal device determines that the time point corresponding to the start timestamp of the video content to be played is 00:00:14, then the time point corresponding to the start timestamp of the video content to be played in the first start indication information is 00:00:15. The first target media segment where the video content is located is the media segment with serial number 4 in the first media index file (the start time of media segment 4 is 00:00:12), and the second offset of the media content relative to the start time of the media segment with serial number 4 is 2 seconds. The second target media segment where the video content to be started is located in the second start-up indication information is the media segment with serial number 5 in the second media index file (the start time of media segment 5 is 00:00:12), and the third offset of the media content relative to the start time of the media segment with serial number 5 is 2 seconds.
[0201] Implementation 5: The first terminal device determines the second play start indication information based on the first media index file and the second fragment information, specifically including: the first terminal device determines the start timestamp of the video content to start playing based on the start timestamp of the latest fragment in the first media index file and the start timestamp of the latest fragment in the second media index file, and then determines a fourth offset of the start timestamp relative to the start time of the entire media. It should be noted that the fourth offset is less than or equal to the offset of the start timestamp of the first target media fragment relative to the start timestamp of the media, and less than or equal to the offset of the start timestamp of the second target media fragment relative to the start timestamp of the media.
[0202] That is, the start indication information includes a fourth offset of the start time of the media content to be played back relative to the media start time.
[0203] Example 5: Similarly, assuming that the size of the media segments in the first CDN node is 4 seconds, the size of the media segments in the second CDN node is 3 seconds, the first media index file includes 5 media segments, where the time point corresponding to the start timestamp of the latest segment is 00:00:16, and the second media index file includes 6 media segments, where the time point corresponding to the start timestamp of the latest segment is 00:00:15, and the media start playback time is 00:00:00. If the first terminal device determines that the time point corresponding to the start timestamp of the video content to be played is 00:00:14, then the fourth offset is 14 seconds.
[0204] As can be seen from the description of the start indication information in the above embodiment, the content of the start indication information is diverse, for example, it can be the serial number of the above media segment, the start timestamp of the media segment or the related offset, and the user can flexibly select it according to actual needs.
[0205] In one implementation, the start indication information further includes start time information, which is used to indicate the system time for starting to play the media content. It should be noted that the system time of the first terminal device and the second terminal device needs to be synchronized with the system time of the second terminal device, for example, by synchronizing the system time of the first terminal device and the second terminal device to the world standard time or the universal time coordinated (UTC) through the network time protocol (NTP).
[0206] The start time information can be an absolute time or a relative time, and the relative time can be an offset relative to the start time of the media segment. For example, if the start time of the media segment is 21:09:20 (21:09:20), and the offset is 2 seconds, the start time of the media content is 21:09:22.
[0207] In one implementation, the first terminal device and the second terminal device are configured with a system time for starting to play the media content, or a time offset is configured in the IPTV platform, where the offset is an offset relative to a configured start time of the media segment.
[0208] In the embodiment of the present application, by configuring the system time for starting the media content, the terminal device plays the media according to the configured system time, which can further ensure that the media is played synchronously by multiple terminals.
[0209] S606: The first terminal device plays the media according to the start instruction information.
[0210] In combination with the content of the play start instruction information described in S605 above, correspondingly, the first terminal device plays the media according to the play start instruction information in the following situations.
[0211] Case 1: When the size of the media segment in the first CDN node is the same as the size of the media segment in the second CDN node, the media is played using any of the following methods B1-B2.
[0212] B1. When the start indication information includes the third serial number of the media segment containing the media content to be played starting from, the first terminal device plays the media according to the start indication information, specifically including: the first terminal device starts playing from the media segment with the third serial number according to the serial number of the media segment downloaded by the first media server (also described as the first CDN node) corresponding to the first index file server.
[0213] For example 1 in implementation 1 above, the media content determined to start playing has a serial number (third serial number) of 3, and the first terminal device starts playing the media segment with serial number 3 among the media segments downloaded from the first CDN node.
[0214] B2. The start indication information includes the third start timestamp or the first offset of the media segment where the media content to be played is started. The first terminal device plays the media according to the start indication information specifically including: the first terminal device determines the fourth serial number according to the third start timestamp or the first offset, and then starts playing from the media segment with the fourth serial number according to the serial number of the media segment downloaded by the first CDN node.
[0215] For Example 2 in the above-mentioned implementation method 2, the starting timestamp of the media content to be played back is determined to be the timestamp corresponding to 00:00:04, then it can be determined that the serial number (the fourth serial number) of the media segment where the media content to be played back is located is 3, then the first terminal device starts playing from the media segment with serial number 3 among the media segments downloaded from the first CDN node.
[0216] For Example 3 in the above-mentioned implementation method 3, the offset (first offset) of the starting timestamp of the media content to be played back relative to the starting timestamp of the entire media is 4 seconds, then it can be determined that the serial number (fourth serial number) of the media segment where the media content to be played back is located is 3, then the first terminal device starts playing the media segment with serial number 3 in the media segment downloaded from the first CDN node.
[0217] Case 2: When the size of the media segments in the first CDN node is different from the size of the media segments in the second CDN node, the media is played using any of the following methods C1-C2.
[0218] C1. The first start indication information corresponding to the first terminal device includes the serial number of the first target media segment where the media content to be played is located and the second offset of the start time of the media content to be played back relative to the start time of the first target media segment. The first terminal device plays the media according to the start indication information, specifically including: the first terminal device downloads the first target media segment from the first CDN node, and starts playing from the first media content in the first target media segment, where the first media content is the media content corresponding to the fourth timestamp indicated by the second offset.
[0219] For Example 4 in the above-mentioned implementation method 4, the first target media segment where the video content to be started is located is the media segment with serial number 4 in the first media index file (the start time of media segment 4 is 00:00:12), and the second offset of the media content relative to the start time of the media segment with serial number 4 is 2 seconds, and the time point corresponding to the fourth timestamp indicated by the second offset is 00:00:14. Then the first terminal device starts playing the media content with a time point of 00:00:14 in the media segment with serial number 4 in the media segment downloaded from the first CDN node.
[0220] C2. The start indication information includes a fourth offset of the start time of the media content to be played back relative to the media start time. The first terminal device plays the media according to the start indication information specifically including: the first terminal device determines the fifth serial number according to the fourth offset, and starts playing the second media content in the media fragment with the fifth serial number according to the serial number of the media fragment downloaded by the first CDN node, where the second media content is the media content corresponding to the fifth timestamp indicated by the fourth offset.
[0221] For Example 5 in the above-mentioned implementation method 5, the determined fourth offset is 14 seconds, and the time point corresponding to the fifth timestamp indicated by the fourth offset is 00:00:14. The first terminal device confirms that the serial number (fifth serial number) of the media segment corresponding to the fourth offset is 4, and then starts playing the media content at the time point 00:00:14 in the media segment with serial number 4 in the media segment downloaded from the first CDN node.
[0222] S607: The first terminal device sends broadcast start indication information to the second terminal device. Correspondingly, the second terminal device receives the broadcast start indication information from the first terminal device.
[0223] S608: The second terminal device plays the media according to the start instruction information.
[0224] Similar to the above S606, combined with the content of the start instruction information described in the above S605, the second terminal device plays the media according to the start instruction information, which includes the following situations.
[0225] Case 1: When the size of the media segment in the first CDN node is the same as the size of the media segment in the second CDN node, the media is played through any of the following methods D1-D3.
[0226] D1. When the start indication information includes the third serial number of the media segment in which the media content to be played starts, the second terminal device plays the media according to the start indication information, specifically including: the second terminal device starts playing from the media segment with the third serial number according to the serial number of the media segment downloaded by the second media server (also described as the second CDN node) corresponding to the second index file server in the second CDN node.
[0227] For Example 1 in the above implementation method 1, the media content determined to start playing is the media segment with serial number 3 (third serial number), then the second terminal device starts playing the media segment with serial number 3 in the media segment downloaded from the second CDN node.
[0228] The start indication information indicates the serial number of the media segment, so that the first terminal device can directly determine the media segment to start playing according to the serial number, and can quickly and efficiently obtain the media segment.
[0229] D2. The start indication information includes the third start timestamp or the first offset of the media segment where the media content to be played is started. The second terminal device plays the media according to the start indication information specifically including: the second terminal device determines the fourth serial number according to the third start timestamp or the first offset, and then starts playing from the media segment with the fourth serial number according to the serial number of the media segment downloaded by the second CDN node.
[0230] For Example 2 in the above-mentioned implementation method 2, the starting timestamp of the media content to be played back is determined to be the timestamp corresponding to 00:00:04, then it can be determined that the serial number (the fourth serial number) of the media segment in which the media content to be played back is located is 3, then the second terminal device starts playing from the media segment with serial number 3 among the media segments downloaded from the second CDN node.
[0231] For Example 3 in the above-mentioned implementation method 3, the offset (first offset) of the starting timestamp of the media content to be played back relative to the starting timestamp of the entire media is 4 seconds, then it can be determined that the serial number (fourth serial number) of the media segment in which the media content to be played back is located is 3, then the second terminal device starts playing the media segment with serial number 3 in the media segment downloaded from the second CDN node.
[0232] Case 2: When the size of the media segment in the first CDN node is different from that in the second CDN node, the media is played through any of the following methods E1-E2.
[0233] E1. The second start indication information corresponding to the second terminal device includes the serial number of the second target media segment where the media content to be played is located and the third offset of the start time of the media content to be played back relative to the start time of the second target media segment. The second terminal device plays the media according to the start indication information, specifically including: the second terminal device downloads the second target media segment from the second CDN node, and starts playing from the third media content in the second target media segment, where the third media content is the media content corresponding to the sixth timestamp indicated by the third offset.
[0234] For Example 4 in the above-mentioned implementation method 4, the second target media segment where the video content to be started is located is the media segment with serial number 5 in the second media index file (the start time of media segment 5 is 00:00:12), and the third offset of the media content relative to the start time of the media segment with serial number 5 is 2 seconds, and the time point corresponding to the sixth timestamp indicated by the third offset is 00:00:14. Then the second terminal device starts playing the media content with a time point of 00:00:14 in the media segment with serial number 5 in the media segment downloaded from the second CDN node.
[0235] E2. The start indication information includes a fourth offset of the start time of the media content to be played back relative to the media start time. The second terminal device plays the media according to the start indication information specifically including: the second terminal device determines the sixth serial number according to the fourth offset, and starts playing the fourth media content in the media fragment with the sixth serial number according to the serial number of the media fragment downloaded from the second CDN, where the fourth media content is the media content corresponding to the seventh timestamp indicated by the fourth offset.
[0236] For Example 5 in the above-mentioned implementation method 5, the determined fourth offset is 14 seconds, and the time point corresponding to the seventh timestamp indicated by the fourth offset is 00:00:14. The first terminal device confirms that the serial number (sixth serial number) of the media segment corresponding to the fourth offset is 5, and then starts playing the media content with a time point of 00:00:14 in the media segment with serial number 5 in the media segment downloaded from the second CDN node.
[0237] Correspondingly, optionally, when the start indication information also includes start time information, the first terminal device and the second terminal device play the media according to the start indication information specifically including: when the system time reaches the time indicated by the start time information, the first terminal device and the second terminal device start playing the downloaded media segment.
[0238] For example, the system time indicated by the start time information is 21:09:22, and the time point corresponding to the timestamp of the media content started to be played by the first terminal device and the second terminal device is 00:00:14. Then the first terminal device and the second terminal device both start playing from 00:00:14 of the media when the system time reaches 21:09:22.
[0239] In summary, in the method for synchronously playing media provided in the embodiment of the present application, the first terminal device participating in the synchronous playing of the media obtains the first media index file of the media from the first index file server, and obtains the second fragment information in the second media index file of the media obtained by the second terminal device from the second index file server; then the first terminal device determines the start indication information based on the first media index file and the second fragment information, and the start indication information is used to indicate the media content to be played starting when playing the media; then the first terminal device sends the start indication information to the second terminal device, so that the second terminal device starts playing the media according to the start indication information. In this method, the first terminal device can indicate the media content to be played starting to the second terminal device through the start indication information, so that the first terminal device and the second terminal device can ensure that the media content to be played starting when playing the media synchronously, and can ensure that multiple terminals start playing synchronously, thereby improving the user's experience of watching or listening to media synchronously.
[0240] In the above-mentioned method for synchronous media playback, the communication connection for interaction between the first terminal device and the second terminal device can be an RTC instant communication connection established by the first terminal device to the second terminal device when the first terminal device initiates synchronous media playback, or it can also be another communication connection that has been established between the first terminal device and the second terminal device before the first terminal device initiates synchronous media playback. This embodiment of the present application is not limited to this.
[0241] It should be noted that if the first terminal device initiates RTC instant communication to the second terminal device when synchronously playing media, the first terminal device and the second terminal device can also realize chat functions based on the instant communication while synchronously playing media, such as video calls, audio calls or text chats.
[0242] The following describes the architecture of a system for synchronized media playback, using an example of an RTC instant messaging (RTC) message initiated by a first terminal device to a second terminal device when synchronized media playback is initiated. Referring to Figure 7 , the system includes a first terminal device 701, a second terminal device 702, a first CDN node 703 (including a first index file server and a first media server), a second CDN node 704 (including a second index file server and a second media server), an RTC network 705, a server 706, and a content provider 707.
[0243] The first CDN node 703 is the CDN node accessed by the first terminal device 701 , and the second CDN node 704 is the CDN node accessed by the second terminal device 702 .
[0244] The RTC network 705 is a network used for instant communication between the first terminal device 701 and the second terminal device 702. The first terminal device 701 and the second terminal device 702 can establish a control plane, a media plane, and a data channel based on the RTC network 705. The first terminal device 701 and the second terminal device 702 transmit messages (such as synchronous playback requests, start indication information, etc.) through the control plane or the data plane, and can transmit video streams (such as video streams of video calls) or audio streams (such as voice streams of voice calls) through the media plane.
[0245] For example, the RTC network 705 may be a web RTC network or the IP-multimedia subsystem (IMS).
[0246] It should be understood that the first terminal device 701 and the second terminal device 702 are terminal devices running instant messaging applications (such as RTC App). When the server 706 is an IPTV platform, the first terminal device 701 and the second terminal device 702 also run IPTV applications. Optionally, in the embodiment of the present application, the IPTV App and RTC App running on the first terminal device 701 and the second terminal device 702 can be independent applications or a single application that integrates the functions of the two. The specific implementation form is not limited in the embodiment of the present application.
[0247] For an introduction to the content provider 707 and the server 706 and other contents, reference may be made to the description of the system architecture shown in FIG. 4 in the above embodiment.
[0248] The connection relationship between the various devices and networks in FIG7 is described below.
[0249] The line marked ① represents the message flow between the server 706 and the first terminal device 701.
[0250] The line marked ② indicates the message flow between the server 706 and the second terminal device 702 .
[0251] The line marked ③ represents the media flow between the server 706 , the first CDN node 703 and the first terminal device 701 .
[0252] The line marked ④ represents the media flow between the server 706 , the second CDN node 704 and the second terminal device 702 .
[0253] The line marked ⑤ represents the control plane signal flow between the RTC network 705 and the first terminal device 701 .
[0254] The line marked ⑥ represents the media plane or data channel between the RTC network 705 and the first terminal device 701.
[0255] The line marked ⑦ represents the control signal flow between the RTC network 705 and the second terminal device 702 .
[0256] The line marked ⑧ represents the media plane or data channel between the RTC network 705 and the second terminal device 702.
[0257] Similar to the architecture shown in Figure 4, before synchronously playing the media, the first terminal device 701 needs to interact with the server 706 (such as the IPTV platform) according to the message flow marked above ① for authentication and authorization, and the second terminal device 702 needs to interact with the server 706 (such as the IPTV platform) according to the message flow marked above ② for authentication and authorization.
[0258] The following examples use an IPTV platform as an example server. IPT describes several detailed methods for synchronized media playback using the HLS and DASH transport protocols. It should be understood that an IPTV platform comprises a service management platform and a service capability platform. The service management platform authenticates and manages access to terminal devices, while the service capability platform authenticates and authorizes media content provided by content providers, processes it, and then transmits it to the CDN network.
[0259] As shown in FIG8 , when the media transmission protocol is the HLS transmission protocol, a method for synchronously playing media provided by an embodiment of the present application includes:
[0260] S801. The first terminal device obtains information such as a channel list and a service entry address from the service management platform of the IPTV platform.
[0261] It should be understood that the first terminal device obtains information such as the channel list and service entry address, and displays the EPG browsing interface based on the channel list and service entry address. The user can then select a desired media program from the EPG browsing interface based on viewing needs. S801 is implemented through the message flow marked by ① in Figure 7.
[0262] S802: The first terminal device determines to initiate synchronous media playback to the second terminal device.
[0263] In one implementation, the user can select a designated control for triggering synchronous media playback, such as a "synchronous movie viewing" control, in the EPG browsing interface displayed on the first terminal device. In response to the user selecting the "synchronous movie viewing" control, the first terminal device displays a friend list, and then the user can select a friend in the friend list (the friend corresponds to the second terminal device) as the requested viewing object, thereby triggering the subsequent synchronous movie viewing process.
[0264] S803: The first terminal device and the second terminal device establish instant communication (including media interface and data channel) through the RTC network.
[0265] In an embodiment of the present application, the first terminal device initiates an instant messaging request to the second terminal device through the RTC network, and the instant messaging request is used to request to establish an RTC connection with the second terminal device. Optionally, the instant messaging can be a video session or a voice session, etc. The video session can be a video call or a video conference. A video call is a session involving two parties, and a video conference can be a session involving multiple parties (for example, the first terminal device can initiate synchronous movie viewing to the second terminal device and the third terminal device). S803 is implemented through the message flows marked by ⑤ and ⑦ in Figure 7, that is, the first terminal device, the RTC network, and the second terminal device send a session request through the control plane signal flow to establish instant messaging.
[0266] Establishing instant messaging between a first terminal device and a second terminal device involves establishing a media interface (or media transmission channel, including a video stream transmission channel and an audio stream transmission channel) and a data channel. The first terminal device can conduct a video or voice call with the second terminal device through the media interface and send an EPG to the second terminal device through the media interface or data channel, so that the EPG browsing interface can also be displayed on the second terminal device.
[0267] S804. The first terminal device sends a service request to the service capability platform of the IPTV platform. The service request is used to subscribe to the media to be played synchronously.
[0268] S805. The service capability platform of the IPTV platform sends the URL of the main index file of the media to the first terminal device.
[0269] In this embodiment of the present application, the user chooses to initiate synchronized media playback on the second terminal device. The user can also select a media service (live broadcast or other) in the EPG browsing interface to synchronize playback with the second terminal device. In response to the user's selection of the media, the first terminal device sends the aforementioned service request to the IPTV platform's service capability platform, which then returns the URL of the main index file for the media. The main index file includes the URLs of multiple bitrate index files. S805 is implemented via the message flow indicated by ① in Figure 7.
[0270] It should be noted that the embodiment of the present application does not limit the execution order of S803 and S804-S805. S803 may be executed first and then S804-S805, or S804-S805 may be executed first and then S803. That is, the first terminal device may first establish instant messaging with the second terminal device and then select the media to be played synchronously, or the first terminal device may first select the media to be played synchronously and then establish instant messaging with the second terminal device. Alternatively, S803 and S804-S805 may be executed simultaneously.
[0271] S806: The first terminal device sends a message to the second terminal device, where the message includes the URL of the main index file of the media.
[0272] Optionally, the first terminal device may send the URL of the primary index file to the second terminal device via the control plane information of the RTC network. For example, the URL of the primary index file may be sent to the RTC network via the message flow indicated by ⑤ in FIG7 , and the RTC network may send the URL of the primary index file to the second terminal device via the message flow indicated by ⑦ in FIG7 . Alternatively, the first terminal device may also send the URL of the primary index file to the second terminal device via an established data channel. For example, the first terminal device may send the URL of the primary index file to the RTC network via the message flow indicated by ⑥ in FIG7 , and the RTC network may then send the URL of the primary index file to the second terminal device via the message flow indicated by ⑧ in FIG7 .
[0273] S807. The first terminal device sends a first HLS request message to the first CDN node. The first HLS request message includes the URL of the main index file of the media.
[0274] The first HLS request message is used to request to obtain the main index file stored in the first CDN node.
[0275] S808. The first CDN node sends a first HLS response message to the first terminal device. The first HLS response message includes a primary index file of the media.
[0276] S809. The first terminal device determines the URL of the first bit rate index file based on the main index file.
[0277] The first terminal device selects an appropriate bit rate based on the current network status of the first terminal device (such as bandwidth size) and the capabilities of the first terminal device, and determines the URL of the bit rate index file corresponding to the bit rate from the first index file (referred to as the URL of the first bit rate index file).
[0278] S810. The first terminal device sends a second HLS request message to the first CDN node. The second HLS request message includes the URL of the first bitrate index file.
[0279] The second HLS request message is used to request to obtain the first bit rate index file stored in the first CDN node.
[0280] S811. The first CDN node sends a second HLS response message to the first terminal device, where the second HLS response message includes a first bitrate index file.
[0281] The above S807-S811 can be implemented through the message flow marked by ③ in Figure 7. In the above S807-S808 and S810-S811, the process of the first terminal device interacting with the first CDN node to obtain the first bitrate index file specifically involves the first terminal device interacting with the first index file server in the first CDN node to obtain the first bitrate index file from the first index file server.
[0282] S812. The second terminal device sends a third HLS request message to the second CDN node. The third HLS request message includes the URL of the main index file of the media.
[0283] The third HLS request message is used to request to obtain the main index file stored in the second CDN node.
[0284] S813. The second CDN node sends a third HLS response message to the second terminal device. The third HLS response message includes the main index file of the media.
[0285] S814. The second terminal device determines the URL of the second bit rate index file according to the main index file.
[0286] The second terminal device selects an appropriate bit rate according to the current network status (such as bandwidth size) and capabilities of the second terminal device, and determines the URL of the bit rate index file corresponding to the bit rate from the second index file (referred to as the URL of the second bit rate index file).
[0287] S815. The second terminal device sends a fourth HLS request message to the second CDN node. The fourth HLS request message includes the URL of the second bit rate index file.
[0288] The fourth HLS request message is used to request to obtain the second code rate index file stored in the second CDN node.
[0289] S816. The second CDN node sends a fourth HLS response message to the second terminal device, where the fourth HLS response message includes a second bit rate index file.
[0290] The above S812-S816 can be implemented through the message flow marked by ④ in Figure 7. In the above S812-S813 and S815-S816, the process of the second terminal device interacting with the second CDN node to obtain the second bitrate index file is specifically that the second terminal device interacts with the second index file server in the second CDN node to obtain the second bitrate index file from the second index file server.
[0291] S817. The second terminal device sends second fragment information of the media to the first terminal device. Correspondingly, the first terminal device receives the second fragment information from the second terminal device.
[0292] According to the above embodiments, the second segment information can be the second sequence number of the latest media segment in the second media index file, or the second start timestamp of the latest media segment in the second media index file, or the second media index file. S817 can be implemented by the message flows marked with ⑦ and ⑤ in FIG7 , or by the message flows marked with ⑧ and ⑥ in FIG7 .
[0293] S818. The first terminal device determines the play start indication information according to the first media index file and the second fragment information.
[0294] The start indication information is used to indicate the media content to start playing when playing the media.
[0295] In one implementation, when the size of the media segment in the first CDN node is the same as the size of the media segment in the second CDN node, the start indication information can be any one of the third serial number of the media segment where the media content to be played starts, the third start timestamp of the media segment where the media content to be played starts, or the first offset of the start timestamp of the media content to be played starts relative to the start timestamp of the media.
[0296] In another implementation, when the size of the media segment in the first CDN node is different from that in the media segment in the second CDN node, the start indication information can be the serial number of the first target media segment where the media content to be played is located and the second offset of the start time of the media content to be played relative to the start time of the first target media segment, or the fourth offset of the start time of the media content to be played relative to the media start time.
[0297] For a detailed description of S818, reference may be made to the description of S605 in the above embodiment, which will not be repeated here.
[0298] S819: The first terminal device sends broadcast start indication information to the second terminal device. Correspondingly, the second terminal device receives the broadcast start indication information from the first terminal device.
[0299] S819 can be implemented through the message flows marked with ⑤ and ⑦ in FIG. 7 , or through the message flows marked with ⑥ and ⑧ in FIG. 7 .
[0300] S820. The first terminal device sends a fifth HLS request message to the first CDN node. The fifth HLS request message includes the URL of the media segment where the media content to be played initially is located.
[0301] The fifth HLS request message is used to request to obtain the media segment corresponding to the media content to be started for playback. The first terminal device obtains the URL of the media segment where the media content to be started for playback is located from the first bit rate index file according to the start indication information.
[0302] S821. The first CDN node sends a fifth HLS response message to the first terminal device. The fifth HLS response message includes a media segment corresponding to the media content to be played initially.
[0303] S820-S821 can be implemented through the message flow marked by ③ in Figure 7. In the above S820-S821, the process of the first terminal device interacting with the first CDN node to obtain the media fragments is specifically that the first terminal device interacts with the first media server corresponding to the first index file server in the first CDN node to obtain the media fragments from the first media server.
[0304] S822. The first terminal device plays the acquired media segment according to the start instruction information.
[0305] S823. The second terminal device sends a sixth HLS request message to the second CDN node. The sixth HLS request message includes the URL of the media segment where the media content to be played initially is located.
[0306] The sixth HLS request message is used to request to obtain the media segment corresponding to the media content to be started for playback, and the second terminal device obtains the URL of the media segment where the media content to be started for playback is located from the second bit rate index file according to the start indication information.
[0307] S824. The second CDN node sends a sixth HLS response message to the second terminal device. The sixth HLS response message includes the media segment corresponding to the media content to be played initially.
[0308] S823-S824 can be implemented through the message flow marked by ④ in Figure 7. In the above S823-S824, the process of the second terminal device interacting with the second CDN node to obtain the media fragments is specifically that the second terminal device interacts with the second media server corresponding to the second index file server in the second CDN node to obtain the media fragments from the second media server.
[0309] S825. The second terminal device plays the acquired media segment according to the start instruction information.
[0310] For detailed descriptions of S820 - S825 , reference may be made to the relevant descriptions of S606 and S608 in the above embodiments, which will not be repeated here.
[0311] As shown in FIG9 , when the media transmission protocol is the DASH transmission protocol, a method for synchronously playing media provided by an embodiment of the present application includes:
[0312] S901. The first terminal device obtains information such as a channel list and a service entry address from the service management platform of the IPTV platform.
[0313] S902: The first terminal device determines to initiate synchronous media playback to the second terminal device.
[0314] S903: The first terminal device and the second terminal device establish instant communication (including media interface and data channel) through the RTC network.
[0315] S904: The first terminal device sends a service request to the service capability platform of the IPTV platform. The service request is used to subscribe to the media to be played synchronously.
[0316] S905. The service capability platform of the IPTV platform sends the URL of the MPD file of the media to the first terminal device.
[0317] In the embodiment of the present application, the MPD file includes URLs of media segments of multiple bit rates of the media. S905 is implemented through the message flow marked by ① in FIG7 .
[0318] Similarly, the embodiment of the present application does not limit the execution order of S903 and S904-S905. S903 can be executed first and then S904-S905, or S904-S905 can be executed first and then S9039, or S903 and S904-S905 can be executed at the same time.
[0319] S906. The first terminal device sends a message to the second terminal device, where the message includes the URL of the media MPD file.
[0320] Optionally, the first terminal device may send the URL of the primary index file to the second terminal device via control plane information of the RTC network, for example, by sending the URL of the media's MPD file to the second terminal device via the message flows identified by ⑤ and ⑦ in FIG7 . Alternatively, the first terminal device may also send the URL of the primary index file to the second terminal device via an established data channel, for example, by sending the URL of the media's MPD file to the second terminal device via the message flows identified by ⑥ and ⑧ in FIG7 .
[0321] S907. The first terminal device sends a first DASH request message to the first CDN node. The first DASH request message includes the URL of the MPD of the media.
[0322] The first DASH request message is used to request to obtain the first MPD file of the media stored in the first CDN node.
[0323] S908. The first CDN node sends a first DASH response message to the first terminal device. The first DASH response message includes a first MPD file of the media.
[0324] In the above S907-S908, the process of the first terminal device interacting with the first CDN node to obtain the first MPD file is specifically that the first terminal device interacts with the first index file server in the first CDN node and obtains the first MPD file from the first index file server.
[0325] S909. The second terminal device sends a second DASH request message to the second CDN node. The second DASH request message includes the URL of the second MPD file of the media.
[0326] The second DASH request message is used to request acquisition of a second MPD file of the media stored in the second CDN node.
[0327] S910. The second CDN node sends a second DASH response message to the second terminal device. The second DASH response message includes a second MPD file of the media.
[0328] In the above S909-S910, the process of the second terminal device interacting with the second CDN node to obtain the second MPD file is specifically that the second terminal device interacts with the second index file server in the second CDN node and obtains the second MPD file from the second index file server.
[0329] S911. The second terminal device sends second fragment information of the media to the first terminal device. Correspondingly, the first terminal device receives the second fragment information from the second terminal device.
[0330] According to the content of the above embodiment, the second fragment information can be the second serial number of the latest media fragment in the second MPD file, or the second starting timestamp of the latest media fragment in the second MPD file, or the second MPD file.
[0331] S912: The first terminal device determines play start indication information according to the first media index file and the second fragment information.
[0332] The start indication information is used to indicate the media content to start playing when playing the media.
[0333] For a detailed description of S912, reference may be made to the description of S818 in the above embodiment, which will not be repeated here.
[0334] S913: The first terminal device sends broadcast start indication information to the second terminal device. Correspondingly, the second terminal device receives the broadcast start indication information from the first terminal device.
[0335] S914. The first terminal device sends a third DASH request message to the first CDN node. The third DASH request message includes the URL of the media segment where the media content to be played initially is located.
[0336] The first terminal device determines the URL of the media segment corresponding to the bit rate according to the current network status or according to the configuration (such as selecting the lowest bit rate).
[0337] The third DASH request message is used to request to obtain the media segment corresponding to the media content to be started for playback. The first terminal device obtains the URL of the media segment where the media content to be started for playback is located from the first MPD file according to the start indication information.
[0338] S915. The first CDN node sends a third DASH response message to the first terminal device. The third DASH response message includes a media segment corresponding to the media content to be played initially.
[0339] In the above S914-S915, the process of the first terminal device interacting with the first CDN node to obtain media segments is specifically that the first terminal device interacts with the first media server corresponding to the first index file server in the first CDN node to obtain media segments from the first media server.
[0340] S916. The first terminal device plays the acquired media segment according to the start instruction information.
[0341] S917. The second terminal device sends a fourth DASH request message to the second CDN node. The fourth DASH request message includes the URL of the media segment where the media content to be played initially is located.
[0342] The second terminal device determines the URL of the media segment corresponding to the bit rate according to the current network status or according to the configuration (such as selecting the lowest bit rate).
[0343] The fourth DASH request message is used to request to obtain the media segment corresponding to the media content to be played initially. The second terminal device obtains the URL of the media segment containing the media content to be played initially from the second MPD file according to the start indication information.
[0344] S918. The second CDN node sends a fourth DASH response message to the second terminal device. The fourth DASH response message includes a media segment corresponding to the media content to be played initially.
[0345] In the above S917-S918, the process of the second terminal device interacting with the second CDN node to obtain the media fragments is specifically that the second terminal device interacts with the second media server corresponding to the second index file server in the second CDN node to obtain the media fragments from the second media server.
[0346] S919. The second terminal device plays the acquired media segment according to the start instruction information.
[0347] For a detailed description of S901-S919, reference may be made to the description of S801-S825 and other contents in the above embodiments, which will not be repeated here.
[0348] As shown in FIG10 , when the media transmission protocol is the HLS transmission protocol, a method for synchronously playing media provided in an embodiment of the present application includes:
[0349] S1001. The first terminal device obtains information such as a channel list and a service entry address from the service management platform of the IPTV platform.
[0350] S1002: The first terminal device determines to initiate synchronous media playback to the second terminal device.
[0351] S1003: The first terminal device and the second terminal device establish instant communication (including media interface and data channel) through the RTC network.
[0352] S1004. The first terminal device sends a service request to the service capability platform of the IPTV platform. The service request is used to subscribe to the media to be played synchronously.
[0353] S1005. The service capability platform of the IPTV platform sends the URL of the main index file of the media to the first terminal device.
[0354] S1006. The first terminal device sends a message to the second terminal device, where the message includes the URL of the main index file of the media.
[0355] S1007. The first terminal device sends a first HLS request message to the first CDN node. The first HLS request message includes the URL of the main index file of the media.
[0356] The first HLS request message is used to request to obtain the main index file stored in the first CDN node.
[0357] S1008. The first CDN node sends a first HLS response message to the first terminal device. The first HLS response message includes a primary index file of the media.
[0358] S1009. The first terminal device determines the URL of the first bit rate index file based on the main index file.
[0359] S1010. The first terminal device sends a second HLS request message to the first CDN node. The second HLS request message includes the URL of the first bitrate index file.
[0360] The second HLS request message is used to request to obtain the first bit rate index file stored in the first CDN node.
[0361] S1011. The first CDN node sends a second HLS response message to the first terminal device, where the second HLS response message includes a first bitrate index file.
[0362] Similarly, in the above S1007-S1008 and S1010-S1011, the process of the first terminal device interacting with the first CDN node to obtain the first bit rate index file is specifically that the first terminal device interacts with the first index file server in the first CDN node and obtains the first bit rate index file from the first index file server.
[0363] S1012. The second terminal device sends a third HLS request message to the second CDN node. The third HLS request message includes the URL of the main index file of the media.
[0364] The third HLS request message is used to request to obtain the main index file stored in the second CDN node.
[0365] S1013. The second CDN node sends a third HLS response message to the second terminal device. The third HLS response message includes a primary index file of the media.
[0366] S1014. The second terminal device determines the URL of the second bit rate index file based on the main index file.
[0367] S1015. The second terminal device sends a fourth HLS request message to the second CDN node. The fourth HLS request message includes the URL of the second bit rate index file.
[0368] The fourth HLS request message is used to request to obtain the second code rate index file stored in the second CDN node.
[0369] S1016. The second CDN node sends a fourth HLS response message to the second terminal device, where the fourth HLS response message includes a second bit rate index file.
[0370] In the above S1012-S1013 and S1015-S1016, the process of the second terminal device interacting with the second CDN node to obtain the second bit rate index file is specifically that the second terminal device interacts with the second index file server in the second CDN node and obtains the second bit rate index file from the second index file server.
[0371] S1017. The first terminal device obtains, from the service management platform of the IPTV platform, the location information of the first CDN node (or first index file server) to which the first terminal device accesses and the location information of the second CDN node (or second index file server) to which the second terminal device accesses.
[0372] Specifically, the first terminal device sends a request message including the user information of the first terminal device and the user information of the second terminal device to the IPTV platform. The IPTV platform then returns the location information of the first CDN node (or the first index file server) and the location information of the second CDN node (or the second index file server) to the first terminal device based on the user information of the terminal devices. S1017 can be implemented through the message flow marked with ① in Figure 7.
[0373] Exemplarily, the location information of a CDN node may indicate which level of CDN node the CDN node is in. For example, the location information of a first CDN node may indicate that the first CDN node is a central node, and the location information of a second CDN node may indicate that the second CDN node is an edge node.
[0374] S1018. The first terminal device determines the second fragment information according to the first media index file, the location information of the first CDN node (or the first index file server), and the location information of the second CDN node (or the second index file server).
[0375] The start indication information is used to indicate the media content to start playing when playing the media.
[0376] For a detailed description of S1018, please refer to the relevant description in the second method (including S1-S2) in the above S604, which will not be repeated here.
[0377] S1019: The first terminal device sends broadcast start indication information to the second terminal device. Correspondingly, the second terminal device receives the broadcast start indication information from the first terminal device.
[0378] S1020. The first terminal device sends a fifth HLS request message to the first CDN node. The fifth HLS request message includes the URL of the media segment where the media content to be played back is located.
[0379] The fifth HLS request message is used to request to obtain the media segment corresponding to the media content to be started for playback. The first terminal device obtains the URL of the media segment where the media content to be started for playback is located from the first bit rate index file according to the start indication information.
[0380] S1021. The first CDN node sends a fifth HLS response message to the first terminal device. The fifth HLS response message includes a media segment corresponding to the media content to be played initially.
[0381] In the above S1020-S1021, the process of the first terminal device interacting with the first CDN node to obtain media fragments is specifically that the first terminal device interacts with the first media server corresponding to the first index file server in the first CDN node to obtain media fragments from the first media server.
[0382] S1022. The first terminal device plays the acquired media segment according to the start instruction information.
[0383] S1023. The second terminal device sends a sixth HLS request message to the second CDN node. The sixth HLS request message includes the URL of the media segment where the media content to be played initially is located.
[0384] The sixth HLS request message is used to request to obtain the media segment corresponding to the media content to be started for playback, and the second terminal device obtains the URL of the media segment where the media content to be started for playback is located from the second bit rate index file according to the start indication information.
[0385] S1024. The second CDN node sends a sixth HLS response message to the second terminal device. The sixth HLS response message includes a media segment corresponding to the media content to be played initially.
[0386] In the above S1023-S1024, the process of the second terminal device interacting with the second CDN node to obtain the media fragments is specifically that the second terminal device interacts with the second media server corresponding to the second index file server in the second CDN node to obtain the media fragments from the second media server.
[0387] S1025. The second terminal device plays the acquired media segment according to the start instruction information.
[0388] For a detailed description of S1001-S1025, reference may be made to the description of S801-S825 and other contents in the above embodiments, which will not be repeated here.
[0389] As shown in FIG11 , when the media transmission protocol is the DASH transmission protocol, a method for synchronously playing media provided in an embodiment of the present application includes:
[0390] S1101. The first terminal device obtains information such as a channel list and a service entry address from the service management platform of the IPTV platform.
[0391] S1102: The first terminal device determines to initiate synchronous media playback to the second terminal device.
[0392] S1103: The first terminal device and the second terminal device establish instant communication (including media interface and data channel) through the RTC network.
[0393] S1104. The first terminal device sends a service request to the service capability platform of the IPTV platform. The service request is used to subscribe to the media to be played synchronously.
[0394] S1105. The service capability platform of the IPTV platform sends the URL of the media MPD file to the first terminal device.
[0395] S1106. The first terminal device sends a message to the second terminal device, where the message includes the URL of the MPD file of the media.
[0396] S1107. The first terminal device sends a first DASH request message to the first CDN node. The first DASH request message includes the URL of the MPD of the media.
[0397] The first DASH request message is used to request to obtain the first MPD file of the media stored in the first CDN node.
[0398] S1108. The first CDN node sends a first DASH response message to the first terminal device. The first DASH response message includes a first MPD file of the media.
[0399] In the above S1107-S1108, the process of the first terminal device interacting with the first CDN node to obtain the first MPD file is specifically that the first terminal device interacts with the first index file server in the first CDN node and obtains the first MPD file from the first index file server.
[0400] S1109. The second terminal device sends a second DASH request message to the second CDN node. The second DASH request message includes the URL of the second MPD file of the media.
[0401] The second DASH request message is used to request acquisition of a second MPD file of the media stored in the second CDN node.
[0402] S1110. The second CDN node sends a second DASH response message to the second terminal device. The second DASH response message includes a second MPD file of the media.
[0403] In the above S1109-S1110, the process of the second terminal device interacting with the second CDN node to obtain the second MPD file is specifically that the second terminal device interacts with the second index file server in the second CDN node and obtains the second MPD file from the second index file server.
[0404] S1111. The first terminal device obtains, from the service management platform of the IPTV platform, the location information of the first CDN node (or first index file server) to which the first terminal device accesses and the location information of the second CDN node (or second index file server) to which the second terminal device accesses.
[0405] S1112. The first terminal device determines the second fragment information based on the first MPD file, the location information of the first CDN node (or the first index file server), and the location information of the second CDN node (or the second index file server).
[0406] The start indication information is used to indicate the media content to start playing when playing the media.
[0407] S1113. The first terminal device sends broadcast start indication information to the second terminal device. Correspondingly, the second terminal device receives the broadcast start indication information from the first terminal device.
[0408] S1114. The first terminal device sends a third DASH request message to the first CDN node. The third DASH request message includes the URL of the media segment where the media content to be played initially is located.
[0409] The third DASH request message is used to request to obtain the media segment corresponding to the media content to be started for playback. The first terminal device obtains the URL of the media segment where the media content to be started for playback is located from the first MPD file according to the start indication information.
[0410] S1115. The first CDN node sends a third DASH response message to the first terminal device. The third DASH response message includes a media segment corresponding to the media content to be played initially.
[0411] In the above S1114-S1115, the process of the first terminal device interacting with the first CDN node to obtain media segments is specifically that the first terminal device interacts with the first media server corresponding to the first index file server in the first CDN node to obtain media segments from the first media server.
[0412] S1116. The first terminal device plays the acquired media segment according to the start instruction information.
[0413] S1117. The second terminal device sends a fourth DASH request message to the second CDN node. The fourth DASH request message includes the URL of the media segment where the media content to be played initially is located.
[0414] The fourth DASH request message is used to request to obtain the media segment corresponding to the media content to be played initially. The second terminal device obtains the URL of the media segment containing the media content to be played initially from the second MPD file according to the start indication information.
[0415] S1118. The second CDN node sends a fourth DASH response message to the second terminal device. The fourth DASH response message includes a media segment corresponding to the media content to be played initially.
[0416] In the above S1117-S1118, the process of the second terminal device interacting with the second CDN node to obtain the media fragments is specifically that the second terminal device interacts with the second media server corresponding to the second index file server in the second CDN node to obtain the media fragments from the second media server.
[0417] S1119. The second terminal device plays the acquired media segment according to the start instruction information.
[0418] For a detailed description of S1101-S1119, please refer to the relevant description of S901-S919, S1001-S1025 and other contents in the above embodiments, which will not be repeated here.
[0419] It is understandable that, in order to implement the above functions, the above-mentioned terminal device includes a hardware structure and / or software module for executing each function. Those skilled in the art should easily realize that, in combination with the method steps of each example described in the embodiments disclosed herein, the embodiments of the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the embodiments of the present application.
[0420] The embodiment of the present application can divide the functional modules of the terminal device according to the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated modules can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical functional division. In actual implementation, there may be other division methods.
[0421] In the case of dividing each functional module according to each function, a possible structural diagram of the terminal device involved in the above embodiment is shown in Figure 12. The terminal device is a first terminal device, and the first terminal device includes an acquisition module 1201, a determination module 1202 and a sending module 1203.
[0422] The acquisition module 1201 is used to execute S602, S604, S801, S901, S1001, S1017, S1018, S1101, S1111, and S1112 in the above method embodiment; the determination module 1202 is used to execute S605, S802, S809, S818, S902, S912, S1002, S1009, and S1102 in the above method embodiment; The sending module 1203 is used to execute S601, S607, S804, S806, S807, S810, S819, S820, S904, S906, S907, S913, S914, S1004, S1006, S1007, S1010, S1019, S1020, S1104, S1106, S1107, S1113, and S1114 in the above method embodiment.
[0423] Optionally, the terminal device provided in the embodiment of the present application further includes a media output module 1204 and a receiving module 1205. The media output module 1204 is configured to execute S606, S822, S916, S1022, and S1116 in the above method embodiment. The receiving module 1205 is configured to execute S817 and S911 in the above method embodiment.
[0424] In the case of an integrated unit, FIG13 shows another possible structural diagram of a terminal device involved in the above embodiments. The terminal device is a first terminal device, and the first terminal device may include: a processing module 1301 and a communication module 1302. The processing module 1301 can be used to control and manage the actions of the first terminal device. For example, the processing module 1301 can be used to support the first terminal device in executing S602, S604, S801, S901, S1001, S1017, S1018, S1101, S1111, S1112, S605, S802, S809, S818, S902, S912, S1002, S1009, S1102 in the above method embodiment, and / or other processes used in the technology described herein. The communication module 1302 can be used to support the communication between the first terminal device and other network entities. The communication module 1302 integrates the functions of the above-mentioned sending module 1203 and the receiving module 1205. The communication module 1302 can be used to support the first terminal device to execute S601, S607, S804, S806, S807, S810, S817, S819, S820, S904, S906, S907, S911, S913, S914, S1004, S1006, S1007, S1010, S1019, S1020, S1104, S1106, S1107, S1113, and S1114 in the above-mentioned method embodiment. Optionally, as shown in Figure 13, the first terminal device may further include a storage module 1303 for storing program code and data of the first terminal device.
[0425] Optionally, the first terminal device may further include an output module 1304, which may be configured to support the first terminal device in executing S606, S822, S916, S1022, and S1116 in the above method embodiment.
[0426] The processing module 1301 may be a processor, for example, the processor 510 in FIG5 . The communication module 1302 may be a transceiver, a transceiver circuit, or a communication interface, for example, the mobile communication module 550 and / or the wireless communication module 560 in FIG5 . The storage module 1303 may be a memory, for example, the internal memory 521 or the external memory 520 in FIG5 . It should be understood that when the media is audio, the output module 1304 may be a speaker, for example, the speaker 570A in FIG5 . When the media is video, the output module 1304 may be a display, for example, the display 594 in FIG5 .
[0427] The various modules of the above-mentioned first terminal device can also be used to perform other actions in the above-mentioned method embodiment. All relevant contents of the various steps involved in the above-mentioned method embodiment can be referred to the functional description of the corresponding functional module and will not be repeated here.
[0428] For more details on how the modules included in the first terminal device implement the above functions, please refer to the descriptions in the previous method embodiments, which will not be repeated here. The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other. Each embodiment focuses on the differences from other embodiments.
[0429] In the case of dividing each functional module into corresponding functional modules, referring to Figure 14, a possible structural diagram of the terminal device involved in the above embodiment is shown. The terminal device is a second terminal device, and the second terminal device includes a sending module 1401, a receiving module 1402, and a media output module 1403.
[0430] Among them, the sending module 1401 is used to execute S812, S815, S817, S823, S909, S911, S917, S1012, S1015, S1023, S1109, and S1117 in the above method embodiments; the receiving module 1402 is used to execute S601, S607, S819, and S913 in the above method embodiments; and the media output module 1403 is used to execute S608, S825, S919, S1025, and S1119 in the above method embodiments.
[0431] Optionally, the terminal device provided in the embodiment of the present application further includes an acquisition module 1404, and the acquisition module 1404 is used to execute S603 in the above method embodiment.
[0432] In the case of an integrated unit, Figure 15 shows another possible structural diagram of the terminal device involved in the above embodiment. The terminal device is a second terminal device, which may include a processing module 1501 and a communication module 1502. The processing module 1501 can be used to control and manage the actions of the second terminal device. For example, the processing module 1501 can be used to support the second terminal device in executing other steps such as S603 in the above method embodiment, and / or other processes used in the technology described herein. The communication module 1502 can be used to support the second terminal device's communication with other network entities. The communication module 1302 integrates the functions of the above-mentioned sending module 1401 and receiving module 1402. The communication module 1502 can be used to support the second terminal device in executing S601, S607, S812, S815, S817, S819, S823, S909, S911, S913, S917, S1012, S1015, S1023, S1109, and S1117 in the above-mentioned method embodiment. Optionally, as shown in FIG15 , the second terminal device may further include a storage module 1503 for storing program code and data of the second terminal device.
[0433] Optionally, the first terminal device may further include an output module 1504, which may be configured to support the second terminal device in executing S608, S825, S919, S1025, and S1119 in the above method embodiment.
[0434] The processing module 1501 may be a processor, for example, the processor 510 in FIG5 . The communication module 1502 may be a transceiver, a transceiver circuit, or a communication interface, for example, the mobile communication module 550 and / or the wireless communication module 560 in FIG5 . The storage module 1503 may be a memory, for example, the internal memory 521 or the external memory 520 in FIG5 . It should be understood that when the media is audio, the output module 1504 may be a speaker, for example, the speaker 570A in FIG5 . When the media is video, the output module 1504 may be a display, for example, the display 594 in FIG5 .
[0435] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware, or any combination thereof. When implemented using a software program, all or part of the embodiments may be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, all or part of the processes or functions in accordance with the embodiments of the present application are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated therein. The available medium may be a magnetic medium (eg, a floppy disk, a magnetic disk, a magnetic tape), an optical medium (eg, a digital video disc (DVD)), or a semiconductor medium (eg, a solid state drive (SSD)).
[0436] Through the description of the above embodiments, those skilled in the art will clearly understand that for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. The specific working processes of the above-described systems, devices, and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0437] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0438] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0439] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0440] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as flash memory, mobile hard disk, read-only memory, random access memory, magnetic disk or optical disk.
[0441] The above is only a specific embodiment of the present application, but the scope of protection of this application is not limited to this. Any changes or substitutions within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
Claims
1. A method for synchronously playing media, characterized in that: include: The first terminal device obtains a first media index file and second fragment information of the media; wherein the first media index file is obtained by the first terminal device from a first index file server; the second fragment information is fragment information in a second media index file of the media obtained by the second terminal device from a second index file server; The first terminal device determines, according to the first media index file and the second fragment information, start-play indication information; the start-play indication information is used to indicate the media content to be played initially when playing the media; The first terminal device sends the play start indication information to the second terminal device.
2. The method according to claim 1, characterized in that The method further comprises: The first terminal device plays the media according to the start indication information.
3. The method according to claim 1, characterized in that The second segment information is a second serial number of the latest media segment in the second media index file; or, the second segment information is a second starting timestamp of the latest media segment in the second media index file; The start indication information includes a third sequence number of a media segment of the media content to be played initially, the third sequence number being less than or equal to the first sequence number and less than or equal to the second sequence number, wherein the first sequence number is a sequence number of a latest segment of the first media index file; or The start indication information includes a third start timestamp of the media segment where the media content to be played starts, the third start timestamp is no later than the first start timestamp and no later than the second start timestamp, wherein the first start timestamp is the start timestamp of the latest segment of the first media index file; or, The start indication information includes a first offset of the start timestamp of the media content to be played back relative to the start timestamp of the media; the first offset is less than or equal to the offset of the first start timestamp relative to the start timestamp of the media, and is less than or equal to the offset of the second start timestamp relative to the start timestamp of the media.
4. The method according to claim 1, characterized in that: The second fragment information is fragment information of the media fragment indicated in the second media index file; The start indication information includes first start indication information and second start indication information; the first start indication information includes the serial number of the first target media segment where the media content to be played back is located and the second offset of the start time of the media content to be played back relative to the start time of the first target media segment, and the first target media segment is one of the media segments indicated by the first media index file; the second start indication information includes the serial number of the second target media segment where the media content to be played back is located and the third offset of the start time of the media content to be played back relative to the start time of the second target media segment, and the second target media segment is one of the media segments indicated by the second media index file; or, The start indication information includes a fourth offset of the start time of the media content to be played back relative to the start time of the media, and the fourth offset is less than or equal to the offset of the start timestamp of the first target media segment relative to the start timestamp of the media, and is less than or equal to the offset of the start timestamp of the second target media segment relative to the start timestamp of the media.
5. The method according to claim 3, characterized in that: The first terminal device plays the media according to the start-play instruction information, including: The first terminal device starts playing the media segment with the third serial number according to the serial number of the media segment downloaded from the first media server corresponding to the first index file server; or The first terminal device determines a fourth serial number according to the third start timestamp or the first offset, and starts playing the media segment with the fourth serial number according to the serial number of the media segment downloaded from the first media server corresponding to the first index file server.
6. The method according to claim 4, characterized in that The first terminal device plays the media according to the start-play instruction information, including: The first terminal device downloads the first target media segment from the first media server, and starts playing the first media content in the first target media segment, where the first media content is the media content corresponding to the fourth timestamp indicated by the second offset; or A fifth sequence number is determined according to the fourth offset, and according to the sequence number of the media segment downloaded by the first media server, playback is started from the second media content in the media segment with the fifth sequence number, where the second media content is the media content corresponding to the fifth timestamp indicated by the fourth offset.
7. The method according to any one of claims 1 to 6, characterized in that: The start indication information also includes start time information, and the start time information is used to indicate the system time when the first terminal device and the second terminal device start playing the media content.
8. The method according to claim 7, characterized in that The first terminal device plays the media according to the start-play instruction information, including: When the system time reaches the time indicated by the start time information, the first terminal device starts to play the downloaded media segment.
9. The method according to any one of claims 1 to 8, characterized in that: Before the first terminal device obtains the first media index file and the second segment information, the method further includes: The first terminal device sends a synchronous play request to the second terminal device, where the synchronous play request is used to request the second terminal device to play the media synchronously with the first terminal device.
10. The method according to any one of claims 1 to 9, characterized in that: The first terminal device obtains second fragment information of the media, including: The first terminal device receives the second fragment information of the media from the second terminal device; or, The first terminal device determines the second fragment information according to the first media index file, the location information of the first index file server, and the location information of the second index file server.
11. The method according to claim 10, characterized in that The first terminal device determines the second fragment information according to the first media index file, the location information of the first index file server, and the location information of the second index file server, including: The first terminal device determines a delay between the first index file server and the second index file server according to the location information of the first index file server and the location information of the second index file server; The first terminal device determines the second fragment information according to the first media index file and a delay between the first index file server and the second index file server.
12. A method for synchronously playing media, characterized in that: include: The second terminal device sends second fragment information of the media to the first terminal device; The second fragment information is fragment information in the second media index file of the media obtained by the second terminal device from the second index file server; The second terminal device receives the start indication information of the media from the first terminal device; wherein the start indication information is used to indicate the media content to be played starting when playing the media; the start indication information is determined according to the first media index file of the media and the second fragment information, and the first media index file is obtained by the first terminal device from a first index file server; The second terminal device plays the media according to the start indication information.
13. The method according to claim 12, characterized in that The second segment information is a second serial number of the latest media segment in the second media index file; or, the second segment information is a second starting timestamp of the latest media segment in the second media index file; The start indication information includes a third sequence number of a media segment in which the media content to be played initially is located; the third sequence number is less than or equal to the first sequence number, and less than or equal to the second sequence number, wherein the first sequence number is a sequence number of a latest segment of the first media index file; or, The start indication information includes a third start timestamp of the media segment where the media content to be played starts; the third start timestamp is no later than the first start timestamp and no later than the second start timestamp, wherein the first start timestamp is the start timestamp of the latest segment of the first media index file; or, The start indication information includes a first offset of the start time of the media content to be played back relative to the start time of the media; the first offset is less than or equal to the offset of the first start timestamp relative to the start timestamp of the media, and is less than or equal to the offset of the second start timestamp relative to the start timestamp of the media.
14. The method according to claim 13, characterized in that The second terminal device plays the media according to the start-play instruction information, including: The second terminal device starts playing the media segment with the third serial number according to the serial number of the media segment downloaded from the second media server corresponding to the second index file server; or The second terminal device determines a fourth sequence number according to the third start timestamp or the first offset, and starts playing the media segment with the fourth sequence number according to the sequence numbers of the media segments downloaded from the second media server.
15. The method according to claim 12, characterized in that The second fragment information is fragment information of the media fragment indicated in the second media index file; The start indication information includes a sequence number of a second target media segment where the media content to be played initially is located and a third offset of a start time of the media content to be played initially relative to a start time of the second target media segment; the second target media segment is one of the media segments indicated by the second media index file; or, The start indication information includes a fourth offset of the start time of the media content to be started relative to the start time of the media; the fourth offset is less than or equal to the offset of the start timestamp of the first target media segment relative to the start timestamp of the media, and is less than or equal to the offset of the start timestamp of the second target media segment relative to the start timestamp of the media, and the first target media segment is the media segment where the media content to be started is located in the media segment indicated by the first media index file.
16. The method according to claim 15, characterized in that The second terminal device plays the media according to the start-play instruction information, including: The second terminal device downloads the second target media segment from the second media server, and starts playing the third media content in the second target media segment, where the third media content is the media content corresponding to the sixth timestamp indicated by the third offset; or A sixth sequence number is determined according to the fourth offset, and according to the sequence number of the media segment downloaded by the second media server, fourth media content in the media segment with the sixth sequence number is played starting from the media content corresponding to the seventh timestamp indicated by the fourth offset.
17. The method according to any one of claims 12 to 16, characterized in that: The start indication information also includes start time information, and the start time information is used to indicate the system time when the first terminal device and the second terminal device start playing the media content.
18. The method according to claim 17, characterized in that The second terminal device plays the media according to the start-play instruction information, including: When the system time reaches the time indicated by the start time information, the second terminal device starts to play the downloaded media segment.
19. The method according to any one of claims 12 to 18, characterized in that Before the second terminal device sends the second fragment information of the media to the first terminal device, the method further includes: The second terminal device receives a synchronous play request sent by the first terminal device, where the synchronous play request is used to request the second terminal device to play the media synchronously with the first terminal device.
20. A terminal device, characterized in that: It comprises a memory and at least one processor connected to the memory, the memory is used to store computer program code, the computer program code comprises computer instructions, when the computer instructions are executed by the at least one processor, the terminal device executes the method as claimed in any one of claims 1 to 11, or executes the method as claimed in any one of claims 12 to 19.
21. A computer-readable storage medium, characterized in that: Computer instructions are stored, and when the computer instructions are executed on a computer, the method according to any one of claims 1 to 11 or the method according to any one of claims 12 to 19 is executed.
22. A communication system, characterized in that: It includes a first terminal device, a second terminal device, a first index file server, a second index file server, a first media server and a second media server; the first terminal device is used to execute the method described in any one of claims 1 to 11, and the second terminal device is used to execute the method described in any one of claims 12 to 19.
Citation Information
Patent Citations
Method, device and system for synchronously playing media
CN119155494A
Method, device and system for playing media between synchronic HS (HTTP (HyperText Transfer Protocol) Streaming) terminal equipment
CN102170584A
Method, device, equipment and system for synchronously playing media information
CN102546608A
Method, system and device for synchronization of media streams
CN102742249A
Methods and systems for synchronizing data streams across multiple client devices
US10397636B1
