Page switching method and device, electronic equipment and storage medium
By switching the rendering surface during page switching in the video social software and setting a transparent window, the problem of video pause during page switching is solved, and the smooth continuation and continuous playback of the video is achieved.
Patent Information
- Application Number
- CN202310715831.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-15
- Publication Date
- 2024-12-17
AI Technical Summary
Existing video social software will cause video pauses when switching pages, and cannot achieve smooth video resumption.
When switching the page, the rendering surface of the current video is switched to the target surface, and set the target surface as a transparent window before switching, until the first frame is rendered successfully, ensure continuous playback of the video.
It realizes smooth playback of videos when switching pages, avoids the sense of lag and ensures the video's continuation effect.
Smart Images

Figure CN119149840A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to Internet technology, and more particularly to a page switching method, device, electronic device, and storage medium. Background Art
[0002] With the rapid development of the Internet, users can easily browse multimedia through media social software. Taking video social software as an example, existing video social software will provide at least two video playback pages for the same video when displaying videos, and users can select one of the video playback pages to browse the video according to their needs.
[0003] Currently, when a user switches video playback pages, the video played on the page before the switch is paused and the video playback progress is recorded. After entering the page after the switch, the video is restarted and the progress of the video is moved to the video playback progress recorded before the switch to achieve the continued playback of the video. However, this continued playback solution will cause the video to pause at the moment of page switching. Summary of the invention
[0004] The present disclosure provides a page switching method, device, electronic device and storage medium to solve the technical problem of video freeze during page switching.
[0005] In a first aspect, an embodiment of the present disclosure provides a page switching method, including:
[0006] Display the first play page of the video;
[0007] In response to a page switching operation on the first play page, the current surface of the first play page for rendering the video is switched to a target surface of the second play page for rendering the video, and before successfully switching to the target surface, the application window corresponding to the target surface is a transparent window;
[0008] After the first frame is successfully rendered on the target surface, the video is displayed on the second playback page.
[0009] In a second aspect, the embodiment of the present disclosure further provides a page switching device, including:
[0010] A first display module, used to display a first play page of the video;
[0011] a switching module, configured to, in response to a page switching operation on the first play page, switch a current surface of the first play page for rendering the video to a target surface of a second play page for rendering the video, wherein before successfully switching to the target surface, the application window corresponding to the target surface is a transparent window;
[0012] The second display module is used to display the video on the second playback page after the first frame is successfully rendered on the target surface.
[0013] In a third aspect, an embodiment of the present disclosure further provides an electronic device, characterized in that the electronic device includes:
[0014] one or more processing devices;
[0015] a storage device for storing one or more programs,
[0016] When the one or more programs are executed by the one or more processing devices, the one or more processing devices implement the page switching method provided in the embodiment of the present disclosure.
[0017] In a fourth aspect, an embodiment of the present disclosure further provides a storage medium comprising computer executable instructions, which, when executed by a computer processor, are used to execute the page switching method provided in the embodiment of the present disclosure.
[0018] In the disclosed embodiment, a first playback page of a video is displayed; in response to a page switching operation on the first playback page, the current surface of the first playback page used for rendering the video is switched to a target surface of a second playback page used for rendering the video, and before successfully switching to the target surface, the application window corresponding to the target surface is a transparent window; after the first frame is successfully rendered on the target surface, the video is displayed on the second playback page. The disclosed embodiment solves the problem that the video will pause at the moment of page switching, and ensures smooth playback of the video when the page is switched. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0020] Figure 1 is a flow chart of a page switching method provided by an embodiment of the present disclosure;
[0021] Figure 2 This is a flow chart of another page switching method provided by an embodiment of the present disclosure;
[0022] Figure 3 It is a schematic diagram of the principle of a page switching method provided by an embodiment of the present disclosure;
[0023] Figure 4 It is a schematic diagram of the principle of another page switching method provided by an embodiment of the present disclosure;
[0024] Figure 5 is a schematic diagram of the structure of a page switching device provided by an embodiment of the present disclosure;
[0025] Figure 6 It is a structural schematic diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0026] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0027] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0028] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0029] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0030] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0031] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0032] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0033] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.
[0034] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0035] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0036] It is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.
[0037] In video social software, a video can have at least one playback page, and different playback pages can realize different functions. For example, one playback page can be a details page for playing a video, and the details page can be a page for users to operate the video itself. The playback page can display a progress bar of the video playback progress and information identifying the viewing angle; for example, another playback page can be a recommendation page for the video, and the video can be commented on and forwarded on the recommendation page.
[0038] When switching pages, the video needs to continue playing. In a scenario, the user browses the video on the recommendation page of the application (or the video list page similar to the recommendation page), and the user can click the "View Details" button to enter the details page to continue watching. After watching, you can return to the recommendation page from the details page and continue to watch the rest of the video from the recommendation page. There is no limitation on the button here, as long as it can achieve the switching of the playback page. The button does not necessarily display "View Details", it can also display "View Panoramic Video" and other words.
[0039] The current general technical solution is to pause the current page and record the current progress when switching pages, and then restart the video and move to the recorded progress after entering the new page. This will cause the video to pause at the moment of switching. Virtual Reality (VR) videos can rotate the viewing angle, and the gap between adjacent frames may be large, so this problem will be more obvious.
[0040] In order to switch between two video playback pages and ensure smooth video playback without any jitters in the scenario where the video needs to be played continuously, the present invention provides a page switching method. Figure 1 It is a flow chart of a page switching method provided by an embodiment of the present disclosure. The embodiment of the present disclosure is applicable to situations where video fluency is ensured when switching pages. The method can be executed by a page switching device, which can be implemented in the form of software and / or hardware, and optionally, by an electronic device, which can be a mobile terminal, a PC or a server, etc.
[0041] like Figure 1 As shown, the method includes:
[0042] S110: Display the first play page of the video.
[0043] The first play page may be a page for playing videos, the first play page may be a page displayed on the homepage of the application, and the first play page may include multiple controls, such as controls for following, commenting on, and collecting videos. In this embodiment, switching between different videos in the first play page may be achieved by sliding the first play page up and down. The first play page may be a list page of videos, such as a recommendation page.
[0044] This step can display the first play page in the application (such as the homepage of the application) to play the video. The video can be a panoramic video, and the user can watch the video from different angles by adjusting the angle of the mobile phone.
[0045] S120: In response to a page switching operation on the first play page, switch a current surface of the first play page for rendering the video to a target surface of a second play page for rendering the video.
[0046] The page switching operation can be considered as an operation of switching the playback page, such as switching the first playback page to the second playback page. The operation method of the page switching operation is not limited here, and can be set according to actual needs, as long as the page switching can be achieved. For example, the page switching can be achieved by sliding the screen, or by clicking a button on the screen. This embodiment does not limit the sliding method, nor does it limit the position of the button in the first playback page and the words presented.
[0047] The player can be used to play audio and video. The first play page and the second play page share the same player. The surface is also called Surface. In Android applications, each Activity component is associated with one or more windows. Each window corresponds to a Surface, which is used to render the user interface (UI) of the window, such as video, on the Surface.
[0048] The current surface can be considered as the surface used for currently rendering the video. Since the first play page is currently displayed, the current surface corresponds to the first play page. The target surface can be considered as the surface corresponding to the second play page, such as the surface used for rendering the video on the second play page.
[0049] When a page switching operation is obtained, the video will be played on the second play page, so the current surface is switched to the target surface to switch the surface so that the video can be played on the second play page. The current surface is the surface used to render the video on the first play page. The target surface is the surface used to render the video on the second play page. The first play page and the second play page play the same video.
[0050] This step does not limit the technical means of switching, for example, the surface switching can be achieved by setting a surface method (such as set surface).
[0051] Before successfully switching to the target surface, the application window corresponding to the target surface is a transparent window. The application window is also called an Activity group, which can be created after detecting a page switching operation. Before successfully switching to the target surface, the transparent application window allows the user to see the screen of the first playback page to avoid the problem of a momentary black screen.
[0052] In this embodiment, when the current surface is switched to the target surface, there will be a switching process. During the switching process, the application window of the target surface can be made transparent. After the switching is completed, the application window of the target surface can be displayed, so that the same video is switched from the first playback page to the second playback page for playback, and a continuous playback effect is presented.
[0053] S130: After the first frame is successfully rendered on the target surface, display the video on the second playback page.
[0054] The first frame can be the first frame of the video rendered on the target surface. After the first frame is rendered successfully, the video can be displayed on the second playback page. For example, the application window of the target surface can be set to opaque so that the second playback page covers the first playback page to display the video.
[0055] Before the first frame is successfully rendered on the target surface, the video is displayed on the first playback page through the transparent target surface application window. After the first frame is successfully rendered on the target surface, the video is displayed on the second playback page, thereby achieving smooth video playback.
[0056] The technical solution of the disclosed embodiment is to display the first playback page of the video; in response to the page switching operation on the first playback page, the current surface of the first playback page used to render the video is switched to the target surface of the second playback page used to render the video, and before successfully switching to the target surface, the application window corresponding to the target surface is a transparent window; after the first frame is successfully rendered on the target surface, the video is displayed on the second playback page. After detecting the page switching operation of the first playback page, the surface is switched, and before successfully switching the surface to the target surface, the application window of the target surface is set to be transparent. After rendering the first frame on the target surface, the video is displayed on the second playback page, which solves the problem that the video will pause at the moment of page switching, so that when switching pages, the video plays smoothly without any lag.
[0057] Based on the above embodiment, a variant embodiment of the above embodiment is proposed. It should be noted that in order to make the description concise, only the differences from the above embodiment are described in the variant embodiment.
[0058] In one embodiment, the page switching method further includes:
[0059] When an exit operation of exiting the second playback page is detected, switching the target surface to the current surface;
[0060] After the first frame is successfully rendered on the current surface, the video is displayed on the first playback page.
[0061] The exit operation can be considered as an operation of exiting the second play page. The exit operation can exit the second play page to the first play page. After obtaining the exit operation, you can exit the display of the video on the second play page and switch to displaying the video on the first play page.
[0062] This embodiment does not limit the operation method of the exit operation. For example, the second play page can be exited by sliding the screen or by clicking the control on the screen.
[0063] This embodiment does not limit the method of switching surfaces, for example, the switching of surfaces can be achieved by setting a surface method. During the process of switching surfaces, the video can continue to be displayed on the second playback page. After the first frame is successfully rendered on the current surface, the video is displayed on the first playback page. The first frame on the current surface can be considered to be the first frame rendered after the video is switched back to the current surface.
[0064] This embodiment does not limit the means for determining whether the first frame on the current surface is successfully determined. For example, it can be determined by event detection or by duration.
[0065] When switching to the current surface, this embodiment determines whether the first frame on the current surface is rendered successfully. If the rendering is successful, the video is played on the first playback page. Before the rendering is unsuccessful, the video continues to be played on the second playback page, so that when switching from the second playback page to the first playback page, the video can be played smoothly.
[0066] In one embodiment, the first frame on the current surface is successfully rendered after a set time period after the target surface is switched to the current surface.
[0067] The set duration can be a pre-set duration, and the duration can be based on a frame number constraint. For example, before displaying the video through the first playback page, wait for 1-3 frames. If you wait for two frames, the duration corresponding to one frame is fixed, then the duration corresponding to two frames can be the set duration. After the setting duration, it can be considered that the rendering of the first frame on the current surface is completed, and the video is on the first playback page.
[0068] In one embodiment, the target surface corresponding to the second playback page is destroyed after the first frame is successfully rendered on the current surface.
[0069] The target surface can be destroyed after the first frame of the current surface is rendered, so that the current surface displays the video and further reduces the storage capacity of the electronic device.
[0070] In one embodiment, the video is a panoramic video, and when the video is switched to be displayed on the second play page, the absolute positions of the video played on the first play page and the video played on the second play page are the same.
[0071] Panoramic videos can be considered as videos shot in all directions, such as 360-degree videos. When a panoramic video is browsed, the viewing angle can be rotated, and the parallax of adjacent frames may be large, so the freeze of the panoramic video will be more obvious during the page switching process. The use of the page switching method provided by the present disclosure to play a panoramic video can more significantly solve the technical problem of video freeze.
[0072] When switching between the first play page and the second play page, the absolute positions of the video played on the first play page and the video played on the second play page are the same, so that there is no jump feeling in the video when the page is switched.
[0073] Figure 2 is another flow chart of a page switching method provided by an embodiment of the present disclosure. This embodiment refines the operation of switching surfaces. Figure 2 , the page switching method comprises the following steps:
[0074] S210: Display the first play page of the video.
[0075] S220: In response to the page switching operation of the first play page, create and make transparent an application window of the second play page.
[0076] After acquiring the page switching operation, the present embodiment can create an application window for the second play page. After creation, the application window for the second play page can be made transparent to ensure that the user can see the previous interface before the target surface is successfully switched, avoiding the problem of instant black screen.
[0077] S230: Associate the player with the second play page, and maintain the play status of the player.
[0078] The player can be considered as a palyer under the Android system, which can play audio and video. In this step, the player can be associated with the second play page, so that the second play page and the first play page share the player. During the page switching process, this embodiment maintains the play state of the player to avoid the problem of video freeze.
[0079] This embodiment does not limit the technical means for maintaining the playing state of the player, as long as the player is always in the playing state.
[0080] In one embodiment, maintaining the playing state of the player includes:
[0081] Intercept the pause method of the player.
[0082] This embodiment intercepts the pause method of the player. The pause method can be considered as a method for the player to pause playback. The prior art will pause the player when switching pages. This embodiment can prevent the player from pausing by intercepting the pause method of the player, so that the player is always in the playback state.
[0083] In this embodiment, the first play page and the second play page share the same player, and when the page is switched, only the Surface is switched without changing the player state, so that the user does not feel paused.
[0084] S240: Use the surface setting method of the player to switch the current surface of the first play page for rendering the video to the target surface of the second play page for rendering the video.
[0085] The set surface method can be considered as a configuration interface of the player, which can be used to set the Surface for video rendering. In this step, the surface for rendering the video can be switched from the current surface to the target surface by setting the surface method, so that the video can be played on the second playback page.
[0086] S250: After the first frame is successfully rendered on the target surface, display the video on the second playback page.
[0087] The page switching method provided in this embodiment shares the player and maintains the player's playing state when switching between the first play page and the second play page, so that the user does not feel a sense of lag. The surface switching is conveniently realized by setting the surface method. After the page switching operation is obtained, the application window of the second play page is created and transparent, so that the content of the first play page is displayed before the first frame is successfully rendered on the target surface, avoiding the technical problem of a momentary black screen.
[0088] The present disclosure is described exemplarily below. The page switching method provided by the present disclosure can be a method for continuous playback of Android page switching. When entering from an external stream to an internal stream, it is necessary to ensure that the video playback is uninterrupted while entering a new activity (i.e., the application window corresponding to the target surface), and the user does not feel a pause. The external stream can be the video stream corresponding to the first playback page, and the internal stream can be the video stream corresponding to the second playback page.
[0089] At the player level, pause (i.e., pause method) and play are intercepted, and setSurfaceDirectly (i.e., setting surface method) is used to switch the rendering target, so that the player can keep playing, especially the sound is uninterrupted. The screen may be interrupted by 1-2 frames, which requires the following other strategies (such as transparent activity and delayed exit) to make up for it.
[0090] Transparent activity: The in-stream activity is set to transparent (i.e., the application window of the second playback page is transparent). Before the surface is successfully switched (i.e., before the target surface is successfully switched, the application window corresponding to the target surface is a transparent window), the user is guaranteed to be able to see the previous interface, thus avoiding the problem of a momentary black screen. The components of the in-stream activity are displayed after the first frame is successfully rendered (i.e., after the first frame is successfully rendered on the target surface, the video is displayed on the second playback page).
[0091] When entering the inner stream, the surface (i.e., the current surface) and player (i.e., the player) of the outer stream are passed in. The surface passed in to the outer stream can determine the surface to exit to when exiting the inner stream. When exiting the inner stream, you can exit to the surface of the outer stream. Passing in the player can allow the inner stream to determine the player shared with the outer stream.
[0092] Delayed exit: When exiting the internal stream, first use setSurfaceDirectly to complete the switching of the rendering target, and then wait for the first frame to be rendered successfully before actually exiting (that is, after the first frame is rendered successfully on the current surface, the video is displayed on the first playback page). The player does not provide a callback for successful rendering, so in theory, you only need to wait for 1, 2, or 3 frames. Otherwise, the screen will flash back when exiting. There is no limit on the number of frames to wait for here, and the set duration can be determined based on the number of frames to wait for. The time required to wait for the number of frames can be the set duration.
[0093] The present invention adapts the video cropping logic to ensure that the absolute position of the video remains unchanged during switching (that is, when the video is switched to the second playback page, the absolute positions of the video played on the first playback page and the video played on the second playback page are the same), and there will be no sense of jump.
[0094] Figure 3 is a schematic diagram of the principle of a page switching method provided by an embodiment of the present disclosure, see Figure 3 , the outflow surface 1 displays the video on the first playback page through the player. After obtaining the page switching operation, the player can switch the surface, such as first creating an application window for the second playback page, and making the application window of the internal flow, that is, the activity transparent, and the outflow still stays in the frame before the switch. Figure 3 It can be seen that the target surface, i.e., inner flow surface 2, is located on the upper layer of outer flow surface 1, but because the application window of inner flow surface 2 is set to transparent, inner flow surface 2 is not displayed. After the first frame rendering is completed on inner flow surface 2, the inner flow page UI can be displayed.
[0095] Figure 4 This is a schematic diagram of the principle of another page switching method provided by an embodiment of the present disclosure. After detecting the exit operation of the second playback page, the surface can be switched. During the switching process, the inner stream surface 2 can continue to be displayed for two to three frames, and then the inner stream surface 2 is destroyed. After the first frame rendering is completed on the outer stream surface 1, the video is displayed on the outer stream surface 1.
[0096] Figure 5is a schematic diagram of a page switching device structure provided by an embodiment of the present disclosure, such as Figure 5 As shown, the device comprises:
[0097] A first display module 510, used to display a first play page of a video;
[0098] A switching module 520, configured to, in response to a page switching operation on the first play page, switch a current surface of the first play page for rendering the video to a target surface of a second play page for rendering the video, wherein before successfully switching to the target surface, the application window corresponding to the target surface is a transparent window;
[0099] The second display module 530 is used to display the video on the second play page after the first frame is successfully rendered on the target surface.
[0100] The technical solution provided by the embodiment of the present disclosure solves the problem that the video may pause at the moment of page switching, so that the video plays smoothly without any lag when switching pages.
[0101] In one embodiment, the switching module 520 includes:
[0102] A creating unit, used for creating and transparentizing an application window of a second playing page in response to a page switching operation of the first playing page;
[0103] an associating unit, used to associate the player with the second playing page and maintain the playing state of the player;
[0104] A switching unit is used to use the surface setting method of the player to switch the current surface of the first playback page used for rendering the video to the target surface of the second playback page used for rendering the video.
[0105] In one embodiment, the association unit is specifically configured to:
[0106] Intercept the pause method of the player.
[0107] In one embodiment, the page switching device further includes a third display module, which is used to:
[0108] When an exit operation of exiting the second playback page is detected, switching the target surface to the current surface;
[0109] After the first frame is successfully rendered on the current surface, the video is displayed on the first playback page.
[0110] In one embodiment, the first frame on the current surface is successfully rendered after a set time period after the target surface is switched to the current surface.
[0111] In one embodiment, the target surface corresponding to the second playback page is destroyed after the first frame is successfully rendered on the current surface.
[0112] In one embodiment, the video is a panoramic video, and when the video is switched to be displayed on the second play page, the absolute positions of the video played on the first play page and the video played on the second play page are the same.
[0113] The page switching device provided in the embodiments of the present disclosure can execute the page switching method provided in any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
[0114] It is worth noting that the various units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the embodiments of the present disclosure.
[0115] Figure 6 Schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure. Figure 6 , which shows an electronic device (eg, Figure 6 A schematic diagram of the structure of a terminal device or server) 500.
[0116] In this embodiment, the electronic device 500 includes:
[0117] One or more processing devices 501;
[0118] The storage device 508 is used to store one or more programs.
[0119] When the one or more programs are executed by the one or more processing devices 501 , the one or more processing devices 501 implement the page switching method as described in the present disclosure.
[0120] The terminal devices in the embodiments of the present disclosure may include but are not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., as well as fixed terminals such as digital TVs, desktop computers, etc. Figure 6 The electronic device 500 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0121] like Figure 6 As shown, the electronic device 500 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the electronic device 500 are also stored. The processing device 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An edit / output (I / O) interface 505 is also connected to the bus 504.
[0122] Typically, the following devices may be connected to the I / O interface 505: an input device 506 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 507 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 508 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 509. The communication device 509 may allow the electronic device 500 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 6 The electronic device 500 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0123] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 509, or installed from a storage device 508, or installed from a ROM 502. When the computer program is executed by the processing device 501, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0124] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0125] The electronic device provided by the embodiment of the present disclosure and the page switching method provided by the above embodiment belong to the same inventive concept. The technical details not fully described in this embodiment can be referred to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.
[0126] An embodiment of the present disclosure provides a computer storage medium on which a computer program is stored. When the program is executed by a processor, the page switching method provided by the above embodiment is implemented.
[0127] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the two.
[0128] The computer storage medium may be a storage medium of computer executable instructions, which, when executed by a computer processor, are used to perform the methods provided by the present disclosure.
[0129] Computer readable storage media may be, for example, but not limited to: electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or devices, or any combination thereof. More specific examples of computer readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate, or transmit a program used by or in combination with an instruction execution system, device, or device. The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to: wire, optical cable, RF (radio frequency), etc., or any suitable combination of the foregoing.
[0130] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0131] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0132] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device:
[0133] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: displays a first playback page of the video;
[0134] In response to a page switching operation on the first play page, the current surface of the first play page for rendering the video is switched to a target surface of the second play page for rendering the video, and before successfully switching to the target surface, the application window corresponding to the target surface is a transparent window;
[0135] After the first frame is successfully rendered on the target surface, the video is displayed on the second playback page.
[0136] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or combinations thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0137] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0138] The modules or units involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of a module or unit does not limit the unit itself in some cases. For example, the first display module may also be described as a "first playback page display module".
[0139] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0140] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0141] According to one or more embodiments of the present disclosure, [Example 1] provides a page switching method, including:
[0142] Display the first play page of the video;
[0143] In response to a page switching operation on the first play page, the current surface of the first play page for rendering the video is switched to a target surface of the second play page for rendering the video, and before successfully switching to the target surface, the application window corresponding to the target surface is a transparent window;
[0144] After the first frame is successfully rendered on the target surface, the video is displayed on the second playback page.
[0145] According to one or more embodiments of the present disclosure, [Example 2] provides the method of Example 1, in response to a page switching operation on the first playback page, switching the current surface of the first playback page for rendering the video to a target surface of the second playback page for rendering the video, including:
[0146] In response to a page switching operation of the first play page, creating and making transparent an application window of the second play page;
[0147] Associating the player with the second play page and maintaining the play state of the player;
[0148] Using the surface setting method of the player, the current surface of the first play page used for rendering the video is switched to the target surface of the second play page used for rendering the video.
[0149] According to one or more embodiments of the present disclosure, [Example 3] provides the method described in Example 2, wherein maintaining the playback state of the player includes:
[0150] Intercept the pause method of the player.
[0151] According to one or more embodiments of the present disclosure, [Example 4] provides the method described in Example 1, further comprising:
[0152] When an exit operation of exiting the second playback page is detected, switching the target surface to the current surface;
[0153] After the first frame is successfully rendered on the current surface, the video is displayed on the first playback page.
[0154] According to one or more embodiments of the present disclosure, [Example 5] provides the method described in Example 4, wherein the first frame on the current surface is successfully rendered after a set time period after the target surface is switched to the current surface.
[0155] According to one or more embodiments of the present disclosure, [Example 6] provides the method described in Example 4, wherein the target surface corresponding to the second playback page is destroyed after the first frame is successfully rendered on the current surface.
[0156] According to one or more embodiments of the present disclosure, [Example 7] provides any method described in Examples 1-6, wherein the video is a panoramic video, and when the video is switched to be displayed on the second playback page, the absolute positions of the video played on the first playback page and the video played on the second playback page are the same.
[0157] According to one or more embodiments of the present disclosure, [Example 8] provides a page switching device, including:
[0158] A first display module, used to display a first play page of the video;
[0159] a switching module, configured to, in response to a page switching operation on the first play page, switch a current surface of the first play page for rendering the video to a target surface of a second play page for rendering the video, wherein before successfully switching to the target surface, the application window corresponding to the target surface is a transparent window;
[0160] The second display module is used to display the video on the second playback page after the first frame is successfully rendered on the target surface.
[0161] According to one or more embodiments of the present disclosure, [Example 9] provides an electronic device, the electronic device comprising:
[0162] one or more processing devices;
[0163] a storage device for storing one or more programs,
[0164] When the one or more programs are executed by the one or more processing devices, the one or more processing devices implement the method described in any one of Examples 1-7.
[0165] According to one or more embodiments of the present disclosure, [Example 10] provides a storage medium containing computer-executable instructions, which are used to execute any of the methods described in Examples 1-7 when executed by a computer processor.
[0166] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
[0167] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0168] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
Claims
1. A page switching method, characterized in that: include: Display the first play page of the video; In response to a page switching operation on the first play page, the current surface of the first play page for rendering the video is switched to a target surface of the second play page for rendering the video, and before successfully switching to the target surface, the application window corresponding to the target surface is a transparent window; After the first frame is successfully rendered on the target surface, the video is displayed on the second playback page.
2. The method according to claim 1, characterized in that In response to a page switching operation on the first play page, switching a current surface of the first play page for rendering the video to a target surface of a second play page for rendering the video includes: In response to a page switching operation of the first play page, creating and making transparent an application window of the second play page; Associating the player with the second play page and maintaining the play state of the player; Using the surface setting method of the player, the current surface of the first play page for rendering the video is switched to the target surface of the second play page for rendering the video.
3. The method according to claim 2, characterized in that The maintaining the playing state of the player comprises: Intercept the pause method of the player.
4. The method according to claim 1, characterized in that Also includes: When an exit operation of exiting the second playback page is detected, switching the target surface to the current surface; After the first frame is successfully rendered on the current surface, the video is displayed on the first playback page.
5. The method according to claim 4, characterized in that The first frame on the current surface is rendered successfully after a set time period after the target surface is switched to the current surface.
6. The method according to claim 4, characterized in that The target surface corresponding to the second playback page is destroyed after the first frame is successfully rendered on the current surface.
7. The method according to any one of claims 1 to 6, characterized in that: The video is a panoramic video. When the video is switched to be displayed on the second play page, the absolute positions of the video played on the first play page and the video played on the second play page are the same.
8. A page switching device, characterized in that: include: A first display module, used to display a first play page of a video; a switching module, configured to, in response to a page switching operation on the first play page, switch a current surface of the first play page for rendering the video to a target surface of a second play page for rendering the video, wherein before successfully switching to the target surface, the application window corresponding to the target surface is a transparent window; The second display module is used to display the video on the second playback page after the first frame is successfully rendered on the target surface.
9. An electronic device, characterized in that: The electronic device comprises: one or more processing devices; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processing devices, the one or more processing devices implement the method according to any one of claims 1 to 7.
10. A storage medium comprising computer executable instructions, which when executed by a computer processor are used to perform the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Video display method and device
CN106534944A
Video playing method and device, terminal and storage medium
CN110582017A
Cross-page switching method and system
CN114567806A
Object dragging method and device
CN115516413A
