CN115499697A - Video carousel switching method and terminal - Google Patents

Video carousel switching method and terminal Download PDF

Info

Publication number
CN115499697A
CN115499697A CN202110671546.XA CN202110671546A CN115499697A CN 115499697 A CN115499697 A CN 115499697A CN 202110671546 A CN202110671546 A CN 202110671546A CN 115499697 A CN115499697 A CN 115499697A
Authority
CN
China
Prior art keywords
node
video
sliding
nodes
preset number
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110671546.XA
Other languages
Chinese (zh)
Other versions
CN115499697B (en
Inventor
刘德建
林琛
陈波
洪曙鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujian Tianyi Network Technology Co ltd
Original Assignee
Fujian Tianyi Network Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujian Tianyi Network Technology Co ltd filed Critical Fujian Tianyi Network Technology Co ltd
Priority to CN202110671546.XA priority Critical patent/CN115499697B/en
Publication of CN115499697A publication Critical patent/CN115499697A/en
Application granted granted Critical
Publication of CN115499697B publication Critical patent/CN115499697B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/472End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/433Content storage operation, e.g. storage operation in response to a pause request, caching operations
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/44004Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving video buffer management, e.g. video decoder buffer or video display buffer
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/45Management operations performed by the client for facilitating the reception of or the interaction with the content or administrating data related to the end-user or to the client device itself, e.g. learning user preferences for recommending movies, resolving scheduling conflicts
    • H04N21/462Content or additional data management, e.g. creating a master electronic program guide from data received from the Internet and a Head-end, controlling the complexity of a video stream by scaling the resolution or bit-rate based on the client capabilities
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Databases & Information Systems (AREA)
  • Human Computer Interaction (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The invention discloses a video carousel switching method and a terminal, wherein a first preset number of video nodes and a second preset number of node containers are preset, video nodes are sequentially added into the node containers, and node videos corresponding to the video nodes are loaded and sequentially played; by limiting the number of the node containers and dynamically replacing the nodes in the node containers, the video content in the node containers can be played circularly through the node containers, the node objects do not need to be created and recovered frequently, the video playing fluency is improved, and the video content of the recent historical nodes can be conveniently and quickly viewed; after the video nodes with the first preset number are loaded and played, the next batch of video nodes are obtained according to the first preset number, so that all resources of the video to be carousel do not need to be stored in a memory space, the situation that the video to be carousel is blocked due to the fact that too much memory space is occupied is avoided, and the fluency of video carousel is improved.

Description

Video carousel switching method and terminal
Technical Field
The present invention relates to the field of information technologies, and in particular, to a video carousel switching method and a terminal.
Background
In current video applications, in order to make a video play continuously or make a user perform an infinite sliding switch on the video, many video resources are often required to be loaded in advance and smooth scrolling is required in the back and forth switch. If all the required resources and operation objects are loaded at one time, the application may be stuck or flash back due to the large memory occupation. Some applications will then load only the video that needs to be played currently and remove the last played video when switching to the next video.
However, this solution has several drawbacks:
first, video switching can be accompanied by a pause phenomenon: for example, each time a user starts playing a video or switches to the next video, the user needs to reload a video object and recreate an instance object, and if the network is not good enough, there may be a case where it takes a long time for video loading; the object is created again, and space needs to be applied to the operating system, and the fluency of the mobile terminal is affected by frequent application of memory space.
Second, when returning to the previous video, it is not possible to continue watching from the last viewpoint: for example, when the current video is switched to, the last video object is removed, and the user wants to continue watching the last video, the video needs to be reloaded, and if the network is not good, the user needs to wait for more time, which seriously affects the watching experience.
Thirdly, the mobile terminal has large power consumption: due to the frequent creation of objects and the recycling of objects, the frequency of garbage recycling by the system is drastically increased, resulting in large CPU footprint, hot equipment and high power consumption.
Disclosure of Invention
The technical problem to be solved by the invention is as follows: the video carousel switching method and the terminal are provided, and the fluency of video carousel can be improved.
In order to solve the technical problems, the invention adopts the technical scheme that:
a video carousel switching method comprises the following steps:
presetting a first preset number of video nodes and a second preset number of node containers, wherein the second preset number is smaller than the first preset number;
sequentially adding one video node in each node container, loading and sequentially playing node videos corresponding to the video nodes in the node containers;
acquiring a sliding distance for sliding the video node, judging whether the sliding distance is greater than a threshold value, if so, taking the selected video node after sliding as a current node, and if not, replacing a node video which is farthest from the current node in the node container with a node video of the current node;
and judging whether the loading and playing of the video nodes of the batch with the first preset number are finished, if so, acquiring the video nodes of the next batch with the first preset number, adding the newly acquired video nodes into the corresponding node container, and loading and playing.
In order to solve the technical problem, the invention adopts another technical scheme as follows:
a video carousel switching terminal comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the following steps when executing the computer program:
presetting a first preset number of video nodes and a second preset number of node containers, wherein the second preset number is smaller than the first preset number;
sequentially adding one video node in each node container, loading and sequentially playing node videos corresponding to the video nodes in the node containers;
acquiring a sliding distance for sliding the video node, judging whether the sliding distance is greater than a threshold value, if so, taking the selected video node after sliding as a current node, and if the current node does not exist in the node container, replacing a node video which is farthest from the current node in the node container with a node video of the current node;
and judging whether the video nodes of the first preset number of the batch are loaded and played completely, if so, acquiring the video nodes of the next batch of the first preset number, adding the newly acquired video nodes into the corresponding node container, and loading and playing.
The invention has the beneficial effects that: presetting a first preset number of video nodes and a second preset number of node containers, sequentially adding video nodes in the node containers, and loading and sequentially playing node videos corresponding to the video nodes; by limiting the number of the node containers and dynamically replacing the nodes in the node containers, the video content in the node containers can be played circularly through the node containers, frequent creation and recovery of node objects are not needed, the video playing fluency is improved, and the video content of the recent historical nodes can be conveniently and quickly viewed; after the video nodes with the first preset number are loaded and played, the next batch of video nodes are obtained according to the first preset number, so that all resources of the video to be carousel do not need to be stored in a memory space, the situation that the video to be carousel is blocked due to the fact that too much memory space is occupied is avoided, and the fluency of video carousel is improved.
Drawings
Fig. 1 is a flowchart of a video carousel switching method according to an embodiment of the present invention;
fig. 2 is a schematic diagram of a video carousel switching terminal according to an embodiment of the present invention;
fig. 3 is a circular switching flowchart of a video carousel switching method according to an embodiment of the present invention;
fig. 4 is a flow chart of playing a moving animation of a video carousel switching method according to an embodiment of the present invention;
fig. 5 is a flowchart illustrating video resource management of a video carousel switching method according to an embodiment of the present invention.
Detailed Description
In order to explain technical contents, achieved objects, and effects of the present invention in detail, the following description is made with reference to the accompanying drawings in combination with the embodiments.
Referring to fig. 1, 3 to 5, an embodiment of the present invention provides a video carousel switching method, including:
presetting a first preset number of video nodes and a second preset number of node containers, wherein the second preset number is smaller than the first preset number;
sequentially adding one video node in each node container, loading and sequentially playing node videos corresponding to the video nodes in the node containers;
acquiring a sliding distance for sliding the video node, judging whether the sliding distance is greater than a threshold value, if so, taking the selected video node after sliding as a current node, and if the current node does not exist in the node container, replacing a node video which is farthest from the current node in the node container with a node video of the current node;
and judging whether the loading and playing of the video nodes of the batch with the first preset number are finished, if so, acquiring the video nodes of the next batch with the first preset number, adding the newly acquired video nodes into the corresponding node container, and loading and playing.
As can be seen from the above description, the beneficial effects of the present invention are: presetting a first preset number of video nodes and a second preset number of node containers, sequentially adding video nodes in the node containers, and loading and sequentially playing node videos corresponding to the video nodes; by limiting the number of the node containers and dynamically replacing the nodes in the node containers, the video content in the node containers can be played circularly through the node containers, frequent creation and recovery of node objects are not needed, the video playing fluency is improved, and the video content of the recent historical nodes can be conveniently and quickly viewed; after the video nodes with the first preset number are loaded and played, the next batch of video nodes are obtained according to the first preset number, so that all resources of the video to be carousel do not need to be stored in a memory space, the situation that the video to be carousel is blocked due to the fact that too much memory space is occupied is avoided, and the fluency of video carousel is improved.
Further, the obtaining a sliding distance for sliding the video node includes:
adjusting the position of the video node in real time by sliding the video node;
at the end of the sliding, a sliding distance is calculated according to the initial touch position of the sliding and the end touch position of the sliding.
According to the description, the positions of the video nodes are adjusted in real time in the process of sliding the video nodes, and the sliding distance is calculated according to the initial touch position and the end touch position in the sliding process, so that the real-time sliding of the video nodes can be realized, and the smoothness of the video sliding is ensured.
Further, the determining whether the sliding distance is greater than a threshold value, if so, specifically including, as the current node, the step of selecting the video node after sliding:
setting a sliding animation;
judging whether the sliding distance is greater than a distance threshold value, if so, taking the selected video node after sliding as a current node, increasing the sliding distance until the video node slides to the middle position of the current node, and playing the sliding animation in the sliding process;
and if not, reducing the sliding distance until all the video nodes recover to the positions before sliding, and playing the sliding animation in the sliding process.
According to the description, whether the next video node can be switched to is judged according to the sliding distance, continuous video switching is achieved by changing the sliding distance and playing the sliding animation, and user experience is improved.
Further, the loading and sequentially playing the node videos corresponding to the video nodes in the node container includes:
judging whether a node video corresponding to the video node exists in a cache, if so, acquiring the node video from the cache, and if not, downloading the node video from a network;
and if the node video of the current node is cached to a preset percentage, starting to play the node video content, and pausing the caching of the node videos in the other node containers.
According to the description, when the node video of the current node is buffered to the preset percentage, the node video content can be played, and the node video in the other node containers is temporarily stopped from being cached, so that the caching pressure can be reduced, and the fluency of carousel is ensured.
Further, still include:
and judging whether the number of the node videos stored in the cache exceeds a number threshold, if so, deleting the node videos which are not played in the cache for the longest time.
According to the above description, the algorithm which is not used most recently is used for cache management, so that node videos which are not played in the longest time can be cleaned, and the cache pressure is reduced.
Referring to fig. 2, another embodiment of the present invention provides a video carousel switching terminal, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the computer program to implement the following steps:
presetting a first preset number of video nodes and a second preset number of node containers, wherein the second preset number is smaller than the first preset number;
sequentially adding one video node in each node container, loading and sequentially playing node videos corresponding to the video nodes in the node containers;
acquiring a sliding distance for sliding the video node, judging whether the sliding distance is greater than a threshold value, if so, taking the selected video node after sliding as a current node, and if the current node does not exist in the node container, replacing a node video which is farthest from the current node in the node container with a node video of the current node;
and judging whether the loading and playing of the video nodes of the batch with the first preset number are finished, if so, acquiring the video nodes of the next batch with the first preset number, adding the newly acquired video nodes into the corresponding node container, and loading and playing.
As can be seen from the above description, a first preset number of video nodes and a second preset number of node containers are preset, video nodes are sequentially added to the node containers, and node videos corresponding to the video nodes are loaded and sequentially played; by limiting the number of the node containers and dynamically replacing the nodes in the node containers, the video content in the node containers can be played circularly through the node containers, frequent creation and recovery of node objects are not needed, the video playing fluency is improved, and the video content of the recent historical nodes can be conveniently and quickly viewed; after the video nodes with the first preset number are loaded and played, the next batch of video nodes are obtained according to the first preset number, so that all resources of the video to be carousel do not need to be stored in a memory space, the situation that the video to be carousel is blocked due to the fact that too much memory space is occupied is avoided, and the fluency of video carousel is improved.
Further, the obtaining a sliding distance for sliding the video node includes:
adjusting the position of the video node in real time by sliding the video node;
at the end of the sliding, a sliding distance is calculated according to the initial touch position of the sliding and the end touch position of the sliding.
According to the description, the positions of the video nodes are adjusted in real time in the process of sliding the video nodes, and the sliding distance is calculated according to the initial touch position and the end touch position in the sliding process, so that the real-time sliding of the video nodes can be realized, and the smoothness of the video sliding is ensured.
Further, the determining whether the sliding distance is greater than a threshold value, if so, specifically including, as the current node, the step of selecting the video node after sliding:
setting a sliding animation;
judging whether the sliding distance is greater than a distance threshold value, if so, taking the selected video node after sliding as a current node, increasing the sliding distance until the video node slides to the middle position of the current node, and playing the sliding animation in the sliding process;
and if not, reducing the sliding distance until all the video nodes recover to the positions before sliding, and playing the sliding animation in the sliding process.
According to the description, whether the next video node can be switched to is judged according to the sliding distance, continuous video switching is achieved by changing the sliding distance and playing the sliding animation, and user experience is improved.
Further, the loading and sequentially playing the node videos corresponding to the video nodes in the node container includes:
judging whether a node video corresponding to the video node exists in a cache, if so, acquiring the node video from the cache, and if not, downloading the node video from a network;
and if the node video of the current node is cached to a preset percentage, starting to play the node video content, and pausing the caching of the node videos in the other node containers.
According to the description, when the node video of the current node is buffered to the preset percentage, the node video content can be played, and the node video in the other node containers is temporarily stored, so that the storage pressure can be reduced, and the fluency of carousel is ensured.
Further, still include:
and judging whether the number of the node videos stored in the cache exceeds a number threshold, if so, deleting the node videos which are not played in the cache for the longest time.
According to the above description, the algorithm which is not used most recently is used for cache management, so that node videos which are not played for the longest time can be cleaned, and the cache pressure is reduced.
The video carousel switching method and the terminal are suitable for all video carousel switching products, can improve the fluency of video carousel, and are described in the following through specific implementation modes:
example one
Referring to fig. 1, 3 to 5, a video carousel switching method includes the steps of:
s1, presetting a first preset number of video nodes and a second preset number of node containers, wherein the second preset number is smaller than the first preset number.
Specifically, in the present embodiment, 5 video nodes and 3 node containers are set in advance.
S2, sequentially adding one video node in each node container, and loading and sequentially playing the node videos corresponding to the video nodes in the node containers.
Wherein, the loading and playing the node videos corresponding to the video nodes in the node container in sequence comprises:
judging whether a node video corresponding to the video node exists in a cache, if so, acquiring the node video from the cache, and if not, downloading the node video from a network;
and if the node video of the current node is cached to a preset percentage, starting to play the node video content, and pausing the caching of the node videos in the other node containers.
Specifically, when a user starts to view a video, the user enters a playing page, 3 child node containers are preloaded, video contents corresponding to the loaded video nodes are sequentially and pre-cached in the containers according to the sequence of the video nodes, and the user starts to play automatically after the video in the current display node container is cached to a playable percentage. And preferentially caching the video of the current node, and starting to cache the videos of the rest nodes after the current node can play.
When the video resource is obtained, the video resource is obtained from the local cache through video management, if the video exists in the local cache, the video resource is directly loaded to the memory, otherwise, the video resource is obtained from the network.
And S3, obtaining the sliding distance for sliding the video node, judging whether the sliding distance is larger than a threshold value, if so, taking the selected video node after sliding as the current node, and if the current node does not exist in the node container, replacing the node video which is farthest from the current node in the node container with the node video of the current node.
Wherein the obtaining of the sliding distance for sliding the video node comprises:
adjusting the position of the video node in real time by sliding the video node;
and at the end of the sliding, calculating a sliding distance according to the initial touch position of the sliding and the end touch position of the sliding.
Specifically, referring to fig. 3, node containers are created in the circular switching module, each node container can independently display the content of a video, when a user slides a screen up and down, Y axes of all nodes are actively updated, a sliding distance is calculated according to the position initially touched by the user and the position currently touched by the user, a difference value is calculated according to the distance given to the Y axes of all nodes in the current video list, and a sliding phenomenon generated by all current video nodes according to the position touched by the user is shown.
Wherein, the judging whether the sliding distance is greater than a threshold value, if so, the specifically including, as the current node, the video node selected after sliding:
setting a sliding animation;
judging whether the sliding distance is greater than a distance threshold value, if so, taking the selected video node after sliding as a current node, increasing the sliding distance until the video node slides to the middle position of the current node, and playing the sliding animation in the sliding process;
if not, reducing the sliding distance until all the video nodes recover to the positions before sliding, and playing the sliding animation in the sliding process.
Specifically, referring to fig. 3 and 4, when the user stops sliding, it is determined whether the display of switching the next node is reached according to the sliding distance, and if the sliding distance is less than one half of the height of the current node container, all nodes are restored; the method mainly comprises the steps that moving animations of all nodes in a video list are mainly controlled in a moving module, the positions of the nodes are set, the sliding phenomenon of the video list is shown according to the sliding distance of a user, 5 nodes can be set in the currently displayed video list, the positions of all the nodes can be updated rapidly through a small number of nodes, massive calculation is avoided, videos in the nodes which are not displayed are replaced through data processing after the moving is finished, the user can feel smooth sliding experience through playing of the animations, when the touch distance of the user is large enough, the next video is switched, and 0.25S sliding animations are set when the next video is switched; when the distance is not enough, the original position is restored, and the sliding animation needs to be played, so that the user can have continuous experience visually.
And taking the selected video node after sliding as a current node, and replacing the node video which is farthest from the current node in the node container with the node video of the current node if the current node does not exist in the node container.
Specifically, if the user slides upwards and takes the selected video node after sliding as the current node, whether the current node exists in the node container is judged, if yes, the node in the node container is not modified, if not, the node video which is farthest away from the current node in the node container is replaced by the node video of the current node, for example, the current node is a third video node, the current node is replaced by a fourth video node after upwards rolling is completed, the position of the first video node is replaced by the fourth video node after sliding is completed, and the video in the node is correspondingly replaced through data processing; if the user slides downwards, the fourth video node is reset and replaced by the first video node, and the video data processing in the node is the same as the upward sliding processing; after the setting is finished, the video circulating carousel can be realized, and the repeated establishment and destruction of a large number of nodes are reduced.
And S4, judging whether the video nodes of the first preset number of the batch are loaded and played completely, if so, acquiring the video nodes of the first preset number of the next batch, adding the newly acquired video nodes into the corresponding node container, and loading and playing.
Specifically, only after the current video in the circular carousel is completely loaded and played, the subsequent videos are continuously loaded according to the first preset number, otherwise, no new video is loaded, if the first preset number is not set, all videos need to be loaded at one time or only one video needs to be loaded at each time, the network occupation for loading all videos at one time is high, and the memory occupation of the videos is large, so that the memory bottleneck is easily caused; only one video is loaded, the video is required to be requested when played every time, video blocking is easily caused under the condition of large network fluctuation, and poor user experience is caused.
Example two
Referring to fig. 5, the difference between the present embodiment and the first embodiment is that how to store the loaded video is further defined, specifically:
and judging whether the number of the node videos stored in the cache exceeds a number threshold, and if so, deleting the node videos which are not played for the longest time in the cache.
In this embodiment, the video can be played and cached locally when being loaded. When the number of the videos which are cached at the same time currently exceeds a threshold value, whether the time from the video to the last playing is longest in all the videos is judged, if the time is longest, the video is cleared from a current memory, and the video is preloaded in advance when the video is used next time.
EXAMPLE III
Referring to fig. 2, a video carousel switching terminal includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the video carousel switching method according to the first embodiment or the second embodiment when executing the computer program.
In summary, according to the video carousel switching method and the terminal provided by the present invention, a first preset number of video nodes and a second preset number of node containers are preset, video nodes are sequentially added to the node containers, and node videos corresponding to the video nodes are loaded and sequentially played, wherein when a current node is cached to a preset percentage and starts to be played, caching of other nodes is performed, so that the caching pressure is reduced, and the improvement of the flow field degree is facilitated; by limiting the number of the node containers and dynamically replacing the nodes in the node containers, the video content in the node containers can be played circularly through the node containers, the node objects do not need to be created and recovered frequently, the video playing fluency is improved, and the video content of the recent historical nodes can be conveniently and quickly viewed; after the sliding is finished, whether the video node needs to be switched to the next video node or restored to the node position before the sliding is judged according to the sliding distance, and a sliding animation is added in the moving process, so that the sliding process is smoothly carried out, and the experience of a user is improved; after the video nodes with the first preset number are loaded and played, the next batch of video nodes are obtained according to the first preset number, so that all resources of the video to be carousel do not need to be stored in a memory space, the situation that the video to be carousel is blocked due to the fact that too much memory space is occupied is avoided, and the fluency of video carousel is improved.
The above description is only an embodiment of the present invention, and is not intended to limit the scope of the present invention, and all equivalent modifications made by the present invention and the contents of the accompanying drawings, which are directly or indirectly applied to the related technical fields, are included in the scope of the present invention.

Claims (10)

1. A video carousel switching method, comprising the steps of:
presetting a first preset number of video nodes and a second preset number of node containers, wherein the second preset number is smaller than the first preset number;
sequentially adding one video node in each node container, loading and sequentially playing node videos corresponding to the video nodes in the node containers;
acquiring a sliding distance for sliding the video node, judging whether the sliding distance is greater than a threshold value, if so, taking the selected video node after sliding as a current node, and if the current node does not exist in the node container, replacing a node video which is farthest from the current node in the node container with a node video of the current node;
and judging whether the loading and playing of the video nodes of the batch with the first preset number are finished, if so, acquiring the video nodes of the next batch with the first preset number, adding the newly acquired video nodes into the corresponding node container, and loading and playing.
2. The video carousel switching method according to claim 1, wherein the obtaining of the sliding distance for sliding the video node comprises:
adjusting the position of the video node in real time by sliding the video node;
at the end of the sliding, a sliding distance is calculated according to the initial touch position of the sliding and the end touch position of the sliding.
3. The method according to claim 1, wherein the determining whether the sliding distance is greater than a threshold value, and if so, taking the selected video node after sliding as a current node specifically includes:
setting a sliding animation;
judging whether the sliding distance is greater than a distance threshold value, if so, taking the selected video node after sliding as a current node, increasing the sliding distance until the video node slides to the middle position of the current node, and playing the sliding animation in the sliding process;
and if not, reducing the sliding distance until all the video nodes recover to the positions before sliding, and playing the sliding animation in the sliding process.
4. The video carousel switching method according to claim 1, wherein the loading and sequentially playing the node videos corresponding to the video nodes in the node container comprises:
judging whether a node video corresponding to the video node exists in a cache, if so, acquiring the node video from the cache, and if not, downloading the node video from a network;
and if the node video of the current node is cached to a preset percentage, starting to play the node video content, and pausing the caching of the node videos in the other node containers.
5. The video carousel switching method of claim 1, further comprising:
and judging whether the number of the node videos stored in the cache exceeds a number threshold, and if so, deleting the node videos which are not played for the longest time in the cache.
6. A video carousel switching terminal comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:
presetting a first preset number of video nodes and a second preset number of node containers, wherein the second preset number is smaller than the first preset number;
sequentially adding one video node in each node container, loading and sequentially playing node videos corresponding to the video nodes in the node containers;
acquiring a sliding distance for sliding the video node, judging whether the sliding distance is greater than a threshold value, if so, taking the selected video node after sliding as a current node, and if not, replacing a node video which is farthest from the current node in the node container with a node video of the current node;
and judging whether the first preset number of video nodes of the batch are loaded and played completely, if so, acquiring the next batch of the first preset number of video nodes, adding the newly acquired video nodes into the corresponding node container, and loading and playing.
7. The video carousel switching terminal according to claim 6, wherein the obtaining of the sliding distance for sliding the video node comprises:
adjusting the position of the video node in real time by sliding the video node;
and at the end of the sliding, calculating a sliding distance according to the initial touch position of the sliding and the end touch position of the sliding.
8. The video carousel switching terminal according to claim 6, wherein the determining whether the sliding distance is greater than a threshold value, if yes, the taking the selected video node after sliding as the current node specifically comprises:
setting a sliding animation;
judging whether the sliding distance is greater than a distance threshold value, if so, taking the selected video node after sliding as a current node, increasing the sliding distance until the video node slides to the middle position of the current node, and playing the sliding animation in the sliding process;
if not, reducing the sliding distance until all the video nodes recover to the positions before sliding, and playing the sliding animation in the sliding process.
9. The video carousel switching terminal according to claim 6, wherein the loading and sequentially playing the node videos corresponding to the video nodes in the node container comprises:
judging whether a node video corresponding to the video node exists in a cache, if so, acquiring the node video from the cache, and if not, downloading the node video from a network;
and if the node video of the current node is cached to a preset percentage, starting to play the node video content, and pausing the caching of the node videos in the other node containers.
10. The video carousel switching terminal according to claim 6, further comprising:
and judging whether the number of the node videos stored in the cache exceeds a number threshold, if so, deleting the node videos which are not played in the cache for the longest time.
CN202110671546.XA 2021-06-17 2021-06-17 Video carousel switching method and terminal Active CN115499697B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110671546.XA CN115499697B (en) 2021-06-17 2021-06-17 Video carousel switching method and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110671546.XA CN115499697B (en) 2021-06-17 2021-06-17 Video carousel switching method and terminal

Publications (2)

Publication Number Publication Date
CN115499697A true CN115499697A (en) 2022-12-20
CN115499697B CN115499697B (en) 2023-07-07

Family

ID=84465474

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110671546.XA Active CN115499697B (en) 2021-06-17 2021-06-17 Video carousel switching method and terminal

Country Status (1)

Country Link
CN (1) CN115499697B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105898607A (en) * 2015-11-20 2016-08-24 乐视云计算有限公司 Network video playback method, device and system
CN106162324A (en) * 2015-04-09 2016-11-23 腾讯科技(深圳)有限公司 The processing method and processing device of video file
CN106534952A (en) * 2016-09-28 2017-03-22 青岛海信电器股份有限公司 Method for continuingly playing film source after source switching and smart television
CN107547940A (en) * 2017-09-13 2018-01-05 广州酷狗计算机科技有限公司 Video playback processing method, equipment and computer-readable recording medium
US20200007926A1 (en) * 2018-06-29 2020-01-02 Baidu Online Network Technology (Beijing) Co., Ltd Method and apparatus for playing video
CN110809168A (en) * 2018-08-06 2020-02-18 中兴通讯股份有限公司 Video live broadcast processing method and device, terminal and storage medium
US20200112772A1 (en) * 2018-10-03 2020-04-09 Wanjeru Kingori System and method for branching-plot video content and editing thereof
CN112911389A (en) * 2021-01-18 2021-06-04 浙江大华技术股份有限公司 Video playing switching method, electronic equipment and computer storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106162324A (en) * 2015-04-09 2016-11-23 腾讯科技(深圳)有限公司 The processing method and processing device of video file
CN105898607A (en) * 2015-11-20 2016-08-24 乐视云计算有限公司 Network video playback method, device and system
CN106534952A (en) * 2016-09-28 2017-03-22 青岛海信电器股份有限公司 Method for continuingly playing film source after source switching and smart television
CN107547940A (en) * 2017-09-13 2018-01-05 广州酷狗计算机科技有限公司 Video playback processing method, equipment and computer-readable recording medium
US20200007926A1 (en) * 2018-06-29 2020-01-02 Baidu Online Network Technology (Beijing) Co., Ltd Method and apparatus for playing video
CN110809168A (en) * 2018-08-06 2020-02-18 中兴通讯股份有限公司 Video live broadcast processing method and device, terminal and storage medium
US20200112772A1 (en) * 2018-10-03 2020-04-09 Wanjeru Kingori System and method for branching-plot video content and editing thereof
CN112911389A (en) * 2021-01-18 2021-06-04 浙江大华技术股份有限公司 Video playing switching method, electronic equipment and computer storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
李汶娟等: "P2P-VOD缓存策略MVC", 《微计算机信息》, no. 03, pages 1 - 3 *
陈起等: "P2P流媒体点播系统中的缓存管理方案的研究和实现", 《计算机应用与软件》, vol. 26, no. 02, pages 94 - 96 *

Also Published As

Publication number Publication date
CN115499697B (en) 2023-07-07

Similar Documents

Publication Publication Date Title
CN106982388B (en) Picture display method and device
CN108762622B (en) Page switching display method and device
CN112540713B (en) Video preview progress bar scaling method, system, device and storage medium
CN110832849B (en) Predictive bit rate selection for 360 degree video streaming
CN105677265A (en) Display method and terminal
CN106572381A (en) Processing method of photo thumbnail and intelligent television
CN112565898B (en) Method and system for moving focus based on smart television operating system
CN112836086B (en) Video processing method and device and electronic equipment
CN109117237B (en) Bullet screen display method and device and electronic equipment
CN104077016A (en) Method and device for displaying and switching multiple windows
CN114071047A (en) Frame rate control method and related device
CN106468994A (en) A kind for the treatment of method and apparatus of application program
CN112148405A (en) Desktop layout method and device and electronic equipment
CN109388737B (en) Method and device for sending exposure data of content item and storage medium
CN113986076A (en) Icon display control method and device, electronic equipment and storage medium
CN115499697A (en) Video carousel switching method and terminal
CN104267812A (en) Information processing method and electronic device
CN109218799B (en) Method, storage medium, device and system for quickly switching high-definition images of android television
US20230091771A1 (en) Device Control Method, Storage Medium, and Non-Transitory Computer-Readable Electronic Device
CN106598439B (en) Display method and device in item scrolling process
CN112883306B (en) Page display method and device
CN115145444A (en) Icon moving method and device, electronic equipment and storage medium
CN112738639B (en) Video switching method and device, electronic equipment and computer readable medium
CN111858395B (en) Data management method and device
CN114564134A (en) Application icon display method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant