Video access method, access device, terminal and computer readable storage medium
By listening to the video access request of the WebView control and replacing the address, judging and displaying local cached videos, the problem of web videos being unable to be directly accessed is solved, improving user experience and saving traffic.
Patent Information
- Application Number
- CN202111354353.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-16
- Publication Date
- 2024-11-22
- Estimated Expiration
- 2041-11-16
AI Technical Summary
The web videos downloaded by users cannot be directly accessed through the web page, resulting in waste of traffic and poor user experience. The reason is that the protocols for loading web videos and loading local videos are different, and cached videos in the local storage space of the terminal cannot be directly opened.
By listening to the video access request of the WebView control, replace the server address with the address in the local storage space, determine whether the video is cached locally, and display it directly during cache. When it is not cached, download it from the server and cache it. When the playback progress reaches the threshold, download it to Local storage.
Improves the user experience, saves traffic requesting video resources from the server, and avoids waste of traffic caused by frequent requests.
Smart Images

Figure CN114205678B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of communication technology, and specifically relates to a video access method, an access device, a terminal and a computer-readable storage medium. Background Art
[0002] Currently, when a user opens a web video of interest through a browser to watch, the user can choose to download the web video of interest to the local storage space of the terminal for direct viewing in the future; however, the video resources downloaded by the user to the local storage space of the terminal cannot be directly accessed through the web page. When the user opens the browser again to access the web video of interest, although the corresponding web video has been cached in the local storage space of the terminal, because the protocols for loading web videos and loading local videos are different, the web page cannot directly open the web video cached in the local storage space of the terminal, and thus needs to continue to request to load the web video from the server, which not only reduces the user experience but also wastes traffic. Summary of the invention
[0003] In view of this, the present application provides a video access method, access device, terminal and computer-readable storage medium, which can solve the problem of high traffic cost and poor user experience due to the inability to load videos cached in the local storage space of the terminal and the need to continue requesting video resources from the server.
[0004] A first aspect of an embodiment of the present application provides a video access method, including:
[0005] The terminal monitors a video access request of the WebView control, wherein the video access request includes a first address, the first address is an address of the video to be accessed in a first server, and the first server is a server that responds to the video access request;
[0006] The terminal replaces the first address with a second address, where the second address includes an address of the video to be accessed in a local storage space of the terminal;
[0007] After the terminal obtains the video to be accessed that is cached in the local storage space of the terminal according to the second address, the terminal displays the video to be accessed.
[0008] In another implementation of the first aspect, before the terminal replaces the first address with a second address, the method further includes:
[0009] The terminal determines, according to the first address, whether the video to be accessed is cached in the local storage space of the terminal;
[0010] Correspondingly, the terminal replacing the first address with the second address includes:
[0011] If the video to be accessed is cached in the local storage space video of the terminal, the terminal replaces the first address with the second address.
[0012] In another implementation of the first aspect, after the terminal determines, according to the first address, whether the video to be accessed is cached in the local storage space of the terminal, the method further includes:
[0013] If the video to be accessed is not cached in the local storage space of the terminal, the terminal sends the video access request to the first server through the WebView control;
[0014] The terminal receives the video frame of the video to be accessed returned by the first server according to the video access request, and caches the video frame of the video to be accessed;
[0015] The terminal plays a video frame of the video to be accessed in the buffer of the terminal;
[0016] When the playing progress of the video to be accessed is greater than a progress threshold, the terminal downloads the video to be accessed from the first server according to the video access request, and stores the video to be accessed in a local storage space of the terminal.
[0017] In another implementation of the first aspect, storing the to-be-accessed video in a local storage space of the terminal includes:
[0018] The terminal encodes the first address to obtain a first identifier;
[0019] Using the first identifier as the name of the video to be accessed, and storing the video to be accessed in the local storage space of the terminal;
[0020] Correspondingly, the terminal determines, according to the first address, whether the video to be accessed is cached in the local storage space of the terminal, including:
[0021] The terminal encodes the first address to obtain a first identifier;
[0022] Determine whether there is a to-be-accessed video named with the first identifier in the local storage space of the terminal;
[0023] If the video to be accessed and named with the first identifier exists in the local storage space of the terminal, it is determined that the video to be accessed is cached in the local storage space of the terminal.
[0024] In another implementation of the first aspect, the terminal obtains, according to the second address, a to-be-accessed video cached in a local storage space of the terminal, including:
[0025] The terminal obtains the video to be accessed from the local storage space of the terminal based on the second address through the http server;
[0026] The terminal sends the video to be accessed to the WebView control through the http server.
[0027] In another implementation manner of the first aspect, the second address also includes an IP address and a port number of the terminal.
[0028] In another implementation of the first aspect, the method further includes:
[0029] When the remaining storage space of the local storage space of the terminal is less than a first value, the to-be-accessed video in the local storage space of the terminal is cleared.
[0030] A second aspect of an embodiment of the present application provides a video access device, including:
[0031] A monitoring module, used for monitoring a video access request of a WebView control, wherein the video access request includes a first address, the first address is an address of a video to be accessed in a first server, and the first server is a server that responds to the video access request;
[0032] A processing module, configured to replace the first address with a second address, wherein the second address includes an address of the video to be accessed in a local storage space of a terminal where the device is located;
[0033] The acquisition module is used to acquire the video to be accessed cached in the local storage space video of the terminal where the device is located according to the second address, and the terminal where the device is located displays the video to be accessed.
[0034] A third aspect of an embodiment of the present application provides a terminal, the terminal comprising a processor, the processor being configured to run a computer program stored in a memory to implement the video access method as described in the first aspect above.
[0035] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the video access method as described in the first aspect above is implemented.
[0036] In the process of implementing access to cached videos in the local storage space of the terminal through the WebView control, the terminal first monitors the video access request of the WebView control, wherein the video access request carries a first address, which is the address of the video to be accessed in the first server, and the first server is the server that responds to the video access request; secondly, the terminal replaces the first address with a second address, and the second address contains the address of the video to be accessed in the local storage space of the terminal; thereafter, the terminal obtains the video to be accessed from the local storage space according to the second address, and displays the obtained video to be accessed. The above-mentioned video access method proposed in the present application can convert the local cached video of the terminal into a web page video for users to browse and watch, so that there is no need to send a video access request to the first server to obtain the video to be accessed when there is already a cached video in the local storage space of the terminal. In this way, the user experience is improved and the traffic consumed by frequent requests to the first server is saved. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without exceeding the scope of protection required by the present application.
[0038] Figure 1 The following is a flow diagram of a video access method provided by an embodiment of the present application;
[0039] Figure 2 A schematic diagram showing a flow chart of a video access method provided by another embodiment of the present application;
[0040] Figure 3 A schematic diagram showing a flow chart of a video access method provided by another embodiment of the present application;
[0041] Figure 4 A schematic diagram showing a flow chart of a video access method provided by another embodiment of the present application;
[0042] Figure 5 A schematic diagram showing a flow chart of a video access method provided by another embodiment of the present application;
[0043] Figure 6 A schematic block diagram showing the composition of a video access device provided by an embodiment of the present application is shown;
[0044] Figure 7 A schematic block diagram of the composition of a terminal provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0045] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.
[0046] In addition, described feature, structure or characteristic can be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present application. However, those skilled in the art will appreciate that the technical scheme of the present application can be put into practice without one or more of the specific details, or other methods, components, devices, etc. can be adopted. In other cases, known methods, devices, realizations or operations are not shown or described in detail to avoid blurring the various aspects of the present application.
[0047] The video access method proposed in this application is applied to a terminal installed with a WebView control.
[0048] The technical solution of the present application will be clearly and completely described below through specific embodiments, as follows:
[0049] See also Figure 1 , is a flow chart of a video access method provided by an embodiment of the present application. As shown in the figure, the video access method includes the following steps:
[0050] S11, the terminal monitors a video access request of a WebView control, the video access request includes a first address, the first address is an address of the video to be accessed in a first server, and the first server is a server that responds to the video access request.
[0051] In the embodiment of the present application, the WebView control is installed on a client of the terminal, such as a browser. The video access request may be a request for the WebView control to access the first server to obtain the video to be accessed after the user inputs a search keyword of the video of interest into the browser in the terminal through the terminal.
[0052] Therefore, the first server is used to provide the video to be accessed according to the video access request.
[0053] The video access request carries the Uniform Resource Locator (URL) of the video to be accessed. The URL is address indication information of the first server, and the URL includes the storage address of the video to be accessed in the first server.
[0054] For the convenience of description, the address of the video to be accessed contained in the URL on the first server is defined as the first address.
[0055] As an example, suppose the URL in the video access request is
[0056] http: / / y.cunwedu.com.cn / cunw-operation-h5 / help / index.html?code=01000001&projectCode=SC002+http: / / cunw-edu-statics.oss-cn-hangzhou.aliyuncs.com / operation / familydesk / consulting / pic / 1601361890404.mp4.
[0057] but
[0058] http: / / cunw-edu-statics.oss-cn-hangzhou.aliyuncs.com / operation / familydesk / consulting / pic / 1601361890404.mp4 is the first address.
[0059] S12: The terminal replaces the first address with a second address, where the second address includes an address of the video to be accessed in the local storage space of the terminal.
[0060] In another embodiment of the present application, before the terminal replaces the first address with the second address, the terminal further includes:
[0061] The terminal determines, based on the first address, whether the video to be accessed is cached in the local storage space of the terminal.
[0062] See also Figure 2 In another embodiment of the present application, the terminal determines whether a video to be accessed is cached in a local storage space of the terminal according to the first address, including:
[0063] S21, the terminal encodes the first address to obtain a first identifier.
[0064] As an example, assume the first address is:
[0065] http: / / cunw-edu-statics.oss-cn-hangzhou.aliyuncs.com / operation / familydesk / consulting / pic / 1601361890404.mp4, the terminal will encode the first address to obtain the video name 793d978dbedb47cb561f2146e3b30084.mp4, and the video name is the first identifier.
[0066] S22, determining whether there is a to-be-accessed video named with the first identifier in the local storage space of the terminal.
[0067] As an example, after obtaining the first identifier 793d978dbedb47cb561f2146e3b30084.mp4, the terminal will search the local storage space of the terminal according to the first identifier to see whether there is a cached video named with the first identifier.
[0068] S23: If the video to be accessed named with the first identifier exists in the local storage space of the terminal, it is determined that the video to be accessed is cached in the local storage space of the terminal.
[0069] As an example, assuming that a video resource named with the first identifier 793d978dbedb47cb561f2146e3b30084.mp4 is stored in the local storage space of the terminal, the terminal can determine that a video to be accessed is stored in the local storage space of the terminal.
[0070] When the terminal determines that a video resource named with the first identifier is cached in the local storage space, the terminal will store the first address
[0071] http: / / cunw-edu-statics.oss-cn-hangzhou.aliyuncs.com / operation / familydesk / consulting / pic / 1601361890404.mp4 is replaced with http: / / localhost+port number+address of the video to be accessed in the SD card, that is, "http: / / localhost+port number+address of the video to be accessed in the SD card" is the second address, where localhost is the local IP address of the terminal.
[0072] The second address is the address of the video to be accessed in the local storage space of the terminal.
[0073] See also Figure 3 In another embodiment of the present application, after the terminal determines whether there is a video to be accessed cached in the local storage space of the terminal according to the first address, the method further includes:
[0074] S33: If the video to be accessed is not cached in the local storage space of the terminal, the terminal sends a video access request to the first server through the WebView control.
[0075] In an embodiment of the present application, if the terminal encodes the first address and obtains the first identifier, but the terminal does not find a video resource named with the first identifier in the local storage space, the terminal will determine that the video to be accessed is not cached in the local storage space. At this time, the terminal will send a video access request to the first server through the WebView control, wherein the video access request carries the address of the first server and the first address of the video to be accessed in the first server.
[0076] S34: The terminal receives the video frame of the video to be accessed returned by the first server according to the video access request, and caches the video frame of the video to be accessed.
[0077] In an embodiment of the present application, after the first server receives a video access request sent by the terminal through the WebWiew control, the first server will respond to the video access request and return the video frame of the video to be accessed to the terminal. While the terminal receives the video frame of the video to be accessed sent by the first server, it caches the video frame of the video to be accessed for the user to browse and watch.
[0078] S35, the terminal plays the video frame of the to-be-accessed video in the buffer of the terminal.
[0079] In the embodiment of the present application, after the terminal receives the video to be accessed returned by the first server, the terminal caches the video to be accessed in the cache of the browser, and then plays the video to be accessed cached in the browser cache.
[0080] S36: When the playback progress of the video to be accessed is greater than the progress threshold, the terminal downloads the video to be accessed from the first server according to the video access request, and stores the video to be accessed in the local storage space of the terminal.
[0081] In an embodiment of the present application, during the playback of the video to be accessed, the terminal will monitor the playback progress of the video to be accessed. As an example, the first server returns the video to be accessed to the cache of the browser in the terminal according to the video access request, and the user can click to play the video to be accessed returned by the first server to the browser cache. During the playback of the video to be accessed, the terminal will monitor whether the video to be accessed has been played 10%. If the video to be accessed has been played 10%, the terminal will download the video to be accessed from the first server to the local storage space of the terminal according to the video access request. In the present application, the setting of the progress threshold is to download the video resources that the user is interested in to the local storage space of the terminal, and to prevent the download of video resources that the user is not interested in from occupying the local storage space of the terminal.
[0082] It should be noted that, because the cache space of the WebView control is extremely small, it is basically not feasible to cache all the video frames of the video to be accessed sent by the first server through WebView. Therefore, in this application, when the video playback progress reaches the progress threshold, the terminal directly downloads the video to be accessed from the first server to the local storage space of the terminal according to the first server address in the video access request.
[0083] See also Figure 4 In another embodiment of the present application, storing the video to be accessed in the local storage space of the terminal includes:
[0084] S3601. The terminal encodes the first address to obtain a first identifier.
[0085] The description of the embodiments of the present application can refer to the embodiments described in S21, and will not be repeated here.
[0086] S3602: Use the first identifier as the name of the video to be accessed, and store the video to be accessed in the local storage space of the terminal.
[0087] In the embodiment of the present application, after obtaining the first identifier of the first address
[0088] 793d978dbedb47cb561f2146e3b30084.mp4, the terminal will be marked with the first
[0089] 793d978dbedb47cb561f2146e3b30084.mp4 is used as the name of the downloaded video to be accessed, the downloaded video to be accessed is named, and the video to be accessed named with the first identifier is stored in the local storage space of the terminal.
[0090] See also Figure 3 In another embodiment of the present application, it further includes:
[0091] S37: When the remaining storage space of the local storage space of the terminal is less than a first value, clear the videos to be accessed in the local storage space of the terminal.
[0092] In the embodiment of the present application, when the terminal detects that the local storage space is insufficient, that is, less than a preset first value, the terminal will clean up the videos to be accessed downloaded to the local storage space of the terminal to release the local storage space of the terminal.
[0093] S13, after the terminal obtains the video to be accessed cached in the local storage space of the terminal according to the second address, the terminal displays the video to be accessed.
[0094] See also Figure 5 In another embodiment of the present application, the terminal obtains the to-be-accessed video cached in the local storage space of the terminal according to the second address, including:
[0095] S1301: The terminal obtains the video to be accessed from the local storage space of the terminal based on the second address through the http server.
[0096] In the embodiment of the present application, the http server is located in the terminal and can be understood as a server. As an example, the server is used to receive the second address sent by the terminal: http: / / localhost+port number+address of the video to be accessed in the SD card, and obtain the video to be accessed from the local storage space of the terminal according to the received second address.
[0097] S1302: The terminal sends the video to be accessed to the WebView control via the http server.
[0098] In the embodiment of the present application, after the terminal obtains the video to be accessed in the local storage space of the terminal through the http server, the terminal will send the video to be accessed obtained from the local storage space to the WebView control through the http server for display by the WebView control.
[0099] like Figure 6 , which is a schematic block diagram of a data access device provided in an embodiment of the present application, and for ease of explanation, only the parts related to the embodiment of the present application are shown. The data access device 6 comprises:
[0100] A monitoring module 610 is used to monitor a video access request of a WebView control, wherein the video access request includes a first address, the first address is an address of a video to be accessed in a first server, and the first server is a server that responds to the video access request;
[0101] A processing module 620 is configured to replace the first address with a second address, where the second address includes an address of the video to be accessed in a local storage space of a terminal where the device is located;
[0102] The acquisition module 630 is used to acquire the video to be accessed cached in the local storage space of the terminal where the device is located according to the second address, and the terminal where the device is located displays the video to be accessed.
[0103] In another embodiment of the present application, the processing module 620 is further configured to:
[0104] According to the first address, it is determined whether the video to be accessed is cached in the local storage space of the terminal where the device is located.
[0105] If the video to be accessed is cached in the local storage space of the terminal where the device is located, the first address is replaced with the second address, wherein the second address includes the IP address and port number of the terminal where the device is located.
[0106] In another embodiment of the present application, the processing module 620 is further configured to:
[0107] If the video to be accessed is not cached in the local storage space of the terminal where the device is located, sending the video access request to the first server through the WebView control;
[0108] receiving a video frame of the video to be accessed returned by the first server according to the video access request, and caching the video frame of the video to be accessed;
[0109] Playing the video frame of the video to be accessed in the cache of the terminal where the device is located;
[0110] When the playing progress of the video to be accessed is greater than the progress threshold, the video to be accessed is downloaded from the first server according to the video access request, and the video to be accessed is stored in the local storage space of the terminal where the device is located.
[0111] In another embodiment of the present application, the processing module 620 is further configured to:
[0112] The first address is encoded to obtain a first identifier;
[0113] The first identifier is used as the name of the video to be accessed, and the video to be accessed is stored in the local storage space of the terminal where the device is located.
[0114] In another embodiment of the present application, the processing module 620 is further configured to:
[0115] Encoding the first address to obtain a first identifier;
[0116] Determine whether there is a to-be-accessed video named with the first identifier in the local storage space of the terminal where the device is located;
[0117] If the video to be accessed and named with the first identifier exists in the local storage space of the terminal where the device is located, it is determined that the video to be accessed is cached in the local storage space of the terminal where the device is located.
[0118] In another embodiment of the present application, the processing module 620 is further configured to:
[0119] When the remaining storage space of the local storage space of the terminal where the device is located is less than a first value, the to-be-accessed video in the local storage space of the terminal where the device is located is cleared.
[0120] In another embodiment of the present application, the acquisition module 630 is further used for:
[0121] Acquire the video to be accessed from a local storage space of a terminal where the device is located based on the second address through an http server;
[0122] The video to be accessed is sent to the WebView control via the http server.
[0123] It should be noted that the execution process and information interaction between the above-mentioned devices / modules are based on the same concept as the data access method provided in the embodiment of the present application. For its specific functions and technical effects, please refer to the method embodiment section and will not be repeated here.
[0124] like Figure 7 , which is a schematic block diagram of a terminal provided in an embodiment of the present application, wherein the terminal 7 of the embodiment includes:
[0125] One or more processors 710, a memory 720, and a computer program 730 stored in the memory 720 and executable on the processor 710. When the processor 710 executes the computer program 730, the steps in the above-mentioned various method embodiments are implemented, for example Figure 1 Steps S11 to S13 are shown.
[0126] Exemplarily, the computer program 730 may be divided into one or more modules, and the one or more modules are stored in the memory 720 and executed by the processor 710 to complete the application. The one or more modules may be a series of computer program instruction segments that can complete specific functions, and the instruction segments are used to describe the execution process of the computer program 730 in the electronic device 7. For example, the computer program 730 may be divided into a monitoring module, an interface determination module, an annotation acquisition module, a search keyword determination module, and a cache data acquisition module. Exemplarily:
[0127] A monitoring module, used for a terminal to monitor a video access request of a WebView control, wherein the video access request includes a first address, the first address is an address of a video to be accessed in a first server, and the first server is a server that responds to the video access request;
[0128] A processing module, configured for the terminal to replace the first address with a second address, wherein the second address includes an address of the video to be accessed in a local storage space of the terminal;
[0129] The acquisition module is used for the terminal to acquire the video to be accessed cached in the local storage space video of the terminal according to the second address, and the terminal displays the video to be accessed.
[0130] The terminal includes but is not limited to a processor 710 and a memory 720. Those skilled in the art will appreciate that Figure 7 It is only an example of terminal 7 and does not constitute a limitation on terminal 7. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the terminal 7 may also include an input device, an output device, a network access device, a bus, etc.
[0131] The processor 710 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0132] The memory 720 may be an internal storage unit of the terminal 7, such as a hard disk or memory of the terminal 7. The memory 720 may also be an external storage device of the terminal 7, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal 7. Further, the memory 720 may also include both an internal storage unit of the terminal 7 and an external storage device. The memory 720 is used to store the computer program and other programs and data required by the terminal 7. The memory 720 may also be used to temporarily store data that has been output or is to be output.
[0133] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0134] Those of ordinary skill in the art will appreciate that the steps of the exception handling methods of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0135] The embodiments of the present application are described in detail above. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application. At the same time, changes or deformations made by those skilled in the art based on the ideas of the present application, the specific implementation methods and the scope of application of the present application, all belong to the scope of protection of the present application. In summary, the content of this specification should not be construed as a limitation on the present application.
Claims
1. A video access method, characterized in that: Applied to a terminal with a WebView control installed, the method includes: The terminal monitors a video access request of the WebView control, wherein the video access request includes a first address, the first address is a URL address of the video to be accessed in a first server, and the first server is a server that responds to the video access request; The terminal replaces the first address with a second address, where the second address includes an address of the video to be accessed in a local storage space of the terminal; After the terminal obtains the video to be accessed cached in the local storage space of the terminal according to the second address, the terminal displays the video to be accessed; Before the terminal replaces the first address with the second address, the method further includes: The terminal determines, according to the first address, whether the video to be accessed is cached in a local storage space of the terminal, including: The terminal encodes the first address to obtain a first identifier; Determine whether there is a to-be-accessed video named with the first identifier in the local storage space of the terminal; If the video to be accessed and named with the first identifier exists in the local storage space of the terminal, determining that the video to be accessed is cached in the local storage space of the terminal; After the terminal determines, according to the first address, whether the video to be accessed is cached in the local storage space of the terminal, the method further includes: If the video to be accessed is not cached in the local storage space of the terminal, the terminal sends the video access request to the first server through the WebView control; The terminal receives the video frame of the video to be accessed returned by the first server according to the video access request, and caches the video frame of the video to be accessed; The terminal plays a video frame of the video to be accessed in the buffer of the terminal; When the playing progress of the video to be accessed is greater than a progress threshold, the terminal downloads the video to be accessed from the first server according to the video access request, and stores the video to be accessed in a local storage space of the terminal.
2. The method according to claim 1, characterized in that The terminal replacing the first address with a second address includes: If the video to be accessed is cached in the local storage space video of the terminal, the terminal replaces the first address with the second address.
3. The method according to claim 2, characterized in that The step of storing the video to be accessed in the local storage space of the terminal includes: The terminal encodes the first address to obtain a first identifier; The first identifier is used as the name of the video to be accessed, and the video to be accessed is stored in the local storage space of the terminal.
4. The method according to claim 3, characterized in that The terminal obtains, according to the second address, a to-be-accessed video cached in a local storage space of the terminal, including: The terminal obtains the video to be accessed from the local storage space of the terminal based on the second address through the http server; The terminal sends the video to be accessed to the WebView control through the http server.
5. The method according to claim 1, characterized in that The second address also includes the IP address and port number of the terminal.
6. The method according to claim 3, characterized in that The method further comprises: When the remaining storage space of the local storage space of the terminal is less than a first value, the to-be-accessed video in the local storage space of the terminal is cleared.
7. A video access device, characterized in that: The device comprises: A monitoring module, used for monitoring a video access request of a WebView control, wherein the video access request includes a first address, the first address is a URL address of a video to be accessed in a first server, and the first server is a server that responds to the video access request; A processing module, configured to replace the first address with a second address, wherein the second address includes an address of the video to be accessed in a local storage space of a terminal where the device is located; an acquisition module, configured to acquire, according to the second address, a video to be accessed that is cached in a local storage space video of the terminal where the device is located, and display the video to be accessed through the terminal where the device is located; The processing module is specifically used to determine whether the video to be accessed is cached in the local storage space of the terminal according to the first address, including: Encoding the first address to obtain a first identifier; Determine whether there is a to-be-accessed video named with the first identifier in the local storage space of the terminal; If the video to be accessed and named with the first identifier exists in the local storage space of the terminal, determining that the video to be accessed is cached in the local storage space of the terminal; The processing module is also used for: If the video to be accessed is not cached in the local storage space of the terminal, the terminal sends the video access request to the first server through the WebView control; The terminal receives the video frame of the video to be accessed returned by the first server according to the video access request, and caches the video frame of the video to be accessed; The terminal plays a video frame of the video to be accessed in the buffer of the terminal; When the playing progress of the video to be accessed is greater than a progress threshold, the terminal downloads the video to be accessed from the first server according to the video access request, and stores the video to be accessed in a local storage space of the terminal.
8. A terminal, characterized in that: The terminal comprises a processor, and the processor is used to run a computer program stored in a memory to implement the video access method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the video access method according to any one of claims 1 to 6.
