CN109166165A - A kind of playback method of dynamic picture, terminal and can storage medium - Google Patents
A kind of playback method of dynamic picture, terminal and can storage medium Download PDFInfo
- Publication number
- CN109166165A CN109166165A CN201810660239.XA CN201810660239A CN109166165A CN 109166165 A CN109166165 A CN 109166165A CN 201810660239 A CN201810660239 A CN 201810660239A CN 109166165 A CN109166165 A CN 109166165A
- Authority
- CN
- China
- Prior art keywords
- dynamic picture
- playing
- audio file
- dynamic
- picture
- 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 41
- 230000009471 action Effects 0.000 claims description 53
- 238000004590 computer program Methods 0.000 claims description 7
- 230000000694 effects Effects 0.000 abstract description 9
- 230000006872 improvement Effects 0.000 description 11
- 230000008569 process Effects 0.000 description 5
- 230000008901 benefit Effects 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 2
- 238000013461 design Methods 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 2
- 101150054987 ChAT gene Proteins 0.000 description 1
- 101100203187 Mus musculus Sh2d3c gene Proteins 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 230000002950 deficient Effects 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 230000008451 emotion Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 230000004044 response Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T13/00—Animation
- G06T13/80—2D [Two Dimensional] animation, e.g. using sprites
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
Abstract
Description
技术领域technical field
本发明实施例涉及多媒体领域,特别涉及动态图片的播放术。Embodiments of the present invention relate to the field of multimedia, and in particular, to a technique for playing dynamic pictures.
背景技术Background technique
目前,社交应用程序(例如QQ、微信等)已成为人们生活必不可少的社交工具,在聊天交互的过程中,可以发送的信息格式涵盖文字、图像、音频、视频等等,格式非常丰富。At present, social applications (such as QQ, WeChat, etc.) have become indispensable social tools in people's lives. In the process of chat interaction, the information formats that can be sent include text, images, audio, video, etc., and the formats are very rich.
本发明人发现:为了表达生动丰富的情绪,人们常用的一种信息为动态图片,如gif格式的动态图片,动态图片具有格式小、展示效果好等优势,但由于标准的gif图片格式的标准限制,原生的gif图片中无法加入音频文件,因此原生的gif图片只能播放图片而不能播放声音,显得有些单调无趣。The inventor found that: in order to express vivid and rich emotions, a kind of information commonly used by people is dynamic pictures, such as dynamic pictures in gif format, dynamic pictures have the advantages of small format and good display effect, but due to the standard Restriction, audio files cannot be added to the native gif picture, so the native gif picture can only play the picture but not the sound, which seems a bit monotonous and boring.
发明内容SUMMARY OF THE INVENTION
本发明实施方式的目的在于提供一种动态图片的播放方法、终端和可存储介质,使得在应用程序中播放接收到的动态图片时,可以同时欣赏到音乐,使得动态图片更丰富有趣。The purpose of the embodiments of the present invention is to provide a dynamic picture playing method, terminal and storable medium, so that when the received dynamic picture is played in an application program, music can be enjoyed at the same time, so that the dynamic picture is richer and more interesting.
为解决上述技术问题,本发明的实施方式提供了一种动态图片的播放方法,包括:在应用程序中接收到包含动态图片的信息;向所述应用程序的服务端请求所述动态图片;接收所述服务端返回的所述动态图片和与所述动态图片对应的音频文件;在播放所述动态图片时,播放所述音频文件。In order to solve the above technical problems, embodiments of the present invention provide a method for playing a dynamic picture, including: receiving information including a dynamic picture in an application; requesting the dynamic picture from a server of the application; receiving The dynamic picture and the audio file corresponding to the dynamic picture returned by the server; when playing the dynamic picture, the audio file is played.
本发明的实施方式还提供了一种终端,包括:至少一个处理器;以及,与所述至少一个处理器通信连接的存储器;其中,所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行如上述的动态图片的播放方法。Embodiments of the present invention also provide a terminal, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a program executable by the at least one processor. The instruction is executed by the at least one processor, so that the at least one processor can execute the above-mentioned method for playing a dynamic picture.
本发明的实施方式还提供了一种计算机可读存储介质,存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现上述的动态图片的播放方法。An embodiment of the present invention further provides a computer-readable storage medium storing a computer program, wherein the computer program implements the above-mentioned method for playing a dynamic picture when the computer program is executed by a processor.
本发明实施方式相对于现有技术而言,主要区别及其效果在于:预先为动态图片配置对应的音频文件,当用户利用应用程序发送动态图片时,接收方用户需要向应用程序的服务端请求动态图片,此时将接收到服务端发来的动态图片和对应的音频文件,之后接收方用户在播放该动态图片时,会自动播放对应的音频文件,造成图片具有声音的效果。可见,本发明的发明人创造性地利用动态图片文件和音频文件同时播放的方式实现了动态图片播放时具有声音的效果,无需改变动态图片本身格式、标准等,实现简便,便于推广。Compared with the prior art, the main difference and effect of the embodiments of the present invention are: the corresponding audio files are pre-configured for the dynamic pictures, and when the user sends the dynamic pictures by using the application, the recipient user needs to request the server of the application. For dynamic pictures, the dynamic pictures and corresponding audio files sent by the server will be received at this time. After that, when the receiver user plays the dynamic pictures, the corresponding audio files will be automatically played, causing the pictures to have the effect of sound. It can be seen that the inventor of the present invention creatively utilizes the simultaneous playback of the dynamic picture file and the audio file to achieve the effect of sound when the dynamic picture is played, without changing the format and standard of the dynamic picture itself, which is easy to implement and easy to popularize.
作为进一步改进,所述在应用程序中接收到包含动态图片的信息中,所述包含动态图片的信息中利用识别信息标识所述动态图片;所述向所述应用程序的服务端请求所述动态图片中,具体包括:发送携带所述识别信息的请求信息。在应用程序内可以通过识别信息标识动态图片,接收方利用识别信息请求动态图片,加快应用程序内通信双方的信息传输速度。As a further improvement, in the information containing dynamic pictures received in the application, the dynamic pictures are identified by identification information in the information containing dynamic pictures; and the dynamic pictures are requested from the server of the application. In the picture, it specifically includes: sending request information carrying the identification information. In the application program, the dynamic picture can be identified by the identification information, and the receiver uses the identification information to request the dynamic picture, so as to speed up the information transmission speed between the two communication parties in the application program.
作为进一步改进,所述识别信息为识别号。As a further improvement, the identification information is an identification number.
作为进一步改进,还包括:在播放所述动态图片时,若检测到用户对所述动态图片点击,且检测到的点击动作符合第一预设动作,则暂停播放所述动态图片和暂停播放所述音频文件。进一步限定在动态图片开始播放之后,还可以监测用户动作,对动态图片进行暂停控制,便于用户对动态图片的控制。As a further improvement, it also includes: when playing the dynamic picture, if it is detected that the user clicks on the dynamic picture, and the detected click action conforms to the first preset action, then pause the playback of the dynamic picture and pause the playback of all the dynamic pictures. described audio files. It is further limited that after the dynamic picture starts to play, user actions can be monitored, and the dynamic picture can be paused and controlled, so as to facilitate the user's control of the dynamic picture.
作为进一步改进,所述第一预设动作为单击、双击或三击。As a further improvement, the first preset action is single click, double click or triple click.
作为进一步改进,还包括:在所述动态图片处于暂停状态时,若检测到用户对所述动态图片点击,且点击动作符合第二预设动作,则恢复播放所述动态图片和恢复播放所述音频文件。进一步限定在暂停之后可以恢复播放,使得对动态图片的控制更为丰富。As a further improvement, it also includes: when the dynamic picture is in a paused state, if it is detected that the user clicks on the dynamic picture, and the click action conforms to the second preset action, resuming playback of the dynamic picture and resuming playback of the dynamic picture audio file. It is further limited that playback can be resumed after being paused, so that the control over dynamic pictures is more abundant.
作为进一步改进,所述第二预设动作为单击、双击或三击。As a further improvement, the second preset action is single click, double click or triple click.
作为进一步改进,在所述接收服务端返回的所述动态图片和与所述动态图片对应的音频文件后,还包括:确定所述动态图片和所述音频文件的总播放时长;在所述暂停播放所述动态图片和暂停播放所述音频文件时,记录所述动态图片和所述音频文件的已播放时长;在所述恢复播放所述动态图片和恢复播放所述音频文件时,根据所述总播放时长和所述已播放时长计算继续播放时间,从所述继续播放时间恢复播放所述动态图片和继续播放所述音频文件。进一步限定通过记录暂停时间点的相关参数,更好地实现恢复播放时可以正常播放。As a further improvement, after receiving the dynamic picture and the audio file corresponding to the dynamic picture returned by the server, the method further includes: determining the total playing time of the dynamic picture and the audio file; When playing the dynamic picture and pausing to play the audio file, record the played duration of the dynamic picture and the audio file; when resuming the playback of the dynamic picture and resuming the playback of the audio file, according to the The total playing time and the already played time are used to calculate the continuous playing time, and the dynamic picture and the audio file are resumed from the continuous playing time. It is further limited to record the relevant parameters of the pause time point, so as to better realize the normal playback when the playback is resumed.
作为进一步改进,所述接收服务端返回的所述动态图片和与所述动态图片对应的音频文件后,还包括:在检测到用户的第三预设动作时,播放所述动态图片。进一步限定在检测到第三预设动作时再播放动态图片,防止同时收到多张动态图片时,声音出现叠加,影响用户欣赏图片。As a further improvement, after receiving the dynamic picture and the audio file corresponding to the dynamic picture returned by the server, the method further includes: when a third preset action of the user is detected, playing the dynamic picture. It is further limited to play the dynamic picture when the third preset action is detected, so as to prevent the sound from being superimposed when multiple dynamic pictures are received at the same time, which affects the user's appreciation of the pictures.
作为进一步改进,还包括:在所述动态图片和所述音频文件接收完成时,播放所述动态图片。限定接收完成才播放图片,保证用户在欣赏图片的同时可以听到音乐,另外,在接收完成时,自动播放,符合用户的使用习惯。As a further improvement, the method further includes: playing the dynamic picture when the receiving of the dynamic picture and the audio file is completed. The picture is played only after the reception is completed, to ensure that the user can listen to the music while enjoying the picture. In addition, when the reception is completed, it will be played automatically, which is in line with the user's usage habits.
作为进一步改进,所述动态图片和对应的所述音频文件预存于所述服务端。利用将动态图片和音频文件预存于服务端,使得用户端在使用时,几乎不影响操作流程,便于本发明的推广。As a further improvement, the dynamic picture and the corresponding audio file are pre-stored in the server. The dynamic pictures and audio files are pre-stored in the server, so that the user end hardly affects the operation process when using it, which is convenient for the promotion of the present invention.
附图说明Description of drawings
一个或多个实施例通过与之对应的附图中的图片进行示例性说明,这些示例性说明并不构成对实施例的限定,附图中具有相同参考数字标号的元件表示为类似的元件,除非有特别申明,附图中的图不构成比例限制。One or more embodiments are exemplified by the pictures in the corresponding drawings, and these exemplifications do not constitute limitations of the embodiments, and elements with the same reference numerals in the drawings are denoted as similar elements, Unless otherwise stated, the figures in the accompanying drawings do not constitute a scale limitation.
图1是根据本发明第一实施方式中动态图片的播放方法的流程图;1 is a flowchart of a method for playing a dynamic picture according to a first embodiment of the present invention;
图2是根据本发明第二实施方式中对开始播放的动态图片的控制方法的流程图;2 is a flowchart of a method for controlling a dynamic picture that starts playing according to a second embodiment of the present invention;
图3是根据本发明第三实施方式中动态图片的播放方法的流程图;3 is a flowchart of a method for playing a dynamic picture according to a third embodiment of the present invention;
图4是根据本发明第四实施方式中终端的结构示意图。FIG. 4 is a schematic structural diagram of a terminal according to a fourth embodiment of the present invention.
具体实施方式Detailed ways
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合附图对本发明的各实施方式进行详细的阐述。然而,本领域的普通技术人员可以理解,在本发明各实施方式中,为了使读者更好地理解本申请而提出了许多技术细节。但是,即使没有这些技术细节和基于以下各实施方式的种种变化和修改,也可以实现本申请所要求保护的技术方案。In order to make the objectives, technical solutions and advantages of the embodiments of the present invention clearer, each embodiment of the present invention will be described in detail below with reference to the accompanying drawings. However, those of ordinary skill in the art can appreciate that, in the various embodiments of the present invention, many technical details are set forth in order for the reader to better understand the present application. However, even without these technical details and various changes and modifications based on the following embodiments, the technical solutions claimed in the present application can be realized.
本发明的第一实施方式涉及一种动态图片的播放方法,其流程如图1所示,具体如下:The first embodiment of the present invention relates to a method for playing a dynamic picture, the process of which is shown in FIG. 1 , and the details are as follows:
步骤101,在应用程序中接收到包含动态图片的信息。Step 101, information including dynamic pictures is received in the application program.
具体的说,用户通过社交应用程序交互信息,发送方需要发出动态图片时,通过网络获取服务端数据库中已有的gif图片清单,清单以图片缩略图的形式排列在特定窗口内供用户选择,用户可以通过点击gif预览图进行选择,服务端接收到选定指令后,应用程序将用户选择的该gif图片的对应的识别信息(如识别号、id号等)发送给接收方。接收方接收到包含动态图片的信息,实际可以是包含动态图片id号的信息。Specifically, users exchange information through social applications, and when the sender needs to send dynamic pictures, it obtains a list of existing gif pictures in the server database through the network, and the list is arranged in a specific window in the form of picture thumbnails for users to choose. The user can select by clicking on the gif preview image. After the server receives the selection instruction, the application sends the corresponding identification information (such as identification number, id number, etc.) of the gif image selected by the user to the recipient. The receiver receives the information including the dynamic picture, which may actually be information including the id number of the dynamic picture.
步骤102,向应用程序的服务端请求动态图片。Step 102, request the dynamic picture from the server of the application.
具体的说,接收方在接收到发送方发送的识别信息后,通过网络请求向服务端(服务器数据库)发出请求信息,请求信息中携带获取该动态图片的id号。Specifically, after receiving the identification information sent by the sender, the receiver sends request information to the server (server database) through a network request, and the request information carries the id number for obtaining the dynamic picture.
需要说明的是,服务器数据库中存储的对应gif图片的音频数据文件,可以由系统预先配置,也可以是用户预先配置。配置完成后存储至数据库,具体将gif图片以及对应的音频文件放在同一条记录上,通过id去标识。It should be noted that, the audio data file corresponding to the gif image stored in the server database may be preconfigured by the system, or may be preconfigured by the user. After the configuration is completed, it is stored in the database. Specifically, the gif image and the corresponding audio file are placed on the same record and identified by id.
值得一提的是,数据库中的数据记录也可以由用户预先上传,具体的说,用户可以借助gif录制工具(例如ScreenToGif、GIFGIF等),通过对图片或者是视频文件的截取处理生成gif图片,同时录制对应的音频数据或者自己配音成音频文件。It is worth mentioning that the data records in the database can also be pre-uploaded by users. Specifically, users can use gif recording tools (such as ScreenToGif, GIFGIF, etc.) to generate gif pictures by intercepting pictures or video files. At the same time, record the corresponding audio data or dub it into an audio file.
步骤103,接收服务端返回的动态图片和与动态图片对应的音频文件。Step 103: Receive the dynamic picture and the audio file corresponding to the dynamic picture returned by the server.
具体的说,服务端在接收到请求信息后,根据请求信息中的id号查找对应的数据记录,数据记录具体包括:gif图片以及对应的音频数据文件,并将查找到的数据记录发送给请求信息的发送方。Specifically, after receiving the request information, the server searches for the corresponding data record according to the id number in the request information. The data record specifically includes: gif picture and the corresponding audio data file, and sends the found data record to the request. sender of the information.
值得一提的是,由于动态图片和音频文件是作为数据记录存储在服务器中,音频文件可以作为缺损项,也就是有些数据记录只有动态图片而没有音频文件,那么接收方根据动态图片的id号请求时,也只会返回动态图片本身,不会返回音频文件,可以发现这样的存储机制很好地融合了现有只有动态图片没有音频文件的方案。也就是说,可以只对数据库中部分动态图片配置音频文件,当只返回动态图片时,只播放动态图片,可见,本发明实施方式对系统的改动小,推广十分便利。It is worth mentioning that since the dynamic pictures and audio files are stored in the server as data records, the audio files can be used as defective items, that is, some data records only have dynamic pictures but no audio files, then the receiver will use the id number of the dynamic pictures. When the request is made, only the dynamic picture itself will be returned, and no audio file will be returned. It can be found that such a storage mechanism integrates well with the existing solution that only has dynamic pictures and no audio files. That is to say, audio files can be configured only for part of the dynamic pictures in the database, and when only dynamic pictures are returned, only the dynamic pictures are played. It can be seen that the embodiment of the present invention makes little changes to the system and is very convenient for promotion.
步骤104,播放动态图片和音频文件。Step 104, playing the dynamic pictures and audio files.
具体的说,本实施方式中,在动态图片以及音频均接收到后,同时播放gif图片以及对应的音频数据文件。播放时将图片与声音结合到一起,在应用程序不需要有播放器的情况下让用户体验到类似播放视频的效果,提高用户体验。Specifically, in this embodiment, after both the dynamic picture and the audio are received, the gif picture and the corresponding audio data file are simultaneously played. When playing, the picture and sound are combined together, and the user can experience the effect similar to playing a video without a player in the application, which improves the user experience.
值得一提的是,如果短时间内接收到多个动态图片,可以以接收的起始时间为准,最早的动态图片先行播放,之后处于等待状态,终端在检测到前一个动态图片播放完毕后,触发下一个动态图片进行播放。避免同时接收多个图片时,声音重叠造成的混乱。It is worth mentioning that if multiple dynamic pictures are received in a short period of time, the start time of the reception can be used as the criterion. The earliest dynamic picture is played first, and then it is in a waiting state. After the terminal detects that the previous dynamic picture is finished playing , trigger the next dynamic picture to play. Avoid confusion caused by overlapping sound when receiving multiple pictures at the same time.
可见,本实施方式相对于现有技术而言,主要区别及其效果在于:预先为动态图片配置对应的音频文件,当用户利用应用程序发送动态图片时,接收方用户用于需要向应用程序的服务端请求动态图片,此时将接收到服务端发来的动态图片和对应的音频文件,之后接收方用户在播放该动态图片时,会自动播放对应的音频文件,造成图片具有声音的效果,体验感大大提升。可见,本发明的发明人创造性地利用动态图片文件和音频文件同时播放的方式实现了动态图片播放时具有声音的效果,无需改变动态图片本身格式、标准等,实现简便,便于推广。另外,由于限定接收完成才播放图片,保证用户在欣赏图片的同时可以听到音乐,另外,在接收完成时,自动播放,符合用户的使用习惯,也不会影响图片欣赏。It can be seen that, compared with the prior art, the main difference and its effect of this embodiment are: the corresponding audio files are configured for the dynamic pictures in advance. When the server requests a dynamic picture, it will receive the dynamic picture and the corresponding audio file sent by the server. After that, when the receiver user plays the dynamic picture, the corresponding audio file will be automatically played, causing the picture to have the effect of sound. The experience is greatly improved. It can be seen that the inventor of the present invention creatively utilizes the simultaneous playback of the dynamic picture file and the audio file to achieve the effect of sound when the dynamic picture is played, without changing the format and standard of the dynamic picture itself, which is easy to implement and easy to popularize. In addition, it is limited to play the picture after the reception is completed, which ensures that the user can listen to the music while enjoying the picture. In addition, when the reception is completed, it is automatically played, which is in line with the user's usage habits and will not affect the picture appreciation.
本发明的第二实施方式涉及一种动态图片的播放方法。第二实施方式是在第一实施方式的基础上做了进一步改进,主要改进之处在于:在第一实施方式中,动态图片只有播放和停止两种状态。而在本发明第二实施方式中,动态图片还具体暂停状态,多种状态的控制可以由用户操控,丰富用户的欣赏方式。The second embodiment of the present invention relates to a method for playing a dynamic picture. The second embodiment is further improved on the basis of the first embodiment, and the main improvement lies in that: in the first embodiment, the dynamic picture has only two states of playing and stopping. In the second embodiment of the present invention, the dynamic picture is also in a specific pause state, and the control of various states can be controlled by the user, which enriches the user's appreciation mode.
具体的说,本实施方式中在动态图片播放时,可以监测用户对动态图片的指令操作:Specifically, in this embodiment, when the dynamic picture is played, the user's instruction operation on the dynamic picture can be monitored:
(1)若检测到用户对动态图片点击,且检测到的点击动作符合第一预设动作,则暂停播放动态图片和暂停播放音频文件。(1) If it is detected that the user clicks on the dynamic picture, and the detected click action conforms to the first preset action, the playback of the dynamic picture and the playback of the audio file are paused.
(2)在动态图片处于暂停状态时,若检测到用户对动态图片点击,且点击动作符合第二预设动作,则恢复播放动态图片和恢复播放音频文件。(2) When the dynamic picture is in a paused state, if it is detected that the user clicks on the dynamic picture, and the click action conforms to the second preset action, then resume playing of the dynamic picture and resume playing of the audio file.
可以发现,利用第一预设动作和第二预设动作分别控制动态图片的暂停和恢复播放,使得音频文件的播放和动态图片联动,不会影响用户欣赏图片。具体的说,第一预设动作和第二预设动作可以分别是单击、双击或三击中的一种,第一预设动作和第二预设动作可以是相同的点击动作,也可以是不相同的点击动作。It can be found that the first preset action and the second preset action are used to control the pause and resume playback of the dynamic picture respectively, so that the playback of the audio file and the dynamic picture are linked together without affecting the user's enjoyment of the pictures. Specifically, the first preset action and the second preset action may be one of a single click, a double click, or a triple click, respectively, and the first preset action and the second preset action may be the same click action, or is not the same as the click action.
如:第一预设动作和第二预设动作均为双击,那么在检测到第一次对动态图片的双击动作时,动态图片和音频文件同时暂停播放,再次检测到用户对动态图片的双击动作时,动态图片和音频文件同时恢复播放。又如:第一预设动作为双击,第二预设动作为单击,那么在检测到第一次对动态图片的双击动作时,动态图片和音频文件同时暂停播放,再次检测到用户对动态图片的单击动作时,动态图片和音频文件同时恢复播放。For example: the first preset action and the second preset action are both double-clicks, then when the first double-click action on the dynamic picture is detected, the dynamic picture and the audio file will be paused to play at the same time, and the user's double-click on the dynamic picture will be detected again. During the action, the dynamic picture and audio files resume playback at the same time. Another example: the first preset action is a double-click, and the second preset action is a single-click, then when the first double-click action on the dynamic picture is detected, the dynamic picture and the audio file are paused to play at the same time, and the user's response to the dynamic picture is detected again. When the picture is clicked, the dynamic picture and audio file will resume playing at the same time.
需要说明的是,本实施方式对动态图片的控制流程可以如图2所示,具体如下:It should be noted that the control flow of the dynamic picture in this embodiment may be as shown in FIG. 2 , and the details are as follows:
步骤201,确定动态图片和音频文件的总播放时长。Step 201: Determine the total playing time of the dynamic picture and the audio file.
具体的说,在接收服务端返回的动态图片和与动态图片对应的音频文件后,确定动态图片和音频文件的总播放时长。更具体的说,可以通过分析动态图片和音频文件的大小等参数获知总播放时长。Specifically, after receiving the dynamic picture and the audio file corresponding to the dynamic picture returned by the server, the total playing time of the dynamic picture and the audio file is determined. More specifically, the total playback duration can be obtained by analyzing parameters such as the size of dynamic pictures and audio files.
步骤202,判断是否检测到用户对图片的双击动作;若是,则执行步骤203;若否,则返回继续执行步骤202。Step 202, it is judged whether a double-click action of the user on the picture is detected; if yes, go to Step 203;
具体的说,在播放动态图片时,判断是否检测到用户对图片的双击动作,这里的双击动作即为第一预设动作。Specifically, when a dynamic picture is played, it is determined whether a double-click action of the user on the picture is detected, and the double-click action here is the first preset action.
步骤203,暂停播放动态图片和音频文件。Step 203: Pause the playing of the dynamic picture and the audio file.
步骤204,记录动态图片和音频文件的已播放时长。Step 204, record the played duration of the dynamic picture and the audio file.
步骤205,判断是否检测到用户对图片的双击动作;若是,则执行步骤206;若否,则返回继续执行步骤205。Step 205, it is judged whether a double-click action of the user on the picture is detected; if yes, go to Step 206;
具体的说,在暂停播放动态图片时,判断是否检测到用户对图片的双击动作,这里的双击动作相当于第二预设动作。Specifically, when the playback of the dynamic picture is paused, it is determined whether a double-click action of the user on the picture is detected, and the double-click action here is equivalent to the second preset action.
步骤206,恢复播放动态图片和音频文件。Step 206, resume playing the dynamic pictures and audio files.
具体的说,根据步骤201中获得的总播放时长和步骤204中记录的已播放时长计算出继续播放时间,在恢复播放时从继续播放时间恢复播放动态图片和继续播放音频文件。Specifically, the continuous playback time is calculated according to the total playback duration obtained in step 201 and the played playback duration recorded in step 204, and the playback of dynamic pictures and audio files is resumed from the playback time when resuming playback.
之后可以继续进入步骤202监测用户的点击动作,直至动态图片播放完毕。Afterwards, it is possible to continue to step 202 to monitor the click action of the user until the dynamic picture is played.
可见,本实施方式进一步限定在动态图片开始播放之后,还可以监测用户动作,对动态图片进行暂停控制,便于用户对动态图片的控制,之后再限定在暂停之后可以恢复播放,使得对动态图片的控制更为丰富。另外,通过记录暂停时间点的相关参数,更好地实现恢复播放时可以正常播放。It can be seen that this embodiment is further limited in that after the dynamic picture starts to play, the user's actions can also be monitored, and the dynamic picture can be paused and controlled, so as to facilitate the user's control of the dynamic picture. More control. In addition, by recording the relevant parameters of the pause time point, it is better to realize the normal playback when the playback is resumed.
本发明的第三实施方式涉及一种动态图片的播放方法。第三实施方式与第一实施方式大致相同,主要区别之处在于:第一实施方式在动态图片和音频文件接收完成后开始播放,而本实施方式是在检测到用户的第三预设动作时开始播放,将自动播放改为由用户控制的播放,更利于用户对动态图片的控制。The third embodiment of the present invention relates to a method for playing a dynamic picture. The third embodiment is roughly the same as the first embodiment, the main difference is that: the first embodiment starts to play after the dynamic picture and audio file are received, while the present embodiment starts when the third preset action of the user is detected. Start playing, and change the automatic playback to the playback controlled by the user, which is more conducive to the user's control of the dynamic picture.
本实施方式动态图片的播放方法可以如图3所示,具体如下:The method for playing a dynamic picture in this embodiment may be as shown in FIG. 3 , and the details are as follows:
本实施方式步骤301至303和第一实施方式中的步骤101至103相类似,在此不再赘述。Steps 301 to 303 in this embodiment are similar to steps 101 to 103 in the first embodiment, and are not repeated here.
步骤304,判断是否检测到用户的第三预设动作;若是,则执行步骤305;若否,则返回继续执行步骤304。Step 304, determine whether the third preset action of the user is detected; if yes, go to Step 305;
具体的说,第三预设动作可以是单击、双击或三击中的一种,终端在检测到第三预设动作时对接收到的动态图片和音频文件进行播放,如果没有检测到,则不播放,接收到的动态图片和音频文件可以都处于等待状态。Specifically, the third preset action may be one of single-click, double-tap or triple-tap. When the terminal detects the third preset action, the terminal plays the received dynamic picture and audio file. Then it will not be played, and the received dynamic pictures and audio files can be in a waiting state.
值得一提的是,第三预设动作可以和第一预设动作或第二预设动作相同,也可以不相同,在此不做限定。It is worth mentioning that the third preset action may be the same as or different from the first preset action or the second preset action, which is not limited herein.
本实施方式步骤305和第一实施方式中的步骤104相类似,在此不再赘述。Step 305 in this embodiment is similar to step 104 in the first embodiment, and details are not repeated here.
可见,本实施方式限定在检测到用户的点击动作时才播放图片,不仅可以保证用户在欣赏图片的同时欣赏到音乐,也符合用户的使用习惯,还能避免同时接收到的多个音频文件同时播放,造成声音叠加的混乱。It can be seen that this embodiment is limited to play the picture when the click action of the user is detected, which not only ensures that the user can enjoy the music while enjoying the picture, but also conforms to the user's usage habits, and can also avoid the simultaneous reception of multiple audio files. Play, creating a clutter of sound overlays.
上面各种方法的步骤划分,只是为了描述清楚,实现时可以合并为一个步骤或者对某些步骤进行拆分,分解为多个步骤,只要包括相同的逻辑关系,都在本专利的保护范围内;对算法中或者流程中添加无关紧要的修改或者引入无关紧要的设计,但不改变其算法和流程的核心设计都在该专利的保护范围内。The steps of the above various methods are divided only for the purpose of describing clearly. During implementation, they can be combined into one step or some steps can be split and decomposed into multiple steps. As long as the same logical relationship is included, they are all within the protection scope of this patent. ;Adding insignificant modifications to the algorithm or process or introducing insignificant designs, but not changing the core design of the algorithm and process are all within the scope of protection of this patent.
本发明第四实施方式涉及一种终端,如图4所示,包括:The fourth embodiment of the present invention relates to a terminal, as shown in FIG. 4 , including:
至少一个处理器;以及,与至少一个处理器通信连接的存储器;其中,存储器存储有可被至少一个处理器执行的指令,指令被至少一个处理器执行,以使至少一个处理器能够执行如第一实施方式至第三实施方式中任一个动态图片的播放方法。at least one processor; and, a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform as A method for playing a dynamic picture in any one of the first embodiment to the third embodiment.
其中,存储器和处理器采用总线方式连接,总线可以包括任意数量的互联的总线和桥,总线将一个或多个处理器和存储器的各种电路连接在一起。总线还可以将诸如外围设备、稳压器和功率管理电路等之类的各种其他电路连接在一起,这些都是本领域所公知的,因此,本文不再对其进行进一步描述。总线接口在总线和收发机之间提供接口。收发机可以是一个元件,也可以是多个元件,比如多个接收器和发送器,提供用于在传输介质上与各种其他装置通信的单元。经处理器处理的数据通过天线在无线介质上进行传输,进一步,天线还接收数据并将数据传送给处理器。The memory and the processor are connected by a bus, and the bus may include any number of interconnected buses and bridges, and the bus connects one or more processors and various circuits of the memory. The bus may also connect together various other circuits, such as peripherals, voltage regulators, and power management circuits, which are well known in the art and therefore will not be described further herein. The bus interface provides the interface between the bus and the transceiver. A transceiver may be a single element or multiple elements, such as multiple receivers and transmitters, providing a means for communicating with various other devices over a transmission medium. The data processed by the processor is transmitted on the wireless medium through the antenna, and further, the antenna also receives the data and transmits the data to the processor.
处理器负责管理总线和通常的处理,还可以提供各种功能,包括定时,外围接口,电压调节、电源管理以及其他控制功能。而存储器可以被用于存储处理器在执行操作时所使用的数据。The processor is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interface, voltage regulation, power management, and other control functions. Instead, memory may be used to store data used by the processor in performing operations.
本发明第五实施方式涉及一种计算机可读存储介质,存储有计算机程序。计算机程序被处理器执行时实现上述方法实施例。A fifth embodiment of the present invention relates to a computer-readable storage medium storing a computer program. The above method embodiments are implemented when the computer program is executed by the processor.
即,本领域技术人员可以理解,实现上述实施例方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-OnlyMemory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。That is, those skilled in the art can understand that all or part of the steps in the method for implementing the above embodiments can be completed by instructing the relevant hardware through a program, and the program is stored in a storage medium and includes several instructions to make a device ( It may be a single chip microcomputer, a chip, etc.) or a processor (processor) to execute all or part of the steps of the methods of the various embodiments of the present application. The aforementioned storage medium includes: U disk, removable hard disk, Read-Only Memory (ROM, Read-Only Memory), Random Access Memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program codes.
本领域的普通技术人员可以理解,上述各实施方式是实现本发明的具体实施例,而在实际应用中,可以在形式上和细节上对其作各种改变,而不偏离本发明的精神和范围。Those of ordinary skill in the art can understand that the above-mentioned embodiments are specific examples for realizing the present invention, and in practical applications, various changes in form and details can be made without departing from the spirit and the spirit of the present invention. scope.
Claims (12)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810660239.XA CN109166165A (en) | 2018-06-25 | 2018-06-25 | A kind of playback method of dynamic picture, terminal and can storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810660239.XA CN109166165A (en) | 2018-06-25 | 2018-06-25 | A kind of playback method of dynamic picture, terminal and can storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109166165A true CN109166165A (en) | 2019-01-08 |
Family
ID=64897254
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810660239.XA Pending CN109166165A (en) | 2018-06-25 | 2018-06-25 | A kind of playback method of dynamic picture, terminal and can storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109166165A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111354384A (en) * | 2020-02-27 | 2020-06-30 | 北京奇艺世纪科技有限公司 | GIF picture generation method, playing method and device and electronic equipment |
CN113810494A (en) * | 2021-09-16 | 2021-12-17 | 腾讯科技(深圳)有限公司 | Audio playing control method, device, terminal and storage medium |
Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101174448A (en) * | 2007-12-10 | 2008-05-07 | 北京炬力北方微电子有限公司 | Talking picture playing method and device, method for generating index file of talking picture |
CN101409594A (en) * | 2008-09-26 | 2009-04-15 | 深圳和勤信息技术有限公司 | Method and system for playing music and synchronous concomitance information through network |
CN101425307A (en) * | 2008-12-04 | 2009-05-06 | 深圳创维-Rgb电子有限公司 | Method, system and handhold terminal device for simultaneously playing image and music |
CN104599307A (en) * | 2015-02-11 | 2015-05-06 | 成都品果科技有限公司 | Mobile terminal animated image display method |
CN105023591A (en) * | 2015-06-30 | 2015-11-04 | 广东欧珀移动通信有限公司 | Audio playing method and system, and user terminal |
CN105208439A (en) * | 2015-09-11 | 2015-12-30 | 深圳Tcl数字技术有限公司 | Audio file playing method and device |
CN105516756A (en) * | 2015-12-16 | 2016-04-20 | 广东欧珀移动通信有限公司 | Network video storage method and mobile terminal |
CN106713636A (en) * | 2016-12-23 | 2017-05-24 | 北京奇虎科技有限公司 | Picture data loading method, device and mobile terminal |
CN106777204A (en) * | 2016-12-23 | 2017-05-31 | 北京奇虎科技有限公司 | The processing method of image data, device and mobile terminal |
CN107295284A (en) * | 2017-08-03 | 2017-10-24 | 浙江大学 | A kind of generation of video file being made up of audio and picture and index playing method, device |
-
2018
- 2018-06-25 CN CN201810660239.XA patent/CN109166165A/en active Pending
Patent Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101174448A (en) * | 2007-12-10 | 2008-05-07 | 北京炬力北方微电子有限公司 | Talking picture playing method and device, method for generating index file of talking picture |
CN101409594A (en) * | 2008-09-26 | 2009-04-15 | 深圳和勤信息技术有限公司 | Method and system for playing music and synchronous concomitance information through network |
CN101425307A (en) * | 2008-12-04 | 2009-05-06 | 深圳创维-Rgb电子有限公司 | Method, system and handhold terminal device for simultaneously playing image and music |
CN104599307A (en) * | 2015-02-11 | 2015-05-06 | 成都品果科技有限公司 | Mobile terminal animated image display method |
CN105023591A (en) * | 2015-06-30 | 2015-11-04 | 广东欧珀移动通信有限公司 | Audio playing method and system, and user terminal |
CN105208439A (en) * | 2015-09-11 | 2015-12-30 | 深圳Tcl数字技术有限公司 | Audio file playing method and device |
CN105516756A (en) * | 2015-12-16 | 2016-04-20 | 广东欧珀移动通信有限公司 | Network video storage method and mobile terminal |
CN106713636A (en) * | 2016-12-23 | 2017-05-24 | 北京奇虎科技有限公司 | Picture data loading method, device and mobile terminal |
CN106777204A (en) * | 2016-12-23 | 2017-05-31 | 北京奇虎科技有限公司 | The processing method of image data, device and mobile terminal |
CN107295284A (en) * | 2017-08-03 | 2017-10-24 | 浙江大学 | A kind of generation of video file being made up of audio and picture and index playing method, device |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111354384A (en) * | 2020-02-27 | 2020-06-30 | 北京奇艺世纪科技有限公司 | GIF picture generation method, playing method and device and electronic equipment |
CN113810494A (en) * | 2021-09-16 | 2021-12-17 | 腾讯科技(深圳)有限公司 | Audio playing control method, device, terminal and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9977591B2 (en) | Image with audio conversation system and method | |
US8392505B2 (en) | Collaborative playlist management | |
WO2017140229A1 (en) | Video recording method and apparatus for mobile terminal | |
US7739584B2 (en) | Electronic messaging synchronized to media presentation | |
US8458260B2 (en) | Information processing unit, content providing server, communication relay server, information processing method, content providing method and communication relay method | |
JP5426008B2 (en) | Content playback device | |
US20080168516A1 (en) | Facilitating Random Access In Streaming Content | |
US20140052770A1 (en) | System and method for managing media content using a dynamic playlist | |
US20160291824A1 (en) | Image Grouping with Audio Commentaries System and Method | |
KR20090130082A (en) | Method and system for previewing media on a network | |
JP2018516516A (en) | Interaction information processing method, client, service platform, and storage medium | |
KR20100081868A (en) | Method and apparatus for playing contents by integrated channel management | |
CN102104623A (en) | Method and system for performing break-point continuous playing of media file through mobile terminal | |
US10965731B2 (en) | Transfer device, client apparatus, server apparatus, reproduction apparatus and transfer method | |
CN109166165A (en) | A kind of playback method of dynamic picture, terminal and can storage medium | |
JP5043711B2 (en) | Video evaluation apparatus and method | |
JP2007514231A (en) | Electronic bookmark | |
JP6266827B1 (en) | Terminal and server | |
US8694613B2 (en) | Client device, information processing method, and information processing system | |
JP5539165B2 (en) | Content distribution apparatus, content reproduction apparatus, and content reproduction system | |
US11089352B1 (en) | Techniques for synchronizing content playback across devices | |
CN101325506B (en) | Client terminal and method for controlling on-line living broadcast frame data | |
WO2024036979A9 (en) | Multimedia resource playback method and related apparatus | |
KR102204223B1 (en) | Apparatus, system, and method for remote connection | |
KR101947186B1 (en) | Content reproduction method and system |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190108 |
|
RJ01 | Rejection of invention patent application after publication |