Player playing control method and device, electronic equipment and storage medium
By enabling direct communication between the JS layer and the native layer under the React Native architecture and utilizing interceptors for parameter adaptation, the problem of insufficient flexibility in the extension of traditional players is solved, achieving precise control of high real-time audio playback and expansion of business functions.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HANGZHOU NETEASE CLOUD MUSIC TECH CO LTD
- Filing Date
- 2026-03-25
- Publication Date
- 2026-07-21
AI Technical Summary
Traditional music and audio players lack scalability and cannot quickly adapt to changes in business needs. In particular, they suffer from high performance overhead in high real-time scenarios such as in-car music playback, making it difficult to meet interactive requirements.
It adopts the React Native architecture, and realizes direct communication between the JS layer and the native layer through interceptors and bridging layers in the JS layer. Parameters are adapted by configuring interceptors, and target playback parameters are directly passed to the native layer, avoiding serialization and deserialization operations. It supports dynamic combination and order adjustment of multiple interceptors.
It significantly improves the scalability and real-time performance of the player's business functions, reduces cross-layer communication overhead, enables precise control over audio playback, and ensures a consistent user experience across multiple devices.
Smart Images

Figure CN122431629A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of communication technology, and in particular to a playback control method, apparatus, electronic device, and storage medium for a player. Background Technology
[0002] Traditional music and audio players often employ a layered architecture consisting of a UI layer, a multimedia engine layer, and a decoder layer. Under this architecture, extending the player's functionality requires modifying the core code or relying on limited plugin interfaces, resulting in insufficient flexibility. Related technologies allow players to use frameworks like Electron or Dio to extend limited functionality through interceptors. However, these interceptors only operate at the API request or network link level, failing to reach core logic such as audio decoding and hardware interaction, making it difficult to quickly adapt to changing business needs. Another approach is to use the React Native architecture with a Bridge communication mechanism to achieve interaction between the JavaScript layer and the native code layer. However, this mechanism requires frequent JSON serialization and deserialization operations, resulting in a lengthy interaction chain and high performance overhead, making it unsuitable for high real-time scenarios such as in-vehicle music playback. Summary of the Invention
[0003] In view of this, the purpose of the present invention is to provide a playback control method, device, electronic device and storage medium for a player, so as to achieve rapid response and adaptation to business needs, and at the same time meet the usage requirements of high real-time scenarios such as in-vehicle music playback.
[0004] In a first aspect, embodiments of the present invention provide a playback control method, the method comprising: receiving an audio playback request for a target audio through an external interface of a JS layer, and determining the initial playback parameters of the target audio in the audio playback request; calling an interceptor configured in the JS layer to perform parameter adaptation processing on the initial playback parameters to obtain target playback parameters adapted to a preset business function; and passing the target playback parameters to the native layer through a call interface encapsulated by a bridge layer in the JS layer, so that the native layer controls the player to play the target audio through the target playback parameters.
[0005] Secondly, embodiments of the present invention provide a playback control device for a player. The player includes a JS layer, a bridging layer, and a native layer. The JS layer interacts with the native layer through a call interface encapsulated by the bridging layer. The JS layer includes a pre-configured interceptor for a preset business function. The device includes: a first receiving module, used to receive an audio playback request for a target audio through the external interface of the JS layer, and determine the initial playback parameters of the target audio in the audio playback request; a first calling module, used to call the interceptor configured in the JS layer to perform parameter adaptation processing on the initial playback parameters to obtain target playback parameters adapted to the preset business function; and a first control module, used to call the call interface encapsulated by the bridging layer through the JS layer to pass the target playback parameters to the native layer, so that the native layer controls the player to play the target audio through the target playback parameters.
[0006] Thirdly, embodiments of the present invention provide an electronic device, including a processor and a memory, wherein the memory stores machine-executable instructions that can be executed by the processor, and the processor executes the machine-executable instructions to implement the playback control method of the aforementioned player.
[0007] Fourthly, embodiments of the present invention provide a storage medium storing machine-executable instructions. When the machine-executable instructions are invoked and executed by a processor, the machine-executable instructions cause the processor to implement the playback control method of the aforementioned player.
[0008] The embodiments of the present invention bring the following beneficial effects:
[0009] The aforementioned playback control method, device, electronic device, and storage medium for the player include: receiving an audio playback request for a target audio through an external interface of the JS layer, and determining the initial playback parameters of the target audio in the audio playback request; calling an interceptor configured in the JS layer to perform parameter adaptation processing on the initial playback parameters to obtain target playback parameters adapted to a preset business function; and passing the target playback parameters to the native layer by calling a call interface encapsulated by the bridge layer through the JS layer, so that the native layer can control the player to play the target audio through the target playback parameters.
[0010] In this approach, the player's JS layer interacts with the native layer through a call interface encapsulated by a bridge layer. Interceptors with preset business functions are pre-configured in the JS layer. When the JS layer's external interface receives a playback request for the target audio, it first obtains the initial playback parameters of the target audio in the request, then calls the interceptors configured in the JS layer to adapt the initial playback parameters, obtaining the target playback parameters adapted to the preset business functions. Finally, the JS layer directly passes the target playback parameters to the native layer through the call interface encapsulated by the bridge layer, enabling the native layer to control the player to complete the playback of the target audio based on these parameters. This approach relies on the bridge layer to achieve direct communication between the JS layer and the native layer, eliminating the need for serialization and deserialization operations, significantly reducing cross-layer communication overhead. Furthermore, when business requirements change, interceptors matching the business requirements can be directly inserted into the JS layer to implement new business functions. The playback parameters processed by the interceptors can directly reach the native layer corresponding to the player's native code, thereby achieving precise control over audio playback and significantly improving the scalability of the player's business functions.
[0011] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention are realized and obtained in accordance with the structures particularly pointed out in the description, claims and drawings.
[0012] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0013] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0014] Figure 1 A flowchart illustrating a playback control method for a player provided in an embodiment of the present invention; Figure 2 An architecture diagram of a player provided in an embodiment of the present invention; Figure 3 A playback control flowchart for a player provided in an embodiment of the present invention; Figure 4 This is a schematic diagram of the structure of a playback control device for a player provided in an embodiment of the present invention; Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0015] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0016] Based on this, the playback control method, device, electronic device and storage medium of the player provided by the embodiments of the present invention can be applied to audio playback scenarios with high real-time interactive requirements, such as in-vehicle music playback, and can also be adapted to audio player playback control scenarios of multiple terminals such as mobile terminals and desktop terminals.
[0017] To facilitate understanding of this embodiment, a playback control method for a player disclosed in this invention will first be described in detail. Here, the player can be deployed on various terminal devices such as mobile devices, desktops, and in-vehicle terminals. The player is implemented based on the React Native architecture and includes a JS layer, a bridging layer, and a native layer. Each layer relies on the technical characteristics of React Native to achieve efficient collaboration. The JS layer refers to the player's business logic layer, written in JavaScript, used to manage the player's business configuration and serving as the control layer for player business rules and parameter flow. The native layer is an execution layer written in compiled languages such as C / C++, running directly at the operating system level and interfacing with the player's hardware driver. This native layer is directly connected to the player's playback device, which is the hardware device that directly executes audio playback operations. The native layer can transform the player's playback logic into instructions executable by the playback device, enabling precise execution of the playback logic on the playback device. The bridging layer connects the JS layer and the native layer. The call interface encapsulated by the bridging layer is exposed to the JS layer for invocation, and the JS layer interacts with the native layer through this call interface. The JS layer contains interceptors with pre-configured preset business functions, and the business functions of these interceptors are matched with business requirements.
[0018] like Figure 1 As shown, the playback control method of the above player includes the following steps: Step S102: Receive the audio playback request for the target audio through the external interface of the JS layer, and determine the initial playback parameters of the target audio in the audio playback request.
[0019] The aforementioned external interface of the JS layer refers to the standardized calling interface exposed by the player's JS layer to external callers (such as user interfaces, third-party applications, in-vehicle central control systems, etc.), which can be used to receive audio playback-related instructions initiated by external callers.
[0020] The aforementioned initial playback parameters refer to the set of parameters that are passed along with the external caller's request when the external caller initiates an audio playback request through an external interface. These parameters describe the basic requirements for playing the target audio. For example, the initial playback parameters include the target audio identifier, which indicates the target audio, as well as basic configuration parameters such as sound quality parameters and sound effect parameters selected by the user.
[0021] Here, the external interface of the JS layer is used to receive the target audio playback request and parse the request to determine the initial playback parameters corresponding to the target audio.
[0022] Step S104: Call the interceptor configured in the JS layer to perform parameter adaptation processing on the initial playback parameters to obtain the target playback parameters adapted to the preset business functions.
[0023] The aforementioned target playback parameters refer to the standardized playback parameters generated after the initial playback parameters have been adapted by the JS layer interceptor. These parameters can directly meet the preset business function execution requirements and can be recognized and executed by the native layer.
[0024] The aforementioned interceptors are pre-configured with business rules that match their business functions. Interceptors can perform targeted parameter adaptation processing on initial playback parameters based on these built-in business rules. Furthermore, the number and execution order of interceptors can be flexibly set according to actual business needs. Target playback parameters can be generated by a single interceptor or by multiple interceptors working together in sequence to meet business function requirements of varying complexity.
[0025] For example, regarding the business requirement of "automatically enabling super-resolution functionality to optimize audio listening experience," the corresponding interceptor has built-in rules linking audio bitrate and super-resolution functionality. When this interceptor is invoked, it updates the audio bitrate in the initial playback parameters according to the bitrate adaptation requirements for super-resolution functionality in the rules, achieving precise matching between the audio bitrate and super-resolution functionality and ensuring that super-resolution functionality works as expected. In addition, the JS layer is also configured with an interceptor that has parameter format conversion capabilities. This interceptor can convert the playback parameters adapted by the JS layer into a parameter format recognizable by the native layer, ensuring that the target playback parameters can be correctly recognized and parsed by the native layer, effectively guaranteeing the accuracy and effectiveness of cross-layer parameter transmission.
[0026] In one implementation, when business needs expand, multiple interceptors can be added to the JS layer, and the multiple interceptors can be sorted according to the business priority of the preset business functions of each interceptor to form an interceptor chain. When performing parameter adaptation, the initial playback parameters can be processed by each interceptor in sequence along the interceptor chain to finally obtain the target playback parameters that meet the multi-dimensional business needs.
[0027] Step S106: By calling the call interface encapsulated by the bridge layer through the JS layer, the target playback parameters are passed to the native layer so that the native layer can control the player to play the target audio through the target playback parameters.
[0028] The aforementioned call interface encapsulated by the bridging layer refers to a collection of functions or methods pre-encapsulated by the bridging layer to achieve cross-layer interaction, possessing a unified calling specification. This call interface is exposed to the JS layer for invocation, allowing the JS layer to interact with the native layer and pass target playback parameters to it.
[0029] Understandably, the JS layer, bridging layer, and native layer all belong to the software architecture of the player. The target playback parameters obtained by them are at the software level, while the native layer is connected to the hardware playback device in the player. Therefore, after the JS layer passes the target playback parameters to the native layer through the call interface encapsulated by the bridging layer, the native layer converts the target playback parameters at the software level into hardware control instructions that the playback device can recognize, and finally realizes the accurate playback of the target audio on the playback device.
[0030] In related technologies, the architecture uses the Bridge communication mechanism to realize the interaction between the JavaScript layer and the native code layer. However, this mechanism requires frequent JSON serialization and deserialization operations, and the resulting interaction latency cannot meet the needs of high real-time scenarios such as audio playback. Especially in audio processing scenarios with frequent cross-language calls, the latency problem will directly affect the playback smoothness and reduce the user experience.
[0031] This application's solution achieves direct communication between the JS layer and the native layer through a bridging layer, eliminating the need for serialization and deserialization operations and significantly reducing cross-layer communication overhead. Furthermore, the interceptor architecture built in this application allows for feature expansion without modifying the player's core code; new features can be implemented through independent interceptor modules and dynamically loaded, significantly improving system maintainability and scalability. Leveraging React Native's cross-platform capabilities and unified interceptor framework, most interceptor logic can be written in JavaScript and shared across multiple platforms, effectively reducing cross-platform development workload and ensuring a consistent user experience across multiple devices.
[0032] Specifically, this application has three core advantages: First, by leveraging the direct calling capabilities of the React Native architecture, it enables high-performance interception method calls between JavaScript and native code, eliminating serialization overhead, significantly improving interceptor execution efficiency, and meeting the real-time requirements of audio processing in high-real-time scenarios such as in-vehicle music playback; Second, the composable audio interceptor chain architecture supports the dynamic combination and order adjustment of various types of interceptors, making the player's functional expansion more flexible and orderly; Third, the cross-platform interceptor development framework allows developers to develop interceptors adapted to multiple platforms based on JS code, reducing repetitive development work and ensuring consistency in audio experience.
[0033] The playback control method of the aforementioned player receives an audio playback request for the target audio through the external interface of the JS layer and determines the initial playback parameters of the target audio in the audio playback request; it calls the interceptor configured in the JS layer to perform parameter adaptation processing on the initial playback parameters to obtain the target playback parameters adapted to the preset business function; and it passes the target playback parameters to the native layer by calling the call interface encapsulated by the bridge layer through the JS layer, so that the native layer can control the player to play the target audio through the target playback parameters.
[0034] In this approach, the player's JS layer interacts with the native layer through a call interface encapsulated by a bridge layer. Interceptors with preset business functions are pre-configured in the JS layer. When the JS layer's external interface receives a playback request for the target audio, it first obtains the initial playback parameters of the target audio in the request, then calls the interceptors configured in the JS layer to adapt the initial playback parameters, obtaining the target playback parameters adapted to the preset business functions. Finally, the JS layer directly passes the target playback parameters to the native layer through the call interface encapsulated by the bridge layer, enabling the native layer to control the player to complete the playback of the target audio based on these parameters. This approach relies on the bridge layer to achieve direct communication between the JS layer and the native layer, eliminating the need for serialization and deserialization operations, significantly reducing cross-layer communication overhead. Furthermore, when business requirements change, interceptors matching the business requirements can be directly inserted into the JS layer to implement new business functions. The playback parameters processed by the interceptors can directly reach the native layer corresponding to the player's native code, thereby achieving precise control over audio playback and significantly improving the scalability of the player's business functions.
[0035] In one approach, the bridging layer pre-defines the mapping relationship between the calling interface and the native methods of the native layer; the native layer is connected to the playback device of the player; the calling interface encapsulated by the bridging layer is called through the JS layer, and the memory entry address of the native method mapped by the calling interface is determined through the bridging layer; based on the memory entry address, the target playback parameters are passed to the native method, and the native method is triggered to control the playback device of the player to play the target audio based on the target playback parameters.
[0036] The aforementioned native method refers to a method written in compiled languages such as C / C++, running directly at the operating system's underlying layer, and interfacing with the player's hardware driver. This bridging layer, also known as the JavaScript Interface layer (JSI layer), connects the JS layer and the native layer (C / C++ layer), providing a high-performance communication channel.
[0037] The memory entry address of the aforementioned native method refers to the starting address in memory space after the native method is loaded into memory. It is the unique identifier that enables the program to accurately locate and call the native method.
[0038] The playback device mentioned above refers to the hardware device that carries the player and directly performs audio playback operations, such as a car audio module or speaker in a vehicle setting.
[0039] Specifically, the bridging layer pre-defines a one-to-one mapping between API calls and native methods. For example, the first API call maps to the native layer's `play()` method, the second API call maps to the native layer's `setDatasource()` method, and so on. These mappings are predefined during the code development phase based on business logic. When the JS layer calls a API call exposed by the bridging layer, the bridging layer determines the memory entry address of the native method mapped to that API call based on the aforementioned mapping. Based on this memory entry address, the bridging layer passes the target playback parameters to the corresponding native method, triggering the execution of that native method. This drives the native method in the native layer to load the target audio data based on the target playback parameters and controls the corresponding hardware playback device of the player to play the target audio.
[0040] In one approach, the interceptors are located in a built-in interceptor chain within the JS layer. The interceptors in the interceptor chain are ordered sequentially based on the business priority of preset business functions. Each interceptor has pre-defined business rules that match its business function. According to the order of the interceptors in the interceptor chain, the interceptors are called sequentially to perform parameter adaptation processing on the initial playback parameters based on the business rules. The adaptation processing result obtained by the interceptor with the higher priority is used as the input of the interceptor with the lower priority. After being adapted by each interceptor in the interceptor chain, the target playback parameters adapted to the preset business function are generated.
[0041] The interceptor chain is essentially a pipeline-style parameter adaptation mechanism: the interceptors in the interceptor chain are ordered sequentially based on the business priority of the preset business functions. The JS layer sends the initial playback parameters to the interceptor at the beginning of the interceptor chain. The initial playback parameters will pass through each interceptor in turn according to the business priority for parameter adaptation processing of the corresponding business functions. The processing result of the previous interceptor will be directly passed to the next interceptor until all interceptors have completed processing, and finally the target playback parameters that conform to all business rules are output.
[0042] Specifically, each interceptor has built-in preprocessing and postprocessing methods. The preprocessing method supports the interceptor in performing targeted adaptation processing on the input playback parameters based on its own predefined business rules. The postprocessing method is the closing method executed after the preprocessing method completes the parameter adaptation; its core purpose is to encapsulate the processing result after parameter adaptation and trigger the passing of this result to the next interceptor in the interceptor chain. In the actual code implementation, after the interceptor completes the targeted adaptation processing of the input parameters, the output processing result is stored in the interceptor context so that the next interceptor can retrieve the result from this context and use it as its own input parameter.
[0043] In one approach, the interceptor chain further includes a configuration interceptor chain; the configuration interceptor chain contains multiple configuration interceptors; the initial playback parameters include: a target audio identifier, the target audio's sound quality parameters, and the target audio's sound effect parameters; the first configuration interceptor, which is the first in the configuration interceptor chain, is invoked; wherein, the first configuration interceptor has a pre-set audio data acquisition rule that indicates that cached data should be acquired first; based on the audio caching rule, the target audio identifier is obtained from the initial playback parameters, and it is determined whether there is audio cache data matching the target audio identifier in the player's playback device; if audio cache data exists, the cache address of the audio cache data is used as the audio playback address of the target audio and added to the initial playback parameters; if there is no audio cache data, the address configuration interceptor is invoked, and based on the address configuration interceptor, the network playback address of the target audio is obtained from the resource server through an external interface, the network playback address is used as the audio playback address of the target audio and added to the initial playback parameters, resulting in a first adaptation processing result containing the audio playback address of the target audio; based on the first adaptation processing result and the configuration interceptors ranked after the first configuration interceptor, the target playback parameters are determined.
[0044] The aforementioned target audio identifier is used to indicate the target audio. The audio quality parameters of the aforementioned target audio may include parameters such as sampling rate and bit rate. The audio effect parameters of the aforementioned target audio include parameters such as playback speed, audio stream type, and audio playback mode.
[0045] The aforementioned first configuration interceptor has pre-set audio data acquisition rules, which instruct that cached data of the target audio be acquired first. This first configuration interceptor has the function of prioritizing the acquisition of cached audio data. The aforementioned resource server refers to a server-side device that provides network storage and data distribution services for the target audio to the player.
[0046] Here, the first configuration interceptor, which is the first in the configuration interceptor chain, is called first. The first configuration interceptor obtains the target audio identifier from the initial playback parameters according to the audio data acquisition rules through its corresponding preprocessing method. It then determines whether there is audio cache data in the player's playback device that matches the target audio identifier based on the target audio identifier.
[0047] If audio cache data exists, the cache address of the audio cache data is used as the audio playback address of the target audio and added to the initial playback parameters. Specifically, if the query method in the native layer finds matching audio cache data, it sends the cache address corresponding to the audio cache data back to the query call interface of the bridge layer. After the bridge layer adapts the format of the cache address, it forwards it to the first configuration interceptor. The first configuration interceptor receives the cache address and uses it as the audio playback address of the target audio, writing it into the initial playback parameters.
[0048] If no audio cache data exists, the address configuration interceptor is invoked. Based on this, the address configuration interceptor obtains the network playback address of the target audio from the resource server through an external interface. This network playback address is then used as the audio playback address of the target audio and added to the initial playback parameters, resulting in a first adaptation processing result containing the audio playback address of the target audio. This first adaptation processing result aligns with the "prioritize audio data cache acquisition" business function of the first configuration interceptor, accurately reflecting the audio address configuration logic of prioritizing cached addresses and using network addresses as a fallback.
[0049] Finally, the target playback parameters are determined based on the first adaptation processing result and the configuration interceptors ranked after the first configuration interceptor. Specifically, after obtaining the first adaptation processing result, the first configuration interceptor updates its interceptor context according to the first adaptation processing result through its corresponding post-processing method, so that the configuration interceptors ranked after the first configuration interceptor can obtain the content of the first adaptation processing result.
[0050] Specifically, the method to determine whether there is audio cache data matching the target audio identifier in the player's playback device is as follows: the query call interface encapsulated by the bridge layer is called through the first configuration interceptor, triggering the query method of the native layer mapped by the query call interface, and the query method is used to query whether there is audio cache data matching the target audio identifier in the player's playback device.
[0051] In other words, the first configuration interceptor first calls the query call interface encapsulated by the bridge layer, and then triggers the native layer to execute the underlying query logic through the mapping relationship between this interface and the native query method. The query method is called to check whether there is audio cache data in the playback device of the player that matches the target audio identifier. This enables the JS layer to query the cache data of the hardware playback device, ensuring that the audio data acquisition rules can be implemented.
[0052] In one approach, the configuration interceptors ordered after the first configuration interceptor include a second configuration interceptor. The second configuration interceptor is configured with rules linking audio bitrate to super-resolution functionality. The second configuration interceptor is invoked to determine the original bitrate corresponding to the target audio based on the audio playback address in the first adaptation processing result. The super-resolution multiplier acquisition interface of the super-resolution function encapsulated in the bridging layer is invoked through the second configuration interceptor, triggering the super-resolution multiplier acquisition method of the native layer mapped by the super-resolution multiplier acquisition interface. The super-resolution multiplier acquisition method determines the super-resolution multiplier supported by the player's playback device. Based on the rules linking audio bitrate to super-resolution functionality, the super-resolution multiplier, and the original bitrate, the target bitrate corresponding to the target audio is calculated. The target bitrate is added to the first adaptation processing result to generate a second adaptation processing result. Based on the second adaptation processing result and the configuration interceptors ordered after the second configuration interceptor, the target playback parameters are determined.
[0053] The aforementioned second configuration interceptor has the function of automatically enabling super-resolution to optimize audio listening experience. It is internally configured with rules linking audio bitrate and super-resolution. Super-resolution refers to the audio optimization function that uses the computing power of the player's hardware playback device to specifically increase the bitrate of low-bitrate audio.
[0054] For example, one of the linkage rules between audio bitrate and super-resolution function indicates the calculation rule for the actual playback bitrate of the target audio after the super-resolution function is enabled, specifically: actual playback bitrate = original bitrate of target audio × super-resolution ratio of hardware playback device.
[0055] Here, the second configuration interceptor is invoked. Based on the audio playback address in the interceptor context updated by the first adaptation processing result, the original bitrate corresponding to the target audio is determined. The super-resolution ratio acquisition interface of the super-resolution function encapsulated by the bridge layer is called through the second configuration interceptor, triggering the super-resolution ratio acquisition method of the native layer mapped by the super-resolution ratio acquisition interface. The super-resolution ratio acquisition method determines the super-resolution ratio supported by the player's playback device. Then, based on the calculation rules indicated in the audio bitrate and super-resolution function linkage rules, the super-resolution ratio and the original bitrate are multiplied to calculate the target bitrate corresponding to the target audio. The target bitrate is added to the first adaptation processing result to generate the second adaptation processing result. The interceptor context can also be updated according to the second adaptation processing result so that the configuration interceptors ranked after the second configuration interceptor can obtain the content of the second adaptation processing result.
[0056] Finally, based on the second adaptation processing result and the configuration interceptors that are sorted after the second configuration interceptor, the target playback parameters are determined.
[0057] In one approach, the configuration interceptors ordered after the second configuration interceptor include a third configuration interceptor. The third configuration interceptor is used to convert the second adaptation processing result into a parameter format adapted to the native layer. Specifically, the third configuration interceptor is invoked; based on the preset audio effect configuration rules in the third configuration interceptor, the audio effect parameters in the second adaptation processing result are converted into audio effect configuration parameters recognizable by the native layer; based on the preset audio quality configuration rules in the third configuration interceptor, the audio quality parameters in the second adaptation processing result are converted into audio quality configuration parameters adapted to the native layer; based on the preset super-resolution parameter setting rules in the third configuration interceptor, the target bitrate in the second adaptation processing result is converted into super-resolution configuration parameters adapted to the native layer; and based on the audio quality configuration parameters, audio effect configuration parameters, super-resolution configuration parameters, and the audio playback address of the target audio, the target playback parameters are determined.
[0058] In other words, the third configuration interceptor is the final parameter adaptation node in the JS layer configuration interceptor chain, and it is responsible for the "format translation and unified integration" function between JS layer parameters and native layer parameters.
[0059] It is understandable that, due to the fundamental differences in parameter definition specifications, data formats, and parsing logic between the JS layer and the native layer (C / C++), the second adaptation processing result obtained by the upstream interceptor cannot be directly recognized and executed by the native layer. Therefore, through the configuration rules preset by the third configuration interceptor, targeted format adaptation is performed on the three types of playback parameters: sound effects, sound quality, and super-resolution. Combined with standardized processing and audio playback addresses, a set of standardized target playback parameters that can be directly parsed, called, and executed by the native layer can be output. This achieves seamless transfer of parameter processing results from the JS layer to the native layer, laying the parameter foundation for the subsequent native layer to drive the hardware playback device to complete audio playback.
[0060] The aforementioned target audio identifier is used to indicate the target audio. The audio quality parameters of the aforementioned target audio may include: sampling rate and bit rate; the audio effect parameters of the aforementioned target audio may include: playback speed, audio stream type, and audio playback mode.
[0061] For example, one audio quality configuration rule could be: converting the sampling rate parameter stored as a string into an integer value that the native layer can directly parse; and converting the bit rate parameter described as a percentage into an absolute bit rate value adapted to the native layer.
[0062] One sound effect configuration rule could be: mapping the playback speed value to the native layer's speed execution value, directly adapting it to the native layer's speed adjustment interface; configuring the audio stream type to the specified music stream type; converting the audio playback mode to a mode identifier recognizable by the native layer, mapping free singing scenarios to a karaoke mode identifier, and mapping other audio playback modes to a normal playback mode identifier.
[0063] One possible super-resolution parameter setting rule is to convert the target bitrate of the target audio into super-resolution configuration parameters adapted to the native layer NPU super-resolution module, such as super-resolution multiplier.
[0064] The third configuration interceptor, based on its preset rules, can directly integrate the sound quality configuration parameters, sound effect configuration parameters, super-resolution configuration parameters, and the audio playback address of the target audio to generate target playback parameters that are compatible with the native layer.
[0065] In another implementation, the configuration interceptors following the third configuration interceptor also include a fourth interceptor. This fourth interceptor is configured with a mapping rule between the focus state of the audio focus and the playback state parameters. The fourth configuration interceptor is invoked to listen to the focus state of the audio focus pushed by the native layer. The focus state includes at least one of the following: the audio focus belongs to the player, the audio focus is preempted by the first device, and the audio focus is returned from the first device to the player. Based on the mapping rule, the playback state parameters of the player are determined. The playback state parameters are used to indicate that the player performs a preset playback action. The target playback parameters are obtained based on the sound quality configuration parameters, sound effect configuration parameters, super-resolution configuration parameters, the audio playback address of the target audio, and the playback state parameters.
[0066] The fourth interceptor mentioned above is an audio focus-aware interceptor; the audio focus can be understood as the audio usage permission allocated to ensure the normal audio output of the player. The first device mentioned above refers to an audio device, audio program, or audio service other than the player that can occupy the audio focus. The mapping rules mentioned above indicate the mapping relationship between the focus state of the audio focus and the playback state parameters.
[0067] For example, the mapping rule could be: when the audio focus belongs to the player, the playback status parameter is the first status parameter, which is used to instruct the player to perform a playback action; when the audio focus is taken over by the first device, the playback status parameter is the second status parameter, which is used to instruct the player to perform a stop playback action; when the audio focus returns from the first device to the player, the playback status parameter is the third status parameter, which is used to instruct the player to perform a resume playback action.
[0068] In this method, the fourth configuration interceptor is invoked to listen to the focus state of the audio focus pushed by the native layer. Here, the native layer of the player is configured with an audio focus state listener. This audio focus state listener is a component of the native layer used to listen to the focus state and focus state changes of the audio focus. It can perceive the allocation, preemption and return of audio focus in real time, and actively report the changed focus state to the fourth configuration interceptor when the audio focus state changes.
[0069] After determining the focus state of the audio focus, the fourth configuration interceptor determines the playback state parameters mapped to the current focus state according to the preset mapping rules. Then, it determines the playback state parameters, sound quality configuration parameters, sound effect configuration parameters, super-resolution configuration parameters, and the audio playback address of the target audio as the target playback parameters adapted to the native layer playback strategy. This enables the native layer to execute playback actions that match the current audio focus state based on the target playback parameters, ensuring that the audio playback behavior is consistent and coordinated with the audio focus allocation mechanism.
[0070] In one approach, the interceptor resides within a built-in interceptor chain in the JS layer. This chain includes a detection interceptor chain and a configuration interceptor chain. The detection interceptors in the detection interceptor chain are invoked before the configuration interceptors in the configuration interceptor chain. The detection interceptors in the detection interceptor chain are called to check the initial playback parameters according to predefined parameter detection rules, determining whether the initial playback parameters conform to these rules. If the initial playback parameters do not conform to the parameter detection rules, the parameter adaptation process for the initial playback parameters is terminated, and a parameter detection exception is reported through the JS layer's external interface. If the initial playback parameters conform to the predefined parameter detection rules in the detection interceptors, the configuration interceptors in the configuration interceptor chain are called again to perform parameter adaptation processing on the initial playback parameters, generating the target playback parameters.
[0071] The parameter adaptation processing performed by the aforementioned detection interceptor on the initial playback parameters specifically refers to the process of conducting compliance checks on the initial playback parameters based on the preset parameter detection rules in the detection interceptor.
[0072] For example, the parameter detection rules specifically include: 1) Copyright detection: verifying whether the target audio has playback permissions in the current region; 2) VIP permission detection: verifying whether the current user has VIP permissions to use the audio quality parameters specified in the initial playback parameters; 3) Device restriction detection: checking whether the number of current playback devices exceeds the preset limit for the number of simultaneous playback devices; 4) Listening time detection: checking whether the intended playback time of the target audio exceeds the listening time threshold limited by the platform.
[0073] The interceptors in this detection interceptor chain have multi-dimensional parameter compliance detection functions. Based on the above detection rules, they can perform full-link, comprehensive compliance verification of the initial playback parameters, ensuring the compliance and stability of audio playback services from the source.
[0074] In other words, the detection interceptors in the detection interceptor chain are called before the configuration interceptors in the configuration interceptor chain. Essentially, this is to perform a pre-compliance check on the initial playback parameters before executing any parameter configuration, format conversion, or other business logic. By detecting multiple dimensions such as copyright, permissions, device, and duration, non-compliant playback requests are filtered out in advance, avoiding invalid configuration interceptor processing and reducing the overhead of cross-layer interaction between the JS layer and the native layer. At the same time, once an anomaly is detected, the parameter adaptation processing of the initial playback parameters can be immediately terminated, and a parameter detection anomaly prompt can be fed back, improving the processing efficiency of playback requests and ensuring that the parameters processed by the subsequent configuration interceptor chain are all compliant and valid, thus avoiding playback failures, permission violations, and other problems caused by non-compliant parameters from the source.
[0075] If the initial playback parameters are found to fully comply with the preset parameter detection rules in the detection interceptor, then the various configuration interceptors in the configuration interceptor chain will continue to be called in the preset order to complete the parameter adaptation process in turn, and finally generate the target playback parameters that are adapted to the native layer and business requirements.
[0076] In one specific embodiment, the software architecture of an in-vehicle media player is as follows: Figure 2 As shown, from top to bottom, it is divided into a JS layer, a JSI bridging layer, and a native layer. The JS layer interacts with the native layer through the call interface encapsulated by the JSI layer; the native layer connects to the in-vehicle audio system in the in-vehicle player.
[0077] The external interface contained in the JS layer is responsible for receiving playback requests from the upper-layer business system and passing the initial playback parameters of the target audio in the audio playback request to the playback logic layer.
[0078] The JS layer also includes components such as MaskPlayerManager and NMMediaPlayer, which use a delegation mechanism to implement the logical scheduling of playback requests, the execution management of the interceptor chain, complete the compliance detection and configuration adaptation of the initial playback parameters, and finally generate parameters that can be passed to the native layer.
[0079] The JSI bridging layer serves as a communication bridge between the JS layer and the native layer. It includes encapsulated calling interfaces such as NCMPlayer and NativeAudioPlayerJSI. Through the mapping relationship between the calling interfaces and native layer methods, it shields the language and format differences between the JS layer and the native layer, enabling the passing of parameters across layers.
[0080] The native layer is the underlying hardware interaction layer, which includes native components such as NCMAudioPlayerC++. It connects directly to the in-vehicle audio system and is responsible for receiving the adapted parameters passed by the JSI bridging layer, driving the hardware playback device to complete the final execution actions such as audio decoding, super-resolution optimization, and playback control.
[0081] This layered design ensures flexible iteration of the business logic in the JS layer, achieves efficient control of the vehicle hardware through the native layer, and solves the compatibility problem of cross-layer communication by leveraging the standardized interface of the JSI bridging layer.
[0082] Correspondingly, in this embodiment, the playback execution process of the in-vehicle player is as follows: Figure 3 As shown, 1) The user initiates a playback request; When a user initiates a playback request, the system receives the audio playback request for the target audio file through the external interface of the JS layer.
[0083] 2) Preparations before playback; Specifically, it involves configuring player runtime parameters, registering status listeners, and configuring playback resources and behaviors.
[0084] The player's runtime parameter configuration (initPlayer) is a core foundational step in the pre-playback preparation stage. Targeting the hardware characteristics and sound quality requirements of in-vehicle audio scenarios, the initPlayer() method is called to complete the standardized initialization of the player's core runtime parameters. This covers multiple dimensions of configuration, including audio format, playback mode, spatial audio, caching strategy, and preloading settings, laying the underlying parameter foundation for the player's subsequent stable operation and high-quality audio output. State monitoring registration is a crucial step in ensuring controllable state throughout the entire playback lifecycle during the pre-playback preparation phase. By calling iotPlayer.registerPlayStateObserver(observer) to register a PlayStateObserver playback state observer, it is possible to monitor the state changes of the player in real time from initialization to playback completion. This not only provides support for subsequent exception feedback after playability checks fail and state callbacks after successful playback, but also adapts to the interaction needs of in-vehicle scenarios, triggering state prompts on the in-vehicle central control screen, ensuring that the state is perceptible and responsive during playback.
[0085] Playback resource and behavior configuration focuses on the precise configuration of the target audio's basic information and playback behavior: on the one hand, it parses the core information in the user request and configures the specific media content of the playback resource, including the unique resource ID of the target audio, the mediaType specific to in-vehicle music, and basic attributes such as the pre-parsed initial audio bitrate; on the other hand, it defines playback behavior rules, such as setting autoPlay to true to start playback immediately after the request, configuring the in-vehicle audio to have the highest priority to avoid audio channel preemption, and finally generating initial playback parameters with basic information, providing a clear processing object for subsequent playability checks and parameter configuration.
[0086] 3) The interceptor chain detects the initial playback parameters; The detection interceptor chain performs multi-dimensional detection on the initial playback parameters according to preset parameter detection rules.
[0087] 4) Determine whether the detection passes. If it passes, proceed to the subsequent player configuration chain. Otherwise, trigger playback interruption and send parameter detection error information to the user through the external interface.
[0088] 5) Configure the interceptor chain to adapt the initial playback parameters; The interceptor chain also includes an audio focus-aware interceptor, which has the ability to perceive the audio focus state in real time and dynamically adjust its behavior. Specifically, during audio playback, if other applications seize the audio focus (such as answering a Bluetooth call in a car or launching other music playback software), the interceptor will monitor the focus state of the audio focus pushed by the native layer. When it detects that the audio focus is occupied by another application, it will immediately trigger the player's playback termination logic and stop the current audio playback according to the mapping rules between the audio focus state and playback state parameters preset by the audio focus-aware interceptor. When the audio focus is returned to the player, it can trigger a resume playback action based on the above mapping rules, ensuring the compatibility between the in-vehicle audio playback behavior and the system's audio focus mechanism.
[0089] 6) The in-vehicle audio system performs playback operation. The target playback parameters are passed to the native layer through the JSI bridging layer. The native layer then drives the in-vehicle audio system to perform hardware-level actions such as audio decoding, super-resolution optimization, and playback control.
[0090] 7) Audio playback successful The target audio is output normally, and the playback process is complete.
[0091] In this approach, the player's JS layer interacts with the native layer through a call interface encapsulated by a bridge layer. Interceptors with preset business functions are pre-configured in the JS layer. When the JS layer's external interface receives a playback request for the target audio, it first obtains the initial playback parameters of the target audio in the request, then calls the interceptors configured in the JS layer to adapt the initial playback parameters, obtaining the target playback parameters adapted to the preset business functions. Finally, the JS layer directly passes the target playback parameters to the native layer through the call interface encapsulated by the bridge layer, enabling the native layer to control the player to complete the playback of the target audio based on these parameters. This approach relies on the bridge layer to achieve direct communication between the JS layer and the native layer, eliminating the need for serialization and deserialization operations, significantly reducing cross-layer communication overhead. Furthermore, when business requirements change, interceptors matching the business requirements can be directly inserted into the JS layer to implement new business functions. The playback parameters processed by the interceptors can directly reach the native layer corresponding to the player's native code, thereby achieving precise control over audio playback and significantly improving the scalability of the player's business functions.
[0092] For the corresponding method embodiments described above, see [link to relevant documentation]. Figure 4 The diagram shows a playback control device for a player, the device comprising: The first receiving module 402 is used to receive an audio playback request for the target audio through the external interface of the JS layer, and determine the initial playback parameters of the target audio in the audio playback request. The first calling module 404 is used to call the interceptor configured in the JS layer to perform parameter adaptation processing on the initial playback parameters and obtain the target playback parameters adapted to the preset business functions. The first control module 406 is used to call the call interface encapsulated by the bridge layer through the JS layer to pass the target playback parameters to the native layer, so that the native layer can control the player to play the target audio through the target playback parameters.
[0093] In this approach, the player's JS layer interacts with the native layer through a call interface encapsulated by a bridge layer. Interceptors with preset business functions are pre-configured in the JS layer. When the JS layer's external interface receives a playback request for the target audio, it first obtains the initial playback parameters of the target audio in the request, then calls the interceptors configured in the JS layer to adapt the initial playback parameters, obtaining the target playback parameters adapted to the preset business functions. Finally, the JS layer directly passes the target playback parameters to the native layer through the call interface encapsulated by the bridge layer, enabling the native layer to control the player to complete the playback of the target audio based on these parameters. This approach relies on the bridge layer to achieve direct communication between the JS layer and the native layer, eliminating the need for serialization and deserialization operations, significantly reducing cross-layer communication overhead. Furthermore, when business requirements change, interceptors matching the business requirements can be directly inserted into the JS layer to implement new business functions. The playback parameters processed by the interceptors can directly reach the native layer corresponding to the player's native code, thereby achieving precise control over audio playback and significantly improving the scalability of the player's business functions.
[0094] The aforementioned bridging layer has a pre-defined mapping relationship between the calling interface and the native methods of the native layer; the native layer is connected to the playback device of the player; the aforementioned device also includes a second control module, which is used to determine the memory entry address of the native method mapped by the calling interface through the bridging layer; based on the memory entry address, the target playback parameters are passed to the native method, and the execution of the native method is triggered to drive the native layer to complete the loading of the target audio data based on the target playback parameters, and control the playback device of the player to play the target audio.
[0095] The aforementioned interceptors are located in the interceptor chain built into the JS layer. The interceptors in the interceptor chain are ordered sequentially based on the business priority of the preset business functions. Each interceptor has a pre-set business rule that matches its business function. The first calling module is used to call the interceptors sequentially according to their order in the interceptor chain to perform parameter adaptation processing on the initial playback parameters based on the business rules. The adaptation processing result obtained by the interceptor with the higher priority is used as the input of the interceptor with the lower priority. After being adapted by each interceptor in the interceptor chain, the target playback parameters adapted to the preset business functions are generated.
[0096] The aforementioned interceptor chain also includes a configuration interceptor chain; the configuration interceptor chain contains multiple configuration interceptors; the initial playback parameters include: target audio identifier, target audio quality parameters, and target audio sound effect parameters; the aforementioned first calling module is used to call the first configuration interceptor ranked first in the configuration interceptor chain; wherein, the first configuration interceptor has a pre-set audio data acquisition rule that indicates that cached data is acquired first; based on the audio caching rule, the target audio identifier is obtained from the initial playback parameters, and it is determined whether there is audio cache data matching the target audio identifier in the player's playback device; if there is audio cache data, the cache address of the audio cache data is used as the audio playback address of the target audio and added to the initial playback parameters; if there is no audio cache data, the address configuration interceptor is called, and based on the address configuration interceptor, the network playback address of the target audio is obtained from the resource server through the external interface, the network playback address is used as the audio playback address of the target audio and added to the initial playback parameters, resulting in a first adaptation processing result containing the audio playback address of the target audio; based on the first adaptation processing result and the configuration interceptors ranked after the first configuration interceptor, the target playback parameters are determined.
[0097] The aforementioned first calling module is used to call the query calling interface encapsulated by the bridge layer through the first configuration interceptor, trigger the query method of the native layer mapped by the query calling interface, and query whether there is audio cache data matching the target audio identifier in the playback device of the player through the query method.
[0098] The configuration interceptors listed above, following the first configuration interceptor, include a second configuration interceptor. The second configuration interceptor is configured with rules linking audio bitrate to super-resolution functionality. The first calling module is used to call the second configuration interceptor to determine the original bitrate corresponding to the target audio based on the audio playback address in the first adaptation processing result. The second configuration interceptor calls the super-resolution multiplier acquisition interface of the super-resolution function encapsulated in the bridge layer, triggering the super-resolution multiplier acquisition method of the native layer mapped by the super-resolution multiplier acquisition interface. The super-resolution multiplier acquisition method determines the super-resolution multiplier supported by the player's playback device. Based on the rules linking audio bitrate to super-resolution functionality, the super-resolution multiplier, and the original bitrate, the target bitrate corresponding to the target audio is calculated. The target bitrate is added to the first adaptation processing result to generate a second adaptation processing result. Based on the second adaptation processing result and the configuration interceptors listed after the second configuration interceptor, the target playback parameters are determined.
[0099] The configuration interceptors listed above that follow the second configuration interceptor include the third configuration interceptor; the third configuration interceptor is used to convert the second adaptation processing result into the parameter format adapted by the native layer. The first calling module is used to call the third configuration interceptor; based on the preset audio effect configuration rules in the third configuration interceptor, it converts the audio effect parameters in the second adaptation processing result to audio effect configuration parameters that can be recognized by the native layer; based on the preset audio quality configuration rules in the third configuration interceptor, it converts the audio quality parameters in the second adaptation processing result to audio quality configuration parameters adapted to the native layer; based on the preset super-resolution parameter setting rules in the third configuration interceptor, it converts the target bitrate in the second adaptation processing result to super-resolution configuration parameters adapted to the native layer; and based on the audio quality configuration parameters, audio effect configuration parameters, super-resolution configuration parameters, and the audio playback address of the target audio, it determines the target playback parameters.
[0100] The aforementioned first calling module is used to call the fourth configuration interceptor to monitor the focus state of the audio focus pushed by the native layer; wherein, the focus state includes at least one of the following: the audio focus belongs to the player, the audio focus is preempted by the first device, and the audio focus is returned from the first device to the player; based on the mapping rules, the playback state parameters of the player are determined; wherein, the playback state parameters are used to indicate: the player executes a preset playback action; based on the sound quality configuration parameters, sound effect configuration parameters, super-resolution configuration parameters, the audio playback address of the target audio, and the playback state parameters, the target playback parameters are obtained.
[0101] The aforementioned interceptors are located in the interceptor chain built into the JS layer. The interceptor chain includes a detection interceptor chain and a configuration interceptor chain. The detection interceptors in the detection interceptor chain are called before the configuration interceptors in the configuration interceptor chain. The first calling module is used to call the detection interceptors in the detection interceptor chain to detect the initial playback parameters according to the preset parameter detection rules in the detection interceptors, and determine whether the initial playback parameters meet the parameter detection rules. In response to the initial playback parameters not meeting the parameter detection rules, the parameter adaptation processing of the initial playback parameters is terminated, and a parameter detection exception prompt is fed back through the external interface of the JS layer. If the initial playback parameters meet the preset parameter detection rules in the detection interceptors, the configuration interceptors in the configuration interceptor chain are called again to generate the target playback parameters.
[0102] This embodiment also provides an electronic device, including a processor and a memory. The memory stores machine-executable instructions that can be executed by the processor, and the processor executes the machine-executable instructions to implement the playback control method of the aforementioned player.
[0103] See Figure 5 As shown, the electronic device includes a processor 100 and a memory 101. The memory 101 stores machine-executable instructions that can be executed by the processor 100. The processor 100 executes the machine-executable instructions to implement the synchronization method of physical information in the game.
[0104] Furthermore, Figure 5The electronic device shown also includes a bus 102 and a communication interface 103, with the processor 100, the communication interface 103 and the memory 101 connected via the bus 102.
[0105] The memory 101 may include high-speed random access memory (RAM) and may also include non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 103 (which can be wired or wireless), such as the Internet, wide area network, local area network, metropolitan area network, etc. The bus 102 may be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 5 The diagram uses only a single double-headed arrow, but this does not imply a single bus or a single type of bus. Processor 100 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of processor 100 or by instructions in software form. Processor 100 can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this invention can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a readily available storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 101, and the processor 100 reads the information from memory 101 and, in conjunction with its hardware, completes the steps of the method described in the foregoing embodiments.
[0106] The processor in the aforementioned electronic device, by executing machine-executable instructions, can implement the following operations of the playback control method of the aforementioned player: receiving an audio playback request for a target audio through the external interface of the JS layer, and determining the initial playback parameters of the target audio in the audio playback request; calling the interceptor configured in the JS layer to perform parameter adaptation processing on the initial playback parameters to obtain the target playback parameters adapted to the preset business function; and passing the target playback parameters to the native layer through the call interface encapsulated by the bridge layer in the JS layer, so that the native layer can control the player to play the target audio through the target playback parameters.
[0107] In this approach, the player's JS layer interacts with the native layer through a call interface encapsulated by a bridge layer. Interceptors with preset business functions are pre-configured in the JS layer. When the JS layer's external interface receives a playback request for the target audio, it first obtains the initial playback parameters of the target audio in the request, then calls the interceptors configured in the JS layer to adapt the initial playback parameters, obtaining the target playback parameters adapted to the preset business functions. Finally, the JS layer directly passes the target playback parameters to the native layer through the call interface encapsulated by the bridge layer, enabling the native layer to control the player to complete the playback of the target audio based on these parameters. This approach relies on the bridge layer to achieve direct communication between the JS layer and the native layer, eliminating the need for serialization and deserialization operations, significantly reducing cross-layer communication overhead. Furthermore, when business requirements change, interceptors matching the business requirements can be directly inserted into the JS layer to implement new business functions. The playback parameters processed by the interceptors can directly reach the native layer corresponding to the player's native code, thereby achieving precise control over audio playback and significantly improving the scalability of the player's business functions.
[0108] The aforementioned bridging layer has a pre-defined mapping relationship between the calling interface and the native methods of the native layer; the native layer is connected to the playback device of the player; the processor in the aforementioned electronic device can perform the following operations of the playback control method of the aforementioned player by executing machine-executable instructions: determining the memory entry address of the native method mapped by the calling interface through the bridging layer; based on the memory entry address, passing the target playback parameters to the native method and triggering the execution of the native method to drive the native layer to complete the loading of the target audio data based on the target playback parameters, and controlling the playback device of the player to play the target audio.
[0109] The aforementioned interceptors are located in a built-in interceptor chain within the JS layer. The interceptors in the interceptor chain are ordered sequentially based on the business priority of preset business functions. Each interceptor has pre-set business rules that match its business function. The processor in the aforementioned electronic device can implement the following operations of the playback control method of the aforementioned player by executing machine-executable instructions: according to the order of the interceptors in the interceptor chain, the interceptors are called sequentially to perform parameter adaptation processing on the initial playback parameters based on the business rules. The adaptation processing result obtained by the interceptor with the higher priority is used as the input of the interceptor with the lower priority. After being adapted one by one by the interceptors in the interceptor chain, the target playback parameters adapted to the preset business function are generated.
[0110] The aforementioned interceptor chain also includes a configuration interceptor chain; the configuration interceptor chain contains multiple configuration interceptors; the initial playback parameters include: target audio identifier, target audio quality parameters, and target audio sound effect parameters; the processor in the aforementioned electronic device, by executing machine-executable instructions, can implement the following operations of the playback control method of the aforementioned player: calling the first configuration interceptor ranked first in the configuration interceptor chain; wherein, the first configuration interceptor has a preset audio data acquisition rule indicating priority acquisition of cached data; based on the audio caching rule, obtaining the target audio identifier from the initial playback parameters, and determining whether the player's playback device contains an audio identifier matching the target audio identifier. The system identifies the matching audio cache data. If audio cache data exists, its cache address is used as the audio playback address of the target audio and added to the initial playback parameters. If no audio cache data exists, the system calls the address configuration interceptor. Based on the address configuration interceptor, the system obtains the network playback address of the target audio from the resource server through the external interface. The network playback address is used as the audio playback address of the target audio and added to the initial playback parameters, resulting in a first adaptation processing result containing the audio playback address of the target audio. Based on the first adaptation processing result and the configuration interceptors ranked after the first configuration interceptor, the target playback parameters are determined.
[0111] The processor in the aforementioned electronic device can execute machine-executable instructions to implement the following operations of the playback control method of the aforementioned player: by calling the query call interface encapsulated by the bridge layer through the first configuration interceptor, the query method of the native layer mapped by the query call interface is triggered, and the query method is used to query whether there is audio cache data in the playback device of the player that matches the target audio identifier.
[0112] The configuration interceptors listed after the first configuration interceptor include a second configuration interceptor. The second configuration interceptor is configured with audio bitrate and super-resolution function linkage rules. The processor in the aforementioned electronic device, by executing machine-executable instructions, can implement the following operations of the playback control method of the aforementioned player: calling the second configuration interceptor to determine the original bitrate corresponding to the target audio based on the audio playback address in the first adaptation processing result; calling the super-resolution multiplier acquisition interface of the super-resolution function encapsulated in the bridge layer through the second configuration interceptor, triggering the super-resolution multiplier acquisition method of the native layer mapped by the super-resolution multiplier acquisition interface, and determining the super-resolution multiplier supported by the player's playback device through the super-resolution multiplier acquisition method; calculating the target bitrate corresponding to the target audio based on the audio bitrate and super-resolution function linkage rules, the super-resolution multiplier, and the original bitrate; adding the target bitrate to the first adaptation processing result to generate a second adaptation processing result; and determining the target playback parameters based on the second adaptation processing result and the configuration interceptors listed after the second configuration interceptor.
[0113] The configuration interceptors listed above that follow the second configuration interceptor include the third configuration interceptor; the third configuration interceptor is used to convert the second adaptation processing result into the parameter format adapted by the native layer. The processor in the aforementioned electronic device, by executing machine-executable instructions, can implement the following operations of the playback control method of the aforementioned player: invoking a third configuration interceptor; converting the sound effect parameters in the second adaptation processing result to native-layer recognizable sound effect configuration parameters based on the preset sound effect configuration rules in the third configuration interceptor; converting the sound quality parameters in the second adaptation processing result to native-layer adapted sound quality configuration parameters based on the preset sound quality configuration rules in the third configuration interceptor; converting the target bitrate in the second adaptation processing result to native-layer adapted super-resolution configuration parameters based on the preset super-resolution parameter setting rules in the third configuration interceptor; and determining the target playback parameters based on the sound quality configuration parameters, sound effect configuration parameters, super-resolution configuration parameters, and the audio playback address of the target audio.
[0114] The processor in the aforementioned electronic device, by executing machine-executable instructions, can implement the following operations of the playback control method of the aforementioned player: invoking the fourth configuration interceptor to monitor the focus state of the audio focus pushed by the native layer; wherein the focus state includes at least one of the following: the audio focus belongs to the player, the audio focus is preempted by the first device, and the audio focus is returned from the first device to the player; determining the playback state parameters of the player based on mapping rules; wherein the playback state parameters are used to indicate that the player executes a preset playback action; and obtaining the target playback parameters based on the sound quality configuration parameters, sound effect configuration parameters, super-resolution configuration parameters, the audio playback address of the target audio, and the playback state parameters.
[0115] The aforementioned interceptors are located in a built-in interceptor chain within the JS layer. This interceptor chain includes a detection interceptor chain and a configuration interceptor chain. The detection interceptors in the detection interceptor chain are called before the configuration interceptors in the configuration interceptor chain. The processor in the aforementioned electronic device, by executing machine-executable instructions, can implement the following operations of the playback control method of the aforementioned player: calling the detection interceptors in the detection interceptor chain to detect the initial playback parameters according to the preset parameter detection rules in the detection interceptors, and determining whether the initial playback parameters conform to the parameter detection rules; in response to the initial playback parameters not conforming to the parameter detection rules, terminating the parameter adaptation processing for the initial playback parameters, and providing a parameter detection exception prompt through the external interface of the JS layer; if the initial playback parameters conform to the preset parameter detection rules in the detection interceptors, continuing to call the configuration interceptors in the configuration interceptor chain to generate the target playback parameters.
[0116] This embodiment also provides a storage medium storing machine-executable instructions. When the machine-executable instructions are invoked and executed by a processor, the machine-executable instructions cause the processor to implement the aforementioned network performance monitoring method.
[0117] The machine-executable instructions stored in the aforementioned storage medium can be executed to achieve the following operations in the playback control method of the aforementioned player: receiving an audio playback request for the target audio through the external interface of the JS layer, and determining the initial playback parameters of the target audio in the audio playback request; calling the interceptor configured in the JS layer to perform parameter adaptation processing on the initial playback parameters to obtain the target playback parameters adapted to the preset business function; and passing the target playback parameters to the native layer through the call interface encapsulated by the bridge layer, so that the native layer can control the player to play the target audio through the target playback parameters.
[0118] In this approach, the player's JS layer interacts with the native layer through a call interface encapsulated by a bridge layer. Interceptors with preset business functions are pre-configured in the JS layer. When the JS layer's external interface receives a playback request for the target audio, it first obtains the initial playback parameters of the target audio in the request, then calls the interceptors configured in the JS layer to adapt the initial playback parameters, obtaining the target playback parameters adapted to the preset business functions. Finally, the JS layer directly passes the target playback parameters to the native layer through the call interface encapsulated by the bridge layer, enabling the native layer to control the player to complete the playback of the target audio based on these parameters. This approach relies on the bridge layer to achieve direct communication between the JS layer and the native layer, eliminating the need for serialization and deserialization operations, significantly reducing cross-layer communication overhead. Furthermore, when business requirements change, interceptors matching the business requirements can be directly inserted into the JS layer to implement new business functions. The playback parameters processed by the interceptors can directly reach the native layer corresponding to the player's native code, thereby achieving precise control over audio playback and significantly improving the scalability of the player's business functions.
[0119] The aforementioned bridging layer has a pre-defined mapping relationship between the calling interface and the native methods of the native layer; the native layer is connected to the playback device of the player; the aforementioned storage medium stores machine-executable instructions, and by executing these machine-executable instructions, the following operations in the playback control method of the aforementioned player can be implemented: the bridging layer determines the memory entry address of the native method mapped by the calling interface; based on the memory entry address, the target playback parameters are passed to the native method, and the execution of the native method is triggered, so as to drive the native layer to complete the loading of the target audio data based on the target playback parameters, and control the playback device of the player to play the target audio.
[0120] The aforementioned interceptors are located in the interceptor chain built into the JS layer. The interceptors in the interceptor chain are ordered sequentially based on the business priority of the preset business functions. Each interceptor has pre-set business rules that match its business functions. The machine-executable instructions stored in the aforementioned storage medium can be used to implement the following operations in the playback control method of the aforementioned player by executing these machine-executable instructions: according to the order of the interceptors in the interceptor chain, the interceptors are called sequentially to perform parameter adaptation processing on the initial playback parameters based on the business rules. The adaptation processing results obtained by the interceptors ranked earlier are used as the input of the interceptors ranked later. After being adapted and processed by the interceptors in the interceptor chain one by one, the target playback parameters adapted to the preset business functions are generated.
[0121] The aforementioned interceptor chain also includes a configuration interceptor chain; the configuration interceptor chain contains multiple configuration interceptors; the initial playback parameters include: target audio identifier, target audio quality parameters, and target audio effect parameters; the machine-executable instructions stored in the aforementioned storage medium, by executing these machine-executable instructions, can realize the following operations in the playback control method of the aforementioned player: calling the first configuration interceptor ranked first in the configuration interceptor chain; wherein, the first configuration interceptor has a preset audio data acquisition rule indicating that cached data is acquired preferentially; based on the audio caching rule, the target audio identifier is obtained from the initial playback parameters, and it is determined whether the player's playback device has the target audio identifier. Audio cache data matching the target audio identifier exists. If audio cache data exists, the cache address of the audio cache data is used as the audio playback address of the target audio and added to the initial playback parameters. If audio cache data does not exist, the address configuration interceptor is called. Based on the address configuration interceptor, the network playback address of the target audio is obtained from the resource server through the external interface. The network playback address is used as the audio playback address of the target audio and added to the initial playback parameters, resulting in a first adaptation processing result containing the audio playback address of the target audio. Based on the first adaptation processing result and the configuration interceptors sorted after the first configuration interceptor, the target playback parameters are determined.
[0122] The machine-executable instructions stored in the aforementioned storage medium can be executed to perform the following operations in the playback control method of the aforementioned player: by calling the query call interface encapsulated by the bridge layer through the first configuration interceptor, the query method of the native layer mapped by the query call interface is triggered, and the query method is used to query whether there is audio cache data matching the target audio identifier in the playback device of the player.
[0123] The configuration interceptors listed after the first configuration interceptor include a second configuration interceptor. The second configuration interceptor is configured with rules linking audio bitrate to super-resolution functionality. The machine-executable instructions stored in the storage medium, when executed, enable the following operations in the playback control method of the aforementioned player: The second configuration interceptor is invoked to determine the original bitrate corresponding to the target audio based on the audio playback address in the first adaptation processing result; the super-resolution multiplier acquisition interface of the super-resolution function encapsulated in the bridge layer is invoked through the second configuration interceptor, triggering the super-resolution multiplier acquisition method of the native layer mapped by the super-resolution multiplier acquisition interface, and the super-resolution multiplier acquisition method is used to determine the super-resolution multiplier supported by the player's playback device; the target bitrate corresponding to the target audio is calculated based on the rules linking audio bitrate to super-resolution functionality, the super-resolution multiplier, and the original bitrate; the target bitrate is added to the first adaptation processing result to generate a second adaptation processing result; and the target playback parameters are determined based on the second adaptation processing result and the configuration interceptors listed after the second configuration interceptor.
[0124] The configuration interceptors listed above that follow the second configuration interceptor include the third configuration interceptor; the third configuration interceptor is used to convert the second adaptation processing result into the parameter format adapted by the native layer. The machine-executable instructions stored in the aforementioned storage medium can be executed to perform the following operations in the playback control method of the aforementioned player: invoking the third configuration interceptor; converting the audio effect parameters in the second adaptation processing result to native-layer recognizable audio effect configuration parameters based on the preset audio effect configuration rules in the third configuration interceptor; converting the audio quality parameters in the second adaptation processing result to native-layer adapted audio quality configuration parameters based on the preset audio quality configuration rules in the third configuration interceptor; converting the target bitrate in the second adaptation processing result to native-layer adapted super-resolution configuration parameters based on the preset super-resolution parameter setting rules in the third configuration interceptor; and determining the target playback parameters based on the audio quality configuration parameters, audio effect configuration parameters, super-resolution configuration parameters, and the audio playback address of the target audio.
[0125] The machine-executable instructions stored in the aforementioned storage medium can be executed to achieve the following operations in the playback control method of the aforementioned player: Invoking the fourth configuration interceptor to monitor the focus state of the audio focus pushed by the native layer; wherein the focus state includes at least one of the following: the audio focus belongs to the player, the audio focus is preempted by the first device, and the audio focus is returned from the first device to the player; determining the playback state parameters of the player based on mapping rules; wherein the playback state parameters are used to indicate that the player performs a preset playback action; and obtaining the target playback parameters based on the sound quality configuration parameters, sound effect configuration parameters, super-resolution configuration parameters, the audio playback address of the target audio, and the playback state parameters.
[0126] The aforementioned interceptors are located in the interceptor chain built into the JS layer. This interceptor chain includes a detection interceptor chain and a configuration interceptor chain. The detection interceptors in the detection interceptor chain are called before the configuration interceptors in the configuration interceptor chain. The machine-executable instructions stored in the aforementioned storage medium, when executed, enable the following operations in the playback control method of the aforementioned player: The detection interceptors in the detection interceptor chain are called to detect the initial playback parameters according to the preset parameter detection rules in the detection interceptors, determining whether the initial playback parameters conform to the parameter detection rules; if the initial playback parameters do not conform to the parameter detection rules, the parameter adaptation processing for the initial playback parameters is terminated, and a parameter detection exception message is fed back through the external interface of the JS layer; if the initial playback parameters conform to the preset parameter detection rules in the detection interceptors, the configuration interceptors in the configuration interceptor chain are called again to generate the target playback parameters.
[0127] The computer program products of the playback control method, device, electronic device and storage medium of the player provided in the embodiments of the present invention include a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the preceding method embodiments. For specific implementation, please refer to the method embodiments, which will not be repeated here.
[0128] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the system and apparatus described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0129] Furthermore, in the description of the embodiments of the present invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in the present invention based on the specific circumstances.
[0130] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0131] In the description of this invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing the invention and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0132] Finally, it should be noted that the above embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A playback control method for a media player, characterized in that, The player comprises a JS layer, a bridging layer, and a native layer; the JS layer interacts with the native layer through a call interface encapsulated by the bridging layer; The JS layer includes: pre-configured interceptors for preset business functions; the method includes: The JS layer receives audio playback requests for target audio through its external interface and determines the initial playback parameters of the target audio in the audio playback request. The interceptor configured in the JS layer is invoked to perform parameter adaptation processing on the initial playback parameters, thereby obtaining the target playback parameters that are adapted to the preset business function; The JS layer calls the API encapsulated in the bridging layer to pass the target playback parameters to the native layer, so that the native layer can control the player to play the target audio through the target playback parameters.
2. The method according to claim 1, characterized in that, The bridging layer has a pre-defined mapping relationship between the calling interface and the native methods of the native layer; The step of passing the target playback parameters to the native layer by calling the call interface encapsulated by the bridge layer through the JS layer includes: The JS layer calls the calling interface encapsulated by the bridge layer, and the bridge layer determines the memory entry address of the native method mapped by the calling interface. Based on the memory entry address, the target playback parameters are passed to the native method, and the native method is triggered to control the playback device of the player to play the target audio based on the target playback parameters.
3. The method according to claim 1, characterized in that, The interceptor is located in the interceptor chain built into the JS layer. The interceptors in the interceptor chain are ordered sequentially based on the business priority of the preset business function. The interceptor has preset business rules that match the business function of the interceptor. The step of calling the interceptor configured in the JS layer to perform parameter adaptation processing on the initial playback parameters to obtain target playback parameters adapted to the preset business function includes: According to the order of the interceptors in the interceptor chain, the interceptors are called sequentially to perform parameter adaptation processing on the initial playback parameters based on the business rules. The adaptation processing result obtained by the interceptor with the higher priority is used as the input of the interceptor with the lower priority. After the interceptors in the interceptor chain perform the adaptation processing one by one, the target playback parameters adapted to the preset business function are generated.
4. The method according to claim 3, characterized in that, The interceptor chain includes a configuration interceptor chain; the configuration interceptor chain contains multiple configuration interceptors; the initial playback parameters include: target audio identifier, the audio quality parameters of the target audio, and the audio effect parameters of the target audio; The step of sequentially calling the interceptors in the interceptor chain to perform parameter adaptation processing on the initial playback parameters based on the business rules, with the adaptation processing result obtained by the interceptor at the front of the chain serving as the input for the interceptor at the back, and generating target playback parameters adapted to the preset business function after each interceptor in the interceptor chain performs adaptation processing, includes: Invoke the first configuration interceptor that is at the top of the configuration interceptor chain; wherein, the first configuration interceptor has a preset audio data acquisition rule that indicates that cached data should be acquired first; Based on the audio caching rules, the target audio identifier is obtained from the initial playback parameters, and it is determined whether there is audio cache data matching the target audio identifier in the playback device of the player; If the audio cache data exists, the cache address of the audio cache data is used as the audio playback address of the target audio and added to the initial playback parameters; If the audio cache data does not exist, the address configuration interceptor is invoked. Based on the address configuration interceptor, the network playback address of the target audio is obtained from the resource server through the external interface. The network playback address is used as the audio playback address of the target audio and added to the initial playback parameters to obtain the first adaptation processing result containing the audio playback address of the target audio. Based on the first adaptation processing result and the configuration interceptors that are sorted after the first configuration interceptor, the target playback parameters are determined.
5. The method according to claim 4, characterized in that, The step of determining whether audio cache data matching the target audio identifier exists in the playback device of the player includes: The query call interface encapsulated by the bridge layer is invoked by the first configuration interceptor, which triggers the query method of the native layer mapped by the query call interface. The query method is used to query whether there is audio cache data in the playback device of the player that matches the target audio identifier.
6. The method according to claim 4, characterized in that, The configuration interceptors that are sorted after the first configuration interceptor include the second configuration interceptor; the second configuration interceptor is configured with audio bitrate and super-resolution function linkage rules; The step of determining the target playback parameters based on the first adaptation processing result and the configuration interceptors ranked after the first configuration interceptor includes: The second configuration interceptor is invoked to determine the original bitrate corresponding to the target audio based on the audio playback address in the first adaptation processing result; The second configuration interceptor calls the super-resolution ratio acquisition interface of the super-resolution function encapsulated in the bridge layer, triggering the super-resolution ratio acquisition method of the native layer mapped by the super-resolution ratio acquisition interface, and determines the super-resolution ratio supported by the playback device of the player through the super-resolution ratio acquisition method. Based on the audio bitrate and super-resolution function linkage rules, the super-resolution multiplier and the original bitrate, the target bitrate corresponding to the target audio is calculated; the target bitrate is added to the first adaptation processing result to generate the second adaptation processing result; Based on the second adaptation processing result and the configuration interceptors that are sorted after the second configuration interceptor, the target playback parameters are determined.
7. The method according to claim 6, characterized in that, The configuration interceptors that are ordered after the second configuration interceptor include a third configuration interceptor; the third configuration interceptor is used to convert the second adaptation processing result to the parameter format adapted by the native layer; The step of determining the target playback parameters based on the second adaptation processing result and the configuration interceptors ranked after the second configuration interceptor includes: The third configuration interceptor is invoked, and based on the preset sound effect configuration rules in the third configuration interceptor, the sound effect parameters in the second adaptation processing result are converted into sound effect configuration parameters that the native layer can recognize. Based on the preset audio quality configuration rules in the third configuration interceptor, the audio quality parameters in the second adaptation processing result are converted to the audio quality configuration parameters adapted by the native layer. Based on the preset super-resolution parameter setting rules in the third configuration interceptor, the target bitrate in the second adaptation processing result is converted to the super-resolution configuration parameters adapted by the native layer. Based on the sound quality configuration parameters, sound effect configuration parameters, super-resolution configuration parameters, and the audio playback address of the target audio, the target playback parameters are determined.
8. The method according to claim 7, characterized in that, The configuration interceptors that are ordered after the third configuration interceptor also include a fourth interceptor, which is configured with a mapping rule between the focus state of the audio focus and the playback state parameters. The step of determining the target playback parameters based on the sound quality configuration parameters, sound effect configuration parameters, super-resolution configuration parameters, and the audio playback address of the target audio further includes: The fourth configuration interceptor is invoked to monitor the focus state of the audio focus pushed by the native layer; wherein the focus state includes at least one of the following: the audio focus belongs to the player, the audio focus is preempted by the first device, and the audio focus is returned from the first device to the player; Based on the mapping rules, the playback status parameters of the player are determined; wherein, the playback status parameters are used to indicate that the player performs a preset playback action; The target playback parameters are obtained based on the sound quality configuration parameters, sound effect configuration parameters, super-resolution configuration parameters, the audio playback address of the target audio, and the playback status parameters.
9. The method according to claim 1, characterized in that, The interceptor is located in the interceptor chain built into the JS layer. The interceptor chain includes a detection interceptor chain and a configuration interceptor chain. The detection interceptors in the detection interceptor chain are called before the configuration interceptors in the configuration interceptor chain. The step of calling the interceptor in the JS layer to perform parameter adaptation processing on the initial playback parameters to obtain the target playback parameters adapted to the preset business function includes: The detection interceptor in the detection interceptor chain is invoked, and the initial playback parameters are detected according to the preset parameter detection rules in the detection interceptor to determine whether the initial playback parameters conform to the parameter detection rules. In response to the initial playback parameters not conforming to the parameter detection rules, the parameter adaptation process for the initial playback parameters is terminated, and a parameter detection error message is fed back through the external interface of the JS layer. If the initial playback parameters meet the preset parameter detection rules in the detection interceptor, the configuration interceptor in the configuration interceptor chain is called again to perform parameter adaptation processing on the initial playback parameters and generate the target playback parameters.
10. A playback control device for a player, characterized in that, The player comprises a JS layer, a bridging layer, and a native layer; the JS layer interacts with the native layer through a call interface encapsulated by the bridging layer; The JS layer includes: a pre-configured interceptor for preset business functions; the device includes: The first receiving module is used to receive an audio playback request for the target audio through the external interface of the JS layer, and determine the initial playback parameters of the target audio in the audio playback request; The first calling module is used to call the interceptor configured in the JS layer to perform parameter adaptation processing on the initial playback parameters to obtain target playback parameters that are adapted to the preset business function; The first control module is used to call the calling interface encapsulated by the bridge layer through the JS layer to pass the target playback parameters to the native layer, so that the native layer controls the player to play the target audio through the target playback parameters.
11. An electronic device, characterized in that, The device includes a processor and a memory, the memory storing machine-executable instructions that can be executed by the processor, the processor executing the machine-executable instructions to implement the playback control method of the player according to any one of claims 1-9.
12. A storage medium, characterized in that, The storage medium stores machine-executable instructions, which, when invoked and executed by a processor, cause the processor to implement the playback control method of the player according to any one of claims 1-9.