Method, device, equipment and storage medium for inter-page video switching

By sharing drawing surface objects across different processing processes and reusing player objects, the problem of video stuttering during video switching was solved, achieving seamless switching and improved smoothness.

CN116467537BActive Publication Date: 2025-12-16TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210028981.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-11
Publication Date
2025-12-16
Estimated Expiration
2042-01-11

AI Technical Summary

Technical Problem

During video switching between different processing processes, existing technologies require the player object to be retrieved again, resulting in excessive time consumption for initialization and video stream retrieval, leading to video stuttering and reduced smoothness.

Method used

By sharing the drawing surface object between different processing processes and reusing the player object of the first processing process, the video content is rendered to the drawing surface object of the second video page, avoiding the need to obtain a new player object and fetch the video stream again.

Benefits of technology

It enables seamless video switching between different processing processes, avoiding video stuttering and reduced smoothness, and improving the smoothness of video playback.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116467537B_ABST
    Figure CN116467537B_ABST
Patent Text Reader

Abstract

The application provides a method, device and equipment for inter-page video switching, and a storage medium. In the application, in response to a switching instruction triggered for a first video page, a second processing process is started. The first video page is obtained based on a first processing process, and video content played is displayed based on a first video view associated with a first drawing surface object. A second video page corresponding to the second processing process and a second drawing surface object corresponding to the second video page are obtained. Through the first processing process, the first drawing surface object in a player object is replaced by the second drawing surface object, and the video content played in the first video page is rendered into a second video view associated with the second drawing surface object, so as to play the video content in the second video page. The player object is obtained based on the first processing process. The application realizes seamless switching of videos between different process pages, and improves smoothness.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer, and particularly relates to a method and device for switching video between pages, equipment and storage medium. BACKGROUND

[0002] With the development of science and technology, various video application programs appear in the public view, and support functions such as short video playing and live video. In order to facilitate target objects to browse and increase the click rate or the browsing volume of the video, in the video application program, video information is first pushed to the target object, and then the target object determines whether to switch to the corresponding video based on the pushed video information. In order to realize video switching, various video application programs widely propose a page-to-page video switching technology.

[0003] At present, the page-to-page video switching technology includes page-to-page video switching of different processing processes. For the page-to-page video switching of different processing processes, that is, the cross-processing process scenario, because the address spaces of different processing processes are isolated from each other, when opening a page of a different processing process, a new player object is usually obtained, and the new player object is used to pull, download and play a video stream corresponding to the video content.

[0004] Because the new player object has time consumption in initialization and pulling of the video stream, that is, there is a long waiting time, which further causes video lag in the video switching process and reduces the fluency of video playing. SUMMARY

[0005] The present application provides a method, device, equipment and storage medium for switching video between pages, to reduce the time for obtaining a player object and the time consumption for pulling a video stream, and further improve the fluency of video playing in the process of switching video between pages.

[0006] In a first aspect, an embodiment of the present application provides a method for switching video between pages, which comprises:

[0007] In response to a switching instruction triggered for a first video page, a second processing process is started; the first video page is obtained based on a first processing process, and video content played in the first video page is displayed based on a first video view associated with a first drawing surface object corresponding to the first video page;

[0008] A second video page corresponding to the second processing process is obtained, and a second drawing surface object corresponding to the second video page is obtained;

[0009] The first drawing surface object in the player object is replaced by the second drawing surface object through the first processing process, and the video content played in the first video page is rendered into the second video view associated with the second drawing surface object to play the video content in the second video page, the player object being obtained based on the first processing process.

[0010] In a second aspect, an embodiment of the present application provides a device for inter-page video switching, the device comprising:

[0011] The starting unit is configured to start a second processing process in response to a switching instruction triggered for a first video page, the first video page being obtained based on the first processing process, and video content played in the first video page being displayed based on a first video view associated with a first drawing surface object corresponding to the first video page.

[0012] The obtaining unit is configured to obtain a second video page corresponding to the second processing process, and obtain a second drawing surface object corresponding to the second video page.

[0013] The rendering unit is configured to replace, through the first processing process, a first drawing surface object in a player object by a second drawing surface object, and render video content played in the first video page into a second video view associated with the second drawing surface object to play the video content in a second video page, the player object being obtained based on the first processing process.

[0014] In a third aspect, an embodiment of the present application provides a device for inter-page video switching, comprising a memory and a processor, wherein the memory is configured to store computer instructions, and the processor is configured to execute the computer instructions to implement steps of a method for inter-page video switching provided by an embodiment of the present application.

[0015] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, which stores computer instructions, and the computer instructions are executed by a processor to implement steps of a method for inter-page video switching provided by an embodiment of the present application.

[0016] In a fifth aspect, an embodiment of the present application provides a computer program product, which comprises computer instructions stored in a computer readable storage medium; when a processor of an electronic device reads the computer instructions from the computer readable storage medium, the processor executes the computer instructions to enable the electronic device to perform steps of a method for inter-page video switching provided by an embodiment of the present application.

[0017] The present application has the following beneficial effects:

[0018] The embodiment of the present application provides a method, device and equipment for inter-page video switching and a storage medium. In the embodiment of the present application, in response to a switching instruction triggered for a first video page, a second processing process is started; through the second processing process, a second drawing surface corresponding to a second video page is obtained; through the first processing process, a first drawing surface object in a player object obtained based on the first processing process is replaced by a second drawing surface object, and video content played in the first video page is rendered into a second video view drawn in the second drawing surface object, so that the target of playing the video content in the second video page is achieved.

[0019] When the first video page is switched to the second video page, the second processing process does not need to obtain a new player object to play a video stream, but the first drawing surface object in the player object obtained based on the first processing process is obtained again as the second drawing surface object corresponding to the second video page, so that the purpose of multiplexing the player object between different processing processes is achieved. Then, the video content required to be rendered by the player object is rendered into a second video view associated with the second drawing surface object, without the need of pulling the video stream corresponding to the video content again, so that the video consistent with the video content in the first video page can be played in the second video page, the time consumed by the initialization of the obtained new player object and the time consumed by the pulling of the video stream are avoided, the frame skipping phenomenon existing when the new player object plays the video content corresponding to the video stream is avoided, the fluency of the video content playing is improved, and the seamless switching of the video between the pages corresponding to different processing processes is achieved.

[0020] Other features and advantages of the present application will be set forth in the following description, and in part will become apparent to those skilled in the art from the description, or can be learned by practice of the present application. The objects and other advantages of the present application can be realized and achieved by the structure particularly pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0022] Figure 1 It is a schematic diagram of video switching in a same video page;

[0023] Figure 2 It is a schematic diagram of seamless switching from a live video explanation page to a live room page;

[0024] Figure 3A schematic diagram of inter-page switching of different processing processes in the related art;

[0025] Figure 4 A schematic diagram of an application scenario provided by an embodiment of the present application;

[0026] Figure 5 A flowchart of a method of inter-page video switching provided by an embodiment of the present application;

[0027] Figure 6 A schematic diagram of a first processing process obtaining a first video page provided by an embodiment of the present application;

[0028] Figure 7 A schematic diagram of switching from a first video page to a second video page based on a switching instruction provided by an embodiment of the present application;

[0029] Figure 8 A schematic diagram of a second processing process obtaining a second video page provided by an embodiment of the present application;

[0030] Figure 9 A schematic diagram of a system architecture of inter-page video switching provided by an embodiment of the present application;

[0031] Figure 10 A schematic diagram of another system architecture of inter-page video switching provided by an embodiment of the present application;

[0032] Figure 11 A flowchart of a specific implementation method of inter-page video switching provided by an embodiment of the present application;

[0033] Figure 12 A device structure diagram of inter-page video switching provided by an embodiment of the present application;

[0034] Figure 13 An electronic device structure diagram provided by an embodiment of the present application. DETAILED DESCRIPTION

[0035] In order to make the objectives, technical solutions and beneficial effects of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of protection of the present application.

[0036] In order to facilitate those of ordinary skill in the art to better understand the technical solutions of the present application, some concepts involved in the present application are introduced below.

[0037] Process: is a computer program on a certain data set on the running activities, is the basic unit of system resource allocation and scheduling, is the basis of operating system structure. Different processing processes are isolated from each other, and application programs cannot directly access the objects and variables of different processing processes.

[0038] Surface: is an important concept of Android graphics system, simply speaking, the data that the application or system wants to display on the screen is delivered to Surface, and the data in Surface is delivered to SurfaceFlinger service of Android system by Surface, and the data in Surface is taken out by SurfaceFlinger service, and finally rendered to the display screen.

[0039] Inter Process Communication: a set of programming interfaces that can coordinate different processes so that they can run simultaneously in an operating system and exchange information with each other.

[0040] Seamless switching: when video stream switches between different pages, scenes or processes in an application, it can seamlessly connect the content played in the previous page or scene without loading process.

[0041] As shown in FIG. 1, in a video playing application of a certain Android version, different short videos contained in the push feed stream can be switched by up and down sliding in the first video page. Figure 1 As shown in FIG. 2, a schematic diagram of video switching in the same video page is shown, and the short video can be a film and television clip, a live video explanation, a short video made by a video producer, and the like.

[0042] When the currently played short video in the first video page is a live explanation video, and a switching instruction triggered for the live explanation video is received, the live room corresponding to the live explanation video will be switched to, i.e. the second video page is switched to, and the live video content is played in the second video page; as shown in FIG. 3, a schematic diagram of seamless switching from live video explanation page to live room page is shown, wherein the live video explanation is also called live feed. Figure 2

[0043] Feed stream: a content aggregator formed by combining a plurality of message sources subscribed by a user, which helps the user to continuously obtain the latest subscribed source content. The feed stream is an information stream that continuously updates and presents content to the user.

[0044] ​Android Activity: Activity is the basic module of Android application, generally referred to as "activity" or "page", in Android application, an Activity is usually a single screen. Simply put, Activity represents a screen that a user can see, mainly used to handle the overall work of the application, such as monitoring system events, displaying specified View for users, starting other Activity, etc. In the embodiments of the present application, the first video page and the second video page can be referred to as Android Activity.

[0045] The second video view, also referred to as the player view (View), can be a SurfaceView or a TextureView; wherein the SurfaceView provides a dedicated drawing panel embedded in the view hierarchy, which can control the format of the panel and its size, and it provides a helper thread to render to the screen;

[0046] TextureView can be used to display content streams, such as video or OpenGL scenes, which can come from a local data source or a remote data source. TextureView can only be used in a hardware-accelerated window, and when software rendering is used, TextureView will not draw anything. Unlike SurfaceView, TextureView does not get a separate window, but acts as a regular View. Therefore, users can move, transform, animate, etc. TextureView.

[0047] The word "exemplary" used in the following means "serving as an example, embodiment or illustration". Any embodiment described as "exemplary" is not necessarily to be construed as superior or better than other embodiments.

[0048] The terms "first", "second" in the text are only for the purpose of description, and cannot be understood as explicitly or implicitly indicating relative importance or implicitly indicating the number of indicated technical features. Therefore, the features defined with "first", "second" can explicitly or implicitly include one or more features, and in the description of the embodiments of the present application, unless otherwise specified, the meaning of "multiple" is two or more.

[0049] The design idea of the embodiments of the present application is briefly introduced as follows:

[0050] Embodiments of the present application relate to a scenario of video playing in a terminal device, in particular to a scenario of inter-page video switching, such as jumping from a live commentary page to a live page, jumping from a video clip playing page to a video playing page, and jumping from a short video playing page to a corresponding video playing page. In the related art, in order to realize inter-page video switching, an inter-page video switching technology is proposed.

[0051] In the related art, the inter-page video switching technology can be inter-page video switching in the same processing process, or inter-page video switching in different processing processes.

[0052] For inter-page video switching in the same processing process, since there is no address isolation problem, the player object or the player view object can be directly accessed, so after opening the page, the player view of the previous page can be passed to the new page, inter-page video switching is realized by reusing the player view, and the video stream does not need to be paused or stopped.

[0053] However, for inter-page video switching in different processing processes, i.e., a cross-processing process scenario, since the address spaces of different processing processes are isolated from each other, when opening a page in a different processing process, a new player object is usually obtained, and the obtained new player object is used to pull and download the video stream and play the video stream. Please refer to Figure 3 , Figure 3 The figure shows inter-page video switching in different processing processes in the related art. A first processing process obtains a first video page and a player object A. In the inter-page video switching process, after triggering a switching instruction, a second processing process is started. The second processing process obtains a second video page and a player object B, and renders video content to be rendered to the second video page based on the player object B.

[0054] It can be seen that the related solution has the following problems in the inter-page video switching process in different processing processes:

[0055] The initialization of the obtained player object B consumes a certain amount of time, and the player object B consumes a certain amount of time to pull the video stream corresponding to the video content, and the video stream played by the player object B has a frame skipping problem.

[0056] Since the initialization of the obtained new player object and the pulling of the video stream consume a certain amount of time, there is a long waiting time, and the played video stream has a frame skipping problem, which further causes video lag in the video switching process and reduces the smoothness of video playing.

[0057] Therefore, in order to solve the problem that due to the address space isolation between different processing processes, a player object must be newly created when video switching is performed between the pages of different processing processes, thereby increasing the time and reducing the video playing fluency, and the seamless video switching cannot be realized, a method and device for inter-page video switching, an electronic device and a storage medium are provided, the purpose of multiplexing the player of different processing processes is realized by sharing the drawing surface between different processing processes, when the first video page corresponding to the first processing process is switched to the second video page corresponding to the second processing process, the time for waiting for loading is not required, the video stream is not stuck and paused, and the effect of seamless video switching between different processing processes is achieved.

[0058] The preferred embodiments of the present application are described below in conjunction with the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to explain and illustrate the present application, and are not used to limit the present application, and the embodiments in the present application and the features in the embodiments can be combined with each other without conflict.

[0059] Please refer to Figure 4 , Figure 4 is a schematic diagram of an application scenario of the embodiments of the present application. The application scenario includes a plurality of terminal devices 110 and a server 120, and the terminal devices 110 and the server 120 can communicate with each other through a communication network.

[0060] In an optional embodiment, the communication network can be a wired network or a wireless network. Therefore, the terminal device 110 and the server 120 can be directly or indirectly connected through wired or wireless communication. For example, the terminal device 110 can be indirectly connected with the server 120 through a wireless access point, or the terminal device 110 can be directly connected with the server 120 through the Internet, which is not limited in the present application.

[0061] In the embodiments of the present application, the terminal device 110 includes but is not limited to a mobile phone, a tablet computer, a notebook computer, a desktop computer, an electronic book reader, a smart voice interaction device, a smart home appliance, a vehicle-mounted terminal, etc. Various client applications supporting video playing can be installed on the terminal device, the client application can be an application program (such as a browser or a video playing software), or a webpage, an applet, etc.

[0062] Server 120 is the backend server corresponding to the client. Server 120 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.

[0063] In the method for switching videos between pages in this application embodiment, it is mainly executed by the terminal device 110. Specifically, the terminal device 110 pulls the video stream from the server 120 and plays the video content corresponding to the video stream on the video page based on the pulled video stream.

[0064] It should be noted that, Figure 4 The examples shown are merely illustrative; in reality, the number of terminal devices 110 and servers 120 is not limited and is not specifically limited in this embodiment.

[0065] In this embodiment of the application, when there are multiple servers 120, the multiple servers 120 can form a blockchain, and the server 120 is a node on the blockchain; as disclosed in the method for video switching between pages in this embodiment of the application, the video stream involved can be stored on the blockchain.

[0066] Based on the above application scenarios, the method for video switching between pages provided by the exemplary embodiments of this application will be described below with reference to the accompanying drawings. It should be noted that the above application scenarios are only shown to facilitate understanding of the spirit and principles of this application, and the embodiments of this application are not limited in any way. Furthermore, the embodiments of this application can be applied to various scenarios, including not only video switching between pages, but also scenarios involving cloud technology, artificial intelligence, smart transportation, and assisted driving.

[0067] Please refer to Figure 5 , Figure 5 An exemplary flowchart of a video switching method is provided in an embodiment of this application, the method including:

[0068] In step S500, in response to the switching instruction triggered for the first video page, a second processing process is started; the first video page is obtained based on the first processing process, and the video content played in the first video page is displayed based on the first video view associated with the first drawing surface object corresponding to the first video page.

[0069] In this embodiment of the application, when a user launches an application that supports video playback on a terminal device, and triggers entry into such an application...Figure 2 When the first video page is clicked, the terminal device responds to the click instruction of the first video page, starts a first processing process, and obtains the first video page based on the first processing process; for example, when the video page of the live explanation video is played is received, a first video page for playing the live explanation video is created through the first processing process to obtain the first video page.

[0070] After obtaining the first video page, a first video view for carrying video content is added in the first video page, and a first drawing surface object associated with the first video view is obtained.

[0071] At the same time, the player object is obtained based on the first processing process, and the video stream pulled from the background server is rendered to the first video view associated with the first drawing surface object through the player object, so as to realize playing of the video content corresponding to the video stream in the first video page. Please refer to Figure 6 , Figure 6 A schematic diagram of obtaining a first video page by a first processing process in an embodiment of the present application.

[0072] Since the page-to-video switching technology is supported in the embodiment of the present application, the user can trigger a switching instruction in the first video page. Please refer to Figure 7 , Figure 7 A schematic diagram of switching from a first video page to a second video page based on a switching instruction in an embodiment of the present application;

[0073] Figure 7 In the example of the live video of teaching makeup, the live explanation video is currently played in the first video page, the user can click the first video page to trigger a switching instruction, for example, the first video page includes the word "click to enter the live room", at this time, the user can trigger a click operation at any position of the video explanation video played in the first video page, that is, trigger the switching instruction, at this time, a second processing process is started, and a second video page is obtained based on the second processing process, so as to realize switching from the first video page to the second video page, and display the video content played in the first video page in the second video page, at this time, the second video page is the live room of the host, and the live video of teaching makeup by the host is displayed in the second video page.

[0074] It should be noted that, Figure 7 It is only an example and is not a limitation of the embodiments of the present application, and any switching instruction triggering mode that can realize switching from the first video page to the second video page is applicable to the embodiments of the present application.

[0075] In step S501, a second video page corresponding to a second processing process is obtained, and a second drawing surface object corresponding to the second video page is obtained.

[0076] In the embodiment of the present application, a transparent second video page is obtained by the second processing process, and a second video view, such as SurfaceView or TextureView, for carrying video content is added in the second video page, and a second drawing surface object associated with the second video view is obtained based on a callback method, that is, a second drawing surface object corresponding to the second video page is obtained; please refer to Figure 8 Figure 8 A schematic diagram of obtaining a second video page by a second processing process is provided in the embodiment of the present application.

[0077] After obtaining the second drawing surface object corresponding to the second video page, the second drawing surface object is transmitted to the first processing process by the second processing process through an inter-process communication interface, and the inter-process communication interface is used to serve the communication between the first processing process and the second processing process, so that the drawing surface object in the player object is replaced by the first processing process.

[0078] In step S502, the first drawing surface object in the player object is replaced by the second drawing surface object by the first processing process, and the video content played in the first video page is rendered into the second video view associated with the second drawing surface object, so as to play the video content in the second video page. The player object is obtained based on the first processing process.

[0079] In the embodiment of the present application, after the first processing process receives the second drawing surface object transmitted by the second processing process, the first drawing surface object in the player object is saved and replaced by the second drawing surface object by the first processing process through a player interface supported by the drawing surface object switching function of the player object;

[0080] That is, the first drawing surface object is saved, and then the second drawing surface object is obtained in the player object. At this time, the player object can render the video content corresponding to the current video stream to the second video view associated with the second drawing surface object. That is, the player object renders the video content played in the first video page to the second video page of the second processing process, so as to play the video content corresponding to the same video stream in the first video page in the second video page.

[0081] By using the cross-process feature of the drawing surface object (Surface) in the Android platform, the player object of the first processing process is reused in the newly started second processing process, so that the player object renders the video corresponding to the video stream to the second video page corresponding to the second processing process, and seamless switching is realized.

[0082] ​In a possible implementation, the video content can be a live video. When the video content is a live video, in addition to playing the live video in the first video page, the comment information and the anchor information are also displayed in the first video page when the video content is played in the second video page.

[0083] Generally, when playing a live video in the second video page, in order to ensure seamless switching between the first video page and the second video page, the live video and other interface elements related to the live video need to be synchronously displayed in the second video page. Therefore, in the embodiment of the present application, the second processing process is used to obtain the object information corresponding to the live video and other interface data of the comment information except the video stream corresponding to the live video from the background server, and synchronously play the video content corresponding to the live video and the object information and the comment information in the second video page; wherein the object information includes but is not limited to: anchor avatar, anchor name, number of likes; the comment information can be comments or bullet screen comments published by the viewer, etc., as shown in the following figure. Figure 7

[0084] Since the player object is obtained based on the first processing process, the second processing process does not obtain a new player object. In order to ensure the normal playing of the video stream, the player events notified by the player object need to be perceived, such as video playing jitter, video playing error, existence of additional data in the video, etc. The player events need to be synchronously displayed in the second video page. Therefore, in a possible implementation, after the video content played in the first video page is rendered into the second video view associated with the second drawing surface object, the second processing process is used to monitor the player object obtained based on the first processing process; the inter-process communication interface is called by the first processing process to call back the player events of the player object to the second processing process; and the received player events are displayed in the second video page by the second processing process; for example, when the player event is video playing jitter, the video content played in the second video processing page will appear jitter phenomenon.

[0085] In a possible implementation, after playing the video content in the second video page, the second video page can also be exited, that is, return to the first video page, which is determined based on whether the user triggers the exit instruction for exiting the second video page. After determining that the user triggers the exit instruction for the second video page, the first video page is returned in response to the exit instruction triggered for the second video page; the second drawing surface object in the player object is reset to the first drawing surface object corresponding to the first video page by the first processing process, and at this time the corresponding video content can be continued to be played in the first video page.

[0086] ​The seamless switching effect between different processing process pages can be realized in the embodiments of the present application, because the seamless switching module is obtained in the system for switching videos between pages. Please refer to Figure 9 , Figure 9 FIG. 1 is a schematic diagram of a system architecture for switching videos between pages in the embodiments of the present application. The system architecture includes a seamless switching module. When the switching instruction triggered by the user for the first video page is implemented by the seamless switching module, the first video page is seamlessly switched to the second video page.

[0087] Generally, when two video page function modules are supported in an Android application, they are a first video page function module 1 and a second video page function module 2, and the first video page function module 1 and the second video page function module 2 are respectively running in different processing processes. There is a video stream playing logic in the first video page function module 1, that is, a player object is obtained in the first video page function module 1, and the video content corresponding to the video stream is currently played in the corresponding first video page. When the user clicks the corresponding first video page, the second video page is entered by the seamless switching module, and the first video page and the second video page play the same video stream.

[0088] In the embodiments of the present application, the seamless switching module specifically includes a local player management module, an inter-process communication interface module, a remote player management module, a player adaptation module, and a page state management module. Please refer to Figure 10 , Figure 10 FIG. 2 is a schematic diagram of another system architecture for switching videos between pages in the embodiments of the present application. In the system architecture:

[0089] The local player management module runs in the first processing process, and is used for receiving the second drawing surface object transmitted by the second processing process through the inter-process communication interface, and operating the multiplexed player object of the first processing process. The operation can include playing, pausing, setting callback, ending, etc.

[0090] The inter-process communication interface module is used for serving the communication between the first processing process and the second processing process.

[0091] The remote player management module runs in the second processing process, and is used for providing the player interface call of the player object of the first processing process, including playing, pausing, setting callback, ending, etc.

[0092] The player adaptation module runs in the second processing process, and is used for, after determining the multiplexed player object of the first processing process, calling the local player management module in the first processing process through the inter-process communication interface to multiplex the player object in the first processing process.

[0093] The page state management module runs in the second processing process, and is configured to call the player object through the player adaptation module when determining a state change of the second video page, such as opening a new page, switching to the desktop by pressing the home key, user exiting the page, and the like.

[0094] The page state management module in the embodiments of the present application is further configured to display the remaining interface elements in the second video page after the video stream is displayed to the second video page, so as to realize complete loading of the second video page.

[0095] Please refer to Figure 11 , Figure 11 A flowchart of a specific implementation method of inter-page video switching provided by the embodiments of the present application includes the following steps:

[0096] In step S1100, the first processing process is started in response to a click instruction of entering the first video page triggered by the user.

[0097] In step S1101, the first drawing surface object corresponding to the first video page and the player object are obtained through the first processing process, and the video content corresponding to the video stream is rendered in the first video view associated with the first drawing surface object through the player object, so as to play the video content in the first video page.

[0098] In step S1102, the second processing process is started in response to a switching instruction triggered for the first video page.

[0099] In step S1103, the second video page corresponding to the second processing process is obtained, and the second video view for video playing is added in the second video page.

[0100] In step S1104, the second drawing surface object associated with the second video view is obtained through the second processing process.

[0101] In step S1105, the second drawing surface object is transmitted to the first processing process through the inter-process communication interface called by the second processing process.

[0102] In step S1106, the first drawing surface object in the player object is replaced by the second drawing surface object through the player interface of the player object when the second drawing surface object is received by the first processing process.

[0103] It should be noted that the second video page is a transparent page, and since the second video page is a transparent page, the player in the first video page is not paused, and thus the user can always see the video content.

[0104] Step S1107, by the first processing process, rendering the video content played in the first video page to the second video view associated with the second drawing surface object, so as to play the video content in the second video page;

[0105] After the Surface replacement is completed, the video stream data to be rendered by the player object is rendered by the Surface object, and the video stream data is displayed "seamlessly" in the second video view in the second video page.

[0106] Step S1108, by the second processing process, based on the object information and the comment information corresponding to the live video obtained from the background server, playing the video content, the object information and the comment information in the second video page together;

[0107] After the video content is displayed in the second video page, the page state management module displays the remaining UI elements such as the object information and the comment information outside the video content, and thus the second video page is completely loaded.

[0108] Step S1109, by the second processing process, monitoring the player object obtained by the first processing process.

[0109] Step S1110, by the first processing process, calling the inter-process communication interface to call the player event of the player object to the second processing process.

[0110] Step S1111, based on the received player event, processing the video content played in the second video page by the second processing process.

[0111] Step S1112, in response to the exit instruction triggered for the second video page, returning to the first video page.

[0112] Step S1113, by the first processing process, resetting the second drawing surface object in the player object to the first drawing surface object corresponding to the first video page.

[0113] In the embodiment of the application, when the first video page is switched to the second video page, the second processing process does not need to obtain a new player object to play the video stream, but reobtains a second drawing surface object corresponding to the second video page based on the player object obtained by the first processing process, so as to achieve the purpose of multiplexing the player object between different processing processes. The video content that needs to be rendered by the player object is rendered to the second video view associated with the second drawing surface object, without the need to pull the video stream corresponding to the video content again, so that the video consistent with the video content in the first video page can be played in the second video page, the time consumed by the initialization of the obtained new player object and the time consumed by the pulling of the video stream are avoided, the frame skipping phenomenon existing when the new player object plays the video content corresponding to the video stream is avoided, the fluency of the video content playing is improved, and the seamless switching of the video between the pages corresponding to different processing processes is achieved.

[0114] Based on the same inventive concept as the above method embodiments of the application, the embodiment of the application further provides a device for switching video between pages. The principle of the device for solving the problem is similar to that of the above method embodiments, and therefore the implementation of the device can be referred to the implementation of the above method, and the repeated parts will not be described herein.

[0115] For reference Figure 12 , Figure 12 An embodiment of the application exemplarily provides a device 1200 for switching video between pages, which comprises:

[0116] A starting unit 1201 is configured to start a second processing process in response to a switching instruction triggered for a first video page. The first video page is obtained based on a first processing process, and the video content played in the first video page is displayed based on a first video view associated with a first drawing surface object corresponding to the first video page.

[0117] An obtaining unit 1202 is configured to obtain a second video page corresponding to the second processing process, and obtain a second drawing surface object corresponding to the second video page.

[0118] A rendering unit 1203 is configured to replace, by the first processing process, a first drawing surface object in a player object with a second drawing surface object, and render the video content played in the first video page to a second video view associated with the second drawing surface object, so as to play the video content in the second video page. The player object is obtained based on the first processing process.

[0119] In a possible implementation, the video content is a live video.

[0120] The rendering unit 1203 is specifically configured to:

[0121] The object information and the comment information corresponding to the live video are obtained from the background server by the second processing process, and the video content, the object information and the comment information corresponding to the live video are played together in the second video page.

[0122] In a possible implementation, the rendering unit 1203 is further configured to:

[0123] After the video content played in the first video page is rendered into the second video view associated with the second drawing surface object, the second processing process monitors the player object obtained based on the first processing process;

[0124] The rendering unit 1203 is further configured to:

[0125] The received player event is displayed in the second video page by the second processing process.

[0126] In a possible implementation, the rendering unit 1203 is further configured to:

[0127] After the video content is played in the second video page, in response to an exit instruction triggered for the second video page, the first video page is returned.

[0128] The second drawing surface object in the player object is reset to the first drawing surface object corresponding to the first video page by the first processing process.

[0129] In a possible implementation, the obtaining unit 1202 is further configured to:

[0130] After the second drawing surface object corresponding to the second video page is obtained, the second processing process calls the inter-process communication interface to pass the second drawing surface object to the first processing process.

[0131] In a possible implementation, the rendering unit 1203 is specifically configured to:

[0132] The first drawing surface object in the player object is replaced by the second drawing surface object by the first processing process calling the player interface.

[0133] In the embodiments of the present application, when the video content played in the first video page corresponding to the first processing process is switched to the second video page corresponding to the second processing process, the second processing process does not need to obtain a new player object again, but multiplexes the player object obtained based on the first processing process with the first processing process. Since a new player object does not need to be obtained again, the time consumed by the initialization of the new player object and the time consumed by the new player object to pull the video stream corresponding to the video content to be played, and the frame skipping problem existing in the process of playing the video stream by the new player object are avoided. Since the time consumption is avoided, the time for waiting for the loading of the video stream is reduced, the video content corresponding to the video stream is ensured not to be stuck and paused, and the fluency of video playing in the process of switching the video between different processing process pages is improved, and the seamless switching effect between different processing process pages is achieved.

[0134] For the convenience of description, each part is described as a module (or unit) according to the function. Of course, in the implementation of the present application, the functions of each module (or unit) can be implemented in the same or multiple software or hardware.

[0135] After introducing the method and device for switching the video between pages according to the example embodiments of the present application, next, the device for switching the video between pages according to another example embodiment of the present application is introduced.

[0136] Those skilled in the art can understand that each aspect of the present application can be implemented as a system, a method or a program product. Therefore, each aspect of the present application can be specifically implemented as a complete hardware embodiment, a complete software embodiment (including firmware, microcode, etc.), or an embodiment combined with hardware and software, which can be collectively referred to as "circuit", "module" or "system" here.

[0137] In some possible embodiments, the device for switching the video according to the present application can at least include a processing unit and a storage unit. The storage unit stores program code, which, when executed by the processing unit, causes the processing unit to perform the steps in the method for switching the video between pages according to various example embodiments of the present application described in the present specification. For example, the processing unit can perform the steps as shown in Figure 5 .

[0138] After introducing the method and device for switching the video between pages according to the example embodiments of the present application, next, the electronic device according to an example embodiment of the present application is introduced.

[0139] Based on the same inventive concept as the above method embodiments of the present application, the electronic device is also provided in the embodiments of the present application. Please refer to Figure 13 , Figure 13An exemplary structure diagram of an electronic device in the embodiments of the present application is provided, and the electronic device includes a communication component 1310, a memory 1320, a display unit 1330, a camera 1340, a sensor 1350, an audio circuit 1360, a Bluetooth module 1370, a processor 1380, and the like.

[0140] The communication component 1310 is configured to communicate with a server. In some embodiments, a wireless fidelity (WiFi) module can be included, which belongs to a short-range wireless transmission technology. The electronic device can help the user to send and receive information through the WiFi module.

[0141] The memory 1320 can be used to store software programs and data. The processor 1380 executes various functions and data processing of the terminal device by running the software programs or data stored in the memory 1320. The memory 1320 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state memory device. The memory 1320 stores an operating system that enables the terminal device to operate. In the present application, the memory 1320 can store the operating system and various application programs, and can also store the code for executing the method of inter-page video switching in the embodiments of the present application.

[0142] The display unit 1330 can also be used to display information input by the user or information provided to the user, as well as the graphical user interface (GUI) of various menus of the terminal device. Specifically, the display unit 1330 can include a display screen 1332 obtained on the front of the terminal device. The display screen 1332 can be configured in the form of a liquid crystal display, a light-emitting diode, and the like. The display unit 1330 can be used to display videos, interface elements, and the like in the embodiments of the present application.

[0143] The display unit 1330 can also be used to receive input digital or character information, and generate signal inputs related to the user obtaining and function control of the terminal device. Specifically, the display unit 1330 can include a touch screen 1331 obtained on the front of the terminal device, which can collect touch operations of the user thereon or therearound, such as clicking buttons, dragging scroll boxes, and the like.

[0144] The touch screen 1331 can be overlaid on the display screen 1332, or the touch screen 1331 can be integrated with the display screen 1332 to realize the input and output functions of the terminal device. After integration, it can be referred to as a touch display screen. In the present application, the display unit 1330 can display application programs and corresponding operation steps.

[0145] The camera 1340 can be used to capture still images, which the user can post comments on through the application. The camera 1340 can be one or more. An object generates an optical image through a lens and projects it onto a photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, which is then transmitted to the processor 1380 to convert into a digital image signal.

[0146] The terminal device can also include at least one sensor 1350, such as an acceleration sensor 1351, a distance sensor 1352, a fingerprint sensor 1353, a temperature sensor 1354. The terminal device can also be configured with a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, a light sensor, a motion sensor, and other sensors.

[0147] The audio circuit 1360, the speaker 1361, and the microphone 1362 can provide an audio interface between the user and the terminal device. The audio circuit 1360 can convert the received audio data into an electrical signal and transmit it to the speaker 1361, which converts it into a sound signal for output. The terminal device can also be configured with a volume button for adjusting the volume of the sound signal. On the other hand, the microphone 1362 converts the collected sound signal into an electrical signal, which is received by the audio circuit 1360 and converted into audio data, which is then output to the communication component 1310 for transmission to another terminal device, for example, or to the storage 1320 for further processing.

[0148] The Bluetooth module 1370 is used to interact with other Bluetooth devices with Bluetooth modules through Bluetooth protocols. For example, the terminal device can establish a Bluetooth connection with a wearable electronic device (such as a smart watch) that also has a Bluetooth module through the Bluetooth module 1370, and thus exchange data.

[0149] The processor 1380 is the control center of the terminal device, which connects all parts of the terminal through various interfaces and lines, and performs various functions of the terminal device and processes data by running or executing software programs stored in the memory 1320 and calling data stored in the memory 1310. In some embodiments, the processor 1380 can include one or more processing units; the processor 1380 can also integrate an application processor and a baseband processor, wherein the application processor mainly processes operating systems, user interfaces, and application programs, and the baseband processor mainly processes wireless communication. It can be understood that the above-mentioned baseband processor can also not be integrated into the processor 1380. In this application, the processor 1380 can run an operating system, an application program, a user interface display and a touch response, and a method for viewing application data according to the embodiments of the application. In addition, the processor 1380 is coupled with the display unit 1330.

[0150] In some possible implementation manners, various aspects of the method for switching video between pages provided in the present application can also be implemented in the form of a program product, which includes a computer program for causing an electronic device to perform the steps in the method for switching video between pages according to various exemplary embodiments of the present application described above in the specification when the program product is run on the electronic device, for example, the electronic device can perform the steps as shown in Figure 5 .

[0151] The program product can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium may, for example, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or apparatus, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: electrical connections having one or more wires, portable disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROMs), optical storage devices, magnetic storage devices, or any suitable combination of the above.

[0152] The program product of the embodiments of the present application can adopt a portable compact disk read-only memory (CD-ROM) and include a computer program, and can be run on a computing device. However, the program product of the present application is not limited to this, and in this document, the readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with a command execution system, device or apparatus.

[0153] A readable signal medium can include a computer program readable computer program code, data signals, and / or computer program product embodied in a carrier or transmittable carrier wave / s.

[0154] The computer program product can be transmitted by any medium of transmission that can be available during the time of first enabling the computer program product. For example, the computer program product can be transmitted from a management server in the network core to a mobile device in the network edge via the Internet or a wireless network.

[0155] It should be noted that although several units or sub-units are mentioned in the above detailed description, the division into such units or sub-units is only illustrative and not mandatory. In fact, depending on the implementation, features and functionalities of two or more units described above can be embodied in a single unit. Conversely, a unit described above can be split into several sub-units to achieve the features and functionalities described.

[0156] Moreover, while operations of the method of the present application are described in a particular order in the drawings, this is not meant to imply that the operations must be performed in that particular order, or that all illustrated operations must be performed to achieve the desired result. Additionally or alternatively, certain steps can be omitted, combined, performed in an order different from that shown, or performed concurrently.

[0157] Those skilled in the art will appreciate that embodiments of the present application can be devised for a method, a system, or a computer program product. Accordingly, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application can take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage devices, etc.) embodying computer programs instructing one or more computer(s) to operate as taught by embodiments of the present application.

[0158] While preferred embodiments of the application have been described, those skilled in the art will appreciate that other modifications than those specifically described can be made within the scope of the present application. Accordingly, all modifications are intended to be included within the scope of the application in accordance with the approved scope of equivalents in the appended claims.

[0159] Obviously, numerous modifications and variations of the present application are possible in light of the above teachings. It is therefore to be understood that within the scope of the appended claims and their equivalents, the application can be practiced otherwise than as specifically described.

Claims

1. A method of inter-page video switching, the method comprising: The method comprises: starting a second processing process in response to a switching instruction triggered for a first video page; the first video page is obtained based on a first processing process, and video content played in the first video page is displayed based on a first video view associated with a first drawing surface object corresponding to the first video page; obtaining a transparent second video page corresponding to the second processing process, and obtaining a second drawing surface object corresponding to the second video page; through the second processing process, an inter-process communication interface is called to pass the second drawing surface object to the first processing process; through the first processing process, the first drawing surface object in the player object is replaced by the second drawing surface object, and the video content played in the first video page is rendered into the second video view associated with the second drawing surface object to play the video content in the second video page, and the player object is obtained based on the first processing process; through the second processing process, the player object is detected, and through the first processing process, an inter-process communication interface is called to call a player event callback corresponding to the player object to the second processing process; based on the received player event, the video content displayed in the second video page is processed through the second processing process; in response to an exit instruction triggered for the second video page, the drawing surface object in the player object is reset through the first processing process.

2. The method of claim 1, wherein, The video content is a live video; The video content is played in the second video page, specifically comprising: through the second processing process, object information and comment information corresponding to the live video are obtained from a background server, and the video content corresponding to the live video, the object information and the comment information are played together in the second video page.

3. The method of claim 1, wherein, When the page state of the second video page is to return to the first video page, the response to the exit instruction triggered for the second video page, through the first processing process, calling the player object, resetting the drawing surface object in the player object, comprises: in response to an exit instruction triggered for the second video page, return to the first video page; through the first processing process, the second drawing surface object in the player object is reset to the first drawing surface object corresponding to the first video page.

4. The method according to any one of claims 1 to 3, characterized in that, The first drawing surface object is replaced by the second drawing surface object, comprising: through the first processing process, a player interface is called to replace the first drawing surface object in the player object with the second drawing surface object.

5. An apparatus for inter-page video switching, the apparatus comprising: The device comprises: The starting unit is configured to start a second processing process in response to a switching instruction triggered for a first video page, the first video page being obtained based on a first processing process, and video content played in the first video page being displayed based on a first video view drawn in a first drawing surface object corresponding to the first video page; The obtaining unit is configured to obtain a transparent second video page corresponding to the second processing process, and obtain a second drawing surface object corresponding to the second video page; and pass the second drawing surface object to the first processing process by calling an inter-process communication interface by the second processing process; The rendering unit is configured to replace the first drawing surface object in a player object with the second drawing surface object by the first processing process, and render the video content played in the first video page into a second video view drawn in the second drawing surface object, so as to play the video content in the second video page, the player object being obtained based on the first processing process; The second processing process detects the player object, and calls a player event corresponding to the player object to the second processing process by the first processing process calling an inter-process communication interface; The second processing process processes the video content displayed in the second video page based on the received player event; The first processing process calls the player object to reset the drawing surface object in the player object in response to an exit instruction triggered for the second video page.

6. The apparatus of claim 5, wherein, The video content is a live video; The rendering unit is specifically configured to: The second processing process obtains object information and comment information corresponding to the live video from a background server, and plays the video content corresponding to the live video, the object information and the comment information together in the second video page.

7. The apparatus of claim 5, wherein, When the page state of the second video page is to return to the first video page, the rendering unit is further configured to: After playing the video content in the second video page, the rendering unit returns to the first video page in response to an exit instruction triggered for the second video page; The first processing process resets the second drawing surface object in the player object to the first drawing surface object corresponding to the first video page.

8. The apparatus of any one of claims 5-7, wherein, The rendering unit is specifically configured to: The first processing process calls a player interface to replace the first drawing surface object in a player object with the second drawing surface object.

9. An electronic device, comprising: The device comprises a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the computer program causes the processor to execute the steps of the method in any one of claims 1-4.

10. A computer-readable storage medium, characterized in that, The device comprises a computer program, and when the computer program is executed on the electronic device, the computer program is configured to cause the electronic device to execute the steps of the method in any one of claims 1-4.

11. A computer program product, characterised in that, The computer program product includes a computer program stored in a computer readable storage medium; when a processor of an electronic device reads the computer program from the computer readable storage medium, the processor executes the computer program, so that the electronic device executes the steps of any one of the methods in claims 1-4.

Citation Information

Patent Citations

  • Video playing method and device, terminal and storage medium

    CN110582017A

  • Data display control method and device, electronic equipment and storage medium

    CN112492332A