Video preloading method, application client and electronic equipmentTechnical Field
The embodiment of the application relates to the technical field of videos, in particular to a video preloading method, an application client and electronic equipment.
Background
With the development of various video application clients, the video application clients have more and more problems. The related video loading technology generally adopts a real-time loading and real-time playing mode, i.e., a mode of loading and playing simultaneously. Such a video loading method generally has the following problems: when a video preview page is browsed after an application client is started, a white screen phenomenon is easily generated due to untimely loading of video preview information (namely a video cover), so that the selection of a user on a video is influenced; in the video playing process, the video playing speed is higher than the video loading speed, a user needs to wait for loading, and the loaded data is easily influenced due to network problems, so that the pause phenomenon in the video playing process is avoided.
Disclosure of Invention
In view of this, embodiments of the present application provide a video preloading method, an application client, and an electronic device, which can implement the above technical problem.
In order to solve the above problem, the embodiments of the present application mainly provide the following technical solutions:
in a first aspect, an embodiment of the present application provides a method for preloading a video, where the method includes:
when detecting that a display area corresponding to any video preview information displayed in a current video preview page of an application client meets a first preset condition, preloading first video information of a target video corresponding to the video preview information;
when the playing control operation aiming at the video preview information is detected, the pre-loaded first video information is played, and the second video information of the target video is loaded, wherein the target video comprises the first video information and the second video information.
In a second aspect, an embodiment of the present application further provides an application client, where the application client includes:
the pre-loading processing module is used for pre-loading first video information of a target video corresponding to the video preview information when detecting that a display area corresponding to any video preview information displayed in a current video preview page of the application client meets a first preset condition;
and the video playing processing module is used for playing the preloaded first video information and loading the second video information of the target video when the playing control operation aiming at the video preview information is detected, wherein the target video comprises the first video information and the second video information.
In a third aspect, an embodiment of the present application further provides an electronic device, including:
at least one processor;
and at least one memory, bus connected with the processor; wherein,
the processor and the memory complete mutual communication through the bus;
the processor is used for calling the program instructions in the memory so as to execute the video preloading method.
In a fourth aspect, embodiments of the present application further provide a non-transitory computer-readable storage medium storing computer instructions, where the computer instructions cause a computer to execute the above-mentioned video preloading method.
By means of the technical scheme, the technical scheme provided by the embodiment of the application at least has the following advantages: whether a corresponding display area of any video preview information displayed in a current video preview page meets a first preset condition or not is detected, the purpose of controlling the first video information of the preloaded target video is achieved, the preloaded first video information can be directly played in the subsequent process of playing the target video, the problem of video delay possibly caused by the fact that the target video is loaded when playing control operation is detected in the prior art is avoided, the second video information can be loaded while the first video information is played, the purpose of shortening the time consumed by loading the target video is achieved, the smoothness of video playing is improved, and therefore video watching experience of a user is improved.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the embodiments of the present application. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
fig. 1 is a schematic flowchart illustrating a method for preloading a video according to an embodiment of the present application;
fig. 2 is a schematic flowchart illustrating another method for preloading video according to an embodiment of the present application;
fig. 3 shows a schematic structural diagram of an application client provided in an embodiment of the present application;
fig. 4 shows a schematic structural diagram of another application client provided in an embodiment of the present application;
fig. 5 shows a schematic structural diagram of an electronic device provided in an embodiment of the present application.
Detailed Description
Reference will now be made in detail to the embodiments of the present application, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are exemplary only for the purpose of explaining the present application and are not to be construed as limiting the present application.
As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. It will be understood that when an element is referred to as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element or intervening elements may also be present. Further, "connected" or "coupled" as used herein may include wirelessly connected or wirelessly coupled. As used herein, the term "and/or" includes all or any element and all combinations of one or more of the associated listed items.
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
In the prior art, video playing generally adopts a real-time loading mode, which is characterized in that the video is played and loaded simultaneously, so that after the video is clicked and played, the following problems mainly exist: firstly, if the loaded part is not enough to support playing, the user often needs to consume time to wait for playing; when a video preview page is entered, if preview information (a video cover) of a video is not loaded, a phenomenon of white screen is easy to occur; and thirdly, in the real-time loading and playing process, the loading speed is easily influenced due to network problems, so that the data loading speed is lower than the playing speed, and the pause phenomenon in the video playing process is caused.
The embodiment of the application client video preloading method, the application client, the electronic device and the computer readable storage medium aims to solve the above technical problems in the prior art.
In one embodiment, as shown in fig. 1, the present application provides a method of video preloading, comprising the steps of:
step S101, when detecting that a display area corresponding to any video preview information displayed in a current video preview page of an application client meets a first preset condition, preloading first video information of a target video corresponding to the video preview information.
In the embodiment of the application, the application client runs on the terminal device, wherein the terminal device can be an electronic device such as a mobile phone, a PC, a notebook, a pad, a wearable device, and the like.
In the embodiment of the application, the video preview information generally represents the cover of the video, and the purpose of attracting the user to click is achieved through the cover of the video, so that the click rate of the video is improved.
In the embodiment of the application, the current video preview page is controlled according to the sliding operation of the user on the terminal device, and when the sliding stop operation of the user on the terminal device is detected, the current video browsing page of the application client is determined according to the position of the user when the sliding operation is stopped. Therefore, in practical applications, there may be situations where the cover of the video displayed in the current video preview page is incomplete, for example, if there are 6 videos displayed in the current video preview page in total, such as video 1-video 6. If the 6 videos are presented in a column by column manner with 3 rows and 2 columns, that is, two videos are displayed in the horizontal direction and 3 videos are displayed in each column in the vertical direction. Specifically, it can be shown that video 1 and video 2 are displayed in the first row, video 3 and video 4 are displayed in the second row, and video 5 and video 6 are displayed in the third row, and because the current video preview page is not enough to completely display the videos in the first row and the third row, the display of the covers (i.e., video preview information) of video 1, video 2, video 5 and video 6 is incomplete, and only the display of the covers of video 3 and video 4 is complete. Assuming that the first preset condition is 50%, that is, when the cover of the video reaches 50% of the entire cover in the displayed portion of the current video preview page, the target video corresponding to the video cover is preloaded. In the above example, the covers of video 1 and video 2 reach 50% of the displayed portion of the current video preview page, the first video information of video 1 and video 23 is preloaded, and the covers of video 5 and video 6 reach 50% of the displayed portion of the current video preview page, and the preloading processing is not performed on video 5 and video 6.
In the embodiment of the application, when the display area corresponding to any video preview information displayed in the current video preview page of the application client is detected to meet a first preset condition, the first video information of the target video corresponding to the video preview information is recorded, so that when the target video is clicked and played in the subsequent current video preview page, the preloaded first video information can be directly played, a user does not need to wait for a loading process, the requirement of the user for quickly watching the video can be met, the phenomena of white screen, playing blockage and the like caused by the loading problem in the process of watching the video by the user are prevented, and the user experience is improved.
Step S102, when the playing control operation aiming at the video preview information is detected, the pre-loaded first video information is played, and the second video information of the target video is loaded, wherein the target video comprises the first video information and the second video information.
In actual application, the playing control operation may be a single-click operation, and when receiving a single-click operation of a user on the cover (i.e., video preview information) of the video B on the current video preview page, the video B is played. Because the first video information of the video B is preloaded, a user can quickly see the played first video information by clicking the video B without waiting, and the second video information of the video B is loaded in the playing process, so that the second video information is continuously played after the preloaded first video information is played, the loading time of a target video is shortened, the effect of video playing is prevented from being influenced due to slow loading, and therefore the fluency of video playing and the video flow experience of the user are improved.
According to the method for preloading the video, whether the corresponding display area of any video preview information displayed in the current video preview page meets the first preset condition or not is achieved, the purpose of controlling the first video information of the preloaded target video is achieved, the preloaded first video information can be directly played subsequently when played, the problem that video delay is possibly caused by the fact that the target video is loaded when playing control operation is detected in the prior art is avoided, the second video information can be loaded while the first video information is played, the purpose of shortening time consumed by loading the target video is achieved, smoothness of video playing is improved, and video watching experience of a user is improved.
In one implementation, the method further comprises: when the first video information of the target video corresponding to the video preview information is preloaded, if any one of the following situations is detected, the preloading of the first video information of the target video is stopped;
switching the current video preview page to other pages of the application client;
switching the application client to a terminal device background;
switching from the application client to other applications;
and closing the application client.
In actual application, any situation is detected, and the control of preloading of the first video information of the target video is stopped, so that the purpose of reducing the power consumption of the terminal equipment running the application client is achieved, and the problem of slow running of the terminal equipment caused by unnecessary preloading is prevented.
In another implementation, as shown in fig. 1, the method further includes step S103 (not shown in the figure), and step S103: and after the preloaded first video information is played, continuously playing the second video information of the loaded target video.
In practical application, assuming that the target video is the video A, when the play control operation for the video preview information of the video A is detected, the preloaded first video information of the video A is played, and the second video information of the video A is loaded.
In another implementation, as shown in fig. 1, the method further includes a step S104 (not shown in the figure), and the step S104: when the playing control operation aiming at the video preview information is detected, if the first video information of the target video is not preloaded, continuously loading the part which is not preloaded in the first video information of the target video until the loading is completed; in step S102, playing the preloaded first video information, including: and after the part which is preloaded and completed in the first video information is played, continuing to play the part which is not preloaded and completed in the preloading process so as to complete the playing of the first video information of the target video.
In practical application, it is assumed that the target video is an a video, if the first video information of the a video is video data with a total duration of 5 seconds, and when the play control operation for the a video is detected, the preloaded portion of the first video information of the a video is the video data of the first 3 seconds, when the a video is played, the video data of the first 3 seconds (i.e., the preloaded portion) of the first video information is played, and at the same time, the video data of the second 2 seconds (i.e., the portion which is not preloaded in the preloading process) of the first video information of the a video is continuously loaded, so that after the video data of the first 3 seconds of the first video information of the a video is played, the video data of the second 2 seconds of the first video information of the a video is played, and the first video information of the a video is completely played.
In another implementation, as shown in fig. 1, the method further includes a step S105 (not shown in the figure), and the step S105: and preloading the next video of the target video when detecting that the data quantity ratio of the data information which is not loaded in the target video and the complete data information of the target video does not exceed a preset ratio threshold.
In practical application, the target video is assumed to be an a video, if the target video is video data with a total time length of 100 seconds, if the predetermined ratio threshold is 20%, when the target video is loaded to the 80 th second, the data information which is not loaded in the target video is video data with a time length of 20 seconds, the data quantity ratio of the data information which is not loaded in the target video to the complete data information of the target video is equal to 20%, and the predetermined ratio threshold is not exceeded, the next video of the a video is preloaded, so that after the a video is played, the next video is played quickly, and the influence on watching of a user due to the fact that the next video is not preloaded is prevented. In actual application, the next video of the target video may be the next video in the current video browsing page, or may be the next video in a preset playlist.
In another implementation manner, when any one of the following conditions is met, a step of preloading first video information of a target video corresponding to video preview information when a display area corresponding to any one of the video preview information displayed in a current video preview page of an application client is detected to meet a first preset condition is performed:
starting an application client;
switching from other pages of the application client to the current video preview page;
and detecting that the page sliding control operation for the video preview page is stopped.
In actual application, the current video preview page can be a page of the application client, and when the current video preview page is the homepage of the application client, the application client is started, so that the current video preview page can be determined; determining a current video preview page through switching operation among different pages of an application client, such as switching among different theme pages; the current video preview page can also be determined after the user slides up and down in each page of the application client. Therefore, no matter how the current video preview page is determined, as long as the display area corresponding to any video preview information displayed on the current video preview page meets the first preset condition, the first video information of the target video corresponding to the video preview information is preloaded.
In another implementation, as shown in fig. 1, the method further includes a step S106 (not shown in the figure), and the step S106: and when the page sliding control operation aiming at the current video preview page is detected, preloading the preset amount of video preview information included in the subsequent video preview page corresponding to the current video preview page in the sliding operation control direction.
In the embodiment of the application, the sliding control operation can include four directions, namely, up, down, left and right directions, and when the method is actually applied, the video browsing page is determined again by sliding in the up and down directions of the current video browsing page. For example, when the user slides up, the predetermined amount of video browsing information included in the subsequent video preview page below the current video browsing page is preloaded, so that the cover (i.e. the video preview information) in the subsequent page of the current video browsing page is quickly loaded, the user can quickly know about the video through the cover, and the white screen phenomenon caused by the cover which is not loaded into the subsequent video when the user slides to other video browsing pages is prevented.
In another embodiment, an embodiment of the present application provides another possible implementation manner, and on the basis of the first embodiment, the method shown in the second embodiment is further included, as shown in fig. 2, the method includes: step S201 to step S204, wherein step S201 and step S202 are the same as or similar to the execution process of step S101 and step S102 in the first embodiment, and are not repeated herein.
Step S203, when the target video is played, calculating the clicked probability of the video publisher information page corresponding to the target video;
and S204, if the clicked probability is not smaller than a preset probability threshold, preloading a video publisher information page corresponding to the target video.
In the embodiment of the application, whether the video publisher information page corresponding to the target video is preloaded is determined by calculating the clicked probability of the video publisher information page corresponding to the target video, so that the video publisher information page corresponding to the preloaded target video can be directly displayed when the video publisher information page corresponding to the target video is clicked, and the phenomenon of screen blank caused by untimely loading is prevented.
In actual application, the probability that the video publisher information page corresponding to the hot video is clicked is high, if the preset probability threshold is assumed to be 60%, when the target video is played, if the calculated probability that the video publisher information page corresponding to the target video is clicked is 80%, the video publisher information page corresponding to the target video is preloaded.
In another embodiment, as shown in fig. 3, an application client 30 includes: a preload processing module 301 and a video play processing module 302.
The pre-loading processing module 301 is configured to pre-load first video information of a target video corresponding to video preview information when detecting that a display area corresponding to any one of the video preview information displayed in a current video preview page of an application client meets a first preset condition;
the video playing processing module 302 is configured to play the preloaded first video information and load the second video information of the target video when detecting a playing control operation for the video preview information, where the target video includes the first video information and the second video information.
The application client side provided by the embodiment of the application client side achieves the purpose of controlling the first video information of the preloaded target video through whether the corresponding display area of any video preview information displayed in the current video preview page meets the first preset condition or not, so that the preloaded first video information can be directly played subsequently during playing, the problem that video delay is possibly caused by loading the target video when playing control operation is detected in the prior art is avoided, loading of the second video information can be completed while the first video information is played, the purpose of shortening the time consumed by loading the target video is achieved, the smoothness of video playing is improved, and the video watching experience of a user is improved.
The preloading processing module 301 is further configured to, when preloading first video information of a target video corresponding to the video preview information, stop preloading of the first video information of the target video if any of the following situations is detected:
performing page sliding control operation aiming at a current video preview page;
switching the current video preview page to other pages of the application client;
switching the application client to a terminal device background;
switching from the application client to other applications;
and closing the application client.
The preloading processing module 301 is further configured to, when a play control operation for the video preview information is detected, if the first video information of the target video is not preloaded, continue to load a part, which is not preloaded, of the first video information of the target video until the loading is completed; and the video playing processing module 302 is further configured to, after playing the pre-loaded portion of the first video information, continue to play the portion that is not pre-loaded in the pre-loading process, so as to complete the playing of the first video information of the target video.
The playing processing module 302 is further configured to continue to play the second video information of the loaded target video after the playing of the preloaded first video information is completed.
The playing processing module 302 is further configured to preload a next video of the target video when detecting that a data amount ratio of the data information that is not loaded in the target video to the complete data information of the target video does not exceed a predetermined ratio threshold.
The preloading processing module 301 is further configured to, when any one of the following conditions is met, execute a step of preloading first video information of a target video corresponding to video preview information when it is detected that a display area corresponding to any one of video preview information displayed in a current video preview page of the application client meets a first preset condition:
starting an application client;
switching from other pages of the application client to the current video preview page;
and detecting that the page sliding control operation for the video preview page is stopped.
The preloading processing module 301 is further configured to preload a predetermined amount of video preview information included in a subsequent video preview page corresponding to the current video preview page in the sliding operation control direction when detecting a page sliding control operation for the current video preview page.
Further, as shown in fig. 4, the application client 40 includes a preload processing module 401, a video play processing module 402, a probability determination module 403, and a personal page preload module 404. The working processes of the preloading processing module 401 and the video playing processing module 402 are respectively the same as or similar to the preloading processing module 301 and the video playing processing module 302 in fig. 3, and are not described herein again.
The probability determining module 403 is configured to, when the target video is played, obtain a clicked probability of a video publisher information page corresponding to the calculated target video;
and the personal page preloading module 404 is configured to preload the video publisher information page corresponding to the target video if the clicked probability is not smaller than the predetermined probability threshold.
The application client in the embodiment of the present application can execute the video preloading method provided in the embodiment of the present application, which is similar to the implementation principle and is not described herein again.
In yet another embodiment, an electronic device is provided in the embodiments of the present application, as shown in fig. 5, which shows a schematic structural diagram of an electronic device 500 suitable for implementing the embodiments of the present application. The terminal device in the embodiments of the present application may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle terminal (e.g., a car navigation terminal), and the like, and a fixed terminal such as a digital TV, a desktop computer, and the like. The electronic device shown in fig. 5 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 5, electronic device 500 may include a processing means (e.g., central processing unit, graphics processor, etc.) 501 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)502 or a program loaded from a storage means 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data necessary for the operation of the electronic apparatus 500 are also stored. The processing device 501, the ROM 502, and the RAM 503 are connected to each other through a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
Generally, the following devices may be connected to the I/O interface 505: input devices 506 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 507 including, for example, a Liquid Crystal Display (LCD), speakers, vibrators, and the like; storage devices 508 including, for example, magnetic tape, hard disk, etc.; and a communication device 509. The communication means 509 may allow the electronic device 500 to communicate with other devices wirelessly or by wire to exchange data. While fig. 5 illustrates an electronic device 500 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to embodiments of the application, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, embodiments of the present application include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 509, or installed from the storage means 508, or installed from the ROM 502. The computer program performs the above-described functions defined in the methods of the embodiments of the present application when executed by the processing device 501.
It should be noted that the computer readable medium mentioned above in the present application may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer readable medium carries one or more programs, and when the one or more programs are executed by the electronic device, the electronic device is caused to execute the method for preloading videos provided by the above embodiments.
Computer program code for carrying out operations for aspects of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of 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 the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present application may be implemented by software or hardware. The name of the module does not in some cases form a limitation of the module itself, for example, the first obtaining module may also be described as a "module for obtaining at least two internet protocol addresses".
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the disclosure. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.