Method, device and system for synchronously playing media

By transmitting media index files and shard information between terminal devices and determining the start-up instructions, the synchronization problem during the start-up of video is solved and the user experience is improved.

CN119155494APending Publication Date: 2024-12-17HUAWEI TECH CO LTD
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202310714713.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-15
Publication Date
2024-12-17

AI Technical Summary

Technical Problem

The existing synchronous viewing technology cannot effectively solve the synchronization problem of media content when the video starts broadcast, resulting in poor user experience.

Method used

By transmitting media index files and shard information between terminal devices, the start-up instruction information is determined to ensure that multiple terminals play media content simultaneously during start-up.

Benefits of technology

It realizes media content synchronization during broadcasting of multiple terminals, improving the user's synchronous viewing or listening media experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119155494A_ABST
    Figure CN119155494A_ABST
Patent Text Reader

Abstract

The invention provides a method, a device and a system for synchronously playing media, relates to the technical field of multimedia, and can ensure synchronous playing of multiple terminals so as to improve the experience of a user for synchronously watching or listening to the media. The method comprises the steps that a first terminal device obtains a first media index file and second fragment information of media, and the first media index file is obtained by the first terminal device from an accessed first index file server; the second fragment information is fragment information in a second media index file of the media acquired from a second index file server by a second terminal device; the first terminal equipment determines play starting indication information according to the first media index file and the second fragment information, and the play starting indication information is used for indicating media content which is started to be played when the media is played; and the first terminal device sends play starting indication information to the second terminal device, so that the second terminal device starts to play the media according to the play starting indication information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] 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

[0002] With the growth of bandwidth and the improvement of hardware performance, multiple users can watch the same video or listen to the same audio through their respective terminals, such as watching a football game or a movie together, which can achieve the effect of watching or listening together in a real scene. This kind of viewing scenario of watching the same video synchronously can be called cloud viewing or synchronous viewing. The following description takes synchronous viewing as an example.

[0003] In order to ensure that users participating in synchronized viewing have a high 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 that initiates 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 required, 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.

[0004] The existing method 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 asynchrony at the beginning of playing, and the asynchrony of the playing content at the beginning of playing will make the user experience poor. Summary of the invention

[0005] The embodiments of the present application provide a method, device and system for synchronously playing media, which can ensure that multiple terminals start playing synchronously, thereby improving the user's experience of synchronously watching or listening to media.

[0006] In order to achieve the above purpose, the embodiment of the present application adopts the following technical solution:

[0007] 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 is obtained by the first terminal device from a first index file server, and the second fragment information is the fragment information in the second media index file of the media obtained by the second terminal device from the second index file server; and the first terminal device determines the start indication information according to the first media index file and the second fragment information, the start indication information is used to indicate the media content to be played when playing the media; and 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, and can ensure that multiple terminals start playing synchronously, thereby improving the user's experience of synchronously watching or listening to the media.

[0008] In a possible implementation, the method for synchronously playing media provided in the embodiment of the present application further includes: the first terminal device plays the media according to the start indication information. Since the first terminal device and the second terminal device both play the same media according to the start indication information, it can be ensured that the first terminal device and the second terminal device start the same media content when playing the media synchronously, and it can be ensured that multiple terminals start synchronously, thereby improving the user's experience of synchronously watching or listening to the media.

[0009] In one possible implementation, 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 where the media content to be played starts, 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 fragment 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 the media fragment with the third serial number according to the serial number of the media fragment downloaded from the first media server corresponding to the first index file server. The start indication information indicates the serial number of the media fragment, so that the first terminal device can directly determine the media fragment to be played starting from the serial number, and can quickly and efficiently obtain the media fragment.

[0010] In a 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 starts, 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 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 back 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. Then the first terminal device determines the 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 number of the media segment downloaded by the first index file server corresponding to the first media server.

[0011] 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.

[0012] Among them, 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. 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, and the first media content is the media content corresponding to the fourth timestamp indicated by the second offset.

[0013] In a 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 is 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 sequence number according to the fourth offset, and starts playing the second media content in the media fragment with the fifth sequence number according to the sequence number of the media fragment downloaded by the first media server, and the second media content is the media content corresponding to the fifth timestamp indicated by the fourth offset.

[0014] 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.

[0015] In a possible implementation, the start indication information also includes start time information, and the start time information is used to indicate the system time for starting to play the media content. Then the first terminal device plays 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 starts to play the downloaded media segment. 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 multiple terminals start playing the media synchronously.

[0016] 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.

[0017] In a possible implementation, the first terminal device obtaining the second fragment information of the media specifically includes: the first terminal device receiving the second fragment information of the media from the second terminal device. Alternatively, 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.

[0018] In a possible implementation, 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, specifically including: the first terminal device determines the 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; and determines the second fragment information according to 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, and the first terminal device determines the second fragment information by itself, which can save the overhead of the second terminal device.

[0019] In the 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 is the fragment information in the 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 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 and the second fragment information of the media, the first media index file is 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 the media.

[0020] 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 starts, 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 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.

[0021] In a 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 starts, 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 of 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 back 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 the media segment with the fourth sequence number according to the media segment sequence number downloaded from the second media server.

[0022] In a possible implementation, the second segment information is the segment information of the media segment indicated in the second media index file, and the start indication information includes the serial number of the second target media segment where the media content to be played starts and the third offset of the start time of the media content to be played starts 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. Then 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 media server, and starts playing from the third media content in the second target media segment, and the third media content is the media content corresponding to the sixth timestamp indicated by the third offset.

[0023] In a 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, and 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 sequence number according to the fourth offset, and starting to play the fourth media content in the media fragment with the sixth sequence number according to the sequence number of the media fragment downloaded by the second media server, and the fourth media content is the media content corresponding to the seventh timestamp indicated by the fourth offset.

[0024] 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.

[0025] In a possible implementation, the start indication information also includes start time information, which is used to indicate the system time for starting to play the media content. Then the second terminal device plays the media according to the start indication information specifically 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. 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.

[0026] 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.

[0027] In a third aspect, an embodiment of the present application provides a terminal device, which is referred to as a first terminal device, and the first terminal device includes an acquisition module, a determination module, and a sending module. The acquisition module is used 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 used to determine the start indication information according to the first media index file and the second fragment information, wherein the start indication information is used to indicate the media content to be started when playing the media; and the sending module is used to send the start indication information to the second terminal device.

[0028] In a possible implementation, the first terminal device further includes a media output module, and the media output module is used to play the media according to the start indication information.

[0029] In a 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 initially is located, 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. The above-mentioned media output module is specifically used to start playing the media segment with the third serial number according to the serial number of the media segment downloaded by the first media server corresponding to the first index file server.

[0030] In a possible implementation, the second segment information is the second start timestamp of the latest media segment in the second media index file, then the start indication information includes the third start timestamp of the media segment where the media content to be played is located, the third start timestamp is not later than the first start timestamp, and is not later than the second start timestamp, 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, 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. The above acquisition module is also specifically used to determine the fourth serial number according to 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 according to the serial number of the media segment downloaded from the first index file server corresponding to the first media server.

[0031] In a possible implementation manner, the second segment information is segment information of the media segment indicated in the second media index file, and the start indication information includes the first start indication information and the second start indication information.

[0032] The first broadcast indication information includes a sequence number of a first target media segment where the media content to be played initially is located 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, wherein the first target media segment is one of the media segments indicated by the first media index file. The acquisition module is also used to download the first target media segment from the first media server; the media output module is specifically used to start playing from the first media content in the first target media segment, wherein the first media content is the media content corresponding to the fourth timestamp indicated by the second offset.

[0033] In a 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 acquisition module is also used to determine the fifth sequence number according to 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 according to 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.

[0034] In a possible implementation, the start indication information also includes start time information, which is used to indicate the system time for starting to play the media content. The media output module is also used to start playing the downloaded media segment when the system time reaches the time indicated by the start time information.

[0035] In a possible implementation, the sending module is further used 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.

[0036] In a possible implementation, the first terminal device further includes a receiving module, which is used to receive second fragment information of the media from the second terminal device.

[0037] In a possible implementation manner, 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.

[0038] In a possible implementation, the acquisition module is specifically used to determine the 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 determine 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.

[0039] In a fourth aspect, an embodiment of the present application provides a terminal device, the second terminal device comprising a sending module, a receiving module and a media output module. The sending module is used to send the second fragment information of the media to the first terminal device, the second fragment information is the fragment information in the second media index file of the media obtained by the second terminal device from the second index file server; the receiving module is used to receive the start indication information of the media from the first terminal device, the start indication information is used to indicate the media content to be played 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, the first media index file is obtained by the first terminal device from the first index file server; the media output module is used to play the media according to the start indication information.

[0040] In a possible implementation, the first terminal device also includes an acquisition module. The above-mentioned 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 where the media content to be played starts, 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 fragment of the first media index file. Then the media output module is specifically used to start playing from the media fragment with the third serial number according to the serial number of the media fragment downloaded by the second media server corresponding to the second index file server.

[0041] In a possible implementation, the second segment information is the second start timestamp of the latest media segment in the second media index file, then the start indication information includes the 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, 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 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 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 according to the third start timestamp or the first offset, and start playing the media segment with the fourth sequence number according to the sequence number of the media segment downloaded by the second media server.

[0042] In a possible implementation, the second segment information is the segment information of the media segment indicated in the second media index file, and the start indication information includes the sequence number of the second target media segment where the media content to be played starts and the third offset of the start time of the media content to be played starts 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. Then the acquisition module is used to download the second target media segment from the second media server; the media output module is specifically used to start playing from the third media content in the second target media segment, and the third media content is the media content corresponding to the sixth timestamp indicated by the third offset.

[0043] In a possible implementation, the second segment information is the segment information of the media segment 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 segment 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 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 played back in the first media index file is located. The acquisition module is used to determine the sixth sequence number according to the fourth offset, and the media output module is specifically used to start playing the fourth media content in the media segment with the sixth sequence number according to the sequence number of the media segment downloaded from the second media server, and the fourth media content is the media content corresponding to the seventh timestamp indicated by the fourth offset.

[0044] In a possible implementation, the start indication information also includes start time information, which is used to indicate the system time for starting to play the media content. The media output module is also used to start playing the downloaded media segment when the system time reaches the time indicated by the start time information.

[0045] In a possible implementation, the receiving module is further used 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.

[0046] 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, and when the computer instructions are executed by at least one processor, the terminal device 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.

[0047] 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.

[0048] 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.

[0049] 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.

[0050] In a ninth aspect, an embodiment of the present application provides a communication system, including 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 of any one of the first aspect and its possible implementations, and the second terminal device is used to execute the method of any one of the second aspect and its possible implementations.

[0051] It should be understood that the beneficial effects achieved by the technical solutions of the third to ninth aspects of the present 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

[0052] Figure 1 A schematic diagram of the architecture of a streaming media transmission system provided in an embodiment of the present application;

[0053] Figure 2 A schematic diagram of a media index file in the HLS transmission protocol provided in an embodiment of the present application;

[0054] Figure 3 A schematic diagram of a content distribution network provided in an embodiment of the present application;

[0055] Figure 4 A schematic diagram of the architecture of a system for synchronously playing media provided in an embodiment of the present application;

[0056] Figure 5 A schematic diagram of the hardware structure of a mobile phone provided in an embodiment of the present application;

[0057] Figure 6 One of the schematic diagrams of a method for synchronously playing media provided in an embodiment of the present application;

[0058] Figure 7 A schematic diagram of the architecture of another system for synchronously playing media provided in an embodiment of the present application;

[0059] Figure 8 A second schematic diagram of a method for synchronously playing media provided in an embodiment of the present application;

[0060] Fig. 9A third schematic diagram of a method for synchronously playing media provided in an embodiment of the present application;

[0061] Fig.10 A fourth schematic diagram of a method for synchronously playing media provided in an embodiment of the present application;

[0062] Fig.11 A fifth schematic diagram of a method for synchronously playing media provided in an embodiment of the present application;

[0063] Fig.12 One of the structural schematic diagrams of a first terminal device provided in an embodiment of the present application;

[0064] Fig.13 A second structural diagram of a first terminal device provided in an embodiment of the present application;

[0065] Fig.14 One of the structural schematic diagrams of a second terminal device provided in an embodiment of the present application;

[0066] Fig.15 The second structural diagram of a second terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0067] The term "and / or" in this article is merely a description of the association relationship of 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.

[0068] 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 the objects.

[0069] In the embodiments of the present 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 the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0070] In the description of the embodiments of the present application, unless otherwise specified, “plurality” means two or more.

[0071] First, some concepts and background knowledge involved in a method, device, and system for synchronously playing media provided in an embodiment of the present application are explained.

[0072] 1. Play media synchronously

[0073] Synchronous media playback on multiple terminals allows multiple people to watch or listen to the same media (such as video, audio, etc.) across terminals and / or regions at the same time. Therefore, even multiple users in different locations can watch the same video or listen to the same audio at the same time through their respective terminal devices. Synchronous viewing of the same video by multiple people is called synchronized viewing, which can achieve an effect similar to watching a movie together in a real scene.

[0074] 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.

[0075] 2. HLS transmission protocol and DASH transmission protocol

[0076] HTTP live streaming (HLS) transmission protocol and dynamic adaptive streaming over HTTP (DASH) transmission protocol are both streaming media network transmission protocols based on HTTP, where HTTP is a hypertext transfer protocol.

[0077] refer to Figure 1 The architecture diagram of the streaming media transmission system shown in the figure is applicable to both the HLS transmission protocol and the DASH transmission protocol. 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.

[0078] Combination Figure 1 , the basic principles of media transmission based on HLS and DASH are:

[0079] The server 101 obtains the media (which may be a video stream or an audio stream) input from the video and audio device (such as a microphone or a camera), and then the media encoder of the server 101 encodes the streaming media at different bit rates into a format suitable for transmission by the distribution component 102, and then the stream splitter divides the encoded media stream into multiple small media files (which may be ts files or fmp4 files), which may also be called media fragments, and sends the media files to the server of the distribution component 102 for storage in sequence, and the media files of different bit rates are used as backup media files for selection by the client 103. The size of the media fragment is determined according to the configuration, for example, the time length of each fragment can be 2 seconds, 4 seconds, 6 seconds, etc.

[0080] Furthermore, the stream segmenter creates an index file containing pointers to these small media files, for example, writes the playback addresses (such as uniform resource locators (URLs)) of these media files into an index file in the playback order, and also stores the index file in the server of the distribution component 102. Optionally, the stream segmenter can also encrypt each media file it generates and generate a corresponding key file, and also store the key file in the server of the distribution component 102.

[0081] The distribution component 102 sends the index file of the media requested by the client 103 to the client 103 via HTTP, and then the client 103 selects a media file with a suitable bit rate from the backup media files with different bit rates of the same media content according to its own bandwidth and performance limitations, and then downloads and plays the media file from the server of the distribution component 102. Specifically, after the client 103 selects the media file with a suitable bit rate according to the index file, it sends the URL of the media file to the distribution component 102, and the distribution component 102 sends the media file corresponding to the URL to the client 103.

[0082] 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.

[0083] 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 address of the rate index file (MediaPlaylist) is stored in the master index file, 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.

[0084] The media index file (MPD file) in the DASH transmission protocol stores the address of each media file at all bit rates, without the concept of classification.

[0085] refer to Figure 2 The following briefly introduces the usage principle of media index files by taking the media index file (i.e., m3u8 file) in the HLS transmission protocol as an example.

[0086] After the client obtains the URL of the main index file of the media, 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, and then obtains the bitrate index file (including the URL of each media segment under the bitrate) according to the URL of the bitrate index file, and then obtains the URL of the video segment from the bitrate index file, and then downloads and plays the video segment according to the URL of the video segment.

[0087] 3. Content delivery network (CDN)

[0088] Above Figure 1 The distribution component in 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.

[0089] 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.

[0090] The present application embodiment takes the three-level CDN as an example. Figure 3 As shown, the three-level CDN divides the management domain into three layers according to location, namely the CDN center layer, the CDN regional layer and the CDN edge layer, wherein 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.

[0091] In an embodiment of the present application, CDN nodes within an area of ​​a specified range 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, the CDN center layer corresponds to a prefecture-level city in a province, the CDN regional layer corresponds to urban areas other than prefecture-level cities, and the CDN edge layer corresponds to counties. Generally, 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 sizes of media segments at different levels in the same business management domain are the same. However, the sizes of media segments for central nodes in different business management domains may be different.

[0092] Optionally, each node in the CDN (also referred to as a CDN node) may be implemented by one or more servers.

[0093] In CDN, the central node has functions such as load balancing, content distribution, and scheduling. Figure 3 In the 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 in the central node executes the above Figure 1 The central node stores the media segments in the central node and continuously adds the address of the media segments to the bitrate index file corresponding to the media segments to update the bitrate index file. In addition, the central node also sends the media segments to the next layer of regional nodes. Similarly, the regional nodes also store the media segments and update the bitrate index file in the regional nodes. After that, the regional nodes send the media segments to the next layer of edge nodes. The regional nodes store the media segments and update the bitrate index file in the regional nodes.

[0094] Optionally, different servers in the CDN have different functions. For example, for each CDN node, the CDN node includes an index file server and a media server, wherein the index file service area is used to store the above media index files (including the main index file and the bit rate index file, i.e., the m3u8 file, or including the MPD file), and the media server is used to store the media files of the media.

[0095] In the scenario of synchronous viewing, when the media played by multiple clients (i.e., multiple terminal devices) is synchronized, the user's viewing experience is better. The existing technical solutions for synchronous viewing are to adjust the progress of multiple clients to the same progress after the media starts playing, that is, during the media playing process, to ensure synchronization.

[0096] In the prior art, a synchronization group including a master terminal (the party initiating 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 in real time the playback progress information (timestamp of the media content) reported by the master terminal and the playback progress information reported by the controlled terminal, and then calculates the error in 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.

[0097] The above method is a method for synchronizing media content during synchronous viewing, which can only solve the problem of asynchronization during synchronous viewing. However, there is still a problem of inconsistent media content being played during synchronous viewing.

[0098] Specifically, in combination with the above content, refer to the above Figure 3, 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 the bitrate index file 1 from the central node. If it is determined that the 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 updates its bitrate index file 2. The edge node located in the edge area periodically (usually 1-2 seconds) obtains the bitrate index file 2 from the regional node. If it is determined that the 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 updates its bitrate index file 3.

[0099] It should be understood that there is a certain delay between CDN nodes at different levels. For example, regional nodes have a delay of 2-3 seconds compared to central nodes, and edge nodes also have a delay of 2-3 seconds compared to regional nodes. In this way, when the CDN accessed by the client is located at different levels, the bitrate index files obtained by the client are different, and thus the media segments that can be obtained are different. For example, taking the example of a 2-second delay between CDN nodes, at a certain moment, the central node has saved 5 media slices (such as slice 1, slice 2, slice 3, slice 4, and slice 5), the regional node may only save 4 media slices (such as slice 1, slice 2, slice 3, and slice 4), and the edge node may only save 3 media slices (such as slice 1, slice 2, and slice 3). Then, the client accessing the central node can obtain 5 media slices, and the bitrate index file includes the addresses of the 5 media slices. The client accessing the regional node can obtain 4 media slices, and the bitrate index file includes the addresses of the 4 media slices. The client accessing the edge node can obtain 3 media slices, and the bitrate index file includes the addresses of the 3 media slices.

[0100] 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 from the third-to-last media segment as an 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.

[0101] Based on the above content, in the scenario of synchronous viewing, when the CDN nodes accessed by each client participating in the synchronous viewing are located at different CDN levels, 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, which is 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.

[0102] 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.

[0103] 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 (referred to as the first terminal device) participating in synchronous viewing 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 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 synchronously watching or listening to media.

[0104] Figure 4This is a schematic diagram of the architecture of a system for synchronously playing media 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 arranged. 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.

[0105] The content provider 406 is used to provide media (such as video stream) to the server 405, and the server 405 includes multiple media resources. Optionally, the server 405 can be an Internet protocol television (IPTV) platform.

[0106] The first CDN node 403 is a CDN node accessed by the first terminal device 401, and the second CDN node 404 is a CDN node accessed by the second terminal device 402. The first CDN node 403 and the second CDN node 404 may be CDN nodes of the same management domain or CDN nodes of different management domains. When the first CDN node 403 and the second CDN node 404 are CDN nodes of the same management domain, the first CDN node and the second CDN node may be CDN nodes of the same level or CDN nodes of different levels, which is not limited in the embodiment of the present application.

[0107] If the server 405 is an IPTV platform, the first terminal device 401 and the second terminal device 402 are terminal devices running IPTV applications (such as IPTV App), such as set-top boxes, mobile phones (with IPTV SDK in the mobile phone), etc. For example, Figure 1 The first terminal device 401 is a set-top box, and the second terminal device 402 is a mobile phone. It can be understood that after the set-top box is started, a menu combining pictures and texts, i.e., an electronic program guide (EPG), can be displayed on the TV screen connected to the set-top box. Through the EPG, users can quickly select the media programs they want 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 the media program.

[0108] Before synchronously playing the media, the first terminal device 401 and the second terminal device 402 need to authenticate and authorize with the server 405 (such as an IPTV platform) respectively, so as to establish a communication connection with the server 405 (refer to Figure 4 ).

[0109] based on Figure 4 In one implementation, the first terminal device 401 can initiate synchronous media playback (e.g., 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 a movie or synchronously listening to audio.

[0110] 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), or the communication connection is an instant communication 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. Figure 4 The communication connection between the first terminal device 401 and the second terminal device 402 is not reflected.

[0111] 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.

[0112] 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 device.

[0113] Taking the mobile phone as an example, Figure 5A 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 screen 594, and a subscriber identification module (SIM) card interface 595, etc. 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.

[0114] It is to be understood that the structure illustrated in the embodiment of the present application does 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 in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0115] 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 processor (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), etc. Different processing units may be independent devices or integrated into one or more processors.

[0116] 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.

[0117] The processor 510 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 510 is a cache memory. The memory may store instructions or data that the processor 510 has just used or cyclically used. If the processor 510 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 510, and thus improves the efficiency of the system.

[0118] In some embodiments, the processor 510 may include one or more interfaces. The interface 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, etc.

[0119] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic 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 different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

[0120] The charging management module 540 is used to receive charging input from a charger. While the charging management module 540 is charging the battery 542 , it can also power the electronic device through the power management module 541 .

[0121] 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, and supplies power to the processor 510, the internal memory 521, the external memory, the display screen 594, the camera 593, and the wireless communication module 560.

[0122] The wireless communication function of the mobile phone 500 can be realized through the antenna 1, the antenna 2, the mobile communication module 550, the wireless communication module 560, the modem processor and the baseband processor.

[0123] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals.

[0124] 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 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc.

[0125] 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.

[0126] 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.

[0127] The mobile phone 500 implements the display function through a GPU, a display screen 594, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 594 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 510 may include one or more GPUs, which execute program instructions to generate or change display information.

[0128] The display screen 594 is used to display images, videos, etc. The display screen 594 includes a display panel. In some embodiments, the mobile phone 500 may include 1 or N display screens 594, where N is a positive integer greater than 1.

[0129] The mobile phone 500 can realize the shooting function through the ISP, the camera 593, the video codec, the GPU, the display screen 594 and the application processor.

[0130] The ISP is used to process the data fed back by the camera 593. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye. The ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. The ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, the ISP can be set in the camera 593.

[0131] 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.

[0132] 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.).

[0133] Video codecs are used to compress or decompress digital videos. Mobile phone 500 may support one or more video codecs. Thus, mobile phone 500 may play or record videos in various coding formats, such as moving picture experts group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

[0134] NPU is a neural-network (NN) computing processor. It can quickly process input information by drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, and can also continuously self-learn.

[0135] 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 through the external memory interface 520 to implement a data storage function, such as storing music, video and other files in the external memory card.

[0136] 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 may 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 may 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.

[0137] The mobile phone 500 can implement audio functions such as music playing and recording through the audio module 570, the speaker 570A, the receiver 570B, the microphone 570C, the earphone interface 570D, and the application processor.

[0138] 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 signal. The audio module 570 can also be used to encode and decode audio signals. In some embodiments, the audio module 570 can be arranged in the processor 510, or some functional modules of the audio module 570 can be arranged in the processor 510.

[0139] The speaker 570A, also called a "speaker", is used to convert an audio electrical signal into a sound signal. The mobile phone 500 can listen to music or listen to a hands-free call through the speaker 570A.

[0140] The receiver 570B, also called a "handset", is used to convert audio electrical signals into sound signals. When the mobile phone 500 receives a call or voice message, the voice can be received by placing the receiver 570B close to the ear.

[0141] Microphone 570C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by approaching the microphone 570C with his mouth to input the sound signal into the microphone 570C.

[0142] The headphone jack 570D is used to connect wired headphones.

[0143] The key 590 includes a power key, a volume key, etc. The key 590 can be a mechanical key or a touch key. The mobile phone 500 can receive key input and generate key signal input related to the user settings and function control of the mobile phone 500.

[0144] 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.

[0145] Indicator 592 may be an indicator light, which may be used to indicate charging status, power changes, messages, missed calls, notifications, etc.

[0146] The SIM card interface 595 is used to connect a SIM card. The SIM card can be connected to or disconnected from the mobile phone 500 by inserting the SIM card interface 595 or removing the SIM card interface 595. The mobile phone 500 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1.

[0147] It is understandable that in the embodiment of the present application, the mobile phone 500 can perform some or all of the steps in the embodiment of the present application, and these steps or operations are only examples. The mobile phone 500 can also perform other operations or variations of various operations. In addition, each step can be performed in a different order presented in the embodiment of the present application, and it is possible that not all operations in the embodiment of the present application need to be performed. The various embodiments of the present application can be implemented separately or in any combination, and the present application does not limit this.

[0148] Based on the above, the method for synchronously playing media provided by the embodiment of the present application is described in detail below. Figure 6 As shown, 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:

[0149] S601. A first terminal device sends a synchronous playback request to a second terminal device. Correspondingly, the second terminal device receives the synchronous playback request, where the synchronous playback request is used to request the second terminal device to synchronously play media with the first terminal device.

[0150] Optionally, the media played synchronously by the first terminal device and the second terminal device may be video or audio. That is, the user of the first terminal device can watch videos synchronously with the user of the second terminal device, such as watching movies, variety shows, ball games, news, etc., and the user of the first terminal device can also listen to audio synchronously with the user of the second terminal device, such as listening to music, listening to books, etc.

[0151] In the embodiment of the present application, when the first terminal device decides to initiate synchronous playback of media to the 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.

[0152] S602: The first terminal device obtains a first media index file of the media from a first index file server.

[0153] It should be understood that the first index file server is located in the first CDN node accessed by the first terminal device, and the first media index file is a media index file of the media stored in the first index file server, and the first media index file includes the fragment information of the media (which may be referred to as the first fragment information), for example, the URL of the media fragment of the first bit rate stored by sequence number. After the user selects a suitable bit rate (such as the first bit rate) on the first terminal device, the first index file server returns the media index file corresponding to the first bit rate to the first terminal device.

[0154] 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.

[0155] 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 accessed by the second terminal device.

[0156] S604: The first terminal device obtains second fragment information of the media.

[0157] 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 of the second bit rate.

[0158] 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.

[0159] Optionally, the second fragment information may be any one of the following A1-A3:

[0160] A1, the second segment information is the second sequence number of the latest media segment in the second media index file;

[0161] A2, the second segment information is the second starting timestamp of the latest media segment in the second media index file; or

[0162] A3. The second fragment information is the fragment information of the media fragment indicated in the second media index file.

[0163] 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 (indicating 0 hours, 0 minutes, 0 seconds), and the start playing time point of a certain media segment in the media is 00:00:10 (indicating 0 hours, 0 minutes, 10 seconds).

[0164] 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.

[0165] Method 1: The first terminal device receives the second segment information of the media from the second terminal device.

[0166] In the 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 bit rate (such as the second bit rate) on the second terminal device, the second index file server returns the media index file corresponding to the second bit rate to the second terminal device, and the second terminal device sends the second segment information (such as the sequence number of the latest segment, the start timestamp of the latest segment, or the second media index file) to the first terminal device according to the second media index file.

[0167] Method 2: The first terminal device determines the second fragment information according to the location information of the first media index file, 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.

[0168] 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 fragmentation 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 accessed by the first terminal device obtained from the server (such as an IPTV platform), and the location information of the second CDN node or the second index file server accessed by the second terminal device. 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 fragmentation information using the location information of the CDN node as an example.

[0169] 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.

[0170] 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.).

[0171] In the embodiment of the present application, the 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.

[0172] That is, the above-mentioned method 2 specifically includes the following S1-S2.

[0173] S1. The first terminal device determines the delay between the first CDN node and the second CDN node according to the location information of the first CDN node and the location information of the second CDN node.

[0174] 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.

[0175] Combined with the above Figure 3From the CDN architecture diagram and related descriptions shown in , it can be seen that there is a certain delay between CDN nodes at different levels in the same management domain, and there is no delay (or the delay can be ignored) between CDN nodes at the same level in the same management domain. For example, the delay between the central node and the regional node may be 2 seconds, the delay between the regional node and the edge node is 2 seconds, and the delay between the central node and the edge node is 4 seconds.

[0176] 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.

[0177] In the embodiment of the present application, the number of slices that differ between the media slices in the first CDN node and the media slices in the second CDN node is calculated based on the time delay between the first CDN node and the second CDN node, and then the second slice information in the second media index file can be determined based on the media slices indicated by the first media index file and the number of the slices that differ. Compared with the above-mentioned method 1, in method 2, the second terminal device does not need to send the second slice information to the first terminal device, and the first terminal device determines the second slice information by itself, which can save the overhead of the second terminal device.

[0178] For example, continue to refer to Figure 3 , assuming that the size of a media segment in a management domain is 2 seconds, the first CDN node is a central node, the second CDN node is a regional node, 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, 5, and the delay between the first CDN node and the second CDN node is 2 seconds. The difference between the first CDN node and the second CDN node is 1 media segment, that is, the media segment in the first CDN node is 1 more than the media segment in the second CDN node. Therefore, according to the first media The index file can determine the second media index file, which includes 4 media segments, and the serial numbers are 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).

[0179] 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, the serial numbers are 1, 2, 3, 4, 5, and the delay between the first CDN node and the second CDN node is 4 seconds. Then, there are 2 media segments between the first CDN node and the second CDN node, that is, the media segments in the first CDN node are 2 more than the media segments in the second CDN node. Therefore, the second media index file can be determined according to the first media index file. 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).

[0180] 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.

[0181] It should be noted that the size of the media segment in the first CDN node may be the same as or different from the size of the media segment in the second CDN node.

[0182] 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 start indication information determined in the above-mentioned S605 can include the following three implementation methods (implementation method 1 to implementation method 3).

[0183] Implementation 1: The first terminal device determines the start indication information according to the first media index file and the second fragment information, specifically including: the first terminal device determines the third sequence number according to the sequence number of the latest fragment of the first media index file (hereinafter referred to as the first sequence number) and the sequence number of the latest fragment of the second media index file (i.e., the second sequence number), and the third sequence number is the sequence number of the media fragment where the media content to be played initially is located. It should be noted 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.

[0184] 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.

[0185] 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 security buffering, the first terminal device determines the media segment with the smallest serial number as the media segment to be played back (i.e., the third serial number), that is, the media content to be played back is the media segment with the serial number of 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 security buffering are retained, the third serial number is determined based on the number of media segments retained for security buffering and the smallest serial number. For example, if two media segments need to be retained as security buffers, the playback starts from the third to last media segment starting from the smallest serial number, that is, the playback starts from the media segment with the serial number of 2, that is, the media content to be played back is the media segment with the serial number of 2.

[0186] Implementation method 2, the first terminal device determines the start indication information according to the first media index file and the second fragment information, specifically including: the first terminal device determines the third start timestamp according to 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), and the third start timestamp is the start timestamp of the media fragment where the media content to be played starts. It should be noted that the third start timestamp is not later than the first start timestamp and not later than the second start timestamp.

[0187] That is, the start indication information includes the third start timestamp of the media segment where the media content to be played starts. It should be understood that the size of the timestamp indicates the early or late time. Generally, the smaller the timestamp, the earlier the time, and the larger the timestamp, the later the time. Therefore, when comparing timestamps, it can be described as the size relationship of the timestamps or the early or late relationship of the timestamps.

[0188] Example 2, assuming that the start timestamp of the latest segment in the first media index file indicates that the start playback time point 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 point 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 security buffering, the first terminal device determines the earliest start timestamp (or the smallest start timestamp) media segment as the timestamp of the media content to be played (i.e., the third timestamp), that is, the time point corresponding to the start timestamp of the media content to be played is 00:00:06, at which 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 security buffering, the third starting timestamp is determined according to the duration of the media content of the retained security buffer and the minimum starting timestamp. For example, if 4 seconds of media content needs to be retained as a security buffer, the playback is started 4 seconds backwards 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 that starts 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.

[0189] Implementation method 3, the first terminal device determines the start indication information according to the first media index file and the second fragment information, including: the first terminal device determines the first offset of the start timestamp of the media content to be played back relative to the start timestamp of the media according to 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.

[0190] 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.

[0191] Example 3, similar to the example in the second implementation method, 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 start timestamp of the latest segment in the first media index file indicates that the start playback time point of the latest segment is 00:00:10 (indicating 0 hours, 0 minutes, 10 seconds), and the start timestamp of the latest segment in the second media index file indicates that the start 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 segment 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), then the starting timestamp of the media content to be played back 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 start timestamp of the media (10 seconds), and the first offset is also smaller than the offset of the second starting timestamp relative to the start timestamp of the media (6 seconds).

[0192] 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 second segment information may 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 start indication information determined in the above-mentioned S605 may include the following two implementation methods (implementation method 4-implementation method 5).

[0193] Implementation method 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 be started when playing the media, and the second start indication information is used to indicate to the second terminal device the media content to be started when playing the media.

[0194] 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) where the media content is located and a 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.

[0195] 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.

[0196] Optionally, the first terminal device determines the second 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 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.

[0197] 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 the 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.

[0198] 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, 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, 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 video content to be played starting 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 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.

[0199] Implementation method 5, the first terminal device determines the second start indication information according to 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 played according to 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 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 is 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.

[0200] 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.

[0201] Example 5, similarly, assuming 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, 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, and the start playback time of the media 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.

[0202] As can be seen from the description of the start indication information in the above embodiments, 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 according to actual needs.

[0203] In one implementation, the start indication information also 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, the system time of the first terminal device and the second terminal device is synchronized to the world standard time or the universal time coordinated (UTC) through the network time protocol (NTP).

[0204] The start time information may be an absolute time or a relative time, and the relative time may 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.

[0205] In one implementation, the system time for starting to play the media content is configured on the first terminal device and the second terminal device, or a time offset is configured in the IPTV platform, and the offset is an offset relative to the configured start time of the media segment.

[0206] 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.

[0207] S606: The first terminal device plays the media according to the start instruction information.

[0208] In combination with the content of the start-play instruction information described in S605, correspondingly, the first terminal device plays the media according to the start-play instruction information including the following situations.

[0209] 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 in any of the following methods B1-B2.

[0210] B1. When the start indication information includes the third serial number of the media segment in which the media content to be played back is located, the first terminal device plays the media according to the start indication information specifically 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 by the first media server (also described as the first CDN node) corresponding to the first index file server.

[0211] For Example 1 in the above-mentioned Implementation Method 1, the media content determined to be started for playback has a serial number (third serial number) of 3, and the first terminal device starts playing the media segment with a serial number of 3 among the media segments downloaded from the first CDN node.

[0212] 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 located. 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.

[0213] 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 first terminal device starts playing from the media segment with serial number 3 among the media segments downloaded from the first CDN node.

[0214] 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 first terminal device starts playing the media segment with serial number 3 in the media segment downloaded from the first CDN node.

[0215] Case 2: When 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 media is played through any of the following methods C1-C2.

[0216] 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 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. 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, the first media content is the media content corresponding to the fourth timestamp indicated by the second offset.

[0217] For Example 4 in the above-mentioned implementation method 4, the first target media segment in which 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 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.

[0218] 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 a 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.

[0219] 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 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] S607: The first terminal device sends broadcast start indication information to the second terminal device, and correspondingly, the second terminal device receives the broadcast start indication information from the first terminal device.

[0221] S608: The second terminal device plays the media according to the start-play instruction information.

[0222] Similar to the above S606, combined with the content of the start indication information described in the above S605, correspondingly, the second terminal device plays the media according to the start indication information including the following situations.

[0223] 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 in any of the following methods D1-D3.

[0224] D1. When the start indication information includes the third serial number of the media segment in which the media content to be played back is located, the second terminal device plays the media according to the start indication information specifically 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 by the second media server (also described as the second CDN node) corresponding to the second index file server in the second CDN node.

[0225] For Example 1 in the above-mentioned Implementation Method 1, the media content determined to be started for playback has a serial number (third serial number) of 3, and the second terminal device starts playing the media segment with a serial number of 3 among the media segments downloaded from the second CDN node.

[0226] 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.

[0227] 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 located. 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.

[0228] 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.

[0229] 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.

[0230] Case 2: 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 media is played through any of the following methods E1-E2.

[0231] 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 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. 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.

[0232] 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.

[0233] 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.

[0234] 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.

[0235] 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 segments.

[0236] 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 the media from 00:00:14 when the system time reaches 21:09:22.

[0237] 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 media obtains the first media index file of the media from the first index file server, and obtains the second segment 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 segment 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 it can be ensured that the first terminal device and the second terminal device start playing the same media content when playing the media synchronously, and it can be ensured that multiple terminals start playing synchronously, thereby improving the user's experience of synchronously watching or listening to the media.

[0238] In the above-mentioned method for synchronously playing media, the communication connection for the first terminal device to interact with the second terminal device can be an RTC instant communication initiated and established by the first terminal device to the second terminal device when the first terminal device initiates synchronous playing of media, or it can also be other communication connections that have been established between the first terminal device and the second terminal device before the first terminal device initiates synchronous playing of media. This embodiment of the present application is not limited.

[0239] It should be noted that if the first terminal device initiates RTC instant communication to the second terminal device while synchronously playing media, the first terminal device and the second terminal device can also implement a chat function based on the instant communication while synchronously playing the media, such as video calls, audio calls or text chats.

[0240] The following takes the RTC instant communication initiated by the first terminal device to the second terminal device when initiating synchronous media playback as an example to introduce the architecture of a system for synchronous media playback. 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.

[0241] 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 .

[0242] The above-mentioned RTC network 705 is a network 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-up 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.

[0243] For example, the RTC network 705 may be a web RTC network or the IP-multimedia subsystem (IMS).

[0244] 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 RTCApp). 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 run by the first terminal device 701 and the second terminal device 702 can be independent applications or an application integrating the functions of the two. The specific implementation form is not limited in the embodiment of the present application.

[0245] For the introduction of content provider 707 and server 706 and other contents, please refer to the above embodiments for Figure 4 Description of the system architecture shown.

[0246] Below Figure 7 The connection relationship between each device and network in the system is described.

[0247] The line marked ① represents the message flow between the server 706 and the first terminal device 701.

[0248] The line marked ② indicates the message flow between the server 706 and the second terminal device 702 .

[0249] The line marked ③ represents the media flow between the server 706 , the first CDN node 703 and the first terminal device 701 .

[0250] The line marked ④ represents the media flow between the server 706 , the second CDN node 704 and the second terminal device 702 .

[0251] The line marked ⑤ represents the control plane signal flow between the RTC network 705 and the first terminal device 701 .

[0252] The line marked ⑥ represents the media plane or data channel between the RTC network 705 and the first terminal device 701.

[0253] The line marked ⑦ represents the control signal flow between the RTC network 705 and the second terminal device 702 .

[0254] The line marked ⑧ represents the media plane or data channel between the RTC network 705 and the second terminal device 702.

[0255] and Figure 4 Similar to the architecture shown, before synchronously playing the media, the first terminal device 701 needs to interact with the server 706 (such as an IPTV platform) according to the message flow marked by ① above for authentication and authorization, and the second terminal device 702 needs to interact with the server 706 (such as an IPTV platform) according to the message flow marked by ② above for authentication and authorization.

[0256] The following embodiments take the IPTV platform as an example of the server side. IPT introduces the processes of several detailed methods for synchronously playing media under the HLS transmission protocol and the DASH transmission protocol. It should be understood that the IPTV platform includes a service management platform and a service capability platform. Among them, the service management platform is used to authenticate and manage the access of terminal devices, and the service capability platform is used to authenticate and authorize the media content provided by the content provider, and then send it to the CDN network after processing.

[0257] like Figure 8 As shown, 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:

[0258] S801. The first terminal device obtains information such as a channel list and a service entry address from a service management platform of the IPTV platform.

[0259] It should be understood that the first terminal device obtains information such as the channel list and the service entry address, and displays the EPG browsing interface according to the channel list and the service entry address, so that the user can select a favorite media program from the EPG browsing interface according to the viewing needs. Figure 7 The message flow marked with ① is implemented.

[0260] S802: The first terminal device determines to initiate synchronous media playback to the second terminal device.

[0261] In one implementation, a user can select a designated control for triggering synchronous playback of media, 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 movie viewing object, thereby triggering the subsequent synchronous movie viewing process.

[0262] S803: The first terminal device and the second terminal device establish instant communication (including media interface and data channel) through the RTC network.

[0263] In the 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 a synchronous movie viewing to the second terminal device and the third terminal device). S803 passes Figure 7 The message flows indicated by ⑤ and ⑦ are implemented, that is, the first terminal device, the RTC network and the second terminal device send a session request through the control plane signal flow, thereby establishing instant communication.

[0264] The establishment of instant communication between the first terminal device and the second terminal device includes 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 make a video or voice call with the second terminal device through the media interface, and send the EPG to the second terminal device through the media interface or the data channel, so that the EPG browsing interface can also be displayed on the second terminal device.

[0265] S804: The first terminal device sends a service request to the service capability platform of the IPTV platform, where the service request is used to subscribe to the media to be synchronously played.

[0266] 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.

[0267] In the embodiment of the present application, the user chooses to initiate synchronous playback of media to the second terminal device, and the user can select a media service (live broadcast service or other) in the EPG browsing interface to play synchronously with the second terminal device. In response to the user's operation of selecting the media, the first terminal device sends the above service request to the service capability platform of the IPTV platform, and then the service capability platform returns the URL of the main index file of the media. The main index file includes the URLs of multiple bit rate index files. S805 passes Figure 7 The message flow marked with ① is implemented.

[0268] It should be noted that the embodiment of the present application does not limit the execution order of S803 and S804-S805, and 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 communication with the first 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 communication with the second terminal device. Alternatively, S803 and S804-S805 may be executed simultaneously.

[0269] S806: The first terminal device sends a message to the second terminal device, where the message includes a URL of a main index file of the media.

[0270] Optionally, the first terminal device may send the URL of the main index file to the second terminal device through the control plane information of the RTC network, for example, through Figure 7 The message flow marked by ⑤ sends the URL of the main index file to the RTC network, and the RTC network sends the URL of the main index file to the RTC network through Figure 7 The message flow marked with ⑦ in the figure sends the URL of the main index file to the second terminal device. Alternatively, the first terminal device can also send the URL of the main index file to the second terminal device through the established data channel, for example, the first terminal device sends the URL of the main index file to the second terminal device through Figure 7 The message flow marked by ⑥ in the figure sends the URL of the main index file to the RTC network, which then sends the URL of the main index file to the RTC network through Figure 7 The message flow marked with ⑧ sends the URL of the main index file to the second terminal device.

[0271] S807. The first terminal device sends a first HLS request message to the first CDN node. The first HLS request message includes a URL of the main index file of the media.

[0272] The first HLS request message is used to request to obtain the main index file stored in the first CDN node.

[0273] S808. The first CDN node sends a first HLS response message to the first terminal device, where the first HLS response message includes a primary index file of the media.

[0274] S809. The first terminal device determines the URL of the first bit rate index file according to the main index file.

[0275] The first terminal device selects a suitable bitrate according to the current network status (eg bandwidth size) and the capabilities of the first terminal device, and determines the URL of the bitrate index file corresponding to the bitrate from the first index file (referred to as the URL of the first bitrate index file).

[0276] S810. The first terminal device sends a second HLS request message to the first CDN node, where the second HLS request message includes the URL of the first bit rate index file.

[0277] The second HLS request message is used to request to obtain the first code rate index file stored in the first CDN node.

[0278] 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 bit rate index file.

[0279] The above S807-S811 can be 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 is specifically that the first terminal device interacts with the first index file server in the first CDN node to obtain the first bitrate index file from the first index file server.

[0280] 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.

[0281] The third HLS request message is used to request to obtain the main index file stored in the second CDN node.

[0282] S813. The second CDN node sends a third HLS response message to the second terminal device, where the third HLS response message includes a primary index file of the media.

[0283] S814. The second terminal device determines the URL of the second bit rate index file according to the main index file.

[0284] The second terminal device selects a suitable bitrate according to the current network status (eg bandwidth size) and the capability of the second terminal device, and determines the URL of the bitrate index file corresponding to the bitrate from the second index file (referred to as the URL of the second bitrate index file).

[0285] 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.

[0286] The fourth HLS request message is used to request to obtain the second code rate index file stored in the second CDN node.

[0287] 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.

[0288] The above S812-S816 can be 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 bit rate 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 bit rate index file from the second index file server.

[0289] S817: The second terminal device sends second fragmentation information of the media to the first terminal device. Correspondingly, the first terminal device receives the second fragmentation information from the second terminal device.

[0290] According to the above embodiments, the second segment information may 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. Figure 7 The message flows marked with ⑦ and ⑤ in the figure are implemented, or through Figure 7 The message flows marked with ⑧ and ⑥ are implemented.

[0291] S818. The first terminal device determines the start indication information according to the first media index file and the second segment information.

[0292] The start indication information is used to indicate the media content to be played initially when playing the media.

[0293] 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 back is located, the third start timestamp of the media segment where the media content to be played back is located, or the first offset of the start timestamp of the media content to be played back relative to the start timestamp of the media.

[0294] 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 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, or the fourth offset of the start time of the media content to be played back relative to the media start time.

[0295] 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.

[0296] S819: The first terminal device sends broadcast start indication information to the second terminal device, and correspondingly, the second terminal device receives the broadcast start indication information from the first terminal device.

[0297] S819 can be Figure 7 The message flows marked by ⑤ and ⑦ are implemented, or through Figure 7 The message flows marked with ⑥ and ⑧ are implemented.

[0298] S820. The first terminal device sends a fifth HLS request message to the first CDN node. The fifth HLS request message includes a URL of a media segment where the media content to be played back is located.

[0299] The fifth HLS request message is used to request to obtain the media segment corresponding to the media content to be played initially, and the first terminal device obtains the URL of the media segment where the media content to be played initially is located from the first bit rate index file according to the start indication information.

[0300] S821. The first CDN node sends a fifth HLS response message to the first terminal device, where the fifth HLS response message includes a media segment corresponding to the media content to be played back.

[0301] S820-S821 can be 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.

[0302] S822: The first terminal device plays the acquired media segment according to the start indication information.

[0303] 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 back is located.

[0304] The sixth HLS request message is used to request to obtain the media segment corresponding to the media content to be played initially, and the second terminal device obtains the URL of the media segment where the media content to be played initially is located from the second bit rate index file according to the start indication information.

[0305] S824. 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.

[0306] S823-S824 can be 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.

[0307] S825. The second terminal device plays the acquired media segment according to the start indication information.

[0308] For a detailed description of S820 - S825 , reference may be made to the related description of S606 and S608 in the above embodiment, which will not be repeated here.

[0309] like Fig. 9 As shown, 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:

[0310] S901. The first terminal device obtains information such as a channel list and a service entry address from a service management platform of the IPTV platform.

[0311] S902: The first terminal device determines to initiate synchronous media playback to the second terminal device.

[0312] S903: The first terminal device and the second terminal device establish instant communication (including media interface and data channel) through the RTC network.

[0313] S904: The first terminal device sends a service request to the service capability platform of the IPTV platform, where the service request is used to subscribe to the media to be synchronously played.

[0314] S905. The service capability platform of the IPTV platform sends the URL of the MPD file of the media to the first terminal device.

[0315] In the embodiment of the present application, the MPD file includes URLs of media segments of multiple bit rates of the media. Figure 7 The message flow marked with ① is implemented.

[0316] Similarly, the embodiments of the present application do not limit the execution order of S903 and S904-S905. S903 may be executed first and then S904-S905, S904-S905 may be executed first and then S9039, or S903 and S904-S905 may be executed simultaneously.

[0317] S906. 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.

[0318] Optionally, the first terminal device may send the URL of the main index file to the second terminal device through the control plane information of the RTC network, for example, through Figure 7 The message streams marked with ⑤ and ⑦ in the figure send the URL of the MPD file of the media to the second terminal device. Alternatively, the first terminal device can also send the URL of the above-mentioned main index file to the second terminal device through the established data channel, for example, the first terminal device sends the URL of the above-mentioned main index file to the second terminal device through Figure 7 The message flows identified by ⑥ and ⑧ send the URL of the MPD file of the media to the second terminal device.

[0319] 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.

[0320] The first DASH request message is used to request to obtain the first MPD file of the media stored in the first CDN node.

[0321] 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.

[0322] 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 to obtain the first MPD file from the first index file server.

[0323] S909. The second terminal device sends a second DASH request message to the second CDN node. The second DASH request message includes a URL of the second MPD file of the media.

[0324] The second DASH request message is used to request to obtain a second MPD file of the media stored in the second CDN node.

[0325] 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.

[0326] 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 to obtain the second MPD file from the second index file server.

[0327] S911. The second terminal device sends second fragmentation information of the media to the first terminal device. Correspondingly, the first terminal device receives the second fragmentation information from the second terminal device.

[0328] 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.

[0329] S912: The first terminal device determines the start indication information according to the first media index file and the second segment information.

[0330] The start indication information is used to indicate the media content to be played initially when playing the media.

[0331] 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.

[0332] S913: The first terminal device sends broadcast start indication information to the second terminal device, and correspondingly, the second terminal device receives the broadcast start indication information from the first terminal device.

[0333] S914. The first terminal device sends a third DASH request message to the first CDN node. The third DASH request message includes a URL of a media segment where the media content to be played initially is located.

[0334] 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).

[0335] The third DASH request message is used to request to obtain the media segment corresponding to the media content to be played initially, and the first terminal device obtains the URL of the media segment where the media content to be played initially is located from the first MPD file according to the start indication information.

[0336] 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.

[0337] In the above S914-S915, 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.

[0338] S916. The first terminal device plays the acquired media segment according to the start indication information.

[0339] 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.

[0340] The second terminal device determines the URL of the media segment of the corresponding bit rate according to the current network status or according to the configuration (such as selecting the lowest bit rate).

[0341] The fourth DASH request message is used to request to obtain the media segment corresponding to the media content to be played initially, and the second terminal device obtains the URL of the media segment where the media content to be played initially is located from the second MPD file according to the start indication information.

[0342] 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.

[0343] 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.

[0344] S919: The second terminal device plays the acquired media segment according to the start indication information.

[0345] For the detailed description of S901-S919, reference may be made to the related description of S801-S825 and other contents in the above embodiments, which will not be repeated here.

[0346] like Fig.10 As shown, 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:

[0347] S1001. The first terminal device obtains information such as a channel list and a service entry address from a service management platform of the IPTV platform.

[0348] S1002: The first terminal device determines to initiate synchronous media playback to the second terminal device.

[0349] S1003: The first terminal device and the second terminal device establish instant communication (including media interface and data channel) through the RTC network.

[0350] S1004: The first terminal device sends a service request to the service capability platform of the IPTV platform, where the service request is used to subscribe to the media to be synchronously played.

[0351] 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.

[0352] S1006: The first terminal device sends a message to the second terminal device, where the message includes a URL of a main index file of the media.

[0353] S1007. The first terminal device sends a first HLS request message to the first CDN node. The first HLS request message includes a URL of a primary index file of the media.

[0354] The first HLS request message is used to request to obtain the main index file stored in the first CDN node.

[0355] S1008. The first CDN node sends a first HLS response message to the first terminal device, where the first HLS response message includes a main index file of the media.

[0356] S1009. The first terminal device determines the URL of the first bit rate index file according to the main index file.

[0357] S1010. The first terminal device sends a second HLS request message to the first CDN node, where the second HLS request message includes a URL of a first bitrate index file.

[0358] The second HLS request message is used to request to obtain the first code rate index file stored in the first CDN node.

[0359] 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 bit rate index file.

[0360] 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 to obtain the first bit rate index file from the first index file server.

[0361] S1012. The second terminal device sends a third HLS request message to the second CDN node. The third HLS request message includes a URL of the main index file of the media.

[0362] The third HLS request message is used to request to obtain the main index file stored in the second CDN node.

[0363] S1013. The second CDN node sends a third HLS response message to the second terminal device, where the third HLS response message includes a primary index file of the media.

[0364] S1014. The second terminal device determines the URL of the second bit rate index file according to the main index file.

[0365] S1015. The second terminal device sends a fourth HLS request message to the second CDN node, where the fourth HLS request message includes a URL of the second bit rate index file.

[0366] The fourth HLS request message is used to request to obtain the second code rate index file stored in the second CDN node.

[0367] 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.

[0368] 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 to obtain the second bit rate index file from the second index file server.

[0369] S1017. The first terminal device obtains, from the service management platform of the IPTV platform, location information of the first CDN node (or the first index file server) to which the first terminal device accesses and location information of the second CDN node (or the second index file server) to which the second terminal device accesses.

[0370] Specifically, the first terminal device sends a request message including user information of the first terminal device and user information of the second terminal device to the IPTV platform, and then the IPTV platform 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 according to the user information of the terminal device. S1017 can be Figure 7 The message flow marked by ① is implemented.

[0371] Exemplarily, the location information of the CDN node may indicate which level of CDN node the CDN node is. For example, the location information of the first CDN node may indicate that the first CDN node is a central node, and the location information of the second CDN node may indicate that the second CDN node is an edge node.

[0372] S1018. The first terminal device determines the second fragmentation 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).

[0373] The start indication information is used to indicate the media content to be played initially when playing the media.

[0374] For a detailed description of S1018, please refer to the relevant description in the above-mentioned method 2 (including S1-S2) in S604, which will not be repeated here.

[0375] S1019: The first terminal device sends broadcast start indication information to the second terminal device, and correspondingly, the second terminal device receives the broadcast start indication information from the first terminal device.

[0376] S1020. The first terminal device sends a fifth HLS request message to the first CDN node. The fifth HLS request message includes a URL of a media segment where the media content to be played back is located.

[0377] The fifth HLS request message is used to request to obtain the media segment corresponding to the media content to be played initially, and the first terminal device obtains the URL of the media segment where the media content to be played initially is located from the first bit rate index file according to the start indication information.

[0378] S1021. The first CDN node sends a fifth HLS response message to the first terminal device, where the fifth HLS response message includes a media segment corresponding to the media content to be played back.

[0379] In the above S1020-S1021, 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.

[0380] S1022: The first terminal device plays the acquired media segment according to the start indication information.

[0381] 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 back is located.

[0382] The sixth HLS request message is used to request to obtain the media segment corresponding to the media content to be played initially, and the second terminal device obtains the URL of the media segment where the media content to be played initially is located from the second bit rate index file according to the start indication information.

[0383] 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.

[0384] 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.

[0385] S1025. The second terminal device plays the acquired media segment according to the start indication information.

[0386] For a detailed description of S1001-S1025, reference may be made to the related description of S801-S825 in the above embodiment and other contents in the above embodiment, which will not be repeated here.

[0387] like Fig.11 As shown, 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:

[0388] S1101. The first terminal device obtains information such as a channel list and a service entry address from a service management platform of the IPTV platform.

[0389] S1102: The first terminal device determines to initiate synchronous media playback to the second terminal device.

[0390] S1103: The first terminal device and the second terminal device establish instant communication (including media interface and data channel) through the RTC network.

[0391] S1104. The first terminal device sends a service request to the service capability platform of the IPTV platform, where the service request is used to subscribe to the media to be synchronously played.

[0392] S1105. The service capability platform of the IPTV platform sends the URL of the MPD file of the media to the first terminal device.

[0393] S1106. The first terminal device sends a message to the second terminal device, where the message includes a URL of the MPD file of the media.

[0394] 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.

[0395] The first DASH request message is used to request to obtain the first MPD file of the media stored in the first CDN node.

[0396] 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.

[0397] 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 to obtain the first MPD file from the first index file server.

[0398] S1109. The second terminal device sends a second DASH request message to the second CDN node. The second DASH request message includes a URL of the second MPD file of the media.

[0399] The second DASH request message is used to request to obtain a second MPD file of the media stored in the second CDN node.

[0400] 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.

[0401] 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 to obtain the second MPD file from the second index file server.

[0402] S1111. The first terminal device obtains, from the service management platform of the IPTV platform, the location information of the first CDN node (or the first index file server) to which the first terminal device accesses and the location information of the second CDN node (or the second index file server) to which the second terminal device accesses.

[0403] S1112. The first terminal device determines the second fragment information according to 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).

[0404] The start indication information is used to indicate the media content to be played initially when playing the media.

[0405] S1113. The first terminal device sends broadcast start indication information to the second terminal device, and correspondingly, the second terminal device receives the broadcast start indication information from the first terminal device.

[0406] S1114. The first terminal device sends a third DASH request message to the first CDN node. The third DASH request message includes a URL of a media segment where the media content to be played back is located.

[0407] The third DASH request message is used to request to obtain the media segment corresponding to the media content to be played initially, and the first terminal device obtains the URL of the media segment where the media content to be played initially is located from the first MPD file according to the start indication information.

[0408] 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.

[0409] In the above S1114-S1115, 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.

[0410] S1116. The first terminal device plays the acquired media segment according to the start indication information.

[0411] 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 back is located.

[0412] The fourth DASH request message is used to request to obtain the media segment corresponding to the media content to be played initially, and the second terminal device obtains the URL of the media segment where the media content to be played initially is located from the second MPD file according to the start indication information.

[0413] 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.

[0414] 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.

[0415] S1119: The second terminal device plays the acquired media segment according to the start indication information.

[0416] For the detailed description of S1101-S1119, reference may be made to the related description of S901-S919, S1001-S1025 and other contents in the above embodiments, which will not be repeated here.

[0417] It is understandable that, in order to realize the above functions, the above terminal device includes a hardware structure and / or software module corresponding to 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 exceed the scope of the embodiments of the present application.

[0418] The embodiment of the present application can divide the functional modules of the above-mentioned terminal device according to the above-mentioned method example. For example, each functional module can be divided corresponding to each function, or two or more functions can be integrated into one processing module. The above-mentioned integrated module 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 function division. There may be other division methods in actual implementation.

[0419] In the case of dividing each functional module into corresponding functional modules, Fig.12 A possible structural diagram of a terminal device involved in the above embodiment is shown. 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 .

[0420] 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 embodiments.

[0421] Optionally, the terminal device provided in the embodiment of the present application further includes a media output module 1204 and a receiving module 1205, wherein the media output module 1204 is used to execute S606, S822, S916, S1022, and S1116 in the above method embodiment. The receiving module 1205 is used to execute S817 and S911 in the above method embodiment.

[0422] In the case of an integrated unit, Fig.13Another possible structural diagram of the terminal device involved in the above embodiment is shown. 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 may be used to control and manage the actions of the first terminal device. For example, the processing module 1301 may be used to support the first terminal device to execute 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 for 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, S1114 in the above-mentioned method embodiment. Optionally, as Fig.13 As shown, the first terminal device may further include a storage module 1303 for storing program codes and data of the first terminal device.

[0423] Optionally, the first terminal device may further include an output module 1304, which may be used to support the first terminal device in executing S606, S822, S916, S1022, and S1116 in the above method embodiment.

[0424] The processing module 1301 may be a processor, for example, the processor may be Figure 5 The communication module 1302 may be a transceiver, a transceiver circuit or a communication interface, for example Figure 5 The mobile communication module 550 and / or the wireless communication module 560 in the storage module 1303 may be a memory, for example Figure 5 The internal memory 521 or the external memory 520 in the storage medium. It should be understood that when the media is audio, the output module 1304 can be a speaker, for example Figure 5 When the media is a video, the output module 1304 may be a display screen, for example Figure 5 Display screen 594 in.

[0425] 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 each step 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.

[0426] For more details on how the module included in the first terminal device implements the above functions, please refer to the description in the previous method embodiments, which will not be repeated here. Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments.

[0427] In the case of dividing each functional module into corresponding functional modules, refer to Fig.14 , shows a possible structural diagram of a terminal device involved in the above embodiment. 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.

[0428] 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.

[0429] 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.

[0430] In the case of an integrated unit, Fig.15Another 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 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 to perform other steps such as S603 in the above method embodiment, and / or other processes of the technology described in this article. The communication module 1502 can be used to support the communication between the second terminal device and other network entities. The communication module 1302 integrates the functions of the above sending module 1401 and the receiving module 1402. The communication module 1502 can be used to support the second terminal device to perform S601, S607, S812, S815, S817, S819, S823, S909, S911, S913, S917, S1012, S1015, S1023, S1109, and S1117 in the above method embodiment. Alternatively, if Fig.15 As shown, the second terminal device may further include a storage module 1503 for storing program codes and data of the second terminal device.

[0431] Optionally, the first terminal device may further include an output module 1504, which may be used to support the second terminal device in executing S608, S825, S919, S1025, and S1119 in the above method embodiment.

[0432] The processing module 1501 may be a processor, for example, the processor may be Figure 5 The communication module 1502 may be a transceiver, a transceiver circuit or a communication interface, for example Figure 5 The mobile communication module 550 and / or the wireless communication module 560 in the storage module 1503 may be a memory, for example Figure 5 The internal memory 521 or the external memory 520 in the storage medium. It should be understood that when the media is audio, the output module 1504 can be a speaker, for example Figure 5 When the media is a video, the output module 1504 may be a display screen, for example Figure 5 Display screen 594 in.

[0433] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using a software program, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instruction is loaded and executed on a computer, the process or function in accordance with the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instruction can 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 instruction can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) mode or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server, data center, etc. that includes one or more available media integrated. 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)).

[0434] Through the description of the above implementation methods, technicians in the relevant field can clearly understand that for the convenience and simplicity of description, 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 is divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device and unit described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0435] In the several embodiments provided in the present 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 only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, 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.

[0436] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0437] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0438] 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 can be essentially or partly embodied in the form of a software product that contributes to the prior art, or all or part of the technical solution. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) or a processor to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: flash memory, mobile hard disk, read-only memory, random access memory, disk or optical disk, and other media that can store program codes.

[0439] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope 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

Cited By

  • Information processing method and device, storage medium and computer program product

    CN121173975A

  • Method, apparatus, and system for synchronizing media playback

    EP4712488A1

  • Method, apparatus, and system for synchronizing media playback

    WO2024255324A1