CN108289237B - Method, device and terminal for playing dynamic picture and computer readable storage medium - Google Patents

Method, device and terminal for playing dynamic picture and computer readable storage medium Download PDF

Info

Publication number
CN108289237B
CN108289237B CN201810146626.1A CN201810146626A CN108289237B CN 108289237 B CN108289237 B CN 108289237B CN 201810146626 A CN201810146626 A CN 201810146626A CN 108289237 B CN108289237 B CN 108289237B
Authority
CN
China
Prior art keywords
playing
control information
dynamic picture
webpage
preset
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.)
Active
Application number
CN201810146626.1A
Other languages
Chinese (zh)
Other versions
CN108289237A (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201810146626.1A priority Critical patent/CN108289237B/en
Publication of CN108289237A publication Critical patent/CN108289237A/en
Application granted granted Critical
Publication of CN108289237B publication Critical patent/CN108289237B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/478Supplemental services, e.g. displaying phone caller identification, shopping application
    • H04N21/4782Web browsing, e.g. WebTV
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/431Generation of visual interfaces for content selection or interaction; Content or additional data rendering
    • H04N21/4312Generation of visual interfaces for content selection or interaction; Content or additional data rendering involving specific graphical features, e.g. screen layout, special fonts or colors, blinking icons, highlights or animations
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/472End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content
    • H04N21/47202End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content for requesting content on demand, e.g. video on demand
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/85Assembly of content; Generation of multimedia applications
    • H04N21/858Linking data to content, e.g. by linking an URL to a video object, by creating a hotspot
    • H04N21/8586Linking data to content, e.g. by linking an URL to a video object, by creating a hotspot by using a URL

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Databases & Information Systems (AREA)
  • Human Computer Interaction (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses a method, a device, a terminal and a computer readable storage medium for playing dynamic pictures, and belongs to the technical field of internet. The method comprises the following steps: when a webpage display instruction is received, playing a dynamic picture in a webpage; in the playing process, acquiring the appointed playing state of the dynamic picture according to the playing control information of the dynamic picture, wherein the playing control information is used for indicating that the appointed playing state is switched to an appointed style for playing when meeting the playing condition; and when the appointed playing state reaches the playing condition, playing the dynamic picture according to an appointed style. The playing mode of the dynamic picture is controlled through the playing control information predefined in the webpage, the playing mode of the dynamic picture is enriched, and the dynamic display effect of the dynamic picture in the webpage is improved. And moreover, the switching playing of the specified style can be controlled based on the playing condition, so that the control intelligence is improved.

Description

Method, device and terminal for playing dynamic picture and computer readable storage medium
Technical Field
The present invention relates to the field of internet technologies, and in particular, to a method, an apparatus, a terminal, and a computer-readable storage medium for playing a dynamic picture.
Background
With the development of internet technology, more and more users prefer to publish dynamic pictures on a network platform. For example, GIF (Graphics Interchange Format) pictures. A dynamic picture can be composed of a plurality of image frames, and the image frames can be played in sequence, so that the effect of showing a simple animation to a user is achieved. Generally, the dynamic pictures can be embedded in the web page for playing, so as to achieve the effect of dynamic display.
In the related art, taking GIF pictures in a played web page as an example, when a user opens a certain web page embedded with GIF pictures, the terminal downloads a web page script of the web page, acquires a URL (Uniform resource locator) address of the GIF picture from the web page script, downloads the GIF picture based on the URL address, and automatically and circularly plays the GIF picture. Wherein, the automatic cycle playing process is as follows: and the terminal circularly plays the multi-frame image frames frame by frame according to the appointed playing sequence until the user closes the webpage, and the terminal stops playing.
In the process of implementing the invention, the inventor finds that the related art has at least the following problems:
in the process of playing the picture, in fact, the terminal controls the playing of the GIF picture only based on the operation of opening and closing the webpage by the user, so that the dynamic display effect of the dynamic picture in the webpage is poor, and the intellectualization of playing the dynamic picture is poor.
Disclosure of Invention
The embodiment of the invention provides a method, a device, a terminal and a computer readable storage medium for playing a dynamic picture, which can solve the problem of poor intellectualization of playing the dynamic picture in the related art. The technical scheme is as follows:
in a first aspect, a method for playing a moving picture is provided, where the method includes:
when a webpage display instruction is received, playing a dynamic picture in a webpage;
in the playing process, acquiring the appointed playing state of the dynamic picture according to the playing control information of the dynamic picture, wherein the playing control information is used for indicating that the appointed playing state is switched to an appointed style for playing when meeting the playing condition;
and when the appointed playing state reaches the playing condition, playing the dynamic picture according to an appointed style.
In a second aspect, an apparatus for playing a moving picture is provided, the apparatus comprising:
the playing module is used for playing the dynamic pictures in the webpage when a webpage display instruction is received;
the first acquisition module is used for acquiring the appointed playing state of the dynamic picture according to the playing control information of the dynamic picture in the playing process, wherein the playing control information is used for indicating that the appointed playing state is switched to an appointed style for playing when meeting the playing condition;
and the playing module is further used for playing the dynamic picture according to a specified style when the specified playing state reaches the playing condition.
In a third aspect, a terminal is provided, where the terminal includes a processor and a memory, where the memory stores at least one instruction, and the instruction is loaded and executed by the processor to implement the operations performed by the method for playing a moving picture according to the first aspect.
In a fourth aspect, a computer-readable storage medium is provided, in which at least one instruction is stored, and the instruction is loaded and executed by a processor to implement the operations performed by the method for playing a moving picture according to the first aspect.
The technical scheme provided by the embodiment of the invention has the following beneficial effects:
in the embodiment of the invention, the terminal can control the playing style of the dynamic picture based on the playing control information predefined in the webpage in the playing process of the dynamic picture without automatic circular playing all the time, thereby enriching the playing style of the dynamic picture and improving the dynamic display effect of the dynamic picture in the webpage. And when the appointed playing style of the dynamic picture reaches the playing condition, the appointed style is switched and played, and the playing condition can be set based on requirements, so that the control intelligence is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic illustration of an implementation environment provided by an embodiment of the invention;
fig. 2 is a flowchart of a method for playing a dynamic picture according to an embodiment of the present invention;
fig. 3 is a flowchart of a method for playing a dynamic picture according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an apparatus for playing a moving picture according to an embodiment of the present invention;
fig. 5 is a block diagram illustrating a terminal according to an exemplary embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is a schematic diagram of an implementation environment provided by an embodiment of the present invention, where the implementation environment includes: a terminal 101 and a server 102. The terminal 101 is installed with a web client, the web client is used for opening a web page, and a dynamic picture can be embedded in the web page. When the terminal 101 opens a web page in the web page client, the terminal 101 downloads a source file of the web page from the server 102, where the source file carries address information of a dynamic picture in the web page. The terminal 101 downloads the moving picture from the server 102 based on the address information in the source file, and plays the moving picture in the web page.
In addition, the source file may also carry first control indication information of the dynamic picture and/or second control indication information of the web page, where the first control indication information corresponds to a dynamic picture and is used to indicate whether to automatically and cyclically play the dynamic picture; the second control indication information corresponds to the web page and is used for indicating whether to automatically and circularly play the dynamic picture in the web page. The terminal can play the dynamic picture in the webpage based on the first control indication information and/or the second control indication information.
The web page client may be any application program that can open a web page, for example, a browser or any application client that has a browsing component or can call a browsing component, or other application programs that can call a function of the browser to open a web page. The dynamic picture is a group of pictures of multi-frame image frames which are played according to a certain playing sequence. For example, the dynamic picture may be a GIF picture, a Flash animation, or the like. The address information may be a URL address of the moving picture.
Fig. 2 is a flowchart of a method for playing a moving picture according to an embodiment of the present invention. The execution subject of the embodiment of the present invention is a terminal, and referring to fig. 2, the method includes:
201. and when a webpage display instruction is received, the terminal plays the dynamic picture in the webpage.
In the embodiment of the invention, when a user browses a webpage in the webpage client, the user can click the webpage identifier of the webpage, and when the terminal detects that a certain webpage identifier is triggered by the user, a webpage display instruction of the webpage is generated, wherein the webpage display instruction can carry the website of the webpage. And the terminal acquires a source file of the webpage from the server according to the website of the webpage and acquires a webpage script from the source file, wherein the webpage script carries the address information of the dynamic picture in the webpage and the position information of the dynamic picture. The terminal analyzes the webpage script to obtain the address information of the dynamic picture and the position information of the dynamic picture in the webpage; and the terminal downloads the dynamic picture from the server according to the address information and renders the dynamic picture at the playing position corresponding to the position information according to the picture data of the dynamic picture.
It should be noted that the source file may be code information written in a specific language and carrying the web page content. For example, the source file may be code information written using HTML (Hyper Text Markup Language). The terminal parses the web page script in the source file and generates a DOM (Document object model) tree of the web page. The dynamic picture in the webpage corresponds to a picture node in the DOM tree, the picture node bears the address information of the dynamic picture and the position information of the dynamic picture, the terminal identifies the picture node in the DOM tree, acquires the address information and the position information of the picture node, and downloads the dynamic picture from the server according to the address information of the dynamic picture; and determining the playing position of the dynamic picture in the webpage according to the position information.
Of course, the web script may also be written in other languages, and accordingly, the specific process of the terminal analyzing the web script to obtain the address information and the location information may also be implemented in other manners, which is not specifically limited in the embodiment of the present invention.
In the embodiment of the invention, in the playing process, the terminal can also control the dynamic picture in the webpage to switch the playing style, for example, the dynamic picture is switched to other pictures to be played, or the playing is stopped when the dynamic picture is played for a certain number of times in a circulating way, and the like. Because the switched playing style can be set as required, the browsing requirement of the user is met, and the actual requirement of a website merchant is also met; in the actual browsing process, the playing style of the dynamic picture is enriched, and the playing effect of the dynamic picture is improved.
In one possible design, some web pages may have moving pictures that do not require switching between plays. In order to accurately control the playing process of the dynamic pictures in the multiple webpages, a developer can predefine whether a webpage starts a playing control function or not for the multiple webpages with different playing requirements, the playing control function of the webpage is used for controlling the dynamic pictures in the webpage to switch playing styles, and therefore a terminal can judge whether the playing styles of the dynamic pictures in the webpage need to be switched or not only according to whether the webpage starts the playing control function or not. Specifically, the terminal may determine whether the webpage has the play control function activated through the following step 202.
202. And the terminal acquires second control indication information of the webpage, and determines that the playing control function of the webpage is started when the second control indication information indicates that the dynamic pictures in the webpage are not automatically and circularly played.
The second control instruction information may be located at a first designated location of the web script; the first specified location may be a starting location of the web script. The terminal reads second control indication information of the webpage from a first specified position of the webpage script, and when the second control indication information indicates that the dynamic pictures in the webpage are not automatically and circularly played, the terminal determines that the playing control function of the webpage is started; and when the second control indication information indicates that the dynamic pictures in the webpage are automatically played circularly, the terminal determines that the playing control function of the webpage is not started.
It should be noted that the second control instruction information is actually a global variable, and the terminal may determine whether the play control function of the web page is turned on only by the global variable to determine whether to switch the play style of the dynamic picture, so as to improve the control efficiency of the terminal; moreover, each webpage corresponds to one piece of second control indication information, and the terminal can realize playing control of the dynamic pictures in the webpage based on the second control indication information of the webpage, so that the control accuracy is improved; different playing styles are adopted for the webpages with different playing requirements, so that the requirements of different users and website merchants are greatly met, and the practicability of the scheme is improved.
In the embodiment of the present invention, the terminal may implement the switching play control of the dynamic picture through the play control information, and actually, the play control information indicates how to play the dynamic picture from two aspects of the play condition and the play style, so that the terminal may first obtain the play control information through the following step 203, and then control the playing of the dynamic picture based on the play control information.
203. And when the playing control function of the webpage is started, the terminal acquires the playing control information of the dynamic picture from the webpage.
The playing control information is used for indicating that the appointed playing state of the dynamic picture meets the playing condition and then switching to an appointed style for playing. The playing control information may be located at a second designated position of the web script, and the second designated position may be a position corresponding to the dynamic picture in the source file, so that each dynamic picture may correspond to one playing control indication information; when the playing control function of the webpage is started, the terminal reads the playing control information from the second appointed position.
In a possible design, multiple dynamic pictures may be embedded in a web page, and some of the multiple dynamic pictures may need to be switched to be played, and some of the multiple dynamic pictures may be automatically played in a loop. In order to further improve the accuracy of controlling the playing, a developer may also define in advance whether each dynamic picture is automatically played in a loop, so that the terminal may control based on the playing requirement of a single picture. Thus, this step 203 may be replaced by: the terminal acquires first control information of the dynamic picture, and when the playing control function of the webpage is started and the first control indication information of the dynamic picture indicates that the dynamic picture is not automatically and circularly played, the terminal acquires the playing control information of the dynamic picture from the webpage.
The first control indication information is used for indicating whether to automatically and circularly play the dynamic picture. The first control indication information may be carried in a third designated location of the web script, and the third designated location may be a location corresponding to the dynamic pictures in the source file, so that each dynamic picture may correspond to one piece of first control indication information, and the terminal reads the first control indication information from the third designated location. When the playing control function is started and the first control indication information indicates that the dynamic picture is not automatically played circularly, the terminal acquires the playing control information of the dynamic picture from the webpage; and when the playing control function is not started or when the playing control function is started but the first control indication information indicates that the dynamic picture is automatically played in a circulating way, the terminal automatically plays the dynamic picture in a circulating way.
It should be noted that the terminal can play the dynamic picture by calling the playing interface of the web page client, and when the dynamic picture is automatically played in a circulating manner, the terminal calls the playing interface corresponding to the automatic circulating playing, so as to realize the automatic circulating playing of the dynamic picture; when the motion picture is not played in an automatic loop, the terminal plays based on the play control information through the following steps 204 and 205.
It should be noted that the source file may only carry any one of the first control instruction information and the second control instruction information, and the terminal determines to control the dynamic picture to switch the playing style based on the instruction of the any one of the first control instruction information and the second control instruction information, that is, when the first control instruction information indicates that the dynamic picture in the web page is not automatically played in a loop, or when the second control instruction information indicates that the dynamic picture is not automatically played in a loop, the terminal determines to control the dynamic picture to switch the playing style, so as to obtain the playing control information, and execute the subsequent step 204. Of course, the source file may not carry the first control instruction information and the second control instruction information, and the terminal defaults to perform switching control of the playing style of the dynamic picture, that is, after step 201, the terminal directly obtains the playing control information and performs step 204.
204. In the playing process, the terminal acquires the appointed playing state of the dynamic picture according to the playing control information of the dynamic picture.
The process of controlling the playing by the terminal through the playing control information is actually a process of judging when to switch to which playing style for playing based on a limiting condition. In this step, the terminal may obtain, according to the play control information, a specified play state required for determining whether the play condition is met. The playing condition may be that the current playing time reaches a preset playing time, or the current playing image frame is a preset image frame.
In the first mode, when the playing condition is that the current playing time reaches the preset playing time, the terminal correspondingly obtains the current playing time of the dynamic picture.
And the terminal finishes playing the multi-frame image frames in the dynamic picture frame by frame according to a certain playing sequence, namely completing one-time playing. However, when the single playing process of the dynamic picture is not yet finished, the current playing time obtained by the terminal may not be accurate, and in order to ensure the accuracy of controlling the playing, the terminal may perform the obtaining operation based on the triggering of a trigger message, where the trigger message may be a single playing end message of the web client, and then the step of obtaining the current playing time of the dynamic picture by the terminal may be: and when receiving a single play ending message of the webpage client, the terminal acquires the current play times of the dynamic picture.
In actual technical implementation, a developer may register a callback function of a web page client in the web page, where the callback function defines a control logic related to the play control information, and when the single play of the dynamic picture is finished, the web page client calls back the callback function and executes a code segment in the callback function for implementing the above-mentioned obtaining process. Wherein, the acquiring process may be: the terminal executes a callback function in the webpage source file based on the triggering of the single play end message of the webpage client, specifically executes an interface calling code for calling a first designated interface of the webpage client in the callback function, namely, the terminal calls the first designated interface of the webpage client according to the interface calling code to acquire the current playing times of the dynamic picture.
In the playing process of the dynamic picture, the webpage client records the playing times of the dynamic picture, the terminal obtains the current playing times based on a section of code in the callback function, the current playing times is used as a parameter of the control logic, and when the control logic in the callback function is continuously executed, data interaction between the webpage and the webpage client is realized, so that the webpage can sense the playing state of the dynamic picture, the playing process of the dynamic picture is actively and pertinently adjusted based on the playing state subsequently, and the convenience of control is improved.
It should be noted that the preset playing time may be set by a developer based on a user requirement, and this is not specifically limited in the embodiment of the present invention. For example, the preset number of playing times may be 3 times, 5 times, etc.
In the second way, when the playing condition is that the current playing time reaches the preset playing time, the terminal obtains the current playing time of the dynamic picture correspondingly.
In the process of playing the dynamic picture, the web page client may further record the playing time length of the dynamic picture and/or the currently played image frame, and the terminal may determine the current playing time length through the web page client, where the process may be: the terminal acquires the current playing time length of the dynamic picture from the webpage client; or, the terminal obtains the current playing time, the single playing time length, the total frame number of the image frames in the dynamic picture and the current playing image frame from the webpage client, and determines the current playing time length according to the current playing time length, the single playing time length, the total frame number and the current playing image frame.
The terminal may obtain the current playing time by calling a second specified interface of the web client, and a specific implementation manner of the process is the same as the process of obtaining the current playing time, which is not described herein again.
In addition, the terminal may also determine the current playing time based on currently playing multiple state information, specifically, the terminal invokes an interface for acquiring the multiple state information, and acquires the multiple state information from the web client, where the multiple state information may be: the single playing time length, the total frame number, the current playing image frame and/or the current playing times of the dynamic picture. When the playing sequence of the current playing image frame is the last playing of the multi-frame image frames, the terminal is indicated to finish a single playing process at present, and the terminal determines the product of the current playing time and the single playing time length as the current playing time length of the dynamic picture; when the playing sequence of the current playing image frame is not the last playing, the current single playing process of the dynamic picture is not ended, and the terminal takes the product of the current playing time and the single playing time length as a first time length; determining the time length occupied by playing the current playing image frame in the current single playing process according to the single playing time length, the total frame number and the current playing image frame, and taking the time length as a second time length; and the terminal determines the sum of the first time length and the second time length as the current playing time length.
It should be noted that the preset playing time may be set by a developer based on a user requirement, and this is not specifically limited in the embodiment of the present invention. For example, the preset playing time period may be 3 seconds, 5 seconds, and the like.
In a third mode, when the playing condition is that the currently played image frame is a preset image frame, the terminal correspondingly acquires the currently played image frame of the dynamic picture.
In an actual technical process, the currently played image frame may be represented by an image identifier of the currently played image frame, and correspondingly, the step may be: and the terminal acquires the image identifier of the currently played image frame from the webpage client. The image identifier may be a number or a playing order of the preset image frame.
The terminal may obtain the image identifier by calling an interface, and the specific implementation manner of the terminal is the same as the manner of obtaining the current playing time, which is not described herein any more.
It should be noted that the playing control information may include a playing condition and a designated style, where the playing condition and the designated style are defined in advance in the web script of the web content by the developer, and the plurality of dynamic pictures may correspond to the plurality of playing control information, so that the terminal may control and play the plurality of dynamic pictures in different styles based on different playing control information, thereby realizing diversity of the control process and greatly improving user experience on the premise of ensuring accurate control.
205. And when the appointed playing state reaches the playing condition, the terminal plays the dynamic picture according to an appointed style.
In the embodiment of the present invention, based on the difference of the playing conditions in the playing control information, the following three situations can be presented according to the switching playing process implemented by the playing control information.
In a first case, the playing control information is used to indicate that the current playing time reaches a preset playing time and then switch to a specific style for playing, and correspondingly, the step may be: and when the current playing times reach the preset playing times, the terminal plays the dynamic picture according to the specified style.
In this step, the terminal obtains the preset playing times indicated by the playing control information from the webpage source file, and judges whether the current playing times reaches the preset playing times; when the current playing times reach the preset playing times, the terminal plays the dynamic picture according to the specified style; when the current playing frequency does not reach the preset playing frequency, the terminal continues to execute the step 204.
The preset playing times can be loaded in a callback function of the source file, and the terminal executes the switching process based on the control logic of the callback function. The preset playing times can be set according to needs, and the embodiment of the invention is not particularly limited to this; for example, the preset number of playing times may be 5 times, 8 times, etc.
In order to meet various browsing requirements of different users and various playing requirements of different website merchants, developers can design various playing styles based on the various playing requirements, so that the playing styles of the dynamic pictures are enriched. Accordingly, the specified style indicated by the plurality of play control information includes, but is not limited to: switching picture playing, switching playing position or playing track playing, interrupting playing or stopping playing. Based on the multiple possibilities of the play control information, the process of switching the play of the terminal can be realized in any one of the following four ways.
In a first mode, the playing control information is first playing control information, and the first playing control information is used for indicating that the current playing times reach preset playing times and switching to other pictures for playing; correspondingly, the steps can be as follows: and when the current playing frequency reaches the preset playing frequency, the terminal switches the dynamic picture to other pictures for playing according to the first playing control information.
In this step, when the current playing frequency reaches a preset playing frequency, the terminal acquires the address information of the other switched pictures through the source file of the webpage, downloads the other pictures from the server based on the address information of the other pictures, and plays the other pictures at the playing position of the dynamic picture; when the current playing time does not reach the preset playing time, the terminal continues to execute the step 204.
When the webpage is developed, the address information of the other pictures can be carried in a source file of the webpage, so that in the step, the terminal can acquire the address information of the other pictures from the source file; or, the source file carries the picture identifier of the other picture, and the terminal acquires the address information corresponding to the picture identifier from the server in real time, so that the step of acquiring the address information of the other switched picture by the terminal may be: the terminal acquires the picture identification from the source file and sends an acquisition instruction to the server, the acquisition instruction carries the picture identification, the server stores address information corresponding to the picture identification, the server acquires address information of other pictures according to the picture identification and returns the address information of the other pictures to the terminal, and the terminal receives the address information and takes the address information as the address information of the other pictures.
In practical implementation, a developer may define a control logic related to the playing control information of the dynamic picture in the callback function of the web page, and the dynamic picture is switched and played through the control logic. The program instruction of the callback function is specifically executed by the terminal, and the execution process of the callback function may be as follows: when the current playing times are acquired from the webpage client, judging whether the current playing times reach the preset playing times or not; when the current playing frequency reaches the preset playing frequency, acquiring address information of the other switched pictures, downloading the other pictures from the server according to the address information, calling a third appointed interface of the webpage client, wherein the third appointed interface is an interface for playing the pictures by the webpage client, and playing the other pictures at the playing position of the dynamic picture through the third appointed interface; and when the current playing frequency does not reach the preset playing frequency, continuing to execute a single playing ending message based on the webpage client to acquire the current playing frequency.
It should be noted that, because the source file carries the address information of the other pictures, the terminal can directly download and display the other pictures based on the source file, thereby improving the switching efficiency. Or, the terminal may further obtain address information of other pictures from the server in real time based on the picture identifier in the source file, and the developer may update the address information associated with the picture identifier in real time in the server.
For example, a developer may design to insert an advertisement during playing of the dynamic picture, and when the playing of the dynamic picture reaches a preset playing frequency, the dynamic picture is switched to an advertisement picture delivered by a merchant for playing, so that the playing position of the dynamic picture can be effectively utilized, and the utilization rate of each display position in a webpage is improved. Furthermore, when the source file carries the picture identifier, the developer can also periodically update the address information corresponding to the picture identifier in the server, for example, periodically update the address information of the newly released advertisement picture, and the source file of the webpage does not need to be written again, so that the dynamic update of the playing process is simplified, the development cost is saved, and the working efficiency is improved.
The terminal can switch and play the pictures corresponding to the address information in sequence according to the address information when the designated playing state of the picture being played meets the playing condition, thereby realizing the splicing and playing of the pictures, increasing the information content of the webpage and improving the utilization efficiency of the playing position of the dynamic picture.
In a possible design, the terminal may further perform the step of switching the picture playing in a circulating manner, that is, the control logic in the callback function may be a control logic of circulating switching, and the terminal performs the step of switching the current moving picture to another picture for playing whenever the current moving picture is played for a specified number of times.
In a second mode, the playing control information is second playing control information, and the second playing control information is used for indicating that the current playing time reaches a preset playing time and then switching to other playing positions or playing tracks for playing; correspondingly, the steps can be as follows: when the current playing time reaches the preset playing time, the terminal switches the dynamic picture to other playing positions or playing tracks for playing according to the second playing control information.
In this step, when the current playing frequency reaches the preset playing frequency, the terminal obtains other playing positions or playing tracks required for switching playing from the source file of the webpage, and plays the dynamic picture at the other playing positions, or plays the dynamic picture according to the playing tracks.
When the playing position is switched and played, the terminal may implement switching and playing of other playing positions through other position information in the source file, specifically, the other position information may be the width and height of the switched dynamic picture, or the stretching multiple or the reducing multiple of the dynamic picture. Correspondingly, the terminal plays the dynamic picture in the webpage according to the width and the height of the switched dynamic picture, or the terminal performs stretching processing or reducing processing on the dynamic picture according to the stretching multiple or the reducing multiple and plays the dynamic picture after the stretching processing or the reducing processing in the webpage. The other playing positions are not specifically limited in the embodiments of the present invention, for example, the dynamic picture is switched from small-window playing to full-screen playing, or from small-window playing to left half-screen playing.
When switching playing of the playing track is performed, the terminal may implement switching playing of the playing track based on track information defined in the source file, specifically, the track information may be an initial position, an end position, and a moving duration from the initial position to the end position of the playing track, and correspondingly, the terminal moves the dynamic picture from the initial position to the end position within the moving duration according to the track information.
In practical implementation, the other position information or the track information may be carried in a control logic of the callback function, and the terminal implements switching and playing of the playing position or the playing track through the control logic.
In a possible design, the terminal may further circularly execute the step of performing the position switching or track switching to play, that is, the control logic in the callback function may be a control logic of circular switching, and the terminal performs the step of switching the current moving picture to another playing position or playing track to play each time the current moving picture is played for a specified number of times.
In a third mode, the playing control information is third playing control information, and the third playing control information is used for indicating that the playing is interrupted for a preset duration and then the playing is resumed when the current playing times reach the preset playing times; correspondingly, the steps can be as follows: when the current playing time reaches the preset playing time, the terminal interrupts the playing of the dynamic picture for a preset time length according to the third playing control information and resumes the playing.
In this step, when the current playing time reaches the preset playing time, the terminal obtains a preset duration corresponding to the interruption of playing from the webpage source file, stops playing the dynamic picture, and continues to play the dynamic picture after stopping the preset duration.
In an actual technical process, the preset duration may be loaded in a control logic of a callback function, and the terminal executes the callback function to implement the interrupted playing, similarly to the first manner. The specific execution process comprises the following steps: when the current playing times reach the preset playing times, the terminal calls a pause playing interface of the webpage client to pause playing of the dynamic picture; meanwhile, the terminal starts timing, and when the timing reaches a preset duration, the playing interface of the webpage client is called, so that the dynamic picture can be continuously played.
In a possible design, the callback function may further define a playing period and an interruption duration of the dynamic picture, so that the terminal periodically performs interruption playing on the dynamic picture. For example, the callback function may define that the playing period is 5 times, and the interruption duration is 3 seconds, that is, the terminal performs interrupted playing for 3 seconds each time the terminal finishes playing the dynamic picture 5 times, and the playing is cycled sequentially.
In a fourth mode, the playing control information is fourth playing control information, and the fourth playing control information is used for indicating that the playing is stopped when the current playing times reach the preset playing times; correspondingly, the steps can be as follows: and when the current playing frequency reaches the preset playing frequency, the terminal stops playing the dynamic picture according to the fourth playing control information.
In this step, when the current playing frequency reaches the preset playing frequency, the terminal calls a pause playing interface of the web client to stop playing the dynamic picture.
In an actual technical process, the terminal may implement the playing stopping process through a control logic of a callback function, which is the same as the third implementation, and details are not described herein.
It should be noted that the playing control information may carry a plurality of designated styles and switching sequences corresponding to the designated styles, and the terminal may further perform switching of the playing styles by using a plurality of corresponding manners of the four manners according to the switching sequences. For example, the terminal switches the dynamic picture to an advertisement picture, switches the advertisement picture from a small screen to a full screen for display, and continues to play other dynamic pictures at the playing position of the dynamic picture after the advertisement is played.
Of course, the switching of the plurality of playing styles may be triggered by a playing condition, that is, whenever the current playing status meets the playing condition, for example, when the current playing frequency reaches a certain number of times, the current playing status is switched to a playing style for playing according to the switching sequence; or, the switching of multiple play patterns may be triggered by multiple play conditions, that is, the terminal determines whether a play condition corresponding to a certain play pattern is satisfied according to the switching sequence, and switches to the play pattern for playing when the current play state meets the corresponding play condition.
In a second case, the playing control information is used to indicate that the current playing time reaches the preset playing time and then switch to the specified style for playing, and correspondingly, the step may be: and when the current playing time reaches the preset playing time, the terminal plays the dynamic picture according to the specified style.
In this step, the terminal obtains a preset playing time indicated by the playing control information from the webpage source file, and judges whether the current playing time reaches the preset playing time; when the current playing time reaches the preset playing time, the terminal plays the dynamic picture according to a specified style; when the current playing time does not reach the preset playing time, the terminal continues to execute the step 204.
In the same way as in the first case, the preset playing duration may be carried in a callback function of the source file, and the terminal executes the switching process based on a control logic of the callback function; the preset playing time length can be set according to needs, and the embodiment of the invention is not particularly limited to this; for example, the preset playing time period may be 3 seconds, 6 seconds, and the like. And, based on the multiple possibilities of the playing control information, the process of switching the playing of the terminal can be realized by any one of the following four ways.
In a first mode, the playing control information is fifth playing control information, and the fifth playing control information is used for indicating that the current playing time length reaches a preset playing time length and switching to other pictures for playing; correspondingly, the steps can be as follows: and when the current playing time reaches the preset playing time, the terminal switches the dynamic picture to other pictures for playing according to the fifth playing control information.
It should be noted that, when the current playing duration reaches the preset playing duration, the implementation manner of the terminal switching the pictures for playing is the same as the first manner in the first case, and details are not described here.
In a second manner, the playing control information is sixth playing control information, and the sixth playing control information is used for indicating that the current playing time length reaches a preset playing time length and then switching to other playing positions or playing tracks for playing; correspondingly, the steps can be as follows: and when the current playing time reaches the preset playing time, the terminal switches the dynamic picture to other playing positions or playing tracks for playing according to the sixth playing control information.
It should be noted that, when the current playing duration reaches the preset playing duration, the implementation manner of switching the terminal to another playing position or playing track for playing is the same as the second manner in the first case, and details are not described herein.
In a third mode, the playing control information is seventh playing control information, and the seventh playing control information is used for indicating that the playing of the preset duration is interrupted and then the playing is resumed when the current playing duration reaches the preset playing duration; correspondingly, the steps can be as follows: and when the current playing time reaches the preset playing time, the terminal interrupts the playing of the dynamic picture for the preset time and then resumes the playing according to the seventh playing control information.
It should be noted that, when the current playing duration reaches the preset playing duration, the implementation manner in which the terminal interrupts playing the preset duration and then resumes playing is the same as the third manner in the first case, and details are not described herein.
In a fourth mode, the playing control information is eighth playing control information, and the eighth playing control information is used for indicating that the playing is stopped when the current playing time reaches the preset playing time; correspondingly, the steps can be as follows: and when the current playing time reaches the preset playing time, the terminal stops playing the dynamic picture according to the eighth playing control information.
It should be noted that, when the current playing duration reaches the preset playing duration, the implementation manner of the terminal stopping playing is the same as the fourth manner in the first case, and details are not described herein.
In a third case, the playing control information is used to indicate that the currently played image frame is a preset image frame, and is switched to a designated style for playing, and correspondingly, the step may be: and when the current playing time reaches the preset playing time, the terminal plays the dynamic picture according to the specified style.
In this step, the terminal obtains a preset image identifier corresponding to the preset image frame from the webpage source file, and judges whether the image identifier of the currently played image frame is the same as the preset image identifier; when the acquired image identifier is the same as the preset image identifier, the terminal determines that the currently played image frame is a preset image frame, and plays the dynamic picture according to a specified style; when the acquired image identifier is different from the preset image identifier, the terminal continues to execute step 204.
In the same way as in the first case, the preset image identifier may be carried in a callback function of the source file, and the terminal executes the switching process based on the control logic of the callback function; based on the multiple possibilities of the play control information, the process of switching the play of the terminal can be realized in any one of the following four ways.
In a first mode, the playing control information is ninth playing control information, and the ninth playing control information is used for indicating that the currently played image frame is a preset image frame and is switched to other pictures for playing; correspondingly, the steps can be as follows: and when the current playing image frame is a preset image frame, the terminal switches the dynamic picture to other pictures for playing according to the ninth playing control information.
It should be noted that, when the currently played image frame is a preset image frame, the implementation manner of the terminal switching the image for playing is the same as the first manner of the above two cases, and details are not described herein.
In a second manner, the playing control information is tenth playing control information, and the tenth playing control information is used for indicating that the currently played image frame is switched to other playing positions or playing tracks for playing when the currently played image frame is a preset image frame; correspondingly, the steps can be as follows: when the current playing image frame is a preset image frame, the terminal switches the dynamic picture to other playing positions or playing tracks for playing according to the tenth playing control information.
It should be noted that, when the currently played image frame is the preset image frame, the implementation manner of switching the terminal to another playing position or playing track for playing is the same as the second manner of the above two cases, and details are not described herein.
In a third mode, the playing control information is eleventh playing control information, and the eleventh playing control information is used for indicating that the playing of the current playing image frame is interrupted for a preset duration and then the playing is resumed when the current playing image frame is a preset image frame; correspondingly, the steps can be as follows: when the current playing image frame is a preset image frame, the terminal interrupts the playing of the dynamic picture for a preset time length according to the eleventh playing control information and resumes the playing.
It should be noted that, when the currently played image frame is the preset image frame, the implementation manner of the terminal interrupting playing for the preset duration and resuming playing is the same as the third manner of the above two cases, and details are not described herein.
In a fourth mode, the playing control information is twelfth playing control information, and the twelfth playing control information is used for indicating that the playing is stopped when the currently played image frame is a preset image frame; correspondingly, the steps can be as follows: and when the current playing image frame is a preset image frame, the terminal stops playing the dynamic picture according to the twelfth playing control information.
It should be noted that, when the currently played image frame is the preset image frame, the implementation manner of stopping the playing of the terminal is the same as the fourth manner of the above two cases, and details are not described herein.
In a possible design, during the playing process, the user may further store an image frame of interest in the dynamic image, and when the terminal receives a storage instruction for storing any image frame in the dynamic image, the terminal obtains any image frame from the web page client and stores any image frame into a designated storage space of the terminal.
When the terminal detects that a storage event exists in the terminal, the storage instruction is generated, and the storage event can be long-time pressing operation of a user on any image frame when the terminal plays the image frame; or, when the user clicks the storage button, the terminal may display the multi-frame image frames in the dynamic picture on the current screen, and the terminal takes a selection operation of the user selecting any image frame from the multi-frame image frames as a storage event. Of course, the storage event may also be triggered in other ways, which is not specifically limited in this embodiment of the present invention. The terminal can obtain the original image data of any image frame by calling the webpage client interface, and store the original image data of any image frame in the designated storage space of the terminal.
In one possible design, a play button and/or a pause button is displayed within a preset range of the dynamic picture, the pause button is used for pausing the playing of the dynamic picture when being triggered, and the play button is used for playing the dynamic picture when being triggered. When the terminal detects that the pause playing button is triggered, the terminal stops playing the dynamic picture by calling a pause playing interface of the webpage client; and when the terminal detects that the playing button is triggered, the terminal continues to play the dynamic picture by calling a playing interface of the webpage client.
It should be noted that the preset range may be set based on the user's needs, for example, the preset range may be a lower left corner, a center, and the like on the dynamic picture, or a position near a lower right corner of the dynamic picture other than the display position of the dynamic picture. Through the play button and the pause play button, the user can control the playing of the dynamic picture by himself, and the browsing experience of the user on the dynamic picture is greatly met.
It should be noted that, in the actual technical operation, the above steps are actually the process of executing the source file of the web page by the terminal, and of course, the interface call of the web page client is also executed based on the code of the source file of the web page. In order to more clearly illustrate the implementation process of this embodiment, the flow of the entire scheme is illustrated by taking the flowchart shown in fig. 3 as an example. Referring to fig. 3, when a user clicks a certain webpage, the terminal loads the webpage based on the website of the webpage, parses a source file of the webpage, generates a DOM tree, parses a picture node where a dynamic picture in the webpage is located according to the DOM tree, downloads the dynamic picture based on a download address in the picture node, and obtains first control instruction information of the picture from the picture node. When the first control indication information of the dynamic picture indicates that the dynamic picture is automatically played in a circulating way, the terminal automatically plays the dynamic picture in a circulating way until the webpage browsing is finished, and the playing is stopped; when the first control indication information of the dynamic picture indicates that the dynamic picture is not automatically and circularly played, the terminal starts to play the dynamic picture when receiving a play starting instruction, and in the playing process, the webpage client controls the terminal to execute a callback function of the webpage source file through a single play ending message, the terminal acquires the specified playing state of the dynamic picture by calling a webpage client interface based on the control logic of the callback function, and similarly, based on the control logic, when the specified playing state meets the playing condition, the terminal plays the dynamic picture according to the specified style based on the information such as a code calling the webpage client or a pause playing interface in the webpage, a defined playing position or a defined playing track and the like.
For example, taking the case that the playing condition is switched to the state that the current playing time reaches the preset playing time and is switched to other pictures for playing as an example: and when the current playing times reach the preset playing times, the terminal loads the other pictures from the server and plays the other pictures. Further, when the other pictures are dynamic pictures, the terminal can also set the appointed playing times of the other pictures, and when the current playing times of the other pictures reach the preset playing times, the playing is stopped; or, taking the example that other pictures are inserted for playing after the single playing is finished, the terminal may also insert other pictures for playing when the single playing of the dynamic picture is finished, for example, advertisement pictures, etc.; and when the other pictures are played once, the terminal continues to play the dynamic picture until the current playing times reach the preset playing times, and the playing is stopped.
In the embodiment of the invention, the terminal can control the playing style of the dynamic picture based on the playing control information predefined in the webpage in the playing process of the dynamic picture without automatic circular playing all the time, thereby enriching the playing style of the dynamic picture and improving the dynamic display effect of the dynamic picture in the webpage. And when the appointed playing style of the dynamic picture reaches the playing condition, the appointed style is switched and played, and the playing condition can be set based on requirements, so that the control intelligence is improved.
Fig. 4 is a schematic structural diagram of an apparatus for playing a moving picture according to an embodiment of the present invention. Referring to fig. 4, the apparatus includes: a playing module 401 and a first obtaining module 402.
The playing module 401 is configured to play a dynamic picture in a webpage when a webpage display instruction is received;
a first obtaining module 402, configured to obtain, during a playing process, a specified playing state of the dynamic picture according to playing control information of the dynamic picture, where the playing control information is used to instruct to switch to a specified style for playing when the specified playing state meets a playing condition;
the playing module 401 is further configured to play the dynamic picture according to a specified style when the specified playing status reaches the playing condition.
Optionally, the apparatus further comprises:
and the second acquisition module is used for acquiring the playing control information of the dynamic picture from the webpage when the playing control function of the webpage is started, and the playing control function is used for controlling the dynamic picture in the webpage to switch playing styles.
Optionally, the second obtaining module is further configured to obtain the playing control information of the dynamic picture from the web page when the playing control function is turned on and the first control indication information of the dynamic picture indicates that the dynamic picture is not automatically played in a loop, where the first control indication information is used to indicate whether the dynamic picture is automatically played in a loop.
Optionally, the apparatus further comprises:
and the determining module is used for acquiring second control indication information of the webpage, determining that the playing control function is started when the second control indication information indicates that the dynamic pictures in the webpage are not automatically played in a circulating manner, and the second control indication information is used for indicating whether the dynamic pictures in the webpage are automatically played in a circulating manner.
Optionally, the playing condition is that the current playing time reaches a preset playing time, or the current playing image frame is a preset image frame, where the first obtaining module 402 includes:
a first obtaining unit, configured to obtain a current playing time of the dynamic picture when the playing condition is that the current playing time reaches a preset playing time;
a second obtaining unit, configured to obtain a current playing time length of the dynamic picture when the playing condition is that the current playing time length reaches a preset playing time length;
and the third acquisition unit is used for acquiring the current playing image frame of the dynamic picture when the playing condition is that the current playing image frame is a preset image frame.
Optionally, the first obtaining unit is further configured to obtain a current playing frequency of the dynamic picture when a single play end message of the web client is received.
Optionally, the second obtaining unit is further configured to obtain a current playing time length of the dynamic picture from the web client; or, obtaining the current playing time of the dynamic picture, the single playing time length, the total frame number of the image frames in the dynamic picture and the current playing image frame from the webpage client, and determining the current playing time length according to the current playing time length, the single playing time length, the total frame number and the current playing image frame.
Optionally, the playing control information is first playing control information, and the first playing control information is used to instruct to switch to another picture for playing when the current playing time reaches a preset playing time; alternatively, the first and second electrodes may be,
the playing control information is second playing control information which is used for indicating that the current playing times reach the preset playing times and then switching to other playing positions or playing tracks for playing; alternatively, the first and second electrodes may be,
the playing control information is third playing control information, and the third playing control information is used for indicating that the playing is interrupted for a preset duration and then the playing is resumed when the current playing times reach the preset playing times; alternatively, the first and second electrodes may be,
the playing control information is fourth playing control information, and the fourth playing control information is used for indicating that the playing is stopped when the current playing times reach the preset playing times.
Optionally, the playing control information is fifth playing control information, where the fifth playing control information is used to instruct to switch to another picture for playing when the current playing time reaches a preset playing time; alternatively, the first and second electrodes may be,
the playing control information is sixth playing control information, and the sixth playing control information is used for indicating that the current playing time length reaches the preset playing time length and then switching to other playing positions or playing tracks for playing; alternatively, the first and second electrodes may be,
the playing control information is seventh playing control information, and the seventh playing control information is used for indicating that the playing of the preset duration is interrupted and then the playing is resumed when the current playing duration reaches the preset playing duration; alternatively, the first and second electrodes may be,
the playing control information is eighth playing control information, and the eighth playing control information is used for indicating that the playing is stopped when the current playing time length reaches the preset playing time length.
Optionally, the playing control information is ninth playing control information, where the ninth playing control information is used to instruct to switch to another picture for playing when the currently played image frame is a preset image frame; alternatively, the first and second electrodes may be,
the playing control information is tenth playing control information, and the tenth playing control information is used for indicating that the current playing image frame is switched to other playing positions or playing tracks for playing when the current playing image frame is a preset image frame; alternatively, the first and second electrodes may be,
the playing control information is eleventh playing control information, and the eleventh playing control information is used for indicating that the playing of the current playing image frame is interrupted for a preset duration and then the playing is resumed when the current playing image frame is a preset image frame; alternatively, the first and second electrodes may be,
the playing control information is twelfth playing control information, and the twelfth playing control information is used for indicating that the playing is stopped when the currently played image frame is a preset image frame.
Optionally, the apparatus further comprises:
and the second acquisition module is used for acquiring any image frame from the webpage client and storing the image frame into a designated storage space of the terminal when receiving a storage instruction for storing the image frame in the dynamic picture.
Optionally, a play button and/or a pause play button are displayed within the preset range of the dynamic picture, the pause play button is used for pausing the playing of the dynamic picture when triggered, and the play button is used for playing the dynamic picture when triggered.
According to the device provided by the embodiment of the invention, the terminal can control the playing style of the dynamic picture based on the playing control information predefined in the webpage in the playing process of the dynamic picture without automatic circular playing all the time, so that the playing style of the dynamic picture is enriched, and the dynamic display effect of the dynamic picture in the webpage is improved. And when the appointed playing style of the dynamic picture reaches the playing condition, the appointed style is switched and played, and the playing condition can be set based on requirements, so that the control intelligence is improved.
All the above optional technical solutions may be combined arbitrarily to form the optional embodiments of the present disclosure, and are not described herein again.
It should be noted that: in the device for playing a moving picture according to the above embodiment, when playing a moving picture, only the division of the above functional modules is taken as an example, and in practical applications, the above function distribution may be completed by different functional modules according to needs, that is, the internal structure of the terminal is divided into different functional modules to complete all or part of the above described functions. In addition, the apparatus for playing a dynamic picture and the method for playing a dynamic picture provided in the above embodiments belong to the same concept, and specific implementation processes thereof are detailed in the method embodiments and are not described herein again.
Fig. 5 is a block diagram illustrating a terminal according to an exemplary embodiment of the present invention. The terminal 500 may be a portable mobile terminal such as: smart phones, tablet computers, MP3 players (Moving Picture Experts group Audio Layer III, motion video Experts compression standard Audio Layer 3), MP4 players (Moving Picture Experts compression standard Audio Layer IV, motion video Experts compression standard Audio Layer 4), notebook computers, or desktop computers. Terminal 500 may also be referred to by other names such as user equipment, portable terminal, laptop terminal, desktop terminal, and the like.
In general, the terminal 500 includes: a processor 501 and a memory 502.
The processor 501 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and so on. The processor 501 may be implemented in at least one hardware form of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), and a PLA (Programmable Logic Array). The processor 501 may also include a main processor and a coprocessor, where the main processor is a processor for processing data in an awake state, and is also called a Central Processing Unit (CPU); a coprocessor is a low power processor for processing data in a standby state. In some embodiments, the processor 501 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content required to be displayed on the display screen. In some embodiments, processor 501 may also include an AI (Artificial Intelligence) processor for processing computational operations related to machine learning.
Memory 502 may include one or more computer-readable storage media, which may be non-transitory. Memory 502 may also include high-speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In some embodiments, a non-transitory computer readable storage medium in memory 502 is used to store at least one instruction for execution by processor 501 to implement the method of playing a moving picture provided by the method embodiments herein.
In some embodiments, the terminal 500 may further optionally include: a peripheral interface 503 and at least one peripheral. The processor 501, memory 502 and peripheral interface 503 may be connected by a bus or signal lines. Each peripheral may be connected to the peripheral interface 503 by a bus, signal line, or circuit board. Specifically, the peripheral device includes: at least one of radio frequency circuitry 504, touch screen display 505, camera 506, audio circuitry 507, positioning components 508, and power supply 509.
The peripheral interface 503 may be used to connect at least one peripheral related to I/O (Input/Output) to the processor 501 and the memory 502. In some embodiments, the processor 501, memory 502, and peripheral interface 503 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 501, the memory 502, and the peripheral interface 503 may be implemented on a separate chip or circuit board, which is not limited in this embodiment.
The Radio Frequency circuit 504 is used for receiving and transmitting RF (Radio Frequency) signals, also called electromagnetic signals. The radio frequency circuitry 504 communicates with communication networks and other communication devices via electromagnetic signals. The rf circuit 504 converts an electrical signal into an electromagnetic signal to transmit, or converts a received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 504 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a subscriber identity module card, and so forth. The radio frequency circuitry 504 may communicate with other terminals via at least one wireless communication protocol. The wireless communication protocols include, but are not limited to: the world wide web, metropolitan area networks, intranets, generations of mobile communication networks (2G, 3G, 4G, and 5G), Wireless local area networks, and/or WiFi (Wireless Fidelity) networks. In some embodiments, the rf circuit 504 may further include NFC (Near Field Communication) related circuits, which are not limited in this application.
The display screen 505 is used to display a UI (User Interface). The UI may include graphics, text, icons, video, and any combination thereof. When the display screen 505 is a touch display screen, the display screen 505 also has the ability to capture touch signals on or over the surface of the display screen 505. The touch signal may be input to the processor 501 as a control signal for processing. At this point, the display screen 505 may also be used to provide virtual buttons and/or a virtual keyboard, also referred to as soft buttons and/or a soft keyboard. In some embodiments, the display screen 505 may be one, providing the front panel of the terminal 500; in other embodiments, the display screens 505 may be at least two, respectively disposed on different surfaces of the terminal 500 or in a folded design; in still other embodiments, the display 505 may be a flexible display disposed on a curved surface or on a folded surface of the terminal 500. Even more, the display screen 505 can be arranged in a non-rectangular irregular figure, i.e. a shaped screen. The Display screen 505 may be made of LCD (liquid crystal Display), OLED (Organic Light-Emitting Diode), and the like.
The camera assembly 506 is used to capture images or video. Optionally, camera assembly 506 includes a front camera and a rear camera. Generally, a front camera is disposed at a front panel of the terminal, and a rear camera is disposed at a rear surface of the terminal. In some embodiments, the number of the rear cameras is at least two, and each rear camera is any one of a main camera, a depth-of-field camera, a wide-angle camera and a telephoto camera, so that the main camera and the depth-of-field camera are fused to realize a background blurring function, and the main camera and the wide-angle camera are fused to realize panoramic shooting and VR (Virtual Reality) shooting functions or other fusion shooting functions. In some embodiments, camera assembly 506 may also include a flash. The flash lamp can be a monochrome temperature flash lamp or a bicolor temperature flash lamp. The double-color-temperature flash lamp is a combination of a warm-light flash lamp and a cold-light flash lamp, and can be used for light compensation at different color temperatures.
Audio circuitry 507 may include a microphone and a speaker. The microphone is used for collecting sound waves of a user and the environment, converting the sound waves into electric signals, and inputting the electric signals to the processor 501 for processing, or inputting the electric signals to the radio frequency circuit 504 to realize voice communication. For the purpose of stereo sound collection or noise reduction, a plurality of microphones may be provided at different portions of the terminal 500. The microphone may also be an array microphone or an omni-directional pick-up microphone. The speaker is used to convert electrical signals from the processor 501 or the radio frequency circuit 504 into sound waves. The loudspeaker can be a traditional film loudspeaker or a piezoelectric ceramic loudspeaker. When the speaker is a piezoelectric ceramic speaker, the speaker can be used for purposes such as converting an electric signal into a sound wave audible to a human being, or converting an electric signal into a sound wave inaudible to a human being to measure a distance. In some embodiments, audio circuitry 507 may also include a headphone jack.
The positioning component 508 is used to locate the current geographic position of the terminal 500 for navigation or LBS (location based Service). The positioning component 508 may be a positioning component based on the GPS (global positioning System) in the united states, the beidou System in china, or the galileo System in russia.
Power supply 509 is used to power the various components in terminal 500. The power source 509 may be alternating current, direct current, disposable or rechargeable. When power supply 509 includes a rechargeable battery, the rechargeable battery may be a wired rechargeable battery or a wireless rechargeable battery. The wired rechargeable battery is a battery charged through a wired line, and the wireless rechargeable battery is a battery charged through a wireless coil. The rechargeable battery may also be used to support fast charge technology.
In some embodiments, terminal 500 also includes one or more sensors 510. The one or more sensors 510 include, but are not limited to: acceleration sensor 511, gyro sensor 512, pressure sensor 513, fingerprint sensor 514, optical sensor 515, and proximity sensor 516.
The acceleration sensor 511 may detect the magnitude of acceleration on three coordinate axes of the coordinate system established with the terminal 500. For example, the acceleration sensor 511 may be used to detect components of the gravitational acceleration in three coordinate axes. The processor 501 may control the touch screen 505 to display the user interface in a landscape view or a portrait view according to the gravitational acceleration signal collected by the acceleration sensor 511. The acceleration sensor 511 may also be used for acquisition of motion data of a game or a user.
The gyro sensor 512 may detect a body direction and a rotation angle of the terminal 500, and the gyro sensor 512 may cooperate with the acceleration sensor 511 to acquire a 3D motion of the user on the terminal 500. The processor 501 may implement the following functions according to the data collected by the gyro sensor 512: motion sensing (such as changing the UI according to a user's tilting operation), image stabilization at the time of photographing, game control, and inertial navigation.
The pressure sensor 513 may be disposed on a side bezel of the terminal 500 and/or an underlying layer of the touch display screen 505. When the pressure sensor 513 is disposed on the side frame of the terminal 500, a user's holding signal of the terminal 500 may be detected, and the processor 501 performs left-right hand recognition or shortcut operation according to the holding signal collected by the pressure sensor 513. When the pressure sensor 513 is disposed at the lower layer of the touch display screen 505, the processor 501 controls the operability control on the UI interface according to the pressure operation of the user on the touch display screen 505. The operability control comprises at least one of a button control, a scroll bar control, an icon control and a menu control.
The fingerprint sensor 514 is used for collecting a fingerprint of the user, and the processor 501 identifies the identity of the user according to the fingerprint collected by the fingerprint sensor 514, or the fingerprint sensor 514 identifies the identity of the user according to the collected fingerprint. Upon recognizing that the user's identity is a trusted identity, the processor 501 authorizes the user to perform relevant sensitive operations including unlocking the screen, viewing encrypted information, downloading software, paying, and changing settings, etc. The fingerprint sensor 514 may be provided on the front, back, or side of the terminal 500. When a physical button or a vendor Logo is provided on the terminal 500, the fingerprint sensor 514 may be integrated with the physical button or the vendor Logo.
The optical sensor 515 is used to collect the ambient light intensity. In one embodiment, the processor 501 may control the display brightness of the touch display screen 505 based on the ambient light intensity collected by the optical sensor 515. Specifically, when the ambient light intensity is high, the display brightness of the touch display screen 505 is increased; when the ambient light intensity is low, the display brightness of the touch display screen 505 is turned down. In another embodiment, processor 501 may also dynamically adjust the shooting parameters of camera head assembly 506 based on the ambient light intensity collected by optical sensor 515.
A proximity sensor 516, also referred to as a distance sensor, is typically disposed on the front panel of the terminal 500. The proximity sensor 516 is used to collect the distance between the user and the front surface of the terminal 500. In one embodiment, when the proximity sensor 516 detects that the distance between the user and the front surface of the terminal 500 gradually decreases, the processor 501 controls the touch display screen 505 to switch from the bright screen state to the dark screen state; when the proximity sensor 516 detects that the distance between the user and the front surface of the terminal 500 becomes gradually larger, the processor 501 controls the touch display screen 505 to switch from the screen-rest state to the screen-on state.
Those skilled in the art will appreciate that the configuration shown in fig. 5 is not intended to be limiting of terminal 500 and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components may be used.
In an exemplary embodiment, a computer-readable storage medium, such as a memory including instructions executable by a processor in a terminal, is also provided to perform the method of playing a moving picture in the following embodiments. For example, the computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (15)

1. A method for playing a dynamic picture, the method being applied to a terminal installed with a web client for opening a web page, the method comprising:
when a webpage display instruction is received, playing a dynamic picture in a webpage, wherein the webpage display instruction is used for indicating the terminal to acquire a source file of the webpage from a server and acquiring a webpage script from the source file, the webpage script carries address information and position information of the dynamic picture, and the webpage script is used for indicating the terminal to download the dynamic picture from the server according to the address information and render the dynamic picture at a playing position corresponding to the position information;
in the playing process, acquiring the appointed playing state of the dynamic picture according to the playing control information of the dynamic picture, wherein the playing control information is used for indicating that the appointed playing state is switched to the appointed style for playing according to the switching sequence corresponding to the appointed style when the appointed playing state meets the playing condition, and the playing condition comprises the following steps: the currently played image frame is a preset image frame, and the specified pattern comprises: switching picture playing, switching playing positions or interrupting playing;
and when the appointed playing state reaches the playing condition, playing the dynamic pictures according to the appointed style and the switching sequence corresponding to the appointed style.
2. The method according to claim 1, wherein before acquiring the specified playing status of the moving picture according to the playing control information of the moving picture during the playing process, the method further comprises:
and when the playing control function of the webpage is started, the playing control information of the dynamic picture is acquired from the webpage, and the playing control function is used for controlling the dynamic picture in the webpage to switch playing styles.
3. The method of claim 2, further comprising:
and when the playing control function is started and the first control indication information of the dynamic picture indicates that the dynamic picture is not automatically played in a circulating way, executing the step of acquiring the playing control information of the dynamic picture from the webpage, wherein the first control indication information is used for indicating whether the dynamic picture is automatically played in a circulating way or not.
4. The method of claim 2, further comprising:
and acquiring second control indication information of the webpage, and determining that the playing control function is started when the second control indication information indicates that the dynamic pictures in the webpage are not automatically played in a circulating manner, wherein the second control indication information is used for indicating whether the dynamic pictures in the webpage are automatically played in a circulating manner.
5. The method according to claim 1, wherein the playing conditions further include that the current playing time reaches a preset playing time, and the obtaining the specified playing status of the dynamic picture according to the playing control information of the dynamic picture comprises:
when the playing condition is that the current playing times reach the preset playing times, acquiring the current playing times of the dynamic picture;
when the playing condition is that the current playing time length reaches a preset playing time length, acquiring the current playing time length of the dynamic picture;
and when the playing condition is that the currently played image frame is a preset image frame, acquiring the currently played image frame of the dynamic picture.
6. The method according to claim 5, wherein when the playing condition is that the current playing time reaches a preset playing time, the obtaining the current playing time of the moving picture comprises:
and when a single play ending message of the webpage client is received, acquiring the current play times of the dynamic picture.
7. The method according to claim 5, wherein the obtaining the current playing time length of the moving picture when the playing condition is that the current playing time length reaches a preset playing time length comprises:
acquiring the current playing time length of the dynamic picture from a webpage client; alternatively, the first and second electrodes may be,
acquiring the current playing times, the single playing time length, the total frame number of the image frames in the dynamic picture and the current playing image frame from the webpage client, and determining the current playing time length according to the current playing times, the single playing time length, the total frame number and the current playing image frame.
8. The method of claim 1,
the playing control information is first playing control information, and the first playing control information is used for indicating that the current playing times reach the preset playing times and switching to other pictures for playing; alternatively, the first and second electrodes may be,
the playing control information is second playing control information, and the second playing control information is used for indicating that the current playing time reaches a preset playing time and then switching to other playing positions or playing tracks for playing; alternatively, the first and second electrodes may be,
the playing control information is third playing control information, and the third playing control information is used for indicating that the playing is interrupted for a preset duration and then the playing is resumed when the current playing times reach the preset playing times; alternatively, the first and second electrodes may be,
the playing control information is fourth playing control information, and the fourth playing control information is used for indicating that the playing is stopped when the current playing times reach the preset playing times.
9. The method of claim 1,
the playing control information is fifth playing control information, and the fifth playing control information is used for indicating that the current playing time length reaches the preset playing time length and switching to other pictures for playing; alternatively, the first and second electrodes may be,
the playing control information is sixth playing control information, and the sixth playing control information is used for indicating that the current playing time length reaches a preset playing time length and then switching to other playing positions or playing tracks for playing; alternatively, the first and second electrodes may be,
the playing control information is seventh playing control information, and the seventh playing control information is used for indicating that the playing of the preset duration is interrupted and then the playing is resumed when the current playing duration reaches the preset playing duration; alternatively, the first and second electrodes may be,
the playing control information is eighth playing control information, and the eighth playing control information is used for indicating that the playing is stopped when the current playing time length reaches the preset playing time length.
10. The method of claim 1,
the playing control information is ninth playing control information, and the ninth playing control information is used for indicating that the current playing image frame is a preset image frame and is switched to other pictures for playing; alternatively, the first and second electrodes may be,
the playing control information is tenth playing control information, and the tenth playing control information is used for indicating that the current playing image frame is switched to other playing positions or playing tracks for playing when the current playing image frame is a preset image frame; alternatively, the first and second electrodes may be,
the playing control information is eleventh playing control information, and the eleventh playing control information is used for indicating that playing is interrupted for a preset duration and then resumed when the currently played image frame is a preset image frame; alternatively, the first and second electrodes may be,
the playing control information is twelfth playing control information, and the twelfth playing control information is used for indicating that the playing is stopped when the currently played image frame is a preset image frame.
11. The method of claim 1, further comprising:
when a storage instruction for storing any image frame in the dynamic picture is received, acquiring the image frame from a webpage client, and storing the image frame into a designated storage space of a terminal.
12. The method according to claim 1, wherein a play button and/or a pause button is displayed within the preset range of the dynamic picture, the pause button is used for pausing the playing of the dynamic picture when being triggered, and the play button is used for playing the dynamic picture when being triggered.
13. An apparatus for playing a moving picture, the apparatus being applied to a terminal having a web client for opening a web page, the apparatus comprising:
the playing module is used for playing a dynamic picture in a webpage when a webpage display instruction is received, wherein the webpage display instruction is used for indicating the terminal to acquire a source file of the webpage from a server and acquiring a webpage script from the source file, the webpage script carries address information and position information of the dynamic picture, and the webpage script is used for indicating the terminal to download the dynamic picture from the server according to the address information and render the dynamic picture at a playing position corresponding to the position information;
a first obtaining module, configured to obtain, during a playing process, a specified playing state of the dynamic picture according to playing control information of the dynamic picture, where the playing control information is used to instruct, when the specified playing state meets a playing condition, to switch to a specified style for playing according to a switching sequence corresponding to the specified style, and the playing condition includes: the currently played image frame is a preset image frame, and the specified pattern comprises: switching picture playing, switching playing positions or interrupting playing;
and the playing module is further configured to play the dynamic picture according to the specified style and a switching sequence corresponding to the specified style when the specified playing state reaches the playing condition.
14. A terminal, comprising a processor and a memory, wherein the memory stores at least one instruction, and the instruction is loaded and executed by the processor to implement the operations performed by the method for playing a moving picture according to any one of claims 1 to 12.
15. A computer-readable storage medium, wherein at least one instruction is stored in the storage medium, and the instruction is loaded and executed by a processor to implement the operations performed by the method for playing a moving picture according to any one of claims 1 to 12.
CN201810146626.1A 2018-02-12 2018-02-12 Method, device and terminal for playing dynamic picture and computer readable storage medium Active CN108289237B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810146626.1A CN108289237B (en) 2018-02-12 2018-02-12 Method, device and terminal for playing dynamic picture and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810146626.1A CN108289237B (en) 2018-02-12 2018-02-12 Method, device and terminal for playing dynamic picture and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN108289237A CN108289237A (en) 2018-07-17
CN108289237B true CN108289237B (en) 2020-08-25

Family

ID=62832938

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810146626.1A Active CN108289237B (en) 2018-02-12 2018-02-12 Method, device and terminal for playing dynamic picture and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN108289237B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110968378A (en) * 2018-09-29 2020-04-07 北京字节跳动网络技术有限公司 GIF animation operation method, device, electronic equipment and storage medium
CN113225571B (en) * 2021-03-25 2022-10-04 海南车智易通信息技术有限公司 Processing system and method for live cover and computing equipment
CN115499672B (en) * 2021-06-17 2023-12-01 北京字跳网络技术有限公司 Image display method, device, equipment and storage medium
CN114756322B (en) * 2022-05-09 2024-02-20 北京航云物联信息技术有限公司 Picture processing method and device, computer equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8438376B1 (en) * 2001-10-19 2013-05-07 Super Talent Technology, Corp. Method and system for providing a modular server on USB flash storage
CN104394481A (en) * 2014-09-30 2015-03-04 腾讯科技(深圳)有限公司 Video playing method and device
CN106385635A (en) * 2016-09-18 2017-02-08 福建天泉教育科技有限公司 GIF animation real-time control method and player
CN106412631A (en) * 2016-10-17 2017-02-15 合信息技术(北京)有限公司 Video playing method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8438376B1 (en) * 2001-10-19 2013-05-07 Super Talent Technology, Corp. Method and system for providing a modular server on USB flash storage
CN104394481A (en) * 2014-09-30 2015-03-04 腾讯科技(深圳)有限公司 Video playing method and device
CN106385635A (en) * 2016-09-18 2017-02-08 福建天泉教育科技有限公司 GIF animation real-time control method and player
CN106412631A (en) * 2016-10-17 2017-02-15 合信息技术(北京)有限公司 Video playing method and device

Also Published As

Publication number Publication date
CN108289237A (en) 2018-07-17

Similar Documents

Publication Publication Date Title
CN110602321B (en) Application program switching method and device, electronic device and storage medium
CN110708596A (en) Method and device for generating video, electronic equipment and readable storage medium
CN109359262B (en) Animation playing method, device, terminal and storage medium
CN107908929B (en) Method and device for playing audio data
CN108449641B (en) Method, device, computer equipment and storage medium for playing media stream
CN108289237B (en) Method, device and terminal for playing dynamic picture and computer readable storage medium
CN110324689B (en) Audio and video synchronous playing method, device, terminal and storage medium
WO2019105393A1 (en) Web page content processing method, apparatus, browser, device and storage medium
CN109783183B (en) Request processing method and device, electronic equipment and storage medium
CN110300274B (en) Video file recording method, device and storage medium
WO2021073293A1 (en) Animation file generating method and device, and storage medium
CN111752666A (en) Window display method and device and terminal
CN113409427B (en) Animation playing method and device, electronic equipment and computer readable storage medium
CN109800003B (en) Application downloading method, device, terminal and storage medium
CN111083526B (en) Video transition method and device, computer equipment and storage medium
CN110738970B (en) Page refreshing method and device for ink screen
CN112257006A (en) Page information configuration method, device, equipment and computer readable storage medium
CN112256181A (en) Interaction processing method and device, computer equipment and storage medium
CN113918258A (en) Page rolling processing method, device, terminal and storage medium
CN113377270A (en) Information display method, device, equipment and storage medium
CN113282355A (en) Instruction execution method and device based on state machine, terminal and storage medium
CN110868642B (en) Video playing method, device and storage medium
CN112616082A (en) Video preview method, device, terminal and storage medium
CN112118353A (en) Information display method, device, terminal and computer readable storage medium
CN108228052B (en) Method and device for triggering operation of interface component, storage medium and terminal

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