CN-116248914-B - Video playing method, system, device, electronic equipment and storage medium
Abstract
The disclosure provides a video playing method, a system, a device, electronic equipment and a storage medium, relates to the technical field of computers, and particularly relates to the technical field of video playing. The specific implementation scheme is that a search request containing a player prerendering identifier is sent to a server in response to video search operation, so that the server sequentially feeds back appointed video data and appointed structure data to a client when detecting that the received search request contains the player prerendering identifier, a player instance for playing the appointed video data is created when the appointed video data is received, the appointed structure data and the player instance are utilized to conduct the rendering operation of a search result page when the appointed structure data is received, and the appointed video data is played by utilizing the player instance in the search result page if the player instance is completely rendered. By the scheme, the playing speed of the video in the page can be improved.
Inventors
- CHANG YING
- DONG HUALEI
- Xu Xiulou
- GAO JIEXUAN
- WU YOU
Assignees
- 北京百度网讯科技有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20230216
Claims (13)
- 1. A video playing method is applied to a client and comprises the following steps: Responding to video searching operation, sending a searching request containing a searching keyword and a player prerendering identifier to a server, so that the server feeds back appointed video data and appointed structure data to the client in sequence when detecting that the received searching request contains the player prerendering identifier, wherein the appointed video data is video data to be played in a searching result page corresponding to the searching request and determined based on the searching keyword, the appointed structure data is page structure data of the searching result page, and the appointed video data is fed back before the appointed structure data; Creating a player instance for playing the specified video data using the specified video data when the specified video data is received; When the appointed structure data is received, rendering operation of the search result page is carried out by utilizing the appointed structure data and the player instance and according to a static resource which is commonly used by any search result page and is obtained in advance, wherein the static resource represents page layout information and page style information, and the acquisition mode of the static resource comprises the steps of sending a static resource acquisition request to a server at an appointed idle time of a client so that the server feeds back target structure data to the client, wherein the target structure data comprises a download address of the static resource, and loading the download address of the static resource in a blank HTML page to obtain the static resource; and if the player instance rendering is completed, playing the appointed video data by utilizing the player instance in the search result page.
- 2. The method of claim 1, wherein the specified structure data includes specified code content, the specified code content being used at least to determine whether rendering of the player instance is complete; The method further comprises the steps of: invoking the specified code content in the process of rendering the search result page to obtain a judgment result of whether the player instance is rendered; And if the player instance rendering is completed, playing the specified video data by using the player instance in the search result page, including: And if the judging result represents that the player instance rendering is completed, playing the appointed video data by utilizing the player instance in the search result page.
- 3. The method of claim 2, wherein the determining whether the player instance is rendered in a manner that includes determining whether the specified video data is present in the search results page.
- 4. The method of claim 2, wherein the specified code content is further for determining whether the specified video data is located within a viewable area of the search results page; If the judging result represents that the rendering of the player instance is completed, playing the appointed video data by utilizing the player instance in the search result page, wherein the steps comprise: and if the judging result indicates that the player instance rendering is completed and the appointed video data is positioned in the visible area of the search result page, playing the appointed video data by utilizing the player instance in the search result page.
- 5. The method of any of claims 1-4, wherein the specified structure data includes a play-up tag belonging to a page element; the playing the specified video data by using the player instance in the search result page comprises: and under the condition that the playing label rendering is completed, playing the appointed video data by triggering the playing label by utilizing the player instance in the search result page.
- 6. The method of claim 1, wherein the rendering operation of the search result page using the specified structure data and the player instance and based on a static resource common to any of the pre-acquired search result pages comprises: loading the search result page by using the specified structure data, and analyzing page elements except the specified video data from the specified structure data; and according to the page layout information and the page style information represented by the static resources, sequentially rendering the player instance and the page elements obtained by analysis to the search result page.
- 7. A video playing method is applied to a server and comprises the following steps: receiving a search request which is sent by a client in response to a video search operation and contains a search keyword and a player prerendering identifier; When the received search request contains the player prerendering identification, feeding back appointed video data and appointed structure data to the client in sequence, so that when the client receives the appointed video data, a player instance for playing the appointed video data is created by utilizing the appointed video data, when the appointed structure data is received, the appointed structure data and the player instance are utilized, and the rendering operation of the search result page is carried out according to the pre-acquired static resources common to any search result page, and if the player instance is rendered, the appointed video data is played by utilizing the player instance in the search result page; the appointed video data are video data to be played in a search result page corresponding to the search request, which is determined based on the search keyword, the appointed structure data are page structure data of the search result page, and the appointed video data are fed back before the appointed structure data; The static resource characterization page layout information and page style information are obtained by sending a static resource obtaining request to a server at a specified idle time of a client so that the server feeds back target structure data to the client, wherein the target structure data comprises a downloading address of the static resource, and loading the downloading address of the static resource in a blank HTML page to obtain the static resource.
- 8. A video playing system comprises a client and a server; the client is used for responding to the video searching operation and sending a searching request containing a searching keyword and a player prerendering identifier to the server; the server is used for receiving the search request, and when the received search request contains the player prerendering identification, feeding back appointed video data and appointed structure data to the client in sequence, wherein the appointed video data is video data to be played in a search result page corresponding to the search request, which is determined based on a search keyword, the appointed structure data is page structure data of the search result page, and the appointed video data is fed back before the appointed structure data; The client is also used for creating a player instance for playing the appointed video data by utilizing the appointed video data when the appointed video data is received, and playing the appointed video data by utilizing the appointed structure data and the player instance and according to a static resource which is commonly used by any search result page and is acquired in advance when the appointed structure data is received; The static resource characterization page layout information and page style information are obtained by sending a static resource obtaining request to a server at a specified idle time of a client so that the server feeds back target structure data to the client, wherein the target structure data comprises a downloading address of the static resource, and loading the downloading address of the static resource in a blank HTML page to obtain the static resource.
- 9. A video-playing apparatus for use with a client, the apparatus comprising: The server is used for receiving a search request which comprises a search keyword and a player prerendering identifier, and sending a video search operation to a server, so that the server sequentially feeds back appointed video data and appointed structure data to the client when detecting that the received search request comprises the player prerendering identifier, wherein the appointed video data is video data which is determined based on the search keyword and is to be played in a search result page corresponding to the search request, the appointed structure data is page structure data of the search result page, and the appointed video data is fed back in advance of the appointed structure data; The creation module is used for creating a player instance for playing the specified video data by utilizing the specified video data when the specified video data is received; The rendering module is used for performing rendering operation of the search result page by utilizing the appointed structure data and the player instance when receiving the appointed structure data and according to a static resource which is commonly used for any search result page and is obtained in advance, wherein the static resource represents page layout information and page style information, and the obtaining mode of the static resource comprises the steps of sending a static resource obtaining request to a server at an appointed idle time of a client so that the server feeds back target structure data to the client, wherein the target structure data comprises a downloading address of the static resource, and loading the downloading address of the static resource in a blank HTML page to obtain the static resource; and the playing module is used for playing the appointed video data by utilizing the player instance in the search result page if the player instance is rendered.
- 10. A video playing device, applied to a server, comprising: The receiving module is used for receiving a search request which is sent by the client side in response to the video search operation and contains a search keyword and a player prerendering identifier; The feedback module is used for feeding back appointed video data and appointed structure data to the client in sequence when the received search request contains the player prerendering identification, so that the client can utilize the appointed video data to create a player instance for playing the appointed video data when receiving the appointed video data, and can utilize the appointed structure data and the player instance and conduct rendering operation of the search result page according to the pre-acquired static resources common to any one of the search result pages when receiving the appointed structure data, and can utilize the player instance in the search result page to play the appointed video data if the player instance is completely rendered; the appointed video data are video data to be played in a search result page corresponding to the search request, which is determined based on the search keyword, the appointed structure data are page structure data of the search result page, and the appointed video data are fed back before the appointed structure data; The static resource characterization page layout information and page style information are obtained by sending a static resource obtaining request to a server at a specified idle time of a client so that the server feeds back target structure data to the client, wherein the target structure data comprises a downloading address of the static resource, and loading the downloading address of the static resource in a blank HTML page to obtain the static resource.
- 11. An electronic device, comprising: at least one processor, and A memory communicatively coupled to the at least one processor, wherein, The memory stores instructions executable by the at least one processor to enable the at least one processor to perform the video-on-play method of any one of claims 1-6 and/or 7.
- 12. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the video-on-play method of any one of claims 1-6 and/or 7.
- 13. A computer program product comprising a computer program which, when executed by a processor, implements the video-playing method according to any one of claims 1-6 and/or 7.
Description
Video playing method, system, device, electronic equipment and storage medium Technical Field The disclosure relates to the technical field of computers, in particular to the technical field of video playing, and specifically relates to a video playing method, a system, a device, electronic equipment and a storage medium. Background In a browsing scene aiming at a search result page, the playing speed of a certain video in the search result page is particularly important, and the faster the video is played, the more the user experience is promoted, so that the retention of the user is ensured. The related technology adopts a same-layer rendering mode to render the page, and after the static resource loading in the page is completed and all elements in the page are rendered, the video playing is realized by calling a playing method corresponding to the video. Disclosure of Invention The disclosure provides a video playing method, a system, a device, electronic equipment and a storage medium. According to a first aspect of the present disclosure, there is provided a video playing method, applied to a client, including: Responding to video searching operation, sending a searching request containing a player prerendering identifier to a server, and enabling the server to feed back appointed video data and appointed structure data to the client in sequence when detecting that the received searching request contains the player prerendering identifier, wherein the appointed video data is video data to be played in a searching result page corresponding to the searching request, and the appointed structure data is page structure data of the searching result page; creating a player instance for playing the specified video data when the specified video data is received; When the appointed structure data is received, rendering operation of the search result page is carried out by utilizing the appointed structure data and the player instance; and if the player instance rendering is completed, playing the appointed video data by utilizing the player instance in the search result page. Optionally, the specified structure data comprises specified code content, wherein the specified code content is at least used for judging whether the player instance is rendered completely or not; The method further comprises the steps of: invoking the specified code content in the process of rendering the search result page to obtain a judgment result of whether the player instance is rendered; And if the player instance rendering is completed, playing the specified video data by using the player instance in the search result page, including: And if the judging result represents that the player instance rendering is completed, playing the appointed video data by utilizing the player instance in the search result page. Optionally, the method for judging whether the player instance is completely rendered comprises judging whether the appointed video data exists in the search result page. Optionally, the specified code content is further used for judging whether the specified video data is located in a visible area of the search result page; If the judging result represents that the rendering of the player instance is completed, playing the appointed video data by utilizing the player instance in the search result page, wherein the steps comprise: and if the judging result indicates that the player instance rendering is completed and the appointed video data is positioned in the visible area of the search result page, playing the appointed video data by utilizing the player instance in the search result page. Optionally, the specified structure data includes a play-starting tag belonging to a page element; the playing the specified video data by using the player instance in the search result page comprises: and under the condition that the playing label rendering is completed, playing the appointed video data by triggering the playing label by utilizing the player instance in the search result page. Optionally, the rendering operation of the search result page by using the specified structural data and the player instance includes: and performing rendering operation of the search result page by utilizing the appointed structure data and the player instance according to a static resource acquired in advance, wherein the static resource represents page layout information and page style information of the search result page. Optionally, the rendering operation of the search result page by using the specified structure data and the player instance and according to the pre-acquired static resources includes: loading the search result page by using the specified structure data, and analyzing page elements except the specified video data from the specified structure data; and according to the page layout information and the page style information represented by the static resources, sequentially rendering the player instance and the page elements