Media playing method and device, electronic equipment, storage medium and program product

By obtaining the baseline playback position and adjusting the playback progress of the player to be synchronized, the problem of low real-time performance during multi-player synchronization is solved, achieving high-precision media content synchronization and improving user experience and smoothness.

CN122120546APending Publication Date: 2026-05-29TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
TENCENT TECHNOLOGY (SHENZHEN) CO LTD
Filing Date
2024-11-29
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

In existing multi-player synchronization solutions, the synchronization control system needs a relatively long time to complete the transmission and processing of synchronization information, resulting in low real-time performance of the synchronization process.

Method used

The system obtains the reference playback position from the player to be synchronized, determines the playback position of the media content to be synchronized, and adjusts the frames of the content to be processed according to the differences, so that the playback progress of the media content to be synchronized is synchronized with the playback progress of the reference media content. High-precision synchronization control is achieved by using a custom clock and function interface.

Benefits of technology

It improves the real-time performance of multi-player synchronous processing, reduces network communication requirements, and ensures the continuity of user experience and the smoothness of media content.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122120546A_ABST
    Figure CN122120546A_ABST
Patent Text Reader

Abstract

The application discloses a media playing method and device, electronic equipment, storage medium and program product; the application plays a media resource; a reference playing position is obtained by using a to-be-synchronized player, the reference playing position is a playing position of a reference content frame in reference playing content, the reference content frame is a content frame currently played by reference media content; a to-be-synchronized playing position of a to-be-played content frame of the to-be-synchronized media content is determined; a to-be-processed content frame is determined from the to-be-played content frame according to a difference between the reference playing position and the to-be-synchronized playing position; the to-be-processed content frame is adjusted to adjust a playing progress of the to-be-synchronized media content, so that the playing progress of the to-be-synchronized media content is synchronized with a playing progress of the reference media content. In the application, the real-time performance of a synchronization processing process of multiple players can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, specifically to a media playback method, apparatus, electronic device, storage medium, and program product. Background Technology

[0002] With the development of internet technology and the diversification of user needs, more and more application scenarios require simultaneous playback of multiple media content from multiple players, such as home entertainment devices, virtual reality (VR), and augmented reality (AR) scenarios. In multi-player scenarios, different players often need to play different audio and video media content. Since each player is independent, inconsistent playback progress can easily occur in practical applications, meaning multiple players are not playing in sync. Existing synchronization solutions for multi-player scenarios typically address this issue by using a synchronization control system to control the players to be synchronized sequentially to jump directly to a reference time point, thus controlling the synchronous playback of multiple players.

[0003] However, in existing synchronization schemes, the synchronization control system needs to coordinate all the players that need to be synchronized, which takes a long time to complete the transmission and processing of synchronization information, resulting in a long synchronization process and reduced real-time performance. Summary of the Invention

[0004] This application provides a media playback method, apparatus, electronic device, storage medium, and program product that can improve the real-time performance of the synchronization process for multiple players.

[0005] This application provides a media playback method, including: playing media resources, the media resources including baseline media content and media content to be synchronized, the baseline media content being played through a baseline player, and the media content to be synchronized being played through a player to be synchronized; obtaining a baseline playback position using the player to be synchronized, the baseline playback position being the playback position of a baseline content frame within the baseline playback content, the baseline content frame being the currently playing content frame of the baseline media content; determining the to-be-synchronized playback position of a content frame to be played in the media content to be synchronized, the to-be-synchronized playback position being the playback position of the content frame to be played within the media content to be synchronized recorded by the player to be synchronized; determining a content frame to be processed from the content frames to be played based on the difference between the baseline playback position and the to-be-synchronized playback position; adjusting the content frame to be processed to adjust the playback progress of the media content to be synchronized, so that the playback progress of the media content to be synchronized is synchronized with the playback progress of the baseline media content.

[0006] This application embodiment also provides a media playback device, including: a playback unit for playing media resources, the media resources including reference media content and media content to be synchronized, the reference media content being played through a reference player, and the media content to be synchronized being played through a player to be synchronized; an acquisition unit for acquiring a reference playback position using the player to be synchronized, the reference playback position being the playback position of a reference content frame in the reference playback content, the reference content frame being the currently playing content frame of the reference media content; a position determination unit for determining the to-be-synchronized playback position of the to-be-synchronized content frame of the media content to be synchronized, the to-be-synchronized playback position being the playback position of the to-be-synchronized content frame in the media content to be synchronized recorded by the player to be synchronized; a frame determination unit for determining a content frame to be processed from the content frames to be played based on the difference between the reference playback position and the to-be-synchronized playback position; and an adjustment unit for adjusting the content frame to be processed to adjust the playback progress of the media content to be synchronized, so that the playback progress of the media content to be synchronized is synchronized with the playback progress of the reference media content.

[0007] In some implementations, the acquisition unit is specifically used to: determine whether the player to be synchronized has a location management function, wherein the location management function is used to determine the playback position to be synchronized and to adjust the content frames to be processed; when it is determined that the player to be synchronized has the location management function, the reference playback position is obtained using the player to be synchronized.

[0008] In some implementations, the playback position is a timestamp, and the media playback device further includes an adding unit, which is used to: when it is determined that the player to be synchronized has the position management function, add the function interface based on the position management function to the player to be synchronized, the custom clock is used to record the timestamp of the content frame of the media content to be synchronized in the media content to be synchronized and to adjust the content frame to be processed, and the function interface is used to call the position management function.

[0009] In some implementations, the frame determination unit is specifically used to: determine a position threshold based on the reference playback position; and determine, from the content frames to be played, content frames whose positions to be synchronized for playback exceed the position threshold.

[0010] In some implementations, the position threshold includes a first threshold and a second threshold. Determining the position threshold based on the reference playback position includes: determining the first threshold based on the reference playback position and an expected playback deviation threshold, wherein the expected playback deviation threshold represents a deviation threshold of the playback position of the media content to be synchronized relative to the expected playback position; and determining the second threshold based on the reference playback position and a synchronization transmission deviation threshold, wherein the synchronization transmission deviation threshold represents a deviation threshold between the reference media content and the media content to be synchronized during playback.

[0011] In some implementations, determining the content frame to be processed from the content frame to be played that has a position exceeding the position threshold includes: determining the content frame to be played as the content frame to be processed when the position of the content frame to be played exceeds the first threshold, or when the position of the content frame to be played does not exceed the second threshold.

[0012] In some implementations, the frame determination unit is further configured to: determine each frame of the content to be played as a content frame following the currently playing content frame of the media content to be synchronized.

[0013] In some embodiments, the media playback device further includes a sleep unit, which is used to: invoke a sleep function based on the difference between the reference playback position and the playback position to be synchronized; and use the sleep function to pause the playback of the media content to be synchronized based on preset synchronization conditions.

[0014] In some embodiments, the media playback device further includes a speed adjustment unit, which is used to: determine a speed adjustment period based on the current position difference and a specified speed adjustment multiplier when a speed adjustment condition is met; the speed adjustment condition includes at least one of the current position difference exceeding a preset position difference and the player to be synchronized lacking a position management function; the current position difference is the difference between the reference playback position and the current playback position of the media content to be synchronized; the current playback position is the playback position of the currently playing content frame of the media content to be synchronized; the position management function is used to determine the playback position to be synchronized and adjust the content frame to be processed; and adjust the playback speed of the player to be synchronized within the speed adjustment period at the specified speed adjustment multiplier to adjust the playback progress of the media content to be synchronized.

[0015] In some implementations, determining the speed-changing time period based on the current position difference and the specified speed-changing multiplier when the speed-changing adjustment condition is met includes: when the speed-changing adjustment condition is met, obtaining the current playback speed of the media content to be synchronized; and calculating the speed-changing time period based on the difference between the specified speed-changing multiplier and the current playback speed, combined with the current position difference.

[0016] In some implementations, the specified variable speed exceeds a preset variable speed. The variable speed unit is further configured to: if the variable speed time period exceeds a preset duration, update the specified variable speed to obtain an updated variable speed, wherein the updated variable speed exceeds the preset variable speed; use the updated variable speed as the specified variable speed, and return to the execution step when the variable speed adjustment condition is met; determine the variable speed time period and subsequent steps based on the current position difference and the specified variable speed, until the variable speed time period does not exceed the preset duration; and adjust the playback speed of the player to be synchronized within the variable speed time period using the specified variable speed to adjust the playback progress of the media content to be synchronized.

[0017] This application also provides an electronic device, including a processor and a memory, wherein the memory stores a plurality of instructions; the processor loads instructions from the memory to execute steps in any of the media playback methods provided in this application.

[0018] This application also provides a computer-readable storage medium storing a plurality of instructions adapted for loading by a processor to execute steps in any of the media playback methods provided in this application.

[0019] This application also provides a computer program product, including multiple instructions, which, when executed by a processor, implement the steps in any of the media playback methods provided in this application.

[0020] This application embodiment can play media resources, which include baseline media content and media content to be synchronized. The baseline media content is played through a baseline player, and the media content to be synchronized is played through a player to be synchronized. A baseline playback position is obtained using the player to be synchronized. The baseline playback position is the playback position of a baseline content frame within the baseline playback content, and the baseline content frame is the currently playing content frame of the baseline media content. The player to be synchronized determines the synchronized playback position of the content frame to be played within the media content to be synchronized, and the synchronized playback position is the playback position of the content frame to be played within the media content to be synchronized as recorded by the player to be synchronized. Based on the difference between the baseline playback position and the synchronized playback position, a content frame to be processed is determined from the content frames to be played. The content frame to be processed is adjusted to adjust the playback progress of the media content to be synchronized, so that the playback progress of the media content to be synchronized is synchronized with the playback progress of the baseline media content.

[0021] In this application, during the synchronization process of multiple players, the difference between the content frame to be played and the reference content frame of the reference player is determined in real time based on the playback position recorded by the player to be synchronized, thereby determining and adjusting the content frame to be processed. In this way, the synchronization processing of each player to be synchronized in a multi-player scenario is distributed locally on each player, allowing each player to independently and in real time adjust its own playback progress according to its own recorded playback progress, thus improving the real-time performance of the multi-player synchronization process. Attached Figure Description

[0022] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0023] Figure 1a This is a schematic diagram of a scenario for the media playback method provided in an embodiment of this application;

[0024] Figure 1b This is a schematic flowchart of the media playback method provided in the embodiments of this application;

[0025] Figure 1c This is a schematic diagram of the player synchronization effect provided in the embodiments of this application;

[0026] Figure 2a This is a schematic flowchart of a media playback method provided in another embodiment of this application;

[0027] Figure 2bThis is a flowchart illustrating yet another media playback method provided in another embodiment of this application;

[0028] Figure 3 This is a schematic diagram of the structure of the media playback device provided in the embodiments of this application;

[0029] Figure 4 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation

[0030] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0031] This application provides a media playback method, apparatus, electronic device, storage medium, and program product.

[0032] The electronic device can be a terminal, a server, or other similar device. The terminal can be a mobile phone, tablet computer, smart Bluetooth device, laptop computer, desktop computer, smart home appliance, smart vehicle, or other similar device. The server can be a single server, a server cluster consisting of multiple servers, or a cloud server.

[0033] In some embodiments, the media playback device may also be integrated into multiple electronic devices, such as multiple servers, with multiple servers implementing the media playback method of this application.

[0034] In some embodiments, the terminal can also be used as a server to implement some or all of the functions of a server.

[0035] For example, refer to Figure 1aThe electronic device can be a terminal that can play media resources, including baseline media content and media content to be synchronized. The baseline media content is played through a baseline player, and the media content to be synchronized is played through a player to be synchronized. The player to be synchronized is used to obtain the baseline playback position, which is the playback position of the baseline content frame within the baseline playback content. The baseline content frame is the currently playing content frame of the baseline media content. The player to be synchronized determines the playback position of the content frame to be played in the media content to be synchronized, which is the playback position of the content frame to be played recorded by the player to be synchronized within the media content to be synchronized. Based on the difference between the baseline playback position and the playback position to be synchronized, the player determines the content frame to be processed from the content frames to be played. The player adjusts the content frame to be processed to adjust the playback progress of the media content to be synchronized, so that the playback progress of the media content to be synchronized is synchronized with the playback progress of the baseline media content.

[0036] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.

[0037] The following sections provide detailed descriptions. It should be noted that the order of the following embodiments is not intended to limit the preferred order of the embodiments. It is understood that in the specific embodiments of this application, data related to user information is involved. When the embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use, and processing of related data must comply with the relevant laws, regulations, and standards of the relevant countries and regions.

[0038] In this embodiment, a media playback method is provided, such as... Figure 1b As shown, this media playback method can be executed by an electronic device. In this embodiment, the electronic device is taken as a terminal for illustration, and the specific process is as follows:

[0039] 110. Play media resources. Media resources include baseline media content and media content to be synchronized. The baseline media content is played through the baseline player, and the media content to be synchronized is played through the media content to be synchronized.

[0040] Media resources refer to a collection of multiple media contents. The media content in media resources can be any type of media data, including video, audio, animation, etc., or a combination of one or more of these types of media data.

[0041] In this embodiment, multiple media contents within a media resource can be played synchronously by multiple players. The reference player is the player that serves as a reference among the multiple players playing the media content of the media resource. The player to be synchronized is the player used to synchronize the playback of the media content in the media resource with the reference player. The media content played by the reference player and the player to be synchronized are the reference media content and the media content to be synchronized, respectively.

[0042] In this embodiment, the player (such as a base player or a player to be synchronized) can be one or more of an audio player, a video player, or other players capable of playing multimedia resources, such as an effects player. For example, the player can specifically be one or more of the following players: KsingPlayer, AudioPlayer, ExoPlayer, MediaPlayer, iJkPlayer, PagPlayer, AlphaPlayer, LyricPlayer, MidiPlayer, or ScorePlayer.

[0043] For example, embodiments of this application can be applied to scenarios where multiple media contents are played simultaneously through multiple players. Examples include multi-player playback scenarios in home or entertainment devices, virtual reality (VR) and augmented reality (AR), live streaming, and multi-user interactive applications. In these multi-player scenarios, multiple players often play multiple media contents from a single media resource simultaneously. One of these players can be used as the base player, and the other players can be used as players to be synchronized; that is, depending on the playback requirements, there can be one or more players to be synchronized.

[0044] The embodiments of this application can be applied to terminals. In some implementations, the base player and the player to be synchronized run on the same terminal. Alternatively, in some implementations, such as in specific scenarios like a distributed playback system, the base player and the player to be synchronized can run distributed across multiple terminals. These multiple terminals rely on communication and coordination between the base player and the player to be synchronized to achieve synchronized playback of multiple media contents in the media resources.

[0045] It should be noted that when the base player and the player to be synchronized are distributed across multiple terminal devices, the media playback method provided in this application embodiment can be implemented by the terminal corresponding to the player to be synchronized. The step of playing media resources includes playing the media content to be synchronized using the player to be synchronized. For example, the synchronization processing of the media content to be synchronized can be implemented on the terminal corresponding to the player to be synchronized, so as to perform media content synchronization locally on the player to be synchronized, avoiding frequent network communication requests and responses, reducing dependence on servers, and improving the real-time performance, efficiency, and reliability of media content synchronization.

[0046] In some implementations, the audio in the media resource can be used as the base media content, and the audio player can be used as the base player. For example, the audio player among multiple players playing the media resource can be used as the base player. When playing media resources, since the audience's auditory experience is better than their visual experience, it is best to ensure that the audio frames heard by the audience are real-time and normal. Moreover, skipping or dropping video frames may not be perceptible to the audience's eyes, but skipping or dropping will cause noise or dropped sound in the audio, which is easily noticed by the audience. Therefore, audio frames cannot be dropped. Thus, in the embodiments of this application, the audio can be used as the standard, that is, the audio in the media resource can be used as the base media content, and the audio player can be used as the base player.

[0047] 120. Use the player to be synchronized to obtain the reference playback position. The reference playback position is the playback position of the reference content frame in the reference playback content. The reference content frame is the content frame currently being played in the reference media content.

[0048] Among them, content frames refer to the frames of media content in media resources. Different types of media content can have different frames. For example, content frames in video or animation can be video frames, while content frames in audio can be audio frames.

[0049] Here, playback position refers to the point in time or location of a content frame during the playback of the corresponding media content. For example, playback position can be represented by a timestamp or frame sequence number (i.e., frame number). In some implementations, the playback position is a timestamp, that is, the reference playback position is the timestamp of the reference content frame.

[0050] For example, the content frame of the reference media content currently being played by the reference player can be used as the reference content frame. The player to be synchronized can then obtain the playback position of this reference content frame from the reference player.

[0051] In some implementations, it can be pre-detected whether the player to be synchronized supports location management functionality. If it does, the location management functionality can be used to perform player synchronization processing on the player to be synchronized. Specifically, obtaining the reference playback position using the player to be synchronized includes:

[0052] Determine if the player to be synchronized has a position management function. The position management function is used to determine the position to be synchronized and to adjust the content frames to be processed.

[0053] When it is determined that the player to be synchronized has a location management function, the reference playback position is obtained using the player to be synchronized.

[0054] The position management function refers to the function used to manage the playback position of content frames. For example, the position management function can be a custom clock. A custom clock refers to a time management mechanism defined by the player. Unlike a standard playback clock, a custom clock allows for more precise control, adjustment, and synchronization of the playback time of content frames according to specific needs or precision requirements. In the embodiments of this application, the custom clock can perform timestamp management on the content frames of the played media content, such as determining the position of the currently playing content frame based on a given timestamp, and achieving precise control of the content frames by adjusting the playback rate, buffering strategy, or synchronization strategy.

[0055] For example, it's possible to pre-detect whether the player to be synchronized supports a custom clock. Players like iJkPlayer, ExoPlayer, and PagPlayer support custom clocks, allowing them to adjust content frames based on the timestamps of recorded content frames. Therefore, for players supporting custom clocks, the baseline playback position of the reference content frame can be obtained, along with the timestamps of the recorded content frames to be played, all using the custom clock. The custom clock can then be used to adjust the content frames to achieve synchronization.

[0056] In some implementations, a corresponding functional interface can be added to players that support location management, allowing these players to invoke the location management function through this interface. The combination of location management and the functional interface enables flexible playback control and high-precision synchronization of the media content to be synchronized. Specifically, after determining whether the player to be synchronized has location management functionality, the process also includes:

[0057] When it is determined that the player to be synchronized has a location management function, a function interface based on the location management function is added to the player to be synchronized. The function interface is used to call the location management function.

[0058] For example, the functional interface could be a clock interface. Before media content synchronization (e.g., before playing the reference content), it's pre-detected whether the player to be synchronized has a custom clock configured. If a custom clock is detected, a clock interface is added to the player to be synchronized. By calling the clock interface, the timestamp of the reference content frame can be obtained, and using the custom clock of the player to be synchronized, the timestamp of the content frame to be played recorded by it can be obtained, and the content frame to be processed can be adjusted, thus implementing a timestamp-based player synchronization process. In this way, based on the time management mechanism of the custom clock, the content frame adjustment operation is performed according to the timestamp of the received reference content frame.

[0059] In some implementations, the function interface of the location management function can also be used to obtain the reference playback position of the reference content frame. Thus, when the terminal corresponding to the player to be synchronized calls the function interface, the terminal can directly obtain the reference playback position of the reference content frame from the reference player, and perform subsequent player synchronization processing through the location management function, thereby improving the real-time performance of the obtained playback position. Specifically, the playback position is a timestamp, and obtaining the reference playback position using the player to be synchronized includes:

[0060] Using the functional interface, obtain the baseline playback position of the baseline content frame from the baseline player.

[0061] For example, the real-time progress of the baseline media content played by the baseline player can be used as a baseline. The player to be synchronized calls the clock interface to pass the timestamp of the baseline media content (i.e., the baseline playback position) to the player to be synchronized.

[0062] In some implementations, the player can be synchronized according to a preset time interval. For example, the player to be synchronized can call a function interface at preset time intervals to obtain the reference playback position of the reference content frame and perform subsequent synchronization processing. This allows the player to be synchronized to continuously detect the playback progress of the reference media content by periodically calling the interface, and to perform multiple real-time synchronizations to ensure the smoothness and stability of media resource playback. In this embodiment, obtaining the reference playback position of a reference content frame and performing subsequent synchronization processing once is considered as one media content synchronization.

[0063] 130. Determine the playback position of the content frame to be played in the media content to be synchronized. The playback position is the position of the content frame to be played in the media content to be synchronized, as recorded by the player to be synchronized.

[0064] For example, the player to be synchronized can read from its local storage the playback position of the frame of the content to be played within the media content to be synchronized.

[0065] In some implementations, the player to be synchronized can utilize location management functionality to record the playback position of the content frame to be played within the media content to be synchronized. For example, the player to be synchronized can use a custom clock to record the timestamps of content frames within the media content to be synchronized.

[0066] 140. Based on the difference between the reference playback position and the position to be synchronized, determine the content frame to be processed from the content frames to be played.

[0067] For example, the player to be synchronized can filter out content frames with abnormal playback (i.e., content frames to be processed) from the content frames to be played based on the playback positions of the reference content frame and the content frames to be played in the media content to be synchronized. In this embodiment, when determining the content frames to be processed from the content frames to be played, the player to be synchronized can determine the difference between the content frames to be played and the reference content frame of the reference player in real time based on the playback position recorded by the player to be synchronized itself. This allows the player to adjust its playback progress in real time according to its own recorded playback progress, without relying on other systems such as other players or systems with playback position recording tools such as a global clock. This improves the independence and flexibility of the player to be synchronized in adjusting the playback progress of the media content during player synchronization, achieving more accurate and efficient player synchronization.

[0068] In some implementations, a position threshold can be determined based on the reference playback position of a reference content frame. This position threshold can then be used directly to determine whether the synchronized playback position of the content frame to be played exceeds a specific standard, thereby improving the efficiency of determining the content frame to be processed. Specifically, determining the content frame to be processed from the content frames to be played based on the difference between the reference playback position and the synchronized playback position includes:

[0069] Determine the position threshold based on the baseline playback position;

[0070] From the content frames to be played, identify the content frames to be processed whose positions exceed the position threshold for synchronized playback.

[0071] The position threshold refers to a threshold used to identify content frames to be processed within the media content to be synchronized. For example, the position threshold can be defined as a specific unit related to the playback position. The media content to be synchronized refers to the content frames whose playback position exceeds the position threshold.

[0072] For example, in this embodiment, the position threshold is related to the reference playback position of the reference content frame. The playback position of the content frame of the media content to be synchronized can be compared with the position threshold to filter out content frames whose playback position exceeds the position threshold from the content frames of the media content to be synchronized. In this embodiment, a content frame whose playback position exceeds the position threshold (i.e., a content frame to be processed) indicates that the playback progress of that content frame is lagging behind the expected progress. Therefore, in this embodiment, based on the position threshold and the playback position of the content frame, the playback progress of the media to be synchronized and the reference media content are compared to determine the content frames in the media content to be synchronized that are lagging in playback progress.

[0073] In some implementations, based on the expected playback deviation threshold and the synchronization display deviation threshold, the pending content frames that deviate too much from the expected playback progress and the pending content frames that deviate too much from the baseline content frames can be screened out, thereby identifying various pending content frames that have anomalies, improving the accuracy and comprehensiveness of identifying pending content frames, and improving the precision of media content synchronization.

[0074] The expected playback deviation threshold refers to the allowable playback position deviation (e.g., maximum position deviation) when the player to be synchronized plays the media content to be synchronized. The synchronization delivery deviation threshold refers to the threshold for synchronizing the reference media content and the media content to be synchronized, such as the maximum allowable position deviation during playback. Therefore, based on the expected playback deviation threshold, content frames whose playback progress lags behind the expected progress can be filtered out, and based on the synchronization delivery deviation threshold, content frames whose playback progress lags behind the reference player can be filtered out.

[0075] For example, in some implementations, a first threshold and a second threshold for the position threshold can be determined firstly by the expected playback deviation threshold and the synchronization transmission deviation threshold, respectively. This allows the playback position of the content frame of the media content to be synchronized to be compared with the first and second thresholds, improving the efficiency of determining the content frame to be processed. Specifically, the position threshold includes a first threshold and a second threshold. Determining the position threshold based on the reference playback position includes:

[0076] Based on the baseline playback position and the expected playback deviation threshold, a first threshold is determined. The expected playback deviation threshold represents the deviation threshold of the playback position of the media content to be synchronized relative to the expected playback position.

[0077] Based on the baseline playback position and the synchronization transmission deviation threshold, a second threshold is determined. The synchronization transmission deviation threshold represents the deviation threshold between the baseline media content and the media content to be synchronized during playback.

[0078] For example, in this embodiment of the application, the expected playback deviation threshold is mainly used to detect abnormal playback progress. It measures whether the playback state of the player has deviated from the expected baseline (such as the baseline playback position) by a time deviation (i.e., the expected playback deviation threshold), and if so, it is considered an abnormal situation. Thus, the first threshold can be expressed as the sum of the baseline playback position and the expected playback deviation threshold, such as first threshold = baseline playback position + expected playback deviation threshold.

[0079] Under normal circumstances, the playback progress of the reference media content and the media content to be synchronized should be kept as consistent as possible. The synchronization deviation threshold is used to define the tolerable deviation between them. In this embodiment, the synchronization deviation threshold mainly focuses on the synchronization of the reference media content and the media content to be synchronized, ensuring that the playback progress of the reference media content and the media content to be synchronized remains consistent within an acceptable time range, avoiding obvious asynchrony. Therefore, the second threshold can be expressed as the difference between the reference playback position and the expected playback deviation threshold, such as second threshold = reference playback position - synchronization deviation threshold.

[0080] In some implementations, the first and second thresholds corresponding to the expected playback deviation threshold and the synchronization transmission deviation threshold can be used as the upper and lower thresholds of the position threshold, respectively, to clearly define the range of content frames to be processed. Content frames of the media content to be synchronized whose playback positions exceed the threshold range determined by the upper and lower thresholds are all considered as content frames to be processed. Specifically, determining the content frames to be synchronized from the content frames to be played, whose playback positions exceed the position threshold, includes:

[0081] When the position of the content frame to be played exceeds the first threshold, or when the position of the content frame to be played does not exceed the second threshold, the content frame to be played is determined as a content frame to be processed.

[0082] For example, for any content frame to be played (such as content frame A) of the media content to be synchronized, the playback position of the content frame (i.e., the position to be synchronized) is denoted as playback position A. If the reference playback position - synchronization transmission deviation threshold ≤ playback position A ≤ reference playback position + expected playback deviation threshold, that is, the position to be synchronized of the frame exceeds the second threshold but does not exceed the first threshold, then content frame A is considered a normally playing content frame. If playback position A < reference playback position - synchronization transmission deviation threshold, or reference playback position + expected playback deviation threshold < playback position A, that is, the position to be synchronized of the frame exceeds the first threshold or does not exceed the second threshold, then content frame A is considered an abnormally playing content frame, and therefore can be used as a content frame to be processed. By analogy, all abnormally playing content frames to be processed can be identified from the media content to be synchronized in the content frames to be played.

[0083] It should be noted that if the playback position A is less than the reference playback position minus the synchronization error threshold, it means that the current playback position A is less than the reference playback position minus the synchronization error threshold. If this condition is met, it means that the content frame has been outdated or arrived prematurely. If the content frame is displayed directly according to the playback position, it will cause a difference between the player to be synchronized and the reference player, which may lead to inaccurate display or timing disorder. Therefore, it is necessary to adjust the content frame to be processed in order to achieve player synchronization.

[0084] If the baseline playback position plus the expected playback deviation threshold is less than playback position A, it means that the content frames of the baseline media content have arrived ahead of schedule, while the playback time of the corresponding content frames of the synchronous media content is later. The playback progress of the waiting synchronous player lags behind the playback progress of the baseline player, and it is necessary to adjust the content frames after these progresses to achieve player synchronization.

[0085] In some implementations, the difference between the reference playback position and the synchronization position of the playback content frame of the media content to be synchronized can be calculated, and the playback content frame whose difference does not meet the specified threshold (such as the expected playback deviation threshold and / or the synchronization transmission and display deviation threshold) can be regarded as the content frame to be processed.

[0086] For example, for any content frame to be played (such as content frame A) of the media content to be synchronized, the playback position of this content frame (i.e., the position to be synchronized) is denoted as playback position A. The difference 1 between the reference playback position and playback position A can be calculated, which is also the difference 2 between playback position A and the reference playback position. If difference 1 is less than or equal to the expected playback deviation threshold, or difference 2 is less than or equal to the synchronization transmission and display deviation threshold, then content frame A is a normally playing content frame, and therefore can be used as a content frame to be processed. If difference 1 is greater than the expected playback deviation threshold, or difference 2 is greater than the synchronization transmission and display deviation threshold, then content frame A is considered to be an abnormally playing content frame, and therefore can be used as a content frame to be processed.

[0087] In some implementations, each frame following the currently playing media content to be synchronized by the player can be individually determined to be a content frame to be processed. This allows for frame-by-frame, real-time control of the playback progress of the content frames to be played, improving the real-time performance and accuracy of determining the content frames to be processed. Specifically, before determining the content frames to be processed from the content frames to be played based on the difference between the reference playback position and the playback position to be synchronized, the process further includes:

[0088] Each frame following the currently playing content frame of the media content to be synchronized is identified as a frame to be played.

[0089] For example, in the sequence of content frames {frame 1, frame 2, frame 3, ..., frame n} of the media content to be synchronized, frame 1 is the currently playing frame of the media content to be synchronized. Frame 2, which follows frame 1, can be considered as the content frame to be played. Based on the difference between the reference playback position and the synchronization position of frame 2, it is determined whether frame 2 is a content frame to be processed. If it is, subsequent processing is performed; otherwise, frame 2 is played normally. This process continues, treating each frame after frame 1 as a content frame to be played and processing it accordingly, until the last frame of the content frame sequence (i.e., frame n) is treated as the content frame to be played and processed accordingly.

[0090] In some implementations, when the reference playback position of the reference content frame is obtained periodically (e.g., according to a preset time interval), the content frames of the media content to be synchronized within the preset time interval starting from the reference playback position time point can also be used as the content frames to be played.

[0091] In some implementations, considering that when the reference playback position of a reference content frame is obtained periodically (e.g., according to a preset time interval), the content frame to be processed is determined based on the reference playback position within each time interval corresponding to the obtained reference playback position (i.e., the preset time interval). That is, the position threshold used to determine whether it is a content frame to be processed remains unchanged, thus allowing batch processing of content frames to be processed according to the preset time interval. Specifically, before determining the content frame to be processed from the content frames to be played based on the difference between the reference playback position and the position to be synchronized, the method further includes: using the content frames of the media content to be synchronized within a specified time period starting from the reference playback position time point as the content frames to be played, where the specified time period is the same as the preset time period. To batch process the content frames to be processed according to the time interval, for example, if the preset time interval is 30 seconds, and the time point at which the player to be synchronized obtains the reference playback position is t, then the content frames of the media content to be synchronized within the time period t+30 seconds can be used as the currently synchronized content frames to be played.

[0092] 150. Adjust the frames of the content to be processed to adjust the playback progress of the media content to be synchronized, so that the playback progress of the media content to be synchronized is synchronized with the playback progress of the reference media content.

[0093] Playback progress refers to the current state of the player during playback, typically represented by time, frame sequence number, or data stream position. It measures how much content the player has played and the current playback progress. Specific methods for adjusting the frames to be processed can include, but are not limited to, frame dropping, frame skipping, and delaying. For example, depending on whether the frame arrives early or lagging behind, delaying or frame dropping / skipping can be used respectively.

[0094] In some implementations, for content frames that arrive early or lag behind in progress, the frames can be discarded using methods such as frame dropping or frame skipping for adjustment. Specifically, adjusting the content frames to be processed includes: discarding the content frames to be processed.

[0095] For example, for content frames whose playback progress is lagging, the position management function can be used to discard the frame, thereby speeding up the playback progress of the player to be synchronized and allowing it to catch up with the reference player, thus achieving synchronization. For content frames that arrive early, directly displaying them according to their playback position would cause discrepancies between the player to be synchronized and the reference player. Therefore, to avoid inaccurate display or timing errors caused by premature display, the position management function can also discard the frame to prevent premature rendering and achieve synchronization. Thus, by discarding content frames, the player to be synchronized and the reference player can play different media content synchronously. Figure 1c The diagram showing the synchronization effect of the media players demonstrates how steps 110 to 150 are performed on each of the m players to be synchronized, so that the frame rate of the media content played by the m players to be synchronized is aligned with that of the reference player.

[0096] In the synchronization process of multiple players, this embodiment determines the difference between the content frame to be played and the reference content frame of the reference player in real time based on the playback position recorded by the player to be synchronized, and then determines and adjusts the content frame to be processed. In this way, the synchronization processing of each player to be synchronized in a multi-player scenario is distributed locally on each player, allowing each player to adjust its own playback progress independently and in real time according to its own recorded playback progress, thereby improving the real-time performance of the synchronization process for multiple players.

[0097] In existing synchronization schemes, when controlling multiple players to synchronize, the synchronization control system typically performs Seek operations on each player in a certain order. The Seek operation directly jumps to the current playback time of the reference player, affecting multiple players. When controlling the jump, all players need to temporarily stop playback, interrupting the user's continuous viewing and impacting the user experience. Even worse, buffering often occurs during the Seek process, further prolonging the user's waiting time. Furthermore, some players, limited by their underlying decoding capabilities, may experience serious problems such as freezing or black screens after multiple Seek operations. To avoid the adverse effects of frequent synchronization, the threshold setting usually needs to far exceed international standards, which sacrifices synchronization accuracy and real-time performance to some extent. In this embodiment, the player to be synchronized adjusts its playback progress independently and in real-time according to its recorded playback position (e.g., based on its own custom clock mechanism) to closely follow the reference player's clock, without needing to pause the player, thus not affecting the user's continuous viewing and ensuring a good user experience. Simultaneously, it avoids stuttering or reduced accuracy and real-time performance, thereby ensuring the continuity, smoothness, and media content quality of the user's viewing experience.

[0098] In some implementations, a sleep function can be used to pause the playback progress of the media content to be synchronized, so that it can be aligned with the reference playback position, ensuring smooth synchronous playback of multiple media contents. Specifically, the media playback method also includes:

[0099] Based on the difference between the baseline playback position and the position to be synchronized, the sleep function is invoked.

[0100] The sleep function pauses the playback of the media content to be synchronized based on preset synchronization conditions.

[0101] The sleep function refers to pausing the current playback to wait for a preset synchronization condition to be met, thereby achieving precise playback synchronization. The preset synchronization condition refers to the conditions related to the synchronized playback of the reference media content and the media content to be synchronized. For example, the preset synchronization condition can be one or more of the following: a preset pause duration such as 10ms, or alignment of the reference playback position with the playback position of the content frame to be played.

[0102] For example, a sleep function (such as the `sleep` function) can pause the thread playing the media content to be synchronized based on a preset pause duration or a calculated pause duration, thus halting playback until preset synchronization conditions are met, such as the pause time reaching the preset or calculated pause duration, at which point playback resumes. The calculated pause duration can be determined by calculating the waiting time based on the difference between the baseline playback position and the synchronized playback position of the media content. This is particularly useful when acceleration strategies are used to catch up in the case of discarded adaptation frames.

[0103] In some implementations, when the playback position of a content frame of the media content to be synchronized exceeds a first threshold, i.e., the content frame is lagging, a sleep function can be used to pause the thread of the media content to be synchronized and adjust the display frequency of the media content to be synchronized to improve playback smoothness. Specifically, based on the difference between the reference playback position and the playback position to be synchronized, the sleep function is invoked, including:

[0104] When the position of the content frame to be played synchronously exceeds the first threshold, the sleep function is called.

[0105] For example, for any frame of the media content to be synchronized (e.g., frame A), if the baseline playback position plus the expected playback deviation threshold is less than playback position A, the display frequency of the media content to be synchronized can be adjusted by sleeping the thread of the media content to be synchronized, ensuring smooth playback. Since the playback state of the player to be synchronized is equivalent to the expected baseline exceeding the expected time deviation, this is usually due to playback errors caused by various factors (such as decoding latency, network fluctuations, etc.). Adjusting the display frequency of the media content to be synchronized through the sleep function avoids desynchronization caused by stuttering, dropped frames, etc., thus preventing system lag and ensuring a smooth playback experience.

[0106] In some implementations, when content frames are outdated or arrive prematurely, these frames are discarded. To prevent excessive playback speed due to frame drops, a sleep function can be used to reduce the frame output frequency, thus avoiding missing or delaying subsequent content frames. Specifically, the sleep function is invoked based on the difference between the reference playback position and the position to be synchronized, including:

[0107] The sleep function is called when the position of the content frame to be played synchronously does not exceed the second threshold.

[0108] When the playback progress difference between the reference media content and the media content to be synchronized is too large, when the player adjusts the playback progress according to the recorded playback position, a large number of frames need to be adjusted. Synchronizing the media content by adjusting these frames may cause sudden jumps or stutters in the video or audio of the media content to be synchronized, affecting the continuity and smoothness of the playback. To address this, in some implementations, when the playback progress difference between the reference media content and the media content to be synchronized is too large, the playback speed of the media content to be synchronized can be adjusted to synchronize the player, avoiding jumps or stutters and improving the continuity and smoothness of the playback. Specifically, the media playback method further includes:

[0109] When the speed adjustment conditions are met, the speed adjustment time period is determined based on the current position difference and the specified speed multiplier. The speed adjustment conditions include at least one of the following: the current position difference exceeds the preset position difference and the player to be synchronized does not have a position management function. The current position difference is the difference between the reference playback position and the current playback position of the media content to be synchronized. The current playback position is the playback position of the content frame currently being played in the media content to be synchronized. The position management function is used to determine the playback position to be synchronized and adjust the content frame to be processed.

[0110] Adjust the playback speed of the player to be synchronized within a specified speed range to adjust the playback progress of the media content to be synchronized.

[0111] Among them, the gear shift adjustment conditions refer to the conditions used to determine whether to perform gear shift adjustment.

[0112] Here, the current position difference refers to the difference between the reference playback position and the current playback position. In this embodiment, the current playback position can be the playback position recorded by the player to be synchronized, or it can be the playback position recorded by other players or the synchronization control system.

[0113] The preset position difference refers to a threshold (such as the maximum position deviation) between the allowed reference playback position and the current playback position of the media content to be synchronized. The specified variable speed refers to a specific speed used to adjust the playback progress. The specified variable speed will be used to accelerate or decelerate the playback progress of the player to be synchronized to ensure that it is synchronized with the reference player. In this embodiment, the preset position difference and the specified variable speed can be set or adjusted according to the application scenario or actual needs.

[0114] The variable speed time period refers to a specific time interval (i.e., a time period) during which the player to be synchronized will adjust its playback progress according to a specified variable speed multiplier. The variable speed time period can be calculated based on the current position difference and the specified variable speed multiplier.

[0115] For example, when the player to be synchronized does not support recording the playback position of the content frame, the player can be synchronized by adjusting the speed of the media content to be synchronized. For example, when no custom clock of the player to be synchronized is detected, the reference playback position of the reference content frame and the current playback position of the media content to be synchronized can be obtained, and the current position difference can be calculated. The playback speed of the player to be synchronized can be adjusted within the variable speed period and the specified variable speed multiplier to adjust the playback progress of the media content to be synchronized.

[0116] Alternatively, the baseline playback position of the reference content frame and the current playback position of the media content to be synchronized can be obtained, and the current position difference can be calculated. When the current position difference is detected to exceed a preset position difference, a variable speed period is determined by calculating the current position difference and a specified variable speed, and the player to be synchronized is controlled to play the media content to be synchronized at the specified variable speed within the variable speed period, so that the playback progress of the media content to be synchronized is synchronized with the playback progress of the reference media content. The starting point of the variable speed period can be the timestamp of the next content frame after the currently playing content frame.

[0117] In some implementations, for a player to be synchronized that supports recording the playback position of content frames, the current playback position can be the playback position recorded by the player to be synchronized. For a player to be synchronized that does not support recording the playback position of content frames, the current playback position can be the playback position recorded by another player or the synchronization control system.

[0118] It should be noted that when the reference player and the player to be synchronized are distributed across multiple terminal devices, the speed-changing process (i.e., the above-described speed-synchronization implementation method) in the media playback method provided in this application, which involves determining the speed-changing time period and adjusting the playback speed, can be implemented by a combination of one or more devices, including the terminal of the reference player, the terminal of the player to be synchronized, and the server. For example, it can be implemented jointly by the terminals of the players corresponding to the media resources (i.e., the reference player and the player to be synchronized), or by the servers corresponding to the multiple players, or by the terminals corresponding to the players to be synchronized.

[0119] In some implementations, for players that do not support recording the playback position of content frames, synchronization can be achieved through variable speed processing at preset time intervals. For example, the player to be synchronized can obtain the reference playback position of a reference content frame and determine the current position difference at preset time intervals, and then perform subsequent synchronization processing. This allows the player to continuously detect the playback progress of the reference media content through periodic variable speed processing, and perform multiple, real-time synchronizations to ensure the smoothness and stability of media resource playback. In this embodiment, obtaining the reference playback position of a reference content frame and determining the current position difference, and then performing subsequent synchronization processing, is considered as one instance of media content synchronization.

[0120] In some implementations, the speed-change period can be calculated based on the difference between the specified speed-change ratio and the current playback speed, as well as the current position difference. Specifically, when the speed-change adjustment conditions are met, the speed-change period is determined based on the current position difference and the specified speed-change ratio, including:

[0121] When the speed adjustment conditions are met, obtain the current playback speed of the media content to be synchronized;

[0122] The time interval for the speed change is calculated based on the difference between the specified variable speed and the current playback speed, combined with the difference in the current position.

[0123] The current playback speed refers to the playback speed of the media content to be synchronized, which is usually the standard playback speed, such as 1.

[0124] For example, the time interval for speed changes can be calculated using the following formula: S × speed – S × speed0 = gapOffset, where S represents the time interval for speed changes, speed represents the specified speed change multiplier, speed0 represents the current playback speed multiplier, and gapOffset represents the current position difference. This formula can also be expressed as S × (speed – speed0) = gapOffset, where speed – speed0 represents the difference between the specified speed change multiplier and the current playback speed multiplier.

[0125] In some implementations, the speed-changing time period and the specified speed-changing multiplier can be adjusted through multiple iterations to control the speed-changing time period to not exceed a preset duration, provided that the specified speed-changing multiplier exceeds a preset multiplier. This balances the relationship between the speed-changing multiplier and the length of the speed-changing time period, ensuring that the speed change meets specific requirements while ensuring that the overall time control does not exceed the preset limit. This avoids a decrease in playback quality and a poor viewing experience due to excessive acceleration or excessively long speed-changing times, thereby improving the user experience. Specifically, when the specified speed-changing multiplier exceeds the preset multiplier, after determining the speed-changing time period based on the current position difference and the specified speed-changing multiplier when the speed adjustment condition is met, the process further includes:

[0126] If the speed change time exceeds the preset duration, update the specified speed change ratio to obtain the updated speed change ratio, which exceeds the preset speed change ratio.

[0127] The updated variable speed is used as the specified variable speed. The execution steps are returned. When the variable speed adjustment conditions are met, the variable speed time period and subsequent steps are determined based on the current position difference and the specified variable speed, until the variable speed time period does not exceed the preset duration. The playback speed of the player to be synchronized is adjusted within the variable speed time period using the specified variable speed to adjust the playback progress of the media content to be synchronized.

[0128] The preset speed and preset duration are thresholds used to limit the specified speed multiplier and speed period, respectively. These preset speed and preset duration can be set according to the application scenario or actual needs.

[0129] For example, a speed adjustment factor exceeding a preset speed, such as 0.25, can be pre-set as the specified speed adjustment factor. When the speed adjustment period calculated from the specified speed adjustment factor does not exceed a preset duration, such as 5 seconds, the playback progress of the player to be synchronized within the calculated speed adjustment period is adjusted using the specified speed adjustment factor.

[0130] If the time interval calculated from the specified speed multiplier exceeds a preset duration (e.g., 5 seconds), the process continues to iterate and solve for specified speed multipliers exceeding the preset speed multiplier and time intervals not exceeding the preset duration. During the solution process, the specified speed multiplier is continuously updated and adjusted, and the updated and adjusted time interval is calculated based on the updated speed multiplier, until the calculated time interval is less than 5 seconds. In the final iteration, the playback progress of the player to be synchronized is adjusted within the time interval calculated in that iteration using the specified speed multiplier from the last iteration.

[0131] In some implementations, if a variable speed period that does not exceed a preset duration cannot be obtained even after multiple iterations, the variable speed period can be allowed to exceed the preset duration when the specified variable speed multiplier exceeds the preset multiplier. Specifically, the shortest variable speed period among the multiple variable speed periods calculated through iterations can be taken as the final variable speed period (hereinafter referred to as the target variable speed period), and the specified variable speed multiplier corresponding to the final variable speed period can be taken as the final variable speed multiplier (hereinafter referred to as the target variable speed multiplier). The playback progress of the player to be synchronized within the target variable speed period can be adjusted based on the target variable speed multiplier. In this way, when a variable speed period that meets the requirements cannot be calculated, allowing the variable speed period to exceed the preset duration can avoid the solution failure caused by strict time limits when performing multiple adjustments. At the same time, using the shortest variable speed period as the target variable speed period can ensure that the solution result is as reasonable as possible, without being too loose and causing poor synchronization effect.

[0132] The media playback scheme provided in this application can be applied to various player scenarios. For example, taking virtual reality as an example, media resources are played, including baseline media content and media content to be synchronized. The baseline media content is played through a baseline player, and the media content to be synchronized is played through a player to be synchronized. The player to be synchronized is used to obtain the baseline playback position, which is the playback position of the baseline content frame in the baseline playback content. The baseline content frame is the content frame currently being played in the baseline media content. The player to be synchronized determines the synchronization position of the content frame to be played in the media content to be synchronized, which is the playback position of the content frame to be played recorded by the player to be synchronized in the media content to be synchronized. Based on the difference between the baseline playback position and the synchronization position, the content frame to be processed is determined from the content frame to be played. The content frame to be processed is adjusted to adjust the playback progress of the media content to be synchronized, so that the playback progress of the media content to be synchronized is synchronized with the playback progress of the baseline media content.

[0133] As can be seen from the above, the embodiments of this application can, during the synchronization processing of multiple players, determine the difference between the content frame to be played and the reference content frame of the reference player in real time based on the playback position recorded by the player to be synchronized, and thus determine and adjust the content frame to be processed. In this way, the synchronization processing of each player to be synchronized in a multi-player scenario is distributed locally on each player, allowing each player to adjust its own playback progress in real time according to its own recorded playback progress, thereby improving the real-time performance of the synchronization processing of multiple players.

[0134] The method described in the above embodiments will be further described in detail below.

[0135] In this embodiment, the method of this application embodiment will be described in detail using the application scenario of karaoke software as an example.

[0136] like Figure 2a As shown, a media playback method can be executed by an electronic device, and the specific process is as follows:

[0137] 210. Play media resources.

[0138] For example, embodiments of this application can be applied to karaoke software, which typically involves multiple players used simultaneously. In the complex architecture of karaoke software, to cope with playback needs across various devices and environments, a combined playback strategy using multiple players is usually employed. This strategy involves using one or more players from KsingPlayer, AudioPlayer, ExoPlayer, MediaPlayer, iJkPlayer, PagPlayer, AlphaPlayer, LyricPlayer, MidiPlayer, and ScorePlayer in combination. This combination method is primarily used because different playback devices (such as TVs, karaoke machines, in-vehicle systems, mobile phones, and IoT devices) may have compatibility or performance differences with specific players. Multiple players in karaoke software run on the same terminal, or in specific scenarios such as distributed playback systems, multiple players can also run distributed across multiple terminals.

[0139] When multiple players play simultaneously, it's crucial to ensure that the timing of each player matches the audio playback time. In karaoke software, the audio player can be used as the baseline player, while other players, such as video and effects players, can be used as players to be synchronized. Depending on the application scenario, there can be one or more players to be synchronized. In this embodiment, a clock-following strategy and a variable-speed strategy are employed to achieve efficient synchronization between multiple players.

[0140] For example, such as Figure 2b In the media playback method illustrated in this embodiment, the system periodically triggers a timed task based on a preset time interval to check and update the current progress of the audio player. The audio playback progress (including the current playback position (i.e., the baseline playback position), decoding position, and other information) obtained according to the timed task is encapsulated in a TimeLine object for subsequent processing and transmission.

[0141] 220. Determine if the player to be synchronized has a location management function.

[0142] For example, such as Figure 2b The media playback method shown in the diagram checks whether each player to be synchronized supports a custom clock. For players that support custom clocks (such as ExoPlayer, iJkPlayer, PagPlayer, etc.), the clock following strategy described in steps 230 to 260 is used for synchronization. For players that do not support custom clocks (such as MediaPlayer, AlphaPlayer, etc.), the variable speed strategy described in steps 270 to 280 is used for synchronization.

[0143] For players that support custom clocks, a MediaClock interface (i.e., a clock interface) can be implemented for each player. This clock interface allows the player to handle frame drops, frame skipping, or waiting operations based on the received audio timing information to achieve synchronization.

[0144] In some implementations, for a player that supports a custom clock, if the difference between the current playback position and the reference playback position exceeds a preset position difference, the player to be synchronized can be synchronized using the speed-changing strategy in steps 270 to 280.

[0145] 230. When it is determined that the player to be synchronized has a position management function, the reference playback position is obtained by using the player to be synchronized. The reference playback position is the playback position of the reference content frame in the reference playback content, and the reference content frame is the content frame currently being played in the reference media content.

[0146] 240. Determine the playback position of the content frame to be played in the media content to be synchronized. The playback position is the position of the content frame to be played in the media content to be synchronized, as recorded by the player to be synchronized.

[0147] 250. Based on the difference between the reference playback position and the position to be synchronized, determine the content frame to be processed from the content frames to be played.

[0148] 260. Adjust the frames of the content to be processed to adjust the playback progress of the media content to be synchronized, so that the playback progress of the media content to be synchronized is synchronized with the playback progress of the reference media content.

[0149] For example, such as Figure 2b The media playback method shown in the diagram utilizes the real-time progress of the audio player as a reference in the clock-following strategy. A TimeLine object containing the current playback position (i.e., the reference playback position) is passed to the player to be synchronized (such as iJkPlayer, ExoPlayer, and PagPlayer) that supports a custom clock via a clock interface. These players will then automatically perform frame dropping, frame skipping, or pausing operations based on the received audio timing information to ensure their playback progress remains consistent with the audio player.

[0150] Specifically, a synchronization threshold `syncTime` (i.e., synchronization deviation threshold) and an exception threshold `unexpectTime` (i.e., expected playback deviation threshold) can be preset. Typically, the absolute value of `syncTime` is less than the absolute value of `unexpectTime`. Based on the timestamp (PTS) of the content frame to be played by the player to be synchronized, the following operations are performed: when `media clock - syncTime <= PTS <= media clock + unexpectTime`, the video frame is displayed normally; if `PTS < media clock - syncTime`, the video frame is discarded to avoid being ahead; if `PTS >= media clock + unexpectTime`, the adapted frame is discarded to catch up quickly; within the range of `media clock + unexpectTime <= PTS`, the display frequency is adjusted appropriately using a sleep thread to ensure smooth playback. The media clock `MediaClock` is a reference tool used to control the player's decoding and playback progress. In the above expression, the media clock is the reference playback position of the reference content frame.

[0151] In this embodiment, the clock-following strategy has an independent alignment mechanism. That is, apart from the audio player, other players (such as video and effects players) can adjust their playback progress in real time and independently according to their own clock mechanisms to closely follow the audio player's clock. The clock-following strategy also provides a seamless synchronization experience, meaning that there is no need to pause playback or experience stuttering during the entire synchronization process, thus ensuring the continuity and smoothness of the user's viewing experience.

[0152] 270. When the speed adjustment conditions are met, the speed adjustment time period is determined based on the current position difference and the specified speed multiplier. The speed adjustment conditions include at least one of the following: the current position difference exceeds the preset position difference and the player to be synchronized does not have a position management function. The current position difference is the difference between the reference playback position and the current playback position of the media content to be synchronized. The current playback position is the playback position of the content frame currently being played in the media content to be synchronized. The position management function is used to determine the playback position to be synchronized and adjust the content frame to be processed.

[0153] 280. Adjust the playback speed of the player to be synchronized within the specified variable speed period to adjust the playback progress of the media content to be synchronized.

[0154] For example, such as Figure 2bThe media playback method illustrated uses a variable speed strategy. The core idea is to maintain a constant audio playback speed while adjusting the playback speed of the video and effects players to match the playback speed of the sync player. This is achieved through playback speed adjustments, such as speeding up or slowing down the playback. The variable speed strategy includes target speed calculation and speed adjustment (acceleration or deceleration). Target speed calculation, in the absence of a custom clock, calculates a target speed based on the time difference between the audio and video. Acceleration or deceleration means the sync player will accelerate or decelerate the playback according to the calculated target speed until it is synchronized with the audio progress. During the speed adjustment process, the bitrate of the media content to be synchronized can also be adjusted accordingly to ensure that the picture quality is not affected during playback at different speeds.

[0155] Specifically, the time interval S (i.e., the speed change period) can be calculated based on the time difference gapOffset (i.e., the current position difference) and the set speed (i.e., the specified speed change multiplier). The calculation process follows the formula S×speed-S×1=gapOffset, which is a vector formula. The unit of S is seconds, 1 is the standard speed multiplier, and gapOffset is the current position difference.

[0156] Provided that speed >= 0.25, the value of S should be kept as low as possible, not exceeding 5. If this cannot be achieved, S is allowed to be greater than 5, but speed cannot be lower than 0.25. Speed ​​cannot be 0 to avoid MediaPlayer misinterpreting it as a pause command. After the set speed-changing period S has elapsed, the player's original speed is restored. Considering that MediaPlayer might interpret the speed setting as a resume or pause operation, the playback speed of all players should be restored to its original speed (i.e., standard speed) before implementing the speed-changing strategy.

[0157] In this embodiment, the speed-adjusting strategy features dynamic adjustment of playback rate. Specifically, based on the real-time progress differences between players, the system can intelligently adjust the playback rate of non-audio players, enabling them to quickly and smoothly align with the audio players. The speed-adjusting strategy also avoids progress rollback. Through refined speed control, it effectively avoids video playback progress rollback caused by keyframe issues, ensuring that the predetermined target value is accurately reached after each synchronization.

[0158] As can be seen from the above, this application embodiment, by cleverly combining two strategies—custom clock and variable speed synchronization—not only achieves precise synchronization between multiple players but also optimizes playback smoothness and user experience. It provides a continuous playback experience without pausing: During synchronization, playback is not interrupted, ensuring the continuity of user viewing and interaction and avoiding interruptions caused by synchronization operations. It ensures stable audio streaming without audio stuttering: Through precise clock management and variable speed adjustment, audio playback remains smooth and stutter-free, providing users with a pure and consistent auditory experience. It simplifies control with streamlined operation logic: The automated synchronization mechanism significantly reduces the complexity and control difficulty of multi-player collaborative work, facilitating development and maintenance. It ensures smooth video transitions without video stuttering: Whether playing videos or special effects, seamless transitions and smooth connections are achieved while maintaining the original image quality, effectively avoiding stuttering or frame skipping. It provides a superior synchronization experience with highly consistent synchronization effects: All players perform "chasing" synchronization based on audio progress, ensuring perfect fit between audio, video, and various special effects, greatly enhancing the overall user viewing experience. Short processing time and rapid response mechanism: This solution has efficient synchronous response capabilities, which can complete the synchronous adjustment between multiple players in a short time, reducing the time wasted waiting for synchronization.

[0159] like Figure 2b The media playback method illustrated, especially for karaoke software applications, achieves the following through synchronization with different types of players: lyrics synchronization, ensuring precise correspondence between lyrics display and audio playback progress, enhancing the user's singing experience; MIDI synchronization (timing synchronization), ensuring perfect integration of the performance rhythm with the audio for music containing MIDI elements; scoring system synchronization, updating the scoring system's feedback in real time to accurately reflect the user's singing performance; and canvas effect synchronization, synchronizing various visual effects and canvas effects, such as background animations and stage lighting, to create an immersive karaoke atmosphere. In this way, audio is tightly integrated with other media elements, providing users with a comprehensive and immersive karaoke experience.

[0160] To better implement the above methods, this application also provides a media playback device, which can be integrated into an electronic device.

[0161] For example, in this embodiment, the method of this application embodiment will be described in detail by taking the media playback device specifically integrated into the terminal as an example.

[0162] For example, such as Figure 3 As shown, the media playback device may include a playback unit 310, an acquisition unit 320, a position determination unit 330, a frame determination unit 340, and an adjustment unit 350, as follows:

[0163] (I) Playback Unit 310

[0164] This is used to play media resources, which include baseline media content and media content to be synchronized. The baseline media content is played through the baseline player, and the media content to be synchronized is played through the media content to be synchronized.

[0165] (II) Acquisition Unit 320

[0166] It is used to obtain the reference playback position using the player to be synchronized. The reference playback position is the playback position of the reference content frame in the reference playback content, and the reference content frame is the content frame currently being played in the reference media content.

[0167] In some implementations, the acquisition unit is specifically used to: determine whether the player to be synchronized has a position management function, wherein the position management function is used to determine the position to be synchronized and to adjust the content frames to be processed; when it is determined that the player to be synchronized has a position management function, the reference playback position is obtained using the player to be synchronized.

[0168] In some implementations, the playback position is a timestamp, and the media playback device further includes an adding unit, which is used to: when it is determined that the player to be synchronized has a position management function, add a function interface based on the position management function to the player to be synchronized, a custom clock is used to record the timestamp of the content frame of the media content to be synchronized in the media content to be synchronized and to adjust the content frame to be processed, and the function interface is used to call the position management function.

[0169] (III) Location Determination Unit 330

[0170] Used to determine the playback position of the content frame to be played in the media content to be synchronized. The playback position is the position of the content frame to be played in the media content to be synchronized, as recorded by the player to be synchronized.

[0171] (iv) Frame Determination Unit 340

[0172] It is used to determine the content frame to be processed from the content frames to be played based on the difference between the reference playback position and the position to be synchronized.

[0173] In some implementations, the frame determination unit is specifically used to: determine a position threshold based on a reference playback position; and determine, from the content frames to be played, content frames whose positions to be synchronized for playback exceed the position threshold.

[0174] In some implementations, the position threshold includes a first threshold and a second threshold. Determining the position threshold based on a reference playback position includes: determining the first threshold based on the reference playback position and an expected playback deviation threshold, wherein the expected playback deviation threshold represents the deviation threshold of the playback position of the media content to be synchronized relative to the expected playback position; and determining the second threshold based on the reference playback position and a synchronization transmission deviation threshold, wherein the synchronization transmission deviation threshold represents the deviation threshold between the reference media content and the media content to be synchronized during playback.

[0175] In some implementations, determining a content frame to be processed from the content frames to be played that has a position exceeding a position threshold includes: determining the content frame to be played as a content frame to be processed when the position of the content frame to be played exceeds a first threshold, or when the position of the content frame to be played does not exceed a second threshold.

[0176] In some implementations, the frame determination unit is further configured to: determine each content frame following the currently playing content frame of the media content to be synchronized as the content frame to be played.

[0177] (V) Adjustment Unit 350

[0178] Used to adjust the frames of the content to be processed in order to adjust the playback progress of the media content to be synchronized, so that the playback progress of the media content to be synchronized is synchronized with the playback progress of the reference media content.

[0179] In some implementations, the media playback device further includes a sleep unit, which is used to: invoke a sleep function based on the difference between the reference playback position and the position to be synchronized; and use the sleep function to pause the playback of the media content to be synchronized based on preset synchronization conditions.

[0180] In some embodiments, the media playback device further includes a speed adjustment unit, which is used to: determine a speed adjustment period based on the current position difference and a specified speed adjustment multiplier when the speed adjustment conditions are met. The speed adjustment conditions include at least one of the following: the current position difference exceeds a preset position difference and the player to be synchronized does not have a position management function. The current position difference is the difference between the reference playback position and the current playback position of the media content to be synchronized. The current playback position is the playback position of the content frame currently being played in the media content to be synchronized. The position management function is used to determine the playback position to be synchronized and adjust the content frame to be processed. The playback speed of the player to be synchronized is adjusted within the speed adjustment period at a specified speed adjustment multiplier to adjust the playback progress of the media content to be synchronized.

[0181] In some implementations, when the speed adjustment conditions are met, the speed adjustment period is determined based on the current position difference and the specified speed adjustment multiplier, including: when the speed adjustment conditions are met, obtaining the current playback speed of the media content to be synchronized; and calculating the speed adjustment period based on the difference between the specified speed adjustment multiplier and the current playback speed, combined with the current position difference.

[0182] In some implementations, if the specified variable speed exceeds a preset variable speed, the variable speed unit is further configured to: if the variable speed period exceeds a preset duration, update the specified variable speed to obtain an updated variable speed, which exceeds the preset variable speed; use the updated variable speed as the specified variable speed and return to the execution steps; when the variable speed adjustment conditions are met, determine the variable speed period and subsequent steps based on the current position difference and the specified variable speed, until the variable speed period does not exceed the preset duration, and adjust the playback speed of the player to be synchronized within the variable speed period using the specified variable speed to adjust the playback progress of the media content to be synchronized.

[0183] In practice, each of the above units can be implemented as an independent entity or can be arbitrarily combined to be implemented as the same or several entities. For the specific implementation of each of the above units, please refer to the previous method embodiments, which will not be repeated here.

[0184] As described above, the media playback device of this embodiment includes a playback unit, an acquisition unit, a position determination unit, a frame determination unit, and an adjustment unit. The playback unit plays media resources, including baseline media content and media content to be synchronized. The baseline media content is played through a baseline player, and the media content to be synchronized is played through a player to be synchronized. The acquisition unit uses the player to be synchronized to acquire a baseline playback position, which is the playback position of a baseline content frame within the baseline playback content. The baseline content frame is the currently playing content frame of the baseline media content. The position determination unit determines the synchronized playback position of the content frame to be played in the media content to be synchronized, which is the playback position of the content frame to be played recorded by the player to be synchronized within the media content to be synchronized. The frame determination unit determines the content frame to be processed from the content frames to be played based on the difference between the baseline playback position and the synchronized playback position. The adjustment unit adjusts the content frame to be processed to adjust the playback progress of the media content to be synchronized, so that the playback progress of the media content to be synchronized is synchronized with the playback progress of the baseline media content.

[0185] Therefore, in the synchronization process of multiple players, this application embodiment can determine the difference between the content frame to be played and the reference content frame of the reference player in real time based on the playback position recorded by the player to be synchronized, and thus determine and adjust the content frame to be processed. In this way, the synchronization processing of each player to be synchronized in a multi-player scenario is distributed locally on each player, allowing each player to adjust its own playback progress in real time according to its own recorded playback progress, thereby improving the real-time performance of the synchronization process for multiple players.

[0186] This application also provides an electronic device, which can be a terminal, server, or other similar device.

[0187] In this embodiment, the electronic device will be used as an example for detailed description, such as... Figure 4 As shown, it illustrates the structural diagram of the terminal involved in the embodiments of this application, specifically:

[0188] The terminal may include components such as a processor 410 with one or more processing cores, a memory 420 with one or more computer-readable storage media, a power supply 430, an input module 440, and a communication module 450. Those skilled in the art will understand that... Figure 4 The terminal structure shown does not constitute a limitation on the terminal and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein:

[0189] The processor 410 is the control center of the terminal, connecting various parts of the terminal through various interfaces and lines. It executes various functions and processes data by running or executing software programs and / or modules stored in the memory 420, and by calling data stored in the memory 420. In some embodiments, the processor 410 may include one or more processing cores; in some embodiments, the processor 410 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may also not be integrated into the processor 410.

[0190] The memory 420 can be used to store software programs and modules. The processor 410 executes various functional applications and data processing by running the software programs and modules stored in the memory 420. The memory 420 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the terminal, etc. In addition, the memory 420 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 420 may also include a memory controller to provide the processor 410 with access to the memory 420.

[0191] The terminal also includes a power supply 430 that supplies power to the various components. In some embodiments, the power supply 430 can be logically connected to the processor 410 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 430 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0192] The terminal may also include an input module 440, which can be used to receive input numeric or character information, and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.

[0193] The terminal may also include a communication module 450. In some embodiments, the communication module 450 may include a wireless module, through which the terminal can perform short-range wireless transmission, thereby providing users with wireless broadband internet access. For example, the communication module 450 can be used to help users send and receive emails, browse web pages, and access streaming media.

[0194] Although not shown, the terminal may also include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 410 in the terminal loads the executable files corresponding to the processes of one or more applications into the memory 420 according to the following instructions, and the processor 410 runs the applications stored in the memory 420, thereby implementing the steps in the methods of the various embodiments of this application.

[0195] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.

[0196] As can be seen from the above, in the synchronization process of multiple players, this embodiment of the application determines the difference between the content frame to be played and the reference content frame of the reference player in real time based on the playback position recorded by the player to be synchronized, and then determines and adjusts the content frame to be processed. In this way, the synchronization processing of each player to be synchronized in the multi-player scenario is distributed locally on each player, and the player to be synchronized adjusts its own playback progress in real time according to its own recorded playback progress, thereby improving the real-time performance of the synchronization process of multiple players.

[0197] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.

[0198] Therefore, embodiments of this application provide a computer-readable storage medium storing a plurality of instructions that can be loaded by a processor to execute steps in any of the media playback methods provided in embodiments of this application. For example, the instructions can execute the following steps:

[0199] The process involves playing media resources, including baseline media content and media content to be synchronized. The baseline media content is played through a baseline player, and the media content to be synchronized is played through a player to be synchronized. The player to be synchronized is used to obtain the baseline playback position, which is the playback position of the baseline content frame within the baseline playback content. The baseline content frame is the currently playing content frame of the baseline media content. The process then determines the synchronization position of the content frame to be played within the media content to be synchronized, which is the playback position of the content frame to be played within the media content to be synchronized, as recorded by the player to be synchronized. Based on the difference between the baseline playback position and the synchronization position, the process identifies the content frame to be processed from the content frames to be played. Finally, the process adjusts the content frame to be processed to adjust the playback progress of the media content to be synchronized, ensuring that the playback progress of the media content to be synchronized is synchronized with that of the baseline media content.

[0200] The storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0201] According to one aspect of this application, a computer program product or computer program is provided, comprising a plurality of instructions that, when executed by a processor, implement the steps of the methods provided in the various optional implementations of the above embodiments. The instructions are stored in a computer-readable storage medium. A processor of an electronic device reads the instructions from the computer-readable storage medium and executes the instructions, causing the electronic device to perform the methods provided in the various optional implementations of the above embodiments.

[0202] Since the instructions stored in the storage medium can execute the steps of any media playback method provided in the embodiments of this application, the beneficial effects that any media playback method provided in the embodiments of this application can achieve can be realized. For details, please refer to the previous embodiments, which will not be repeated here.

[0203] The above provides a detailed description of a media playback method, apparatus, electronic device, storage medium, and program product provided in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A media playback method, characterized in that, include: Play media resources, which include baseline media content and media content to be synchronized. The baseline media content is played through a baseline player, and the media content to be synchronized is played through a player to be synchronized. The reference playback position is obtained using the player to be synchronized. The reference playback position is the playback position of the reference content frame in the reference playback content. The reference content frame is the content frame currently being played in the reference media content. Determine the synchronized playback position of the content frame to be played in the media content to be synchronized, wherein the synchronized playback position is the playback position of the content frame to be played in the media content to be synchronized as recorded by the synchronized player; Based on the difference between the reference playback position and the playback position to be synchronized, determine the content frame to be processed from the content frame to be played. Adjust the content frames to be processed to adjust the playback progress of the media content to be synchronized, so that the playback progress of the media content to be synchronized is synchronized with the playback progress of the reference media content.

2. The media playback method as described in claim 1, characterized in that, The step of determining the content frame to be processed from the content frames to be played based on the difference between the reference playback position and the playback position to be synchronized includes: Determine the position threshold based on the reference playback position; From the content frames to be played, determine the content frames to be processed whose positions for synchronized playback exceed the position threshold.

3. The media playback method as described in claim 2, characterized in that, The position threshold includes a first threshold and a second threshold, and determining the position threshold based on the reference playback position includes: Based on the baseline playback position and the expected playback deviation threshold, the first threshold is determined, wherein the expected playback deviation threshold represents the deviation threshold of the playback position of the media content to be synchronized relative to the expected playback position. Based on the reference playback position and the synchronization transmission deviation threshold, the second threshold is determined. The synchronization transmission deviation threshold represents the deviation threshold between the reference media content and the media content to be synchronized during playback.

4. The media playback method as described in claim 3, characterized in that, The step of determining, from the content frames to be played, the content frames whose positions for synchronized playback exceed the position threshold includes: When the position to be synchronized in the content frame to be played exceeds the first threshold, or when the position to be synchronized in the content frame to be played does not exceed the second threshold, the content frame to be played is determined as the content frame to be processed.

5. The media playback method as described in claim 1, characterized in that, Before determining the content frame to be processed from the content frame to be played based on the difference between the reference playback position and the playback position to be synchronized, the method further includes: Each frame following the currently playing content frame of the media content to be synchronized is determined as the content frame to be played.

6. The media playback method as described in claim 1, characterized in that, The method further includes: Based on the difference between the baseline playback position and the playback position to be synchronized, the sleep function is invoked; The sleep function is used to pause the playback of the media content to be synchronized based on preset synchronization conditions.

7. The media playback method as described in claim 1, characterized in that, The step of obtaining the reference playback position using the player to be synchronized includes: Determine whether the player to be synchronized has a location management function, the location management function being used to determine the position of the player to be synchronized and to adjust the content frames to be processed; When it is determined that the player to be synchronized has the location management function, the reference playback position is obtained using the player to be synchronized.

8. The media playback method as described in claim 7, characterized in that, After determining whether the player to be synchronized has location management functionality, the process further includes: When it is determined that the player to be synchronized has the location management function, the function interface based on the location management function is added to the player to be synchronized. The function interface is used to call the location management function.

9. The media playback method according to any one of claims 1 to 8, characterized in that, The method further includes: When the speed adjustment conditions are met, the speed adjustment time period is determined based on the current position difference and the specified speed multiplier. The speed adjustment conditions include at least one of the following: the current position difference exceeds the preset position difference and the player to be synchronized does not have a position management function. The current position difference is the difference between the reference playback position and the current playback position of the media content to be synchronized. The current playback position is the playback position of the content frame currently being played in the media content to be synchronized. The position management function is used to determine the playback position to be synchronized and adjust the content frame to be processed. The playback speed of the player to be synchronized is adjusted within the specified variable speed period to adjust the playback progress of the media content to be synchronized.

10. The media playback method as described in claim 9, characterized in that, When the speed adjustment conditions are met, the speed change time period is determined based on the current position difference and the specified speed multiplier, including: When the speed adjustment conditions are met, the current playback speed of the media content to be synchronized is obtained; The time interval of the speed change is calculated based on the difference between the specified variable speed and the current playback speed, combined with the current position difference.

11. The media playback method as described in claim 9, characterized in that, When the specified speed ratio exceeds a preset speed ratio, after determining the speed adjustment time period based on the current position difference and the specified speed ratio when the speed adjustment conditions are met, the process further includes: If the speed change time exceeds the preset duration, the specified speed change ratio is updated to obtain the updated speed change ratio, and the updated speed change ratio exceeds the preset speed change ratio. The updated variable speed is used as the specified variable speed. The execution steps are returned. When the variable speed adjustment conditions are met, the variable speed time period and subsequent steps are determined based on the current position difference and the specified variable speed, until the variable speed time period does not exceed the preset duration. The playback speed of the player to be synchronized is adjusted within the variable speed time period using the specified variable speed, so as to adjust the playback progress of the media content to be synchronized.

12. A media playback device, characterized in that, include: A playback unit is used to play media resources, which include baseline media content and media content to be synchronized. The baseline media content is played through a baseline player, and the media content to be synchronized is played through a player to be synchronized. The acquisition unit is used to acquire a reference playback position using the player to be synchronized. The reference playback position is the playback position of the reference content frame in the reference playback content. The reference content frame is the content frame currently being played in the reference media content. A position determination unit is used to determine the synchronized playback position of the content frame to be played in the media content to be synchronized, wherein the synchronized playback position is the playback position of the content frame to be played in the media content to be synchronized as recorded by the synchronized player. A frame determination unit is used to determine the content frame to be processed from the content frames to be played based on the difference between the reference playback position and the playback position to be synchronized. An adjustment unit is used to adjust the content frame to be processed in order to adjust the playback progress of the media content to be synchronized, so that the playback progress of the media content to be synchronized is synchronized with the playback progress of the reference media content.

13. An electronic device, characterized in that, The method includes a processor and a memory, the memory storing multiple instructions; the processor loads instructions from the memory to perform the steps of the media playback method as described in any one of claims 1 to 11.

14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a plurality of instructions adapted for loading by a processor to perform the steps of the media playback method according to any one of claims 1 to 11.

15. A computer program product comprising multiple instructions, characterized in that, When the instruction is executed by the processor, it implements the steps of the media playback method according to any one of claims 1 to 11.