CN107608737A - Animation playing method and device - Google Patents

Animation playing method and device Download PDF

Info

Publication number
CN107608737A
CN107608737A CN201710923210.1A CN201710923210A CN107608737A CN 107608737 A CN107608737 A CN 107608737A CN 201710923210 A CN201710923210 A CN 201710923210A CN 107608737 A CN107608737 A CN 107608737A
Authority
CN
China
Prior art keywords
progress
layer
animation
animation file
currently playing
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
CN201710923210.1A
Other languages
Chinese (zh)
Other versions
CN107608737B (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.)
Beijing Kingsoft Internet Security Software Co Ltd
Original Assignee
Beijing Kingsoft Internet Security Software 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 Beijing Kingsoft Internet Security Software Co Ltd filed Critical Beijing Kingsoft Internet Security Software Co Ltd
Priority to CN201710923210.1A priority Critical patent/CN107608737B/en
Publication of CN107608737A publication Critical patent/CN107608737A/en
Application granted granted Critical
Publication of CN107608737B publication Critical patent/CN107608737B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention provides an animation playing method and device, wherein the method comprises the following steps: executing animation data corresponding to the animation file when a trigger event corresponding to a prestored animation file is detected; when the current playing layer of the animation file is a progress layer, acquiring the actual progress of a trigger event, and judging whether the current playing progress of the progress layer is smaller than the actual progress; if the current playing progress is larger than or equal to the actual progress, the progress layer is stopped to be updated, so that the interaction between the playing progress of the progress layer and the corresponding trigger event can be realized in the playing process of the animation file, the animation file is prevented from being written in a pure code mode, the development time and the version iteration time of the animation file are shortened, and the development efficiency of the animation file is improved.

Description

Animation playing method and device
Technical field
The present invention relates to cartoon technique field, more particularly to a kind of animation playing method and device.
Background technology
At present, the animation effect of most of animation is all closely bound up with progress bar, such as the scale removal process of rubbish, internal memory Scanning process, charging process etc..Simple animation can not reduce user's anxiety and lifting Consumer's Experience, can only show and fill The animation with progress bar of electric progress, garbage-cleaning progress and internal memory scan progress etc. can reduce user Jiao Consider, lift Consumer's Experience.
The instrument cleaning class software of in the market, when realizing the animation with progress bar, mainly using pure code Mode write animation and play out, it is necessary to expend the considerable energy and time of programmer, and need bit by bit to adjust Examination, will also carry out more equipment adaptations, extend the development time and version iteration time of the animation with progress bar.
The content of the invention
It is contemplated that at least solves one of technical problem in correlation technique to a certain extent.
Therefore, first purpose of the present invention is to propose a kind of animation playing method, for solving to have in the prior art The problem of development time for having the animation of progress bar is grown, and the version iteration time is long.
Second object of the present invention is to propose a kind of moving-image playback device.
Third object of the present invention is to propose another moving-image playback device.
Fourth object of the present invention is to propose a kind of non-transitorycomputer readable storage medium.
The 5th purpose of the present invention is to propose a kind of computer program product.
For the above-mentioned purpose, first aspect present invention embodiment proposes a kind of animation playing method, including:
In the corresponding trigger event of the animation file that detects with prestore, animation number corresponding to the animation file is performed According to;
When the currently playing figure layer of the animation file is the progress figure layer, actually entering for the trigger event is obtained Degree, judges whether the currently playing progress of the progress figure layer is less than the actual progress;
If the currently playing progress is more than or equal to the actual progress, stop updating the progress figure layer.
Further, described method also includes:
In the corresponding trigger event of the animation file that detects with prestore, lottie storehouses of increasing income are called to read the animation File, so that lottie increases income, storehouse identifies the progress figure layer that preset mark is carried in the animation file, and by the progress chart The value of the preset attribute of layer is revised as preset value, generates animation data corresponding to the animation file;Wrapped in the animation file Include:Progress figure layer with preset mark.
Further, described method also includes:
When the currently playing figure layer of the animation file is the progress figure layer, judge in the progress figure layer with it is described Whether part animation had played corresponding to actual progress;
If part corresponding with actual progress animation had played in the progress figure layer, stop described in renewal Progress figure layer.
Further, described method also includes:
Before trigger event corresponding with the animation file to prestore is detected, the animation file and corresponding triggering are obtained Event;
Store the animation file and corresponding trigger event.
Further, described method also includes:
If the currently playing progress is less than the actual progress, and corresponding with the actual progress in the progress figure layer Part animation do not played, then update the animation of the progress figure layer.
Further, described method also includes:
Obtain the property value of the currently playing figure layer of the animation file;
According to the property value, judge whether the currently playing figure layer is progress figure layer.
The animation playing method of the embodiment of the present invention, in the corresponding trigger event of the animation file that detects with prestore, Perform animation data corresponding to animation file;When the currently playing figure layer of animation file is progress figure layer, trigger event is obtained Actual progress, judge whether the currently playing progress of progress figure layer is less than actual progress;If currently playing progress is more than or equal to Actual progress, then stop renewal progress figure layer, so as in the playing process of animation file, realize the broadcasting of progress figure layer Interaction between progress and corresponding trigger event, avoid writing animation file by the way of pure code, shorten animation file Development time and version iteration time, improve the development efficiency of animation file.
For the above-mentioned purpose, second aspect of the present invention embodiment proposes a kind of moving-image playback device, including:
Playing module, in the corresponding trigger event of the animation file that detects with prestore, performing the animation text Animation data corresponding to part;
Judge module, for when the currently playing figure layer of the animation file is the progress figure layer, obtaining described touch The actual progress of hair event, judges whether the currently playing progress of the progress figure layer is less than the actual progress;
Update module, it is additionally operable to when the currently playing progress is more than or equal to the actual progress, stops described in renewal Progress figure layer.
Further, described device also includes:
Calling module, in the corresponding trigger event of the animation file that detects with prestore, calling lottie to increase income The animation file is read in storehouse, so that lottie increases income, storehouse identifies the progress figure layer that preset mark is carried in the animation file, And the value of the preset attribute of the progress figure layer is revised as preset value, generate animation data corresponding to the animation file;Institute Stating animation file includes:Progress figure layer with preset mark.
Further, the judge module, the currently playing figure layer being additionally operable in the animation file are the progress chart During layer, judge whether part corresponding with actual progress animation had played in the progress figure layer;
The update module, it is additionally operable to part corresponding with the actual progress animation in the progress figure layer and has broadcast When letting off, then stop updating the progress figure layer.
Further, described device also includes:Acquisition module and memory module;
The acquisition module, for before trigger event corresponding with the animation file to prestore is detected, obtaining the animation File and corresponding trigger event;
The memory module, for storing the animation file and corresponding trigger event.
Further, the update module, it is additionally operable to be less than the actual progress in the currently playing progress, and it is described Part corresponding with actual progress animation does not play out-of-date in progress figure layer, updates the animation of the progress figure layer.
Further, described device also includes:Acquisition module;
The acquisition module, the property value of the currently playing figure layer for obtaining the animation file;
The judge module, it is additionally operable to according to the property value, judges whether the currently playing figure layer is progress figure layer.
The moving-image playback device of the embodiment of the present invention, in the corresponding trigger event of the animation file that detects with prestore, Perform animation data corresponding to animation file;When the currently playing figure layer of animation file is progress figure layer, trigger event is obtained Actual progress, judge whether the currently playing progress of progress figure layer is less than actual progress;If currently playing progress is more than or equal to Actual progress, then stop renewal progress figure layer, so as in the playing process of animation file, realize the broadcasting of progress figure layer Interaction between progress and corresponding trigger event, avoid writing animation file by the way of pure code, shorten animation file Development time and version iteration time, improve the development efficiency of animation file.
For the above-mentioned purpose, third aspect present invention embodiment proposes another moving-image playback device, including memory, Processor and storage are on a memory and the computer program that can run on a processor, it is characterised in that the processor is held Animation playing method as described above is realized during row described program.
To achieve these goals, fourth aspect present invention embodiment proposes a kind of computer-readable storage of non-transitory Medium, when the instruction in the storage medium is executed by processor, realize method as described above.
For the above-mentioned purpose, fifth aspect present invention embodiment proposes a kind of computer program product, when the calculating When instruction processing unit in machine program product performs, a kind of animation playing method is performed, methods described includes:
In the corresponding trigger event of the animation file that detects with prestore, animation number corresponding to the animation file is performed According to;
When the currently playing figure layer of the animation file is the progress figure layer, actually entering for the trigger event is obtained Degree, judges whether the currently playing progress of the progress figure layer is less than the actual progress;
If the currently playing progress is more than or equal to the actual progress, stop updating the progress figure layer.
The additional aspect of the present invention and advantage will be set forth in part in the description, and will partly become from the following description Obtain substantially, or recognized by the practice of the present invention.
Brief description of the drawings
Of the invention above-mentioned and/or additional aspect and advantage will become from the following description of the accompanying drawings of embodiments Substantially and it is readily appreciated that, wherein:
Fig. 1 is a kind of schematic flow sheet of animation playing method provided in an embodiment of the present invention;
Fig. 2 is the schematic flow sheet of another animation playing method provided in an embodiment of the present invention;
Fig. 3 is the schematic flow sheet of another animation playing method provided in an embodiment of the present invention;
Fig. 4 is a kind of structural representation of moving-image playback device provided in an embodiment of the present invention;
Fig. 5 is the structural representation of another moving-image playback device provided in an embodiment of the present invention;
Fig. 6 is the structural representation of another moving-image playback device provided in an embodiment of the present invention;
Fig. 7 is the structural representation of another moving-image playback device provided in an embodiment of the present invention.
Embodiment
Embodiments of the invention are described below in detail, the example of the embodiment is shown in the drawings, wherein from beginning to end Same or similar label represents same or similar element or the element with same or like function.Below with reference to attached The embodiment of figure description is exemplary, it is intended to for explaining the present invention, and is not considered as limiting the invention.
Below with reference to the accompanying drawings the animation playing method and device of the embodiment of the present invention are described.
Fig. 1 is a kind of schematic flow sheet of animation playing method provided in an embodiment of the present invention.As shown in figure 1, the animation Player method comprises the following steps:
S101, in the corresponding trigger event of the animation file that detects with prestore, perform animation corresponding to animation file Data.
The executive agent of animation playing method provided by the invention is moving-image playback device, and moving-image playback device specifically can be with To install software on the terminal device, either the software on the server being connected with terminal device or it is provided with The terminal device of the software, server etc..
In the present embodiment, before trigger event corresponding with the animation file to prestore is detected, moving-image playback device obtains institute State animation file and corresponding trigger event;Store the animation file and corresponding trigger event.
Further, in the present embodiment, in the corresponding trigger event of the animation file that detects with prestore, animation plays Device may call upon lottie storehouses of increasing income and read animation file, so that lottie increases income with default in storehouse identification animation file The progress figure layer of mark, and the value of the preset attribute of progress figure layer is revised as preset value, generate animation corresponding to animation file Data;Animation file includes:Progress figure layer with preset mark.
In the present embodiment, by the corresponding trigger event of the animation file that detects with prestore, calling lottie to open Animation file, progress figure layer of the identification with preset mark are read in source storehouse, and the value of the preset attribute of progress figure layer is revised as Preset value, animation data corresponding to generation animation file, can be such that moving-image playback device is identified in follow-up play animation file Go out progress figure layer, and then control the playing progress rate of progress figure layer, make the playing progress rate of progress figure layer and actually entering for trigger event Degree is synchronous.
In the present embodiment, Consumer's Experience UX designer can design dynamic in graphics video handles software After Effect Draw, the animation file of json forms is exported with bodymovin plug-in units;Then it is literary in the animation of derived json forms by programmer In part, progress figure layer is labeled as preset mark isProgress:true;By the animation file of labeled progress figure layer and right The trigger event storage answered is arrived in application software, such as the software kit of the software such as antivirus software, securing software.Wherein, animation text Trigger event corresponding to part is such as can be garbage-cleaning event, internal memory scan event, charge event.
In the present embodiment, the lottie that mentions increases income storehouse and increased income storehouse for the lottie after improving.Lottie after improvement is opened Source storehouse can identify the progress chart that preset mark is carried in animation file during the animation file of json forms is read Layer.Lottie after improvement increases income can also be revised as preset value in storehouse by the value of the preset attribute of progress figure layer, for example, will enter The property value for spending the mIsProgress attributes of figure layer is revised as true.
In the present embodiment, animation data is specifically as follows corresponding to animation file, the row of Layer classes corresponding to animation file Table.Record has the property value of each figure layer in the list of Layer classes.Moving-image playback device can perform the list, be broadcast with realizing Put animation file.
It should be noted that if the progress figure layer in animation file does not carry out preset mark, lottie increases income storehouse identification The not progress figure layer in animation file, can only be identified as control by animation file and play out, do not realize progress figure layer Playing progress rate interacts with trigger event state, i.e. the playing progress rate of progress figure layer and the actual progress of trigger event can not be same Step.
In the present embodiment, the actual progress of trigger event for example can be charging progress, rubbish scan progress etc..For example, In the case where trigger event is charge event, animation file corresponding to charge event is charging animation file.Charge animation text The progress figure layer of part can show 0 percent to absolutely charging progress.It is 80 percent in actual charging progress In the case of, can working as in charging animation file in order to ensure the matching between actual charging progress and the progress of progress figure layer When preceding broadcasting figure layer is progress figure layer, compare the currently playing progress of progress figure layer and actual charging progress, it is determined whether stop Renewal progress figure layer.That is, charging animation file, in playing process, being played to 80 percent from 0 percent can To stop renewal progress figure layer, to show current charging progress to user so that user understands current current schedules, reduces Anxiety of the user in charging process is waited, lifted Consumer's Experience, so as to reduce garbage-cleaning event, internal memory scan event, The interruption times of user in charge event, improve the Experience Degree of application software.
S102, when the currently playing figure layer of animation file is progress figure layer, obtain the actual progress of trigger event, judge Whether the currently playing progress of progress figure layer is less than actual progress.
Wherein, moving-image playback device can obtain the property value of the currently playing figure layer of animation file;According to property value, sentence Whether currently playing figure layer of breaking is progress figure layer.
In the present embodiment, whether include in the attribute that moving-image playback device can be by judging currently playing figure layer MIsProgress attributes, and whether the value of mIsProgress attributes is true to determine whether currently playing figure layer is progress Figure layer.In the present embodiment, progress figure layer is determined by the attribute of currently playing figure layer, moving-image playback device can be made according to tactile The actual progress of hair event controls the playing progress rate of progress figure layer, makes the playing progress rate of progress figure layer and the reality of trigger event Progress is synchronous.
If S103, currently playing progress are more than or equal to actual progress, stop renewal progress figure layer.
In the present embodiment, in the case where the currently playing progress of progress figure layer is more than or equal to actual progress, animation plays Device can stop renewal progress figure layer.And for the animation of other figure layers in animation file, then it can continue cycling through broadcasting.
The animation playing method of the embodiment of the present invention, in the corresponding trigger event of the animation file that detects with prestore, Perform animation data corresponding to animation file;When the currently playing figure layer of animation file is progress figure layer, trigger event is obtained Actual progress, judge whether the currently playing progress of progress figure layer is less than actual progress;If currently playing progress is more than or equal to Actual progress, then stop renewal progress figure layer, so as in the playing process of animation file, realize the broadcasting of progress figure layer Interaction between progress and corresponding trigger event, avoid writing animation file by the way of pure code, shorten animation file Development time and version iteration time, improve the development efficiency of animation file.
In addition, it is also necessary to illustrate, the convenience of design and broadcasting in the present embodiment to animation file, make The multiple animation files of each trigger event design can be directed to by obtaining UX designer, and the progress figure layer in animation file is marked Handle, then playing cartoon file, so that UX designer can select most suitable animation text according to animation result of broadcast Part is added in the software kit of instrument cleaning class software.
Fig. 2 is the schematic flow sheet of another animation playing method provided in an embodiment of the present invention.As shown in Fig. 2 in Fig. 1 On the basis of illustrated embodiment, described method can also comprise the following steps:
S104, when currently playing figure layer is progress figure layer, judge corresponding with actual progress in progress figure layer partly to move Whether picture had played.
In the present embodiment, each frame animation corresponding to progress figure layer is with mark, for marking whether each frame animation has been broadcast Let off.Moving-image playback device is inquired about and marked corresponding to each frame animation, it is possible to learn whether each frame animation had played, and then Learn whether part corresponding with actual progress animation had played in progress figure layer.
If part corresponding with actual progress animation had played in S105, progress figure layer, stop renewal progress chart Layer.
In the present embodiment, in the case that part corresponding with actual progress animation had played in progress figure layer, move Renewal progress figure layer can be stopped by drawing playing device.And for the animation of other figure layers in animation file, then it can continue to follow Ring plays.
Fig. 3 is the schematic flow sheet of another animation playing method provided in an embodiment of the present invention.As shown in figure 3, this is dynamic Player method is drawn to comprise the following steps:
S201, in the corresponding trigger event of the animation file that detects with prestore, call lottie increase income storehouse read it is dynamic File is drawn, carries the progress figure layer of preset mark in storehouse identification animation file so that lottie increases income, and by the pre- of progress figure layer If the value of attribute is revised as preset value, animation data corresponding to animation file is generated;Animation file includes:With preset mark Progress figure layer.
S202, perform animation data corresponding to animation file.
S203, obtain animation file currently playing figure layer property value.
S204, according to property value, judge whether currently playing figure layer is progress figure layer, if currently playing figure layer is progress chart Layer, then step S206 is performed, otherwise perform step S205.
S205, when currently playing figure layer is not progress figure layer, update the animation of currently playing figure layer, and obtain animation text Other figure layers in addition to currently playing figure layer of part are as currently playing figure layer, return to step S203.
S206, when currently playing figure layer is progress figure layer, obtain the actual progress of trigger event, judge progress figure layer Whether currently playing progress is less than actual progress, if currently playing progress is more than or equal to actual progress, performs step S207, no Then perform step S208.
If S207, currently playing progress are more than or equal to actual progress, stop renewal progress figure layer, and obtain animation file Other figure layers in addition to currently playing figure layer as currently playing figure layer, return to step S203.
If S208, currently playing progress are less than actual progress, part corresponding with actual progress in progress figure layer is judged Whether animation had played, if part corresponding with actual progress animation had played in progress figure layer, performed step S209, otherwise perform step S210.
If part corresponding with actual progress animation had played in S209, progress figure layer, stop renewal progress chart Layer, and other figure layers in addition to currently playing figure layer of animation file are obtained as currently playing figure layer, return to step S203.
If part corresponding with actual progress animation did not played in S210, progress figure layer, renewal progress figure layer is moved Draw, and obtain other figure layers in addition to currently playing figure layer of animation file as currently playing figure layer, return to step S203.
In the present embodiment, when currently playing progress is less than actual progress, it is understood that there may be two kinds of situations, a kind of situation be into Part corresponding with actual progress animation had played in degree figure layer;Another situation be in progress figure layer with actual progress pair The part animation answered did not played.In the case that part corresponding with actual progress animation had played in progress figure layer, Moving-image playback device can stop renewal progress figure layer.And for the animation of other figure layers in animation file, then it can continue Loop play.
In addition, if currently playing progress is less than actual progress, and part corresponding with actual progress animation in progress figure layer Do not played, then continue renewal progress figure layer, untill the currently playing progress of progress figure layer is equal to actual progress.
In the present embodiment, it is less than actual progress, and portion corresponding with actual progress in progress figure layer in currently playing progress In the case that transfer picture did not played, moving-image playback device can continue the animation of playing progress rate figure layer, with progress figure layer Animation plays the currently playing progress of renewal progress figure layer, until the currently playing progress of progress figure layer is equal to actual progress, so Stop renewal progress figure layer afterwards.
In the present embodiment, in the case that part corresponding with actual progress animation had played in progress figure layer, stop Progress figure layer is only updated, avoids the frequent updating of progress figure layer.Illustrated by taking the animation file that charges as an example, actually charge into Spend in the case of 80 percent, the progress of progress figure layer can be updated to 80 percent;If by the use of user, this When actual charging progress be 60 percent, because part animation corresponding with 60 percent played in progress figure layer Cross, then moving-image playback device is not updated to progress figure layer, that is to say, that the progress of progress figure layer is shown or 8 percent Ten, without updating to 60 percent.
The animation playing method of the embodiment of the present invention, in the corresponding trigger event of the animation file that detects with prestore, Call lottie increase income storehouse read animation file so that lottie increases income storehouse identification animation file in carry preset mark progress Figure layer, and the value of the preset attribute of progress figure layer is revised as preset value, generate animation data corresponding to animation file;Animation text Part includes:Progress figure layer with preset mark;Perform animation data corresponding to animation file;Obtain the current of animation file Play the property value of figure layer;According to property value, judge whether currently playing figure layer is progress figure layer;Currently playing figure layer be into Spend figure layer when, judge whether the currently playing progress of progress figure layer is less than actual progress, and judge in progress figure layer with reality Whether part animation had played corresponding to progress;If currently playing progress is more than or equal to actual progress, or, progress figure layer In part corresponding with actual progress animation played, then stop updating the progress figure layer, so as in animation text In the playing process of part, the interaction between the playing progress rate of progress figure layer and corresponding trigger event is realized, avoids using pure generation The mode of code writes animation file, shortens the development time and version iteration time of animation file, improves the exploitation of animation file Efficiency.
Fig. 4 is a kind of structural representation of moving-image playback device provided in an embodiment of the present invention.As shown in figure 4, including:Broadcast Amplification module 41, judge module 42 and update module 43.
Wherein, playing module 41, in the corresponding trigger event of the animation file that detects with prestore, described in execution Animation data corresponding to animation file;
Judge module 42, for when the currently playing figure layer of the animation file is the progress figure layer, described in acquisition The actual progress of trigger event, judges whether the currently playing progress of the progress figure layer is less than the actual progress;
Update module 43, it is additionally operable to when the currently playing progress is more than or equal to the actual progress, stops renewal institute State progress figure layer.
Moving-image playback device provided by the invention is specifically as follows installation software on the terminal device, or installed in Software on the server of terminal device connection, or the terminal device of the software, server etc. are installed.
In the present embodiment, the actual progress of trigger event for example can be charging progress, rubbish scan progress etc..For example, In the case where trigger event is charge event, animation file corresponding to charge event is charging animation file.Charge animation text The progress figure layer of part can show 0 percent to absolutely charging progress.It is 80 percent in actual charging progress In the case of, can working as in charging animation file in order to ensure the matching between actual charging progress and the progress of progress figure layer When preceding broadcasting figure layer is progress figure layer, compare the currently playing progress of progress figure layer and actual charging progress, it is determined whether stop Renewal progress figure layer.That is, charging animation file, in playing process, being played to 80 percent from 0 percent can To stop renewal progress figure layer, to show current charging progress to user so that user understands current current schedules, reduces Anxiety of the user in charging process is waited, lifted Consumer's Experience, so as to reduce garbage-cleaning event, internal memory scan event, The interruption times of user in charge event, improve the Experience Degree of application software.
In the present embodiment, animation data is specifically as follows corresponding to animation file, the row of Layer classes corresponding to animation file Table.Record has the property value of each figure layer in the list of Layer classes.Moving-image playback device can perform the list, be broadcast with realizing Put animation file.
Further, can also include in the basis of above-described embodiment, described device:Acquisition module;
The acquisition module, the property value of the currently playing figure layer for obtaining the animation file;The judge module, It is additionally operable to according to the property value, judges whether the currently playing figure layer is progress figure layer.
In the present embodiment, whether include in the attribute that moving-image playback device can be by judging currently playing figure layer MIsProgress attributes, and whether the value of mIsProgress attributes is true to determine whether currently playing figure layer is progress Figure layer.In the present embodiment, progress figure layer is determined by the attribute of currently playing figure layer, moving-image playback device can be made according to tactile The actual progress of hair event controls the playing progress rate of progress figure layer, makes the playing progress rate of progress figure layer and the reality of trigger event Progress is synchronous.
In the present embodiment, in the case where the currently playing progress of progress figure layer is more than or equal to actual progress, animation plays Device can stop renewal progress figure layer.And for the animation of other figure layers in animation file, then it can continue cycling through broadcasting.
Further, with reference to reference to figure 5, on the basis of embodiment illustrated in fig. 4, described device also includes:Call mould Block 44, in the corresponding trigger event of the animation file that detects with prestore, call lottie increase income storehouse read it is described dynamic File is drawn, so that lottie increases income, storehouse identifies the progress figure layer that preset mark is carried in the animation file, and by the progress The value of the preset attribute of figure layer is revised as preset value, generates animation data corresponding to the animation file;In the animation file Including:Progress figure layer with preset mark.
In the present embodiment, by the corresponding trigger event of the animation file that detects with prestore, calling lottie to open Animation file, progress figure layer of the identification with preset mark are read in source storehouse, and the value of the preset attribute of progress figure layer is revised as Preset value, animation data corresponding to generation animation file, can be such that moving-image playback device is identified in follow-up play animation file Go out progress figure layer, and then control the playing progress rate of progress figure layer, make the playing progress rate of progress figure layer and actually entering for trigger event Degree is synchronous.
In the present embodiment, Consumer's Experience UX designer can design dynamic in graphics video handles software After Effect Draw, the animation file of json forms is exported with bodymovin plug-in units;Then it is literary in the animation of derived json forms by programmer In part, progress figure layer is labeled as preset mark isProgress:true;By the animation file of labeled progress figure layer and right The trigger event storage answered is arrived in application software, such as the software kit of the software such as antivirus software, securing software.Wherein, animation text Trigger event corresponding to part is such as can be garbage-cleaning event, internal memory scan event, charge event.
In the present embodiment, the lottie that mentions increases income storehouse and increased income storehouse for the lottie after improving.Lottie after improvement is opened Source storehouse can identify the progress chart that preset mark is carried in animation file during the animation file of json forms is read Layer.Lottie after improvement increases income can also be revised as preset value in storehouse by the value of the preset attribute of progress figure layer, for example, will enter The property value for spending the mIsProgress attributes of figure layer is revised as true.
It should be noted that if the progress figure layer in animation file does not carry out preset mark, lottie increases income storehouse identification The not progress figure layer in animation file, can only be identified as control by animation file and play out, do not realize progress figure layer Playing progress rate interacts with trigger event state, i.e. the playing progress rate of progress figure layer and the actual progress of trigger event can not be same Step.
Further, with reference to reference to figure 6, on the basis of embodiment illustrated in fig. 4, described device also includes:Obtain mould Block 45 and memory module 46;
The acquisition module 45, it is described dynamic for before trigger event corresponding with the animation file to prestore is detected, obtaining Draw file and corresponding trigger event;
The memory module 46, for storing the animation file and corresponding trigger event.
The moving-image playback device of the embodiment of the present invention, in the corresponding trigger event of the animation file that detects with prestore, Perform animation data corresponding to animation file;When the currently playing figure layer of animation file is progress figure layer, trigger event is obtained Actual progress, judge whether the currently playing progress of progress figure layer is less than actual progress;If currently playing progress is more than or equal to Actual progress, then stop renewal progress figure layer, so as in the playing process of animation file, realize the broadcasting of progress figure layer Interaction between progress and corresponding trigger event, avoid writing animation file by the way of pure code, shorten animation file Development time and version iteration time, improve the development efficiency of animation file.
In addition, it is also necessary to illustrate, the convenience of design and broadcasting in the present embodiment to animation file, make The multiple animation files of each trigger event design can be directed to by obtaining UX designer, and the progress figure layer in animation file is marked Handle, then playing cartoon file, so that UX designer can select most suitable animation text according to animation result of broadcast Part is added in the software kit of instrument cleaning class software.
Further, the judge module 42, the currently playing figure layer being additionally operable in the animation file are the progress During figure layer, judge whether part corresponding with actual progress animation had played in the progress figure layer;
The update module 43, part corresponding with actual progress animation it has been additionally operable in the progress figure layer It is out-of-date to play, and stops updating the progress figure layer.
In the present embodiment, each frame animation corresponding to progress figure layer is with mark, for marking whether each frame animation has been broadcast Let off.Moving-image playback device is inquired about and marked corresponding to each frame animation, it is possible to learn whether each frame animation had played, and then Learn whether part corresponding with actual progress animation had played in progress figure layer.
In the present embodiment, in the case that part corresponding with actual progress animation had played in progress figure layer, move Renewal progress figure layer can be stopped by drawing playing device.And for the animation of other figure layers in animation file, then it can continue to follow Ring plays.
Further, the update module 43, it is additionally operable to be less than the actual progress, and institute in the currently playing progress State part corresponding with actual progress animation in progress figure layer and do not play out-of-date, update the animation of the progress figure layer.
In the present embodiment, when currently playing progress is less than actual progress, it is understood that there may be two kinds of situations, a kind of situation be into Part corresponding with actual progress animation had played in degree figure layer;Another situation be in progress figure layer with actual progress pair The part animation answered did not played.In the case that part corresponding with actual progress animation had played in progress figure layer, Moving-image playback device can stop renewal progress figure layer.And for the animation of other figure layers in animation file, then it can continue Loop play.
In the present embodiment, in the case that part corresponding with actual progress animation had played in progress figure layer, stop Progress figure layer is only updated, avoids the frequent updating of progress figure layer.Illustrated by taking the animation file that charges as an example, actually charge into Spend in the case of 80 percent, the progress of progress figure layer can be updated to 80 percent;If by the use of user, this When actual charging progress be 60 percent, because part animation corresponding with 60 percent played in progress figure layer Cross, then moving-image playback device is not updated to progress figure layer, that is to say, that the progress of progress figure layer is shown or 8 percent Ten, without updating to 60 percent.
The moving-image playback device of the embodiment of the present invention, in the corresponding trigger event of the animation file that detects with prestore, Perform animation data corresponding to animation file;When the currently playing figure layer of animation file is progress figure layer, trigger event is obtained Actual progress, judge whether the currently playing progress of progress figure layer is less than actual progress;If currently playing progress is more than or equal to Part corresponding with actual progress animation had played in actual progress, or progress figure layer, then stopped updating the progress Figure layer, so as in the playing process of animation file, realize the playing progress rate of progress figure layer and corresponding trigger event it Between interaction, avoid writing animation file by the way of pure code, when shortening development time and the version iteration of animation file Between, improve the development efficiency of animation file.
Fig. 7 is the structural representation of another moving-image playback device provided in an embodiment of the present invention.The moving-image playback device Including:
Memory 1001, processor 1002 and it is stored in the calculating that can be run on memory 1001 and on processor 1002 Machine program.
Processor 1002 realizes the animation playing method provided in above-described embodiment when performing described program.
Further, moving-image playback device also includes:
Communication interface 1003, for the communication between memory 1001 and processor 1002.
Memory 1001, for depositing the computer program that can be run on processor 1002.
Memory 1001 may include high-speed RAM memory, it is also possible to also including nonvolatile memory (non- Volatile memory), a for example, at least magnetic disk storage.
Processor 1002, the animation playing method described in above-described embodiment is realized during for performing described program.
If memory 1001, processor 1002 and the independent realization of communication interface 1003, communication interface 1003, memory 1001 and processor 1002 can be connected with each other by bus and complete mutual communication.The bus can be industrial standard Architecture (Industry Standard Architecture, referred to as ISA) bus, external equipment interconnection (Peripheral Component, referred to as PCI) bus or extended industry-standard architecture (Extended Industry Standard Architecture, referred to as EISA) bus etc..The bus can be divided into address bus, data/address bus, control Bus processed etc..For ease of representing, only represented in Fig. 7 with a thick line, it is not intended that an only bus or a type of Bus.
Optionally, in specific implementation, if memory 1001, processor 1002 and communication interface 1003, are integrated in one Realized on block chip, then memory 1001, processor 1002 and communication interface 1003 can be completed mutual by internal interface Communication.
Processor 1002 is probably a central processing unit (Central Processing Unit, referred to as CPU), or Person is specific integrated circuit (Application Specific Integrated Circuit, referred to as ASIC), or quilt It is configured to implement one or more integrated circuits of the embodiment of the present invention.
The present embodiment also provides a kind of non-transitorycomputer readable storage medium, is stored thereon with computer program, its It is characterised by, the program realizes animation playing method as described above when being executed by processor.
The present embodiment also provides a kind of computer program product, when the instruction processing unit in the computer program product is held During row, a kind of animation playing method is performed, methods described includes:
In the corresponding trigger event of the animation file that detects with prestore, animation number corresponding to the animation file is performed According to;
When the currently playing figure layer of the animation file is the progress figure layer, actually entering for the trigger event is obtained Degree, judges whether the currently playing progress of the progress figure layer is less than the actual progress;
If the currently playing progress is more than or equal to the actual progress, stop updating the progress figure layer.
In the description of this specification, reference term " one embodiment ", " some embodiments ", " example ", " specifically show The description of example " or " some examples " etc. means specific features, structure, material or the spy for combining the embodiment or example description Point is contained at least one embodiment or example of the present invention.In this manual, to the schematic representation of above-mentioned term not Identical embodiment or example must be directed to.Moreover, specific features, structure, material or the feature of description can be with office Combined in an appropriate manner in one or more embodiments or example.In addition, in the case of not conflicting, the skill of this area Art personnel can be tied the different embodiments or example and the feature of different embodiments or example described in this specification Close and combine.
In addition, term " first ", " second " are only used for describing purpose, and it is not intended that instruction or hint relative importance Or the implicit quantity for indicating indicated technical characteristic.Thus, define " first ", the feature of " second " can be expressed or Implicitly include at least one this feature.In the description of the invention, " multiple " are meant that at least two, such as two, three It is individual etc., unless otherwise specifically defined.
Any process or method described otherwise above description in flow chart or herein is construed as, and represents to include Module, fragment or the portion of the code of the executable instruction of one or more the step of being used to realize custom logic function or process Point, and the scope of the preferred embodiment of the present invention includes other realization, wherein can not press shown or discuss suitable Sequence, including according to involved function by it is basic simultaneously in the way of or in the opposite order, carry out perform function, this should be of the invention Embodiment person of ordinary skill in the field understood.
Expression or logic and/or step described otherwise above herein in flow charts, for example, being considered use In the order list for the executable instruction for realizing logic function, may be embodied in any computer-readable medium, for Instruction execution system, device or equipment (such as computer based system including the system of processor or other can be held from instruction The system of row system, device or equipment instruction fetch and execute instruction) use, or combine these instruction execution systems, device or set It is standby and use.For the purpose of this specification, " computer-readable medium " can any can be included, store, communicate, propagate or pass Defeated program is for instruction execution system, device or equipment or the dress used with reference to these instruction execution systems, device or equipment Put.The more specifically example (non-exhaustive list) of computer-readable medium includes following:Electricity with one or more wiring Connecting portion (electronic installation), portable computer diskette box (magnetic device), random access memory (RAM), read-only storage (ROM), erasable edit read-only storage (EPROM or flash memory), fiber device, and portable optic disk is read-only deposits Reservoir (CDROM).In addition, computer-readable medium, which can even is that, to print the paper of described program thereon or other are suitable Medium, because can then enter edlin, interpretation or if necessary with it for example by carrying out optical scanner to paper or other media His suitable method is handled electronically to obtain described program, is then stored in computer storage.
It should be appreciated that each several part of the present invention can be realized with hardware, software, firmware or combinations thereof.Above-mentioned In embodiment, software that multiple steps or method can be performed in memory and by suitable instruction execution system with storage Or firmware is realized.Such as, if realized with hardware with another embodiment, following skill well known in the art can be used Any one of art or their combination are realized:With the logic gates for realizing logic function to data-signal from Logic circuit is dissipated, the application specific integrated circuit with suitable combinational logic gate circuit, programmable gate array (PGA), scene can compile Journey gate array (FPGA) etc..
Those skilled in the art are appreciated that to realize all or part of step that above-described embodiment method carries Suddenly it is that by program the hardware of correlation can be instructed to complete, described program can be stored in a kind of computer-readable storage medium In matter, the program upon execution, including one or a combination set of the step of embodiment of the method.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing module, can also That unit is individually physically present, can also two or more units be integrated in a module.Above-mentioned integrated mould Block can both be realized in the form of hardware, can also be realized in the form of software function module.The integrated module is such as Fruit is realized in the form of software function module and as independent production marketing or in use, can also be stored in a computer In read/write memory medium.
Storage medium mentioned above can be read-only storage, disk or CD etc..Although have been shown and retouch above Embodiments of the invention are stated, it is to be understood that above-described embodiment is exemplary, it is impossible to be interpreted as the limit to the present invention System, one of ordinary skill in the art can be changed to above-described embodiment, change, replace and become within the scope of the invention Type.

Claims (10)

  1. A kind of 1. animation playing method, it is characterised in that including:
    In the corresponding trigger event of the animation file that detects with prestore, animation data corresponding to the animation file is performed;
    When the currently playing figure layer of the animation file is the progress figure layer, the actual progress of the trigger event is obtained, Judge whether the currently playing progress of the progress figure layer is less than the actual progress;
    If the currently playing progress is more than or equal to the actual progress, stop updating the progress figure layer.
  2. 2. according to the method for claim 1, it is characterised in that also include:
    In the corresponding trigger event of the animation file that detects with prestore, lottie storehouses of increasing income are called to read the animation text Part, so that lottie increases income, storehouse identifies the progress figure layer that preset mark is carried in the animation file, and by the progress figure layer The value of preset attribute be revised as preset value, generate animation data corresponding to the animation file;The animation file includes: Progress figure layer with preset mark.
  3. 3. according to the method for claim 1, it is characterised in that also include:
    When the currently playing figure layer of the animation file is the progress figure layer, judge in the progress figure layer with the reality Whether part animation had played corresponding to progress;
    If part corresponding with actual progress animation had played in the progress figure layer, stop updating the progress Figure layer.
  4. 4. according to the method for claim 1, it is characterised in that also include:
    Before trigger event corresponding with the animation file to prestore is detected, the animation file and corresponding triggering thing are obtained Part;
    Store the animation file and corresponding trigger event.
  5. 5. according to the method for claim 3, it is characterised in that also include:
    If the currently playing progress is less than the actual progress, and portion corresponding with the actual progress in the progress figure layer Transfer is drawn and not played, then updates the animation of the progress figure layer.
  6. 6. according to the method for claim 1, it is characterised in that also include:
    Obtain the property value of the currently playing figure layer of the animation file;
    According to the property value, judge whether the currently playing figure layer is progress figure layer.
  7. A kind of 7. moving-image playback device, it is characterised in that including:
    Playing module, in the corresponding trigger event of the animation file that detects with prestore, performing the animation file pair The animation data answered;
    Judge module, for when the currently playing figure layer of the animation file is the progress figure layer, obtaining the triggering thing The actual progress of part, judges whether the currently playing progress of the progress figure layer is less than the actual progress;
    Update module, it is additionally operable to when the currently playing progress is more than or equal to the actual progress, stops updating the progress Figure layer.
  8. A kind of 8. moving-image playback device, it is characterised in that including:
    Memory, processor and storage are on a memory and the computer program that can run on a processor, it is characterised in that institute The animation playing method as described in any in claim 1-6 is realized when stating computing device described program.
  9. 9. a kind of non-transitorycomputer readable storage medium, is stored thereon with computer program, it is characterised in that the program quilt The animation playing method as described in any in claim 1-6 is realized during computing device.
  10. 10. a kind of computer program product, when the instruction processing unit in the computer program product performs, perform a kind of dynamic Player method is drawn, methods described includes:
    In the corresponding trigger event of the animation file that detects with prestore, animation data corresponding to the animation file is performed;
    When the currently playing figure layer of the animation file is the progress figure layer, the actual progress of the trigger event is obtained, Judge whether the currently playing progress of the progress figure layer is less than the actual progress;
    If the currently playing progress is more than or equal to the actual progress, stop updating the progress figure layer.
CN201710923210.1A 2017-09-30 2017-09-30 Animation playing method and device Active CN107608737B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710923210.1A CN107608737B (en) 2017-09-30 2017-09-30 Animation playing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710923210.1A CN107608737B (en) 2017-09-30 2017-09-30 Animation playing method and device

Publications (2)

Publication Number Publication Date
CN107608737A true CN107608737A (en) 2018-01-19
CN107608737B CN107608737B (en) 2020-12-18

Family

ID=61067957

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710923210.1A Active CN107608737B (en) 2017-09-30 2017-09-30 Animation playing method and device

Country Status (1)

Country Link
CN (1) CN107608737B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110134392A (en) * 2019-04-30 2019-08-16 延锋伟世通电子科技(南京)有限公司 Sequence frame animation play plug-in unit based on kanzi
CN110928474A (en) * 2019-09-20 2020-03-27 捷开通讯(深圳)有限公司 Junk file cleaning method and device, storage medium and terminal
CN111488188A (en) * 2019-01-28 2020-08-04 阿里巴巴集团控股有限公司 Animation implementation method and related device and system
CN112395035A (en) * 2020-11-30 2021-02-23 杭州安恒信息安全技术有限公司 Animation playing method, device, equipment and medium based on 3D large screen

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130239039A1 (en) * 2012-03-09 2013-09-12 Apple Inc. Rocket effect in a progress bar
CN106658201A (en) * 2017-01-13 2017-05-10 北京元心科技有限公司 Method and device for optimizing progress bar of player

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130239039A1 (en) * 2012-03-09 2013-09-12 Apple Inc. Rocket effect in a progress bar
CN106658201A (en) * 2017-01-13 2017-05-10 北京元心科技有限公司 Method and device for optimizing progress bar of player

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111488188A (en) * 2019-01-28 2020-08-04 阿里巴巴集团控股有限公司 Animation implementation method and related device and system
CN111488188B (en) * 2019-01-28 2024-03-29 阿里巴巴集团控股有限公司 Animation realization method, related device and system
CN110134392A (en) * 2019-04-30 2019-08-16 延锋伟世通电子科技(南京)有限公司 Sequence frame animation play plug-in unit based on kanzi
CN110928474A (en) * 2019-09-20 2020-03-27 捷开通讯(深圳)有限公司 Junk file cleaning method and device, storage medium and terminal
CN112395035A (en) * 2020-11-30 2021-02-23 杭州安恒信息安全技术有限公司 Animation playing method, device, equipment and medium based on 3D large screen

Also Published As

Publication number Publication date
CN107608737B (en) 2020-12-18

Similar Documents

Publication Publication Date Title
CN107608737A (en) Animation playing method and device
CN106937172A (en) Interactive approach and device during video playback based on artificial intelligence
CN108920242A (en) Navigation bar generation method and device
CN104395882A (en) Creation and context-aware presentation of customized emoticon item sets
CN108181992A (en) Voice awakening method, device, equipment and computer-readable medium based on gesture
CN108154140A (en) Voice awakening method, device, equipment and computer-readable medium based on lip reading
CN1828597B (en) Simple style
CN107609098A (en) Searching method and device
CN104915186B (en) A kind of method and apparatus making the page
CN109144712A (en) Memory pool building, memory allocation method and device
CN105138340A (en) Interaction method and system for Native and Web pages
CN104461545B (en) Content in mobile terminal is provided to the method and device of user
CN107562498A (en) Animation effect implementation method, device and terminal device based on Android platform
CN110069739A (en) The page preloads method and device
CN105518638A (en) Method and device for loading view of application and electronic terminal
CN105096235B (en) Graphic processing method and graphic processing facility
CN108108215A (en) Skin generation method, device, terminal and computer readable storage medium
CN107220063A (en) Dynamic wallpaper generation method and device
CN109741038A (en) Token processing method, computer readable storage medium and electronic equipment based on block chain account
CN104133679B (en) The method and apparatus for showing function of application
CN107977234A (en) Software function bootstrap technique and device
CN107341097A (en) Information pushing method and device
CN107408105A (en) Have ready conditions controlled sample addition type
CN108170430A (en) A kind of method and system of showing interface
CN107332991A (en) Screen locking interface information processing 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