Video switching method, device, storage medium and computer equipment

By transferring the player component to the target layout level of the native control layer and disconnecting the control of the logic control layer, the complex logic of the player component horizontal and vertical screen switching in the prior art is solved, and efficient video switching is achieved.

CN115550567BActive Publication Date: 2025-04-29TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110738048.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-30
Publication Date
2025-04-29
Estimated Expiration
2041-06-30

AI Technical Summary

Technical Problem

In the prior art, the horizontal and vertical screen switching logic of the player component is complex and needs to be compatible with multiple page scenarios, resulting in low video switching efficiency.

Method used

By receiving a horizontal screen switching request for the target video, the player component is transferred to the target layout level in the native control layer, disconnect the control of the logic control layer, adjust the size of the player component to the target horizontal screen size, and switch the mode to the horizontal screen mode.

Benefits of technology

The horizontal and vertical screen switching logic of player components in different page scenarios is simplified, the efficiency of video switching is improved, and the impact of the logic control layer on different page scenarios is avoided.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115550567B_ABST
    Figure CN115550567B_ABST
Patent Text Reader

Abstract

The embodiment of the present application discloses a video switching method, device, storage medium and computer equipment, which relates to the field of computer technology; by receiving a horizontal screen switching request for a target video, the player component is transferred to the target layout level in the native control layer through the native receiving layer to disconnect the control of the player component by the logic control layer; the size of the player component is adjusted to the target horizontal screen size according to the transferred target layout level, and the current vertical screen mode is switched to the horizontal screen mode; a first target event is generated, and the control of the player component by the logic control layer is suspended according to the first target event. In this way, by transferring the player component to the native control layer to disconnect the control of the player component by the logic control layer, the video switching logic under different page scenarios is simplified, and then the size of the player component is adjusted to the target horizontal screen size through the target layout level, the horizontal screen playback of the target video is achieved, and the efficiency of video switching is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a video switching method, device, storage medium and computer equipment. Background Art

[0002] With the development of computer technology, watching videos on mobile phones is a very common function. In order to obtain a better viewing experience, you can adjust the screen size of the video playback by switching the page between horizontal and vertical screens when playing the video.

[0003] In the prior art, the horizontal and vertical screen switching logic of the player component needs to be compatible with various different page scenarios, and the horizontal and vertical screen switching in each scenario requires different processing logic. Therefore, the logic of using the player component to implement horizontal and vertical screen switching in multiple scenarios is relatively complicated, and the video switching efficiency is low. Summary of the invention

[0004] The embodiments of the present application provide a video switching method, apparatus, storage medium and computer equipment, which can improve the efficiency of video switching.

[0005] The present application provides a video switching method, including:

[0006] Receive a horizontal screen switching request for the target video, and transfer the player component to the target layout level in the native control layer through the native receiving layer;

[0007] Adjusting the size of the player component to a target horizontal screen size according to the transferred target layout level, and switching the current vertical screen mode to a horizontal screen mode, so as to play the target video based on the horizontal screen mode;

[0008] A first target event is generated, and control of the player component by the logic control layer is suspended according to the first target event.

[0009] Accordingly, an embodiment of the present application provides a video switching device, including:

[0010] A transfer unit, configured to receive a horizontal screen switching request for a target video, and transfer the player component to a target layout level in the native control layer through the native receiving layer;

[0011] A switching unit, configured to adjust the size of the player component to a target horizontal screen size according to the transferred target layout level, and switch the current vertical screen mode to a horizontal screen mode, so as to play the target video based on the horizontal screen mode;

[0012] The generating unit is used to generate a first target event, and suspend the control of the player component by the logic control layer according to the first target event.

[0013] In one embodiment, the transfer unit comprises:

[0014] A first selection subunit is used to select a player component in the native receiving layer and save the current playback state of the target video;

[0015] A first transfer subunit, used to transfer the selected player component to a target layout level in the native control layer;

[0016] The first playback subunit is used to restore the current playback state of the target video for playback based on the player component in the target layout level.

[0017] In one embodiment, the video switching device further includes:

[0018] A portrait screen switching unit, configured to receive a landscape screen cancellation request for a target video, and switch a current landscape screen mode to a portrait screen mode according to the landscape screen cancellation request;

[0019] The vertical screen transfer unit is used to transfer the player component to the corresponding position in the native receiving layer through the logic control layer to achieve vertical screen playback of the target video.

[0020] In one embodiment, the vertical screen switching unit includes:

[0021] A second selection subunit is used to select a player component in the target layout level according to the horizontal screen cancellation request;

[0022] A generating subunit, configured to generate a second target event, and restore the control of the player component by the logic control layer according to the second target event;

[0023] The first switching subunit is used to switch the current page displayed on the display screen from the horizontal screen mode to the vertical screen mode.

[0024] In one embodiment, the video switching device further includes:

[0025] An acquisition unit, used to acquire a video information list, the video information list including a video identification set and a play parameter of a plurality of videos, the play parameter being used to indicate a target video identification corresponding to a video currently being played in a horizontal screen mode;

[0026] The playing unit is used to play the target video through the player component according to the video identifier in the video identifier set.

[0027] In one embodiment, the vertical screen transfer unit includes:

[0028] An acquisition subunit, used for acquiring target playback parameters through the logic control layer;

[0029] A determination subunit, configured to determine a target level corresponding to the target video in the native receiving layer according to a target video identifier indicated by the target playback parameter;

[0030] An adjusting subunit, configured to adjust the current page displayed on the display screen according to the target level and transfer the player component to the target level;

[0031] The second playback subunit is used to restore the current playback state of the target video and play it based on the player component in the target level, wherein the current playback state is the playback state of the target video saved when the player component in the target layout level is selected according to the horizontal screen cancellation request.

[0032] In one embodiment, the adjusting subunit is used to:

[0033] Determining a display interface corresponding to the target video according to the target level;

[0034] Adjusting the current page displayed on the display screen based on the display interface, and sending the target level information corresponding to the target level to the player component container in the native control layer;

[0035] The player component is transferred to the target level through the native control layer according to the target level information received by the player component container.

[0036] In addition, an embodiment of the present application further provides a storage medium, which stores a plurality of instructions, and the instructions are suitable for a processor to load to execute the steps in any one of the video switching methods provided in the embodiment of the present application.

[0037] In addition, an embodiment of the present application further provides a computer device, including a processor and a memory, wherein the memory stores an application program, and the processor is used to run the application program in the memory to implement the video switching method provided in the embodiment of the present application.

[0038] The embodiment of the present application also provides a computer program product or a computer program, wherein the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a storage medium. The processor of the computer device reads the computer instructions from the storage medium, and the processor executes the computer instructions, so that the computer device performs the steps in the video switching method provided in the embodiment of the present application.

[0039] The embodiment of the present application receives a horizontal screen switching request for a target video, transfers the player component to the target layout level in the native control layer through the native receiving layer, so as to disconnect the control of the player component by the logic control layer; adjusts the size of the player component to the target horizontal screen size according to the transferred target layout level, and switches the current vertical screen mode to the horizontal screen mode to achieve horizontal screen playback of the target video; generates a first target event, and suspends the control of the player component by the logic control layer according to the first target event. In this way, by transferring the logic of video switching to the native receiving layer, when the native receiving layer receives a horizontal screen switching request for the target video, the player component is removed to the native control layer to disconnect the control of the logic control layer over the player component, so that the logic of horizontal screen switching of the player component can be separated from the influence of the page layout of different page scenes controlled by the logic control layer, thereby avoiding the situation in the prior art where different switching logics need to be designed when switching the player component between horizontal and vertical screens in different page scenes, thereby simplifying the horizontal and vertical screen switching logic of the player component in different page scenes, and then adjusting the size of the player component to the target horizontal screen size through the target layout layer, thereby achieving horizontal screen playback of the target video in different page scenes and improving the efficiency of video switching. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0041] Figure 1 It is a schematic diagram of an implementation scenario of a video switching method provided in an embodiment of the present application;

[0042] Figure 2a A schematic diagram of the page structure of an information bottom page with a video embedded therein provided in an embodiment of the present application;

[0043] Figure 2b A schematic diagram of the page structure of a video list page provided in an embodiment of the present application;

[0044] Figure 2c A schematic diagram of the page structure of a video immersive underlying page provided in an embodiment of the present application;

[0045] Figure 3 It is a flowchart of a video switching method provided in an embodiment of the present application;

[0046] Figure 4a It is a page hierarchy diagram of a video immersive bottom page in a vertical screen state of a video switching method provided by an embodiment of the present application;

[0047] Figure 4b It is a page hierarchy diagram of a video immersive bottom page in a horizontal screen state of a video switching method provided by an embodiment of the present application;

[0048] Figure 5 is another flow chart of a video switching method provided by an embodiment of the present application;

[0049] Figure 6 is a schematic diagram of a vertical screen mode of a video switching method provided in an embodiment of the present application;

[0050] Figure 7 is a horizontal screen mode schematic diagram of a video switching method provided in an embodiment of the present application;

[0051] Figure 8 is a schematic diagram of the structure of a video switching device provided in an embodiment of the present application;

[0052] Fig. 9 It is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0053] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.

[0054] The embodiments of the present application provide a video switching method, device, storage medium and computer equipment. Among them, the video switching method can be applied to a video switching device, and the video switching device can be integrated in a computer device, which can be a server or a terminal. Among them, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer and other computer devices that can input data, but is not limited to this. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, network acceleration services (Content Delivery Network, CDN), and basic cloud computing services such as big data and artificial intelligence platforms.

[0055] In order to better illustrate the embodiments of the present application, please refer to the following terms for reference:

[0056] Java: Java is an object-oriented programming language that is powerful and easy to use. As a representative of static object-oriented programming languages, Java implements object-oriented theory very well, allowing programmers to perform complex programming with an elegant way of thinking.

[0057] JavaScript: referred to as "JS", is a lightweight, interpreted or just-in-time compiled programming language with function priority. Although it is famous as a scripting language for developing World Wide Web (Web) pages, it is also used in many non-browser environments. JavaScript is a dynamic scripting language based on prototype programming, multi-paradigm, and supports object-oriented, imperative and declarative (such as functional programming) styles.

[0058] React: A web development framework, a JavaScript library for building user interfaces (UI), originated from an internal project at Facebook.

[0059] React Native: RN for short, is a cross-platform mobile application development framework that Facebook opened up in April 2015. It is a JS framework that Facebook opened up earlier, and a derivative of React on the native mobile application platform, supporting both iOS and Android platforms. RN uses JavaScript to develop mobile applications, so technicians who are familiar with Web front-end development only need to learn a little to enter the field of mobile application development.

[0060] Activity: Activity is one of the four most basic and commonly used components in Android. The four major components of Android are Activity, Service, Content Provider and Broadcast Receiver. Activity is an application component that provides a screen that users can interact with to complete a task. All operations in Activity are closely related to the user. It is a component responsible for interacting with the user and can display specified controls through view controls. In an Android application, an Activity is usually a separate screen that can display some controls and detect and handle user events.

[0061] Software Development Kit: Software Development Kit, referred to as SDK, is generally a collection of development tools used by software engineers to build application software for specific software packages, software frameworks, hardware platforms, operating systems, etc.

[0062] Subclass: A class formed by a subset of a set of object instances of a class. The former is called the superclass or parent class of the subclass. A subclass has all the attributes and operations of its parent class, and also has its own unique attributes or operations.

[0063] See also Figure 1 , taking the video switching device integrated into the computer equipment as an example, Figure 1 The schematic diagram of the implementation environment scenario of the video switching method provided in the embodiment of the present application includes terminal A, wherein terminal A can be a smart phone, tablet computer, laptop computer, desktop computer or other computer devices capable of video switching, but is not limited thereto. Among them, terminal A can receive a horizontal screen switching request for a target video, transfer the player component to the target layout level in the native control layer through the native receiving layer to disconnect the control of the player component by the logic control layer; adjust the size of the player component to the target horizontal screen size according to the transferred target layout level, and switch the current vertical screen mode to the horizontal screen mode to achieve horizontal screen playback of the target video; generate a first target event, and suspend the control of the player component by the logic control layer according to the first target event.

[0064] It should be noted that Figure 1 The schematic diagram of the implementation environment scenario of the video switching method shown is only an example. The implementation environment scenario of the video switching method described in the embodiment of the present application is to more clearly illustrate the technical solution of the embodiment of the present application, and does not constitute a limitation on the technical solution provided by the embodiment of the present application. It is known to those skilled in the art that with the evolution of video switching and the emergence of new business scenarios, the technical solution provided by the present application is also applicable to similar technical problems.

[0065] Application development is generally carried out by developers based on the Application Framework layer in the Android system architecture. On this basis, application development based on the RN framework generally runs on an Activity in the application framework, that is, displayed in a native Activity page. Developers develop applications based on the RN framework on this Activity page. This development method based on the RN framework is more flexible than native development, and the interaction with native development is relatively simple, which is conducive to flexible and efficient development of the application's display interface.

[0066] The RN framework uses JavaScript to develop applications and provides an extension layer implemented in Java. This extension layer is used to encapsulate custom components for developers according to specific development needs, and control the interactive display of custom encapsulated components in the native page of the Android system through the JS end. It can be seen that the control logic of custom components is mostly implemented through the JS end. Among them, the player component (Vedioview) is a common component for Android interface development. It supports basic functions such as video playback, pause, switching clarity, and fast forward. It is commonly used in page scenarios such as embedded videos on information bottom pages, video list pages, and video immersive bottom pages. Please refer to Figure 2a , Figure 2b as well as Figure 2c , Figure 2a A schematic diagram of the page structure of an information bottom page with embedded video provided in an embodiment of the present application, Figure 2b A schematic diagram of the page structure of a video list page provided in an embodiment of the present application. The video list page may include multiple videos such as video 1, video 2, and video 3. Figure 2c A schematic diagram of the page structure of a video immersive underlying page provided in an embodiment of the present application.

[0067] In the prior art, the horizontal and vertical screen switching logic of the player component is completed on the JS side. When the user needs to switch the page between horizontal and vertical screens to obtain a more comfortable viewing experience, for different page scenarios such as information underlying page embedded with video, video list page, and video immersive underlying page, since the player component is in the page layout of different page scenarios, different control logics are required to achieve the horizontal and vertical screen switching of the player component in different scenarios. For example, whether the player component needs to be removed, how to adjust the size of the player component, and how to adapt the display interface of the horizontal screen mode, etc., there will be different control logics according to different page scenarios. Therefore, the horizontal and vertical screen switching logic of the player component controlled by the JS side is relatively complicated, and the video switching efficiency is low.

[0068] In order to solve the above problems, an embodiment of the present application provides a video switching method, which transfers the horizontal and vertical screen switching logic of the JS side to the extended layer where the player component is located. When the extended layer where the player component is located receives a horizontal screen switching request for the target video, the player component is removed to the native UI layout framework layer of the Android system to disconnect the JS side's control over the player component, and then adjust the size of the player component to the target horizontal screen size to achieve horizontal screen display of the target video, and notify the JS side to suspend control of the player component to achieve horizontal screen playback of the target video. All page scenarios are applicable to the video switching method provided in the embodiment of the present application. Therefore, the horizontal and vertical screen switching logic of the player component in different page scenarios is simplified, thereby improving the efficiency of video switching.

[0069] The specific implementation process is described in detail below. It should be noted that the description order of the following embodiments is not intended to limit the preferred order of the embodiments.

[0070] This embodiment will be described from the perspective of a video switching device. The video switching device may be integrated into a computer device. The computer device may be a server or a terminal, and this application does not limit this.

[0071] See also Figure 3 , Figure 3 : is a flow chart of a video switching method provided in an embodiment of the present application. The video switching method includes:

[0072] In step 101, a horizontal screen switching request for a target video is received, and a player component is transferred to a target layout level in a native control layer through a native receiving layer.

[0073] Among them, the native control layer refers to the layer specified by the Android system SDK, which is the layer where the native UI layout framework of the Android system is located, for example, the layer where the native basic UI layout framework of the Android system, such as FrameLayout, LinearLayout, AbsoluteLayout, and RelativeLayout, is located.

[0074] The native receiving layer refers to the extension layer provided by the RN framework. It is developed based on the native control layer and can support developers to customize the capabilities of components through the Android side. This is the layer where custom components are located and is implemented through Java code, so it can also be called the Java side.

[0075] The logical control layer refers to the layer specified by the SDK provided by the RN framework and the SDK provided by other third parties. It is implemented in JavaScript language, so it can also be called the JS side. It is used to control the custom components in the native receiving layer so that the custom components, that is, the Android native components encapsulated by the RN framework, can be applied and displayed in the native control layer provided by the Android system.

[0076] The target video may be at least one video played by a player component, or may be a whole composed of multiple videos with a certain play order, and the player component is used to play the target video. The target video may be a video in different page scenarios such as an embedded video on an information bottom page, a video list page, and a video immersive bottom page.

[0077] The target layout level is a level that is not controlled by the logic control layer, and can implement full-screen layout, so that the player component can be adjusted to the target horizontal screen size to implement horizontal screen playback. Specifically, it can be a level in the native control layer. In one embodiment, the target layout level can be a content frame layout (ContentFrameLayout) in the native control layer, which is a subclass of the frame layout FrameLayout and can be used to implement the full-screen layout of the player component.

[0078] Among them, in order to simplify the horizontal and vertical screen switching logic of the player component in different page scenarios, the horizontal and vertical screen switching logic of the player component can be transferred to the native receiving layer where the player component is located, and the horizontal and vertical screen switching logic of the player component is controlled by the native receiving layer. Specifically, when a horizontal screen switching request for a target video is received, the player component can be transferred to the target layout level in the native control layer through the native receiving layer. Since the native receiving layer is controlled by the logic control layer, and the native control layer is not controlled by the logic control layer, transferring the player component to the target layout level in the native control layer can disconnect the control of the player component by the logic control layer, and then the influence of the page layout of different page scenarios controlled by the logic control layer on the horizontal screen switching of the player component can be eliminated, thereby simplifying the horizontal and vertical screen switching logic of the player component in different page scenarios.

[0079] In one embodiment, a horizontal screen switching request for a target video can be triggered by a user clicking on a horizontal screen playback control on a player component, or by a user input instruction, such as an instruction input by voice, an instruction input by a gesture action, etc., without limitation. The horizontal screen switching request can be triggered during the playback of the target video, or can be triggered without being triggered during the playback of the target video, without limitation, so that a horizontal screen switching request for the target video can be received.

[0080] In one embodiment, in order to achieve a smooth transition of the target video when switching between horizontal and vertical screens, enhance the user's viewing experience, and improve the efficiency of video switching, after the native receiving layer receives a horizontal screen switching request for the target video, the player component in the native receiving layer can be selected, and the playback of the target video can be paused, and the current playback status of the target video can be saved, and the current playback status of the target video includes the current playback progress of the target video; then the selected player component can be transferred to the target layout level in the native control layer; based on the player component in the target layout level, the playback status of the target video can be restored, and the playback of the target video can be continued according to the current playback progress, so that a smooth transition of the target video during the horizontal and vertical screen switching process can be achieved.

[0081] In one embodiment, please refer to Figure 4a , Figure 4a This is a page hierarchy diagram of a video immersive underlying page in a vertical screen state of a video switching method provided in an embodiment of the present application, wherein a horizontal screen switching request is triggered by the user selecting a full-screen control in the page, thereby receiving a horizontal screen switching request for a target video, and transferring the player component to a target layout hierarchy in the native control layer through the native receiving layer.

[0082] In step 102, the size of the player component is adjusted to the target horizontal screen size according to the transferred target layout level, and the current vertical screen mode is switched to the horizontal screen mode.

[0083] Among them, the target horizontal screen size is the size of the player component in horizontal screen mode, which is the size of the player component in horizontal screen mode that the system or user hopes to obtain. Based on the target horizontal screen size, the size of the target video displayed on the screen in horizontal screen mode that the system or user hopes to obtain can be obtained. The specific size of the target horizontal screen size can be adjusted and set by the developer according to actual conditions.

[0084] In order to achieve horizontal screen playback of the target video, the size of the player component can be adjusted to the target horizontal screen size according to the target layout level after the transfer. Specifically, the layout file corresponding to the target horizontal screen size can be configured in the target layout level. When the player component is transferred to the target layout level, the corresponding layout file can be loaded according to the layout of the target layout level, and then it can be adaptively adjusted to the target horizontal screen size. At the same time, the player component adjusted to the target horizontal screen size and the page where it is located can be switched from the current portrait mode to the landscape mode to play the target video based on the landscape mode.

[0085] In one embodiment, the current page displayed on the display screen can be switched from the current portrait mode to the landscape mode by calling an application programming interface (API) provided by the Android system that can support screen rotation.

[0086] In one embodiment, please refer to Figure 4b , Figure 4b It is a page hierarchy diagram of a video immersive bottom page in a horizontal screen state of a video switching method provided by an embodiment of the present application. After receiving a horizontal screen switching request, the player component is transferred to the target layout hierarchy in the native control layer through the native receiving layer. The size of the player component can be adjusted to the target horizontal screen size according to the transferred target layout hierarchy, and the current vertical screen mode is switched to the horizontal screen mode, so that Figure 4a The page level of the video immersive bottom page in the vertical screen state provided in is adjusted to Figure 4bThe page hierarchy of the video immersive underlying page in landscape mode is shown.

[0087] In step 103, a first target event is generated, and the control of the player component by the logic control layer is suspended according to the first target event.

[0088] Among them, the first target event can be an event (Event) that the native control layer actively sends to the logical control layer, which is used to notify the logical control layer of the event that the native control layer starts to take over the playback process of the player component, so that the logical control layer responds to the event.

[0089] In one embodiment, after the player component is transferred from the native receiving layer to the native control layer, the native control layer can use an event dispatcher (Event Dispatcher) to generate a first target event, and send the first target event to the logic control layer to notify the logic control layer of the event that the native control layer begins to take over the playback process of the player component. The logic control layer can then respond to the first target event, thereby suspending control of the player component and saving the current control state of the player component by the logic control layer, so that the process of horizontal screen playback of the player component in the target layout level of the native control layer is not affected by the control of the logic control layer, thereby avoiding the situation where the player component plays the target video in the target layout level of the native control layer while the logic control layer continues to control the playback process of the player component, causing confusion in the playback process of the player component.

[0090] Furthermore, it can be ensured that when the player component exits horizontal screen playback, the control state of the player component saved by the logic control layer can be smoothly connected, and by restoring the control of the player component by the logic control layer, the vertical screen playback of the target video in vertical screen mode can be continued normally through the native receiving layer.

[0091] In one embodiment, when the user triggers a cancellation request for the horizontal screen for the target video, the player component of the target layout level transferred to the native control layer can be transferred to the native receiving layer to resume the playback of the target video in the vertical screen mode, which can include:

[0092] (1) receiving a horizontal screen cancellation request for a target video, and switching the current horizontal screen mode to the vertical screen mode according to the horizontal screen cancellation request;

[0093] (2) The player component is transferred to the corresponding position in the native receiving layer through the logic control layer to achieve vertical screen playback of the target video.

[0094] Among them, a horizontal screen cancellation request for the target video can be received. According to the horizontal screen cancellation request, the current page displayed on the display screen is converted from horizontal screen mode to vertical screen mode. At the same time, the player component can be transferred to the hierarchical position corresponding to the currently playing target video in the native receiving layer through the logic control layer to realize vertical screen playback of the target video.

[0095] In one embodiment, after receiving a horizontal screen cancellation request for a target video, a player component in the target layout layer can be selected according to the horizontal screen cancellation request, the playback of the target video can be paused and the current playback state of the target video can be saved, and then a second target event can be generated. The second target event can be an event that the native control layer actively sends to the logic control layer, which is used to notify the logic control layer of the event that the native control layer ends the playback process of the player component, so that the logic control layer responds to the event. Thus, when the logic control layer receives the second target event, the control of the player component by the logic control layer can be restored according to the second target event, and the current page displayed on the display screen can be switched from the horizontal screen mode to the vertical screen mode. Then, the player component can be transferred to the hierarchical position corresponding to the currently playing target video in the native receiving layer through the logic control layer, and the size of the player component can be adaptively adjusted according to the hierarchical position in the native receiving layer, and the display interface layout in the vertical screen mode can be adjusted through the logic control layer to achieve vertical screen playback of the target video.

[0096] As can be seen from the above, the embodiment of the present application receives a horizontal screen switching request for the target video, transfers the player component to the target layout level in the native control layer through the native receiving layer; adjusts the size of the player component to the target horizontal screen size according to the transferred target layout level, and switches the current vertical screen mode to the horizontal screen mode to play the target video based on the horizontal screen mode; generates a first target event, and suspends the control of the player component by the logic control layer according to the first target event. In this way, by transferring the logic of video switching to the native receiving layer, when the native receiving layer receives a horizontal screen switching request for the target video, the player component is removed to the native control layer to disconnect the control of the player component by the logic control layer, and then adjusts the size of the player component to the target horizontal screen size through the target layout level to achieve the horizontal screen of the target video, and suspends the control of the player component by the logic control layer according to the first target event, thereby achieving horizontal screen playback of the target video and improving the efficiency of video switching.

[0097] According to the method described in the above embodiment, the following is further described in detail with examples.

[0098] In this embodiment, the video switching device is specifically integrated in a computer device as an example for description. The video switching method is executed by a terminal and a video immersive page is used as an example for specific description.

[0099] For a better description of the embodiments of this application, please refer to Figure 5 , Figure 5 Another schematic diagram of the video switching method provided in the embodiment of the present application. The specific process is as follows:

[0100] In step 201, the terminal obtains a video information list, and plays a target video through the player component according to the video identifier in the video identifier set.

[0101] Among them, the video information list (Vedioinfo) may include video identification sets and playback parameters of multiple videos, which can be obtained through the open source cross-platform multimedia development library (Simple DirectMedia Layer, referred to as SDL). The video identification set is a whole composed of video identifications (Vedio ID, referred to as vid) corresponding to multiple videos, including at least one video identification. The playback parameters are parameters during video playback in horizontal mode. The playback progress of the target video in the video information list can be known through the playback parameters. For example, it can be known that the currently playing target video is the number of videos played by the player component in horizontal mode, or the number of videos played by the player component in horizontal mode can be known. Among them, the playback parameter can be used to indicate the target video identification corresponding to the video currently playing in horizontal mode. The target video identification indicated by the playback parameter can move the player component back to the corresponding level in the native receiving layer. For example, for the video information list (V1, V2, V3), V1, V2 and V3 are the video identifiers of the three target videos respectively. When the target video V2 is played, the playback parameter at this time may be V2, and when the target video V3 is played, the playback parameter at this time may be V3; the playback parameter may also be the playback offset (Offset) during video playback in horizontal mode. The playback offset is the number of videos that the player component has played in horizontal mode. The number of videos indicated by the playback parameter can move the player component back to the corresponding level in the native receiving layer. For example, for the video information list (V1, V2, V3) including three target videos, when the target video V2 is played, the playback offset at this time is 1, and when the target video V3 is played, the playback offset at this time is 2.

[0102] In one embodiment, the video information list may be an array, and the video identifier of the target video may be an element in the array. When the playback parameter is the target video identifier corresponding to the video currently being played in landscape mode, the playback parameter may be the element corresponding to the target video currently being played in the array. For example, for a video information list {a, b, c} including three target videos, when target video c is played, the playback parameter at this time is element c; when the playback parameter is the playback offset during video playback in landscape mode, the playback parameter may be the array subscript of the video identifier corresponding to the target video currently being played, or may be the difference between the array subscript of the element corresponding to the target video currently being played and the array subscript of the element corresponding to the first target video played in landscape mode. For example, for a video information list {a, b, c} including three target videos, when target video c is played, the playback parameter at this time is array subscript 2.

[0103] In order to enable the player component to continue playing the next video in landscape mode, a video information list can be obtained before receiving a landscape switching request for the target video. According to the video identifier in the video information list, the video data stream corresponding to the video identifier can be obtained through the player component to play the video.

[0104] In step 202, the terminal receives a horizontal screen switching request for the target video, selects a player component in the native receiving layer, and saves the current playback state of the target video.

[0105] Among them, the current playback status of the target video includes the current playback progress of the target video. In order to achieve a smooth transition of the target video when switching between horizontal and vertical screens, enhance the user's viewing experience, and improve the efficiency of switching between horizontal and vertical screens of the video, after receiving the horizontal screen switching request for the target video, the terminal selects the player component in the native receiving layer, pauses the playback of the target video and saves the current playback status of the target video. At the same time, the playback parameters can be used to indicate the target video identifier corresponding to the video currently playing in horizontal screen mode, and then the level information corresponding to the video currently playing can be obtained through the target video identifier.

[0106] In one embodiment, the current playback state of the video can be saved through a texture view component (Textureview).

[0107] In order to facilitate the specific description of the video switching method provided in the embodiment of the present application, this embodiment will be described by taking the scenario of the video immersive page as an example. Figure 6 , Figure 6 A schematic diagram of a vertical screen mode of a video switching method provided in an embodiment of the present application.

[0108] In one embodiment, please continue to refer to Figure 6 When the user clicks on the current page displayed on the display screen, that is, the full-screen control 12 on the current page 10 displayed on the terminal screen, a horizontal screen switching request for the target video is triggered. The terminal receives the horizontal screen switching request for the target video, and then selects the player component 11 in the native receiving layer, pauses the playback of the target video and saves the current playback status of the target video.

[0109] In step 203, the terminal transfers the selected player component to the target layout level in the native control layer, and restores the current playback state of the target video for playback based on the player component in the target layout level.

[0110] Among them, in order to simplify the horizontal and vertical screen switching logic of the player component in different page scenarios, the horizontal and vertical screen switching logic of the player component can be transferred to the native receiving layer where the player component is located, and then the horizontal and vertical screen switching logic of the player component can be controlled by the native receiving layer. Specifically, when a horizontal screen switching request for a target video is received, the player component can be transferred to the target layout level in the native control layer through the native receiving layer. Since the native receiving layer is controlled by the logic control layer, and the native control layer is not controlled by the logic control layer, therefore, by transferring the player component to the target layout level in the native control layer, the control of the player component by the logic control layer can be disconnected, and then the influence of the page layout of different page scenarios controlled by the logic control layer on the horizontal screen switching of the player component can be separated, thereby simplifying the horizontal and vertical screen switching logic of the player component in different page scenarios.

[0111] In step 204, the terminal adjusts the size of the player component to the target horizontal screen size according to the transferred target layout level, switches the current vertical screen mode to the horizontal screen mode, generates a first target event, and suspends the control of the player component by the logic control layer according to the first target event.

[0112] Among them, the target horizontal screen size is the size of the player component in horizontal screen mode, which is the size of the player component in horizontal screen mode that the system or user hopes to obtain. Based on the target horizontal screen size, the size of the target video displayed on the screen in horizontal screen mode that the system or user hopes to obtain can be obtained. The specific size of the target horizontal screen size can be adjusted and set by the developer according to actual conditions.

[0113] The first target event may be an event that the native control layer actively sends to the logic control layer, and is used to notify the logic control layer of the event that the native control layer starts to take over the playback process of the player component, so that the logic control layer responds to the event.

[0114] The terminal adaptively adjusts the size of the player component and the layout of the target layout level according to the transferred target layout level, and then adjusts it to the target horizontal screen size, and switches the current vertical screen mode to the horizontal screen mode, thereby generating a first target event. According to the first target event, the logic control layer suspends the control of the player component to the player component, so that the process of the player component performing horizontal screen playback in the target layout level of the native control layer is not affected by the control of the logic control layer, thereby avoiding the situation where the player component plays the target video in the target layout level of the native control layer while the logic control layer continues to control the playback process of the player component, resulting in confusion in the playback process of the player component in the horizontal screen mode.

[0115] In one embodiment, please refer to Figure 7 , Figure 7 A schematic diagram of a horizontal screen mode of a video switching method provided in an embodiment of the present application, wherein the terminal adjusts the size of the player component to the target horizontal screen size according to the target layout level after the transfer, obtains a player component 21 of the target horizontal screen size, and switches the current vertical screen mode to the horizontal screen mode, obtains the current page 20 displayed on the screen of the terminal in the horizontal screen mode, thereby playing the target video in the horizontal screen mode.

[0116] In step 205, the terminal receives a horizontal screen cancellation request for the target video, and selects a player component in the target layout level according to the horizontal screen cancellation request.

[0117] Among them, after the user triggers a horizontal screen cancellation request for the target video, the terminal receives the horizontal screen cancellation request for the target video. In order to smoothly restore the vertical screen playback state of the target video, the player component in the target layout level can be selected according to the horizontal screen cancellation request to pause and save the current playback state of the target video.

[0118] In one embodiment, please continue to refer to Figure 7 After the user clicks the return control 22 on the current page 20 displayed on the screen in landscape mode, a landscape cancellation request for the target video is triggered. The terminal receives the landscape cancellation request for the target video, selects the player component in the target layout level according to the landscape cancellation request, pauses the playback of the target video, and saves the current playback status of the target video.

[0119] In step 206, the terminal generates a second target event, and according to the second target event, the logic control layer restores control of the player component, and switches the current page displayed on the display screen from the horizontal screen mode to the vertical screen mode.

[0120] Among them, the second target event can be an event that the native control layer actively sends to the logic control layer, which is used to notify the logic control layer of the event that the native control layer ends controlling the playback process of the player component, so that the logic control layer responds to the event.

[0121] Among them, after receiving the horizontal screen switching request, the terminal sends a first target event to notify the logic control layer to release the control of the playback process of the player component, so that the terminal can control the player component to play the target video through the target layout level of the native control layer to achieve horizontal screen playback of the target video. Therefore, in order to achieve vertical screen playback of the target video, a second target event can be generated and sent to the logic control layer, so that the logic control layer takes over the control of the playback process of the player component, and then the vertical screen playback of the target video is achieved through the logic control layer.

[0122] In step 207, the terminal obtains a target playback parameter through the logic control layer, and determines a target level corresponding to the target video in the native receiving layer according to a target video identifier indicated by the target playback parameter.

[0123] The target playback parameter is the playback parameter corresponding to the target video currently being played when the terminal receives the horizontal screen cancellation request, and the target playback parameter indicates the target video identifier corresponding to the target video currently being played. The target level is the level corresponding to the target video currently being played in the native receiving layer obtained according to the target video identifier, through which the player component can be transferred to the level corresponding to the target video currently being played in the native receiving layer, and then the target video can continue to be played in the vertical screen mode.

[0124] When the user plays the target video in landscape mode and continues to play the target video, that is, when multiple target videos are played in landscape mode, different target videos may correspond to different display interfaces (UIs) in portrait mode, and components on different display interfaces correspond to different positions in the native receiving layer. Therefore, after the terminal receives the second target event through the logic control layer, in order to transfer the player component that has played multiple videos in landscape mode to the corresponding position in the native receiving layer, the target playback parameter can be obtained through the logic control layer, and then the target level corresponding to the target video currently being played in the native receiving layer can be determined through the target video identifier corresponding to the target video currently being played indicated by the target playback parameter.

[0125] In one embodiment, it can be assumed that the playback parameter is the playback offset during video playback in horizontal mode. When the player component plays the target video according to the video identifier in the video information list, the playback offset can be used to synchronously record the number of target video plays in horizontal mode according to the video identifier, and then the target level corresponding to the target video in the native receiving layer can be determined according to the number of plays. For example, assuming that the first video is played in horizontal mode, and then the second video is played, when the third target video is played, the terminal receives a horizontal screen cancellation request. At this time, the target playback parameter is the playback offset 2, and then the target level corresponding to the target video in the native receiving layer can be determined according to the target playback parameter, that is, the target level corresponding to the current level in the native receiving layer after offsetting the current level by two videos.

[0126] In one embodiment, each time a target video is played in the horizontal screen mode, the playback parameters corresponding to the target video are obtained and sent to the logic control layer, and the display interface is adjusted through the logic control layer.

[0127] In step 208, the terminal determines the display interface corresponding to the target video according to the target level, adjusts the current page displayed on the display screen based on the display interface, and sends the target level information corresponding to the target level to the player component container in the native control layer.

[0128] Among them, the terminal determines the display interface corresponding to the target video according to the target level, and adjusts the current page displayed on the display screen according to the display interface to obtain the page displayed on the display screen in the portrait mode. In order to transfer the player component that plays multiple videos in the landscape mode to the corresponding position in the native receiving layer, a player component container can be set. The player component container is in the native receiving layer and is used to receive control instructions from the logic control layer to the player component, and send the control instructions received from the logic control layer to the player component to the player component for execution. Furthermore, in order to transfer the player component to the position corresponding to the target level in the native receiving layer, when the current page displayed on the display screen is adjusted according to the display interface corresponding to the target level through the logic control layer, the target level information corresponding to the target level can be triggered to send the instruction to the player component container in the native control layer. Then, when the player component is transferred to the native control layer, the target level information obtained by the player component container can be used to transfer the player component to the correct level.

[0129] In step 209, the terminal transfers the player component to the target level through the native control layer according to the target level information received by the player component container, and restores the current playback state of the target video based on the player component in the target level and plays it.

[0130] The current playback state is the playback state of the target video saved when the terminal selects the player component in the target layout level according to the horizontal screen cancellation request. After sending the target level information to the native control layer where the player component is located through the player component container, the terminal transfers the player component to the target level through the native control layer according to the target level information received by the player component container, restores the current playback state of the target video based on the player component in the target level, and plays the target video in vertical screen.

[0131] From the above, it can be seen that the embodiment of the present application obtains a video information list through the terminal, and plays the target video through the player component according to the video identifier in the video identifier set; the terminal receives a horizontal screen switching request for the target video, selects the player component in the native receiving layer, and saves the current playback state of the target video; the terminal transfers the selected player component to the target layout level in the native control layer, and restores the current playback state of the target video for playback based on the player component in the target layout level; the terminal adjusts the size of the player component to the target horizontal screen size according to the transferred target layout level, and switches the current vertical screen mode to the horizontal screen mode, generates a first target event, and suspends the control of the player component by the logic control layer according to the first target event; the terminal receives a horizontal screen cancellation request for the target video, and selects the player component in the target layout level according to the horizontal screen cancellation request. The terminal generates a second target event, and according to the second target event, restores the control of the logic control layer over the player component, and switches the current page displayed on the display screen from the landscape mode to the portrait mode; the terminal obtains the target playback parameter through the logic control layer, and determines the target level corresponding to the target video in the native receiving layer according to the target video identifier indicated by the target playback parameter; the terminal determines the display interface corresponding to the target video according to the target level, adjusts the current page displayed on the display screen based on the display interface, and sends the target level information corresponding to the target level to the player component container in the native control layer; the terminal transfers the player component to the target level through the native control layer according to the target level information received by the player component container, and restores the current playback state of the target video based on the player component in the target level and plays it. In this way, by transferring the logic of video switching to the native receiving layer, when the native receiving layer receives a horizontal screen switching request for the target video, the player component is transferred to the native control layer to disconnect the control of the logic control layer over the player component, and then the size of the player component is adjusted to the target horizontal screen size through the target layout layer to achieve the horizontal screen of the target video, and the control of the player component by the logic control layer is suspended according to the first target event, so as to achieve horizontal screen playback of the target video. When a horizontal screen cancellation request for the target video is received, the video information list is obtained, and the player component is transferred to the layer corresponding to the target video in the native receiving layer through the playback parameters carried by the video information list, it is possible to achieve continuous playback of multiple videos in horizontal screen mode, thereby improving the efficiency of video switching.

[0132] In order to better implement the above method, an embodiment of the present invention further provides a video switching device, which can be integrated in a computer device, and the computer device can be a terminal.

[0133] For example, Figure 8As shown, it is a schematic diagram of the structure of a video switching device provided in an embodiment of the present application. The video switching device may include a transfer unit 301, a switching unit 302 and a generation unit 303, as follows:

[0134] The transfer unit 301 is used to receive a horizontal screen switching request for a target video, and transfer the player component to a target layout level in the native control layer through the native receiving layer;

[0135] A switching unit 302, configured to adjust the size of the player component to a target horizontal screen size according to the transferred target layout level, and switch the current vertical screen mode to the horizontal screen mode;

[0136] The generating unit 303 is used to generate a first target event, and suspend the control of the player component by the logic control layer according to the first target event.

[0137] In one embodiment, the transfer unit 301 includes:

[0138] The first selection subunit is used to select the player component in the native receiving layer and save the current playback state of the target video;

[0139] A first transfer subunit, used to transfer the selected player component to a target layout level in the native control layer;

[0140] The first playback subunit is used to restore the current playback state of the target video for playback based on the player component in the target layout level.

[0141] In one embodiment, the video switching device further includes:

[0142] A portrait screen switching unit, configured to receive a landscape screen cancellation request for a target video, and switch a current landscape screen mode to a portrait screen mode according to the landscape screen cancellation request;

[0143] The vertical screen transfer unit is used to transfer the player component to the corresponding position in the native receiving layer through the logic control layer to achieve vertical screen playback of the target video.

[0144] In one embodiment, the vertical screen switching unit includes:

[0145] A second selection subunit is used to select a player component in the target layout level according to the horizontal screen cancellation request;

[0146] A generating subunit, used for generating a second target event, and restoring the control of the player component by the logic control layer according to the second target event;

[0147] The first switching subunit is used to switch the current page displayed on the display screen from the horizontal screen mode to the vertical screen mode.

[0148] In one embodiment, the video switching device further includes:

[0149] An acquisition unit, used to acquire a video information list, the video information list including a video identifier set and a play parameter of a plurality of videos, the play parameter being used to indicate a target video identifier corresponding to a video currently being played in a horizontal screen mode;

[0150] The playing unit is used to play the target video through the player component according to the video identifier in the video identifier set.

[0151] In one embodiment, the vertical screen transfer unit includes:

[0152] An acquisition subunit, used to acquire target playback parameters through the logic control layer;

[0153] A determination subunit, configured to determine a target level corresponding to the target video in the native receiving layer according to a target video identifier indicated by the target playback parameter;

[0154] An adjusting subunit, used for adjusting the current page displayed on the display screen according to the target level and transferring the player component to the target level;

[0155] The second playback subunit is used to restore the current playback state of the target video and play it based on the player component in the target layer.

[0156] In one embodiment, the adjustment subunit is used to:

[0157] Determine a display interface corresponding to the target video according to the target level;

[0158] Adjusting the current page displayed on the display screen based on the display interface, and sending the target level information corresponding to the target level to the player component container in the native control layer;

[0159] The player component is transferred to the target level through the native control layer according to the target level information received by the player component container.

[0160] In specific implementation, the above units can be implemented as independent entities, or can be arbitrarily combined to be implemented as the same or several entities. The specific implementation of the above units can refer to the previous method embodiments, which will not be repeated here.

[0161] As can be seen from the above, the embodiment of the present application receives a horizontal screen switching request for the target video through the transfer unit 301, and transfers the player component to the target layout level in the native control layer through the native receiving layer; the switching unit 302 adjusts the size of the player component to the target horizontal screen size according to the transferred target layout level, and switches the current vertical screen mode to the horizontal screen mode to play the target video based on the horizontal screen mode; the generation unit 303 generates a first target event, and suspends the control of the player component by the logic control layer according to the first target event. In this way, by transferring the logic of video switching to the native receiving layer, when the native receiving layer receives the horizontal screen switching request for the target video, the player component is removed to the native control layer to disconnect the control of the player component by the logic control layer, and then the size of the player component is adjusted to the target horizontal screen size through the target layout level to realize the horizontal screen of the target video, and the control of the player component by the logic control layer is suspended according to the first target event, so as to realize the horizontal screen playback of the target video and improve the efficiency of video switching.

[0162] The present application also provides a computer device, such as Fig. 9 As shown, it shows a schematic diagram of the structure of a computer device involved in an embodiment of the present application, and the computer device may be a server, specifically:

[0163] The computer device may include components such as a processor 401 with one or more processing cores, a memory 402 with one or more computer-readable storage media, a power supply 403, and an input unit 404. Those skilled in the art will appreciate that Fig. 9 The computer device structure shown in the figure does not constitute a limitation on the computer device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. Among them:

[0164] The processor 401 is the control center of the computer device. It uses various interfaces and lines to connect various parts of the entire computer device. By running or executing software programs and / or modules stored in the memory 402, and calling data stored in the memory 402, it executes various functions of the computer device and processes data, thereby performing overall detection of the computer device. Optionally, the processor 401 may include one or more processing cores; preferably, the processor 401 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, display interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 401.

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

[0166] The computer device also includes a power supply 403 for supplying power to various components. Preferably, the power supply 403 can be logically connected to the processor 401 through a power management system, so as to manage charging, discharging, and power consumption through the power management system. The power supply 403 can also include any components such as one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, and power status indicators.

[0167] The computer device may further include an input unit 404, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.

[0168] Although not shown, the computer device may further include a display unit, etc., which will not be described in detail herein. Specifically in this embodiment, the processor 401 in the computer device will load the executable files corresponding to the processes of one or more application programs into the memory 402 according to the following instructions, and the processor 401 will run the application programs stored in the memory 402, thereby realizing various functions, as follows:

[0169] Receive a horizontal screen switching request for the target video, and transfer the player component to the target layout level in the native control layer through the native receiving layer; adjust the size of the player component to the target horizontal screen size according to the transferred target layout level, and switch the current vertical screen mode to the horizontal screen mode to play the target video based on the horizontal screen mode; generate a first target event, and suspend the control of the player component by the logic control layer according to the first target event.

[0170] The specific implementation of each of the above operations can be found in the previous embodiments, which will not be described in detail here. It should be noted that the computer device provided in the embodiment of the present application and the video switching method in the above embodiment belong to the same concept, and its specific implementation process is detailed in the above method embodiment, which will not be described in detail here.

[0171] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.

[0172] To this end, an embodiment of the present application provides a storage medium in which a plurality of instructions are stored, and the instructions can be loaded by a processor to execute the steps in any one of the video switching methods provided in the embodiments of the present application. For example, the instructions can execute the following steps:

[0173] Receive a horizontal screen switching request for the target video, and transfer the player component to the target layout level in the native control layer through the native receiving layer; adjust the size of the player component to the target horizontal screen size according to the transferred target layout level, and switch the current vertical screen mode to the horizontal screen mode to play the target video based on the horizontal screen mode; generate a first target event, and suspend the control of the player component by the logic control layer according to the first target event.

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

[0175] Since the instructions stored in the storage medium can execute the steps in any video switching method provided in the embodiments of the present application, the beneficial effects that can be achieved by any video switching method provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.

[0176] According to one aspect of the present application, a computer program product or a computer program is provided, the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the methods provided in the various optional implementations provided in the above embodiments.

[0177] The above is a detailed introduction to a video switching method, device, storage medium and computer equipment provided in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the ideas of the present application, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A video switching method, characterized in that: include: Receive a horizontal screen switching request for the target video, and transfer the player component to the target layout level in the native control layer through the native receiving layer; Adjusting the size of the player component to a target horizontal screen size according to the transferred target layout level, and switching the current vertical screen mode to a horizontal screen mode, so as to play the target video based on the horizontal screen mode; A first target event is generated, and control of the player component by the logic control layer is paused according to the first target event.

2. The video switching method according to claim 1, characterized in that: The transferring of the player component to the target layout level in the native control layer through the native receiving layer includes: Selecting a player component in the native receiving layer to save the current playback state of the target video; Transfer the selected player component to the target layout level in the native control layer; Restores the current playback state of the target video based on the player component in the target layout hierarchy.

3. The video switching method according to claim 1, wherein: The method further comprises: Receiving a horizontal screen cancellation request for a target video, and switching a current horizontal screen mode to a vertical screen mode according to the horizontal screen cancellation request; The player component is transferred to a corresponding position in the native receiving layer through the logic control layer to achieve vertical screen playback of the target video.

4. The video switching method according to claim 3, characterized in that: The switching the current landscape mode to the portrait mode according to the landscape cancellation request includes: Selecting a player component in the target layout level according to the horizontal screen cancellation request; Generate a second target event, and restore the control of the player component by the logic control layer according to the second target event; Switch the current page displayed on the display from landscape mode to portrait mode.

5. The video switching method according to any one of claims 3 to 4, characterized in that: Before receiving the horizontal screen switching request for the target video, the method further includes: Obtaining a video information list, the video information list including a video identifier set and a play parameter of a plurality of videos, the play parameter being used to indicate a target video identifier corresponding to a video currently being played in a horizontal screen mode; The target video is played through the player component according to the video identifier in the video identifier set.

6. The video switching method according to claim 5, characterized in that: The transferring the player component to a corresponding position in the native receiving layer through the logic control layer includes: Acquire target playback parameters through the logic control layer; Determine a target level corresponding to the target video in the native receiving layer according to the target video identifier indicated by the target playback parameter; Adjusting the current page displayed on the display screen according to the target level, and transferring the player component to the target level; Based on the player component in the target level, the current playback state of the target video is restored and played, wherein the current playback state is the playback state of the target video saved when the player component in the target layout level is selected according to the horizontal screen cancellation request.

7. The video switching method according to claim 6, characterized in that: The step of adjusting the current page displayed on the display screen according to the target level and transferring the player component to the target level includes: Determining a display interface corresponding to the target video according to the target level; Adjusting the current page displayed on the display screen based on the display interface, and sending the target level information corresponding to the target level to the player component container in the native control layer; The player component is transferred to the target level through the native control layer according to the target level information received by the player component container.

8. A video switching device, characterized in that: Also includes: A transfer unit, configured to receive a horizontal screen switching request for a target video, and transfer the player component to a target layout level in the native control layer through the native receiving layer, so as to disconnect the control of the player component by the logic control layer; A switching unit, configured to adjust the size of the player component to a target horizontal screen size according to the transferred target layout level, and switch the current vertical screen mode to a horizontal screen mode, so as to play the target video based on the horizontal screen mode; The generating unit is used to generate a first target event, and suspend the control of the player component by the logic control layer according to the first target event.

9. A storage medium, characterized in that: The storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute the steps in the video switching method according to any one of claims 1 to 7.

10. A computer device, characterized in that: It comprises a memory and a processor; the memory stores an application program, and the processor is used to run the application program in the memory to execute the steps in the video switching method according to any one of claims 1 to 7.

11. A computer program product, characterized in that The computer program product includes computer instructions, which are stored in a storage medium; a processor of a computer device reads the computer instructions from the storage medium, and the processor executes the computer instructions, so that the computer device executes the steps in the video switching method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Terminal horizontal / vertical screen switching method and device

    CN106406848A

  • Method and device for switching transverse screen and vertical screen and terminal

    CN108234763A