CN111523065A - Rich text data processing method and device, electronic equipment and computer storage medium - Google Patents

Rich text data processing method and device, electronic equipment and computer storage medium Download PDF

Info

Publication number
CN111523065A
CN111523065A CN201910106451.6A CN201910106451A CN111523065A CN 111523065 A CN111523065 A CN 111523065A CN 201910106451 A CN201910106451 A CN 201910106451A CN 111523065 A CN111523065 A CN 111523065A
Authority
CN
China
Prior art keywords
video
text data
control
video object
rich text
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910106451.6A
Other languages
Chinese (zh)
Other versions
CN111523065B (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.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201910106451.6A priority Critical patent/CN111523065B/en
Publication of CN111523065A publication Critical patent/CN111523065A/en
Application granted granted Critical
Publication of CN111523065B publication Critical patent/CN111523065B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9577Optimising the visualization of content, e.g. distillation of HTML documents

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the invention provides a rich text data processing method, a rich text data processing device, electronic equipment and a computer storage medium, wherein the rich text data processing method comprises the following steps: label analysis is carried out on rich text data in the text display control; if the current label is determined to be the video object label according to the analysis result, generating a webpage display element corresponding to the video object label; acquiring a video address of a video object corresponding to the video object label, and setting the video address as a content address of the webpage display element; and associating a video playing control with the webpage display element so as to acquire the video object from the content address and play the video object through the video playing control when the webpage display element is triggered in a display interface. According to the embodiment of the invention, the webpage display of the video content in the rich text data through the text display control is realized.

Description

Rich text data processing method and device, electronic equipment and computer storage medium
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to a rich text data processing method and device, electronic equipment and a computer storage medium.
Background
As computer technology has developed, more and more applications are required to present a wide variety of contents through the form of web pages. To meet this demand, rich text data edited in a rich text format is widely used to implement simpler and faster web page information distribution.
Rich Text Format (RTF) is a cross-platform document Format in which the edited Rich Text data may include Text content, image content, or a mixture of both. When the webpage displays contents according to the rich text data, the rich text data is firstly transmitted into a text display control such as a TextView control; then, analyzing the object tags to obtain various object tags for webpage display, such as an image tag < img >, a font tag < font >, a link tag < a >, and the like; and then, the webpage content is displayed according to the labels.
In practical applications, however, many applications require the presentation of video content through web pages in addition to text content and image content. However, the current text display control cannot process the video content contained in the rich text data, so that the webpage cannot realize webpage display of the video content by analyzing the rich text data in the text display control.
Disclosure of Invention
In view of the above, embodiments of the present invention provide a data processing scheme to solve the above problems.
According to a first aspect of the embodiments of the present invention, there is provided a rich text data processing method, including: label analysis is carried out on rich text data in the text display control; if the current label is determined to be the video object label according to the analysis result, generating a webpage display element corresponding to the video object label; acquiring a video address of a video object corresponding to the video object label, and setting the video address as a content address of the webpage display element; and associating a video playing control with the webpage display element so as to acquire the video object from the content address and play the video object through the video playing control when the webpage display element is triggered in a display interface.
According to a second aspect of the embodiments of the present invention, there is provided a rich text data processing apparatus including: the analysis module is used for carrying out label analysis on the rich text data in the text display control; the generation module is used for generating a webpage display element corresponding to the video object label if the current label is determined to be the video object label according to the analysis result; the setting module is used for acquiring a video address of a video object corresponding to the video object label and setting the video address as a content address of the webpage display element; and the association module is used for associating a video playing control with the webpage display element so as to acquire the video object from the content address and play the video object through the video playing control when the webpage display element is triggered in a display interface.
According to a third aspect of embodiments of the present invention, there is provided an electronic apparatus, including: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication through the communication bus; the memory is used for storing at least one executable instruction, and the executable instruction causes the processor to execute the operation corresponding to the rich text data processing method according to the first aspect.
According to a fourth aspect of embodiments of the present invention, there is provided a computer storage medium having stored thereon a computer program which, when executed by a processor, implements the rich-text data processing method according to the first aspect.
According to the rich text data processing scheme provided by the embodiment of the invention, for the rich text data in the text display control, if the video object label indicating the video object is analyzed, the video address of the video object is used as the content address of the webpage display element by generating the webpage display element, and the webpage display element is associated with the video playing control, so that the video object is played when the webpage display element is triggered. The webpage display element can be an appropriate element which is parsed and displayed by the webpage. Therefore, the analysis and the processing of the video object label are converted into the analysis and the processing of the webpage display element, so that the rich text data in the text display control can be comprehensively analyzed without an external program or control, and the webpage display of the video content in the rich text data through the text display control is realized.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments described in the embodiments of the present invention, and it is also possible for a person skilled in the art to obtain other drawings based on the drawings.
FIG. 1 is a flowchart illustrating steps of a rich text data processing method according to a first embodiment of the present invention;
FIG. 2 is a flowchart illustrating steps of a rich text data processing method according to a second embodiment of the present invention;
FIG. 3 is a flowchart illustrating the steps of a rich text data processing method according to a third embodiment of the present invention;
FIG. 4 is a block diagram of a rich text data processing apparatus according to a fourth embodiment of the present invention;
FIG. 5 is a block diagram of a rich text data processing apparatus according to a fifth embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device according to a sixth embodiment of the present invention.
Detailed Description
In order to make those skilled in the art better understand the technical solutions in the embodiments of the present invention, the technical solutions in the embodiments of the present invention will be described clearly and completely with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all embodiments. All other embodiments obtained by a person skilled in the art based on the embodiments of the present invention shall fall within the scope of the protection of the embodiments of the present invention.
The following further describes specific implementation of the embodiments of the present invention with reference to the drawings.
Example one
Referring to fig. 1, a flowchart illustrating steps of a rich text data processing method according to a first embodiment of the present invention is shown.
The rich text data processing method of the embodiment comprises the following steps:
step S102: and performing label analysis on the rich text data in the text display control.
When the rich text data is displayed through the webpage, the rich text data needs to be firstly transmitted into a text display control of the webpage, the rich text data is analyzed, and the webpage display is performed according to the analysis result. The tag parsing of the rich text data is the most important process, and the webpage tags which can be identified and processed by the webpage are obtained through the tag parsing, so that the webpage can process and display the content in the tags in an appropriate manner.
In this embodiment, the rich text data further includes a video object tag besides a conventional tag, where the video object tag may be any suitable tag that can indicate that the content in the tag is content related to the video object, such as a < video > tag. At present, because the text display control can only process limited tags, the video object tags of rich text data cannot be analyzed and processed in the text display control, and in order to solve the problem, the rich text data processing scheme provided by the embodiment of the invention is used for processing the video object tags and the content thereof contained in the rich text data in the text display control.
Step S104: and if the current label is determined to be the video object label according to the analysis result, generating a webpage display element corresponding to the video object label.
The web page presentation element may be any appropriate element that can be parsed, processed, and displayed by a web page. In the embodiment of the invention, the parsable elements in the TextView are expanded so as to process the < video > tag and the content thereof, and the content in the < video > tag is parsed into the webpage display elements. And then, the display and the playing of the video object are realized by setting the webpage display elements.
For example, when the < video > tag is resolved, a span object element corresponding to the < video > tag is generated, and the corresponding object in the Android system is called through the span object to realize the processing of the content in the < video > tag.
Step S106: and acquiring a video address of the video object corresponding to the video object label, and setting the video address as a content address of the webpage display element.
The content marked by the video object tag usually includes information related to the video object, such as the name, cover page, address, etc. of the video object. In this embodiment, in order to implement playing of a video object through a web page display element, a video address of the video object needs to be assigned to the web page display element as a content address of the web page display element, so that when the web page display element is triggered, the video object is obtained from the content address.
Step S108: and associating the video playing control with the webpage display element so as to acquire the video object from the content address and play the video object through the video playing control when the webpage display element is triggered in the display interface.
The video playing control is used for realizing the playing control of the video object, the webpage display element is associated with the video playing control, and when the webpage display element is triggered by a user in a display interface and acquires the video object, the video playing control can be called to play and control the video object.
The trigger to the web page presentation element may be any suitable trigger operation, for example, a click operation, a hover operation, a long press operation, and the like, which is not limited in this embodiment of the present invention.
According to the embodiment, for rich text data in the text display control, if a video object label indicating a video object is analyzed, a webpage display element is generated, a video address of the video object is used as a content address of the webpage display element, and the webpage display element is associated with the video playing control, so that the video object is played when the webpage display element is triggered. The webpage display element can be an appropriate element which is parsed and displayed by the webpage. Therefore, the analysis and the processing of the video object label are converted into the analysis and the processing of the webpage display element, so that the rich text data in the text display control can be comprehensively analyzed without an external program or control, and the webpage display of the video content in the rich text data through the text display control is realized.
The rich text data processing method of the present embodiment may be performed by any suitable electronic device having data processing capabilities, including but not limited to: mobile terminals (such as mobile phones, PADs, etc.), servers, PCs, etc.
Example two
Referring to fig. 2, a flowchart illustrating steps of a rich text data processing method according to a second embodiment of the present invention is shown.
The rich text data processing method of the embodiment comprises the following steps:
step S202: and performing label analysis on the rich text data in the text display control.
In the embodiment of the invention, the rich text data also comprises a video object label besides a conventional label. Through label analysis of the rich text data, various labels in the rich text data can be obtained.
In a feasible mode, rich text data can be obtained through a text display control, and a container class object corresponding to the rich text data is generated; and traversing the labels of the container objects, and acquiring the labels in the rich text data according to the traversal result. In the method, rich text data is firstly transmitted into the text display control, then the container type object is generated, and label analysis of the rich text data is realized through label traversal of the container type object. Through the container class object, the integral processing of the rich text data can be realized, and the speed and the efficiency of analyzing and processing the rich text data are improved. And the data conversion is realized in the text display control by adopting the mode of firstly transmitting the rich text data and then generating the container type object, so that the text display control can conveniently acquire conversion information, and the subsequent processing is convenient. The container class object may be any appropriate object that can accommodate various rich text data, such as a span object in Android.
In another feasible mode, generating a corresponding container class object according to the rich text data, and assigning the container class object to the text display control; and traversing labels of the container class objects in the text display control, and acquiring the labels in the rich text data according to a traversal result. In the method, the container type object is generated according to the rich text data, then the text display control is input, and label analysis of the rich text data is realized through label traversal of the container type object. Through the container class object, the integral processing of the rich text data can be realized, and the speed and the efficiency of analyzing and processing the rich text data are improved. And by adopting the mode of generating the container class object before transmitting the container class object into the text display control, data conversion and generation are not needed in the text display control, so that the data processing burden related to the text display control is simplified. The container class object may be any suitable object capable of accommodating various rich text data, such as a span object.
Step S204: and if the current label is determined to be the video object label according to the analysis result, generating a webpage display element corresponding to the video object label.
And when the video object label is analyzed, processing the video object label, and firstly generating a corresponding webpage display element. The web page presentation element may be any appropriate element that can be parsed, processed, and displayed by a web page. Optionally, the webpage presentation element may be a span object element. Through the span object elements, the objects in the rich text data can be divided as required, and only the required parts are processed, so that the flexibility of processing is improved.
When generating a web page display element corresponding to a video object tag, one possible approach includes: acquiring a cover page address of the video object through reflection calling; and generating a webpage display element corresponding to the video object tag according to the cover image acquired from the cover address.
Reflection calls are a way that can be assembled at runtime without the need for source code linking between components to create more flexible code. Through the reflection calling, the program can obtain the information of the class to be operated at the running time, and can obtain the complete construction of the class at the running time and call the corresponding method and attribute. Therefore, in the running state of the program, all the attributes and methods of any class can be known; any method and attribute of any object can be called, so that dynamic acquisition of information and dynamic calling of the object are realized.
In this embodiment, a class capable of reading rich text data, such as an XmlReader class, may be reflectively called to obtain a cover page address, such as a post address, of a video object, without writing additional codes and programs, which saves the overall implementation cost of the rich text data processing scheme of this embodiment. After the cover image is obtained from the cover address, the cover image can be used as a display image of the webpage display element, and the webpage display element corresponding to the video object tag is generated.
Optionally, the generating, according to the cover image obtained from the cover address, a webpage display element corresponding to the video object tag may include: acquiring image information and size information of a cover image from the cover address; and generating a webpage display element corresponding to the video object label according to the image information and the size information of the cover image. In this way, the display image of the webpage display element can be kept consistent with the cover image of the video object to the maximum extent, and the display effect of the webpage display element is kept consistent with that of the video object.
But not limited to the above manner, the image information and/or the size information of the display image of the web page display element may be different from the video object, and may reflect the corresponding information of the video object.
Step S206: and acquiring a video address of the video object corresponding to the video object label, and setting the video address as a content address of the webpage display element.
For example, the video object tag may indicate the URL of the video object through the src attribute of the < source > tag, based on which, the attribute value of the src attribute may be obtained, and then, the attribute value is assigned to the web page presentation element as the content address of the web page presentation element, so that the video object may be obtained from the content address when the web page presentation element is triggered.
Step S208: and setting a video playing button in a display area of the webpage display element.
The video playing button is used for calling the video playing control when receiving the triggering operation of the user.
In order to further improve the display effect and facilitate the operation of a user, in this step, a video playing button is further set for the webpage display element, and when the button is triggered, if the button is clicked, the video playing control associated with the webpage display element can be called to play the acquired video object.
However, in practical applications, a video playing button may not be set, and when a user performs a trigger operation on a web page display element, for example, clicks the web page display element or hovers over the web page display element for a certain time, the video playing control is invoked.
Therefore, this step is an optional step, and in practical applications, after step S206 is executed, step S210 may be executed by directly skipping this step.
Step S210: and associating the webpage display element with a video playing control so as to acquire the video object from the content address and play the video object through the video playing control when the webpage display element is triggered in the display interface.
In one possible approach, the presentation of the element-associated video playback control for the web page may be implemented as: setting a video playing control in a top view of a display interface for displaying the webpage display elements; and associating the video playing control with the webpage display element. The video playing control is arranged in the top view of the current display interface of the webpage display element, so that the arrangement and the realization of the video playing control are simplified, and the normal playing of the video object corresponding to the webpage display element can be effectively ensured. But not limited thereto, other ways of setting the video playing control are also applicable, and the video playing control can be associated with the webpage display element.
Through the processing process, the processing of rich text data and the webpage display of each object in the rich text data can be realized in the text display control, and the processing and the webpage display of the video object in the rich text data are converted into the processing and the webpage display of the webpage display element. And when the displayed webpage display element is triggered, starting to control and play the corresponding video object.
Optionally, to further enhance the usage experience, the following step S212 may also be performed.
Step S212: and processing the video playing control and/or the video object according to the detected operation.
This step may include:
processing one: if detecting that the father control of the text display control moves, acquiring a moving distance; and moving the video playing control according to the moving distance.
For example, if the user performs a scrolling operation on the current display interface, the parent control of the text display control moves accordingly, and accordingly, the video playing control also needs to be adaptively moved so as to match with the display of the web page display element.
And (5) processing: and if the video playing control is detected to move out of the current display area, stopping playing the video object.
For example, if the user performs a scrolling operation on the current display interface, so that the video playing control moves out of the current display area, that is, the video object can not be displayed any more, at this time, the playing of the video object is stopped.
Through the process, the flexible display and processing of the video playing control and/or the video object are realized.
According to the embodiment, for rich text data in the text display control, if a video object label indicating a video object is analyzed, a webpage display element is generated, a video address of the video object is used as a content address of the webpage display element, and the webpage display element is associated with the video playing control, so that the video object is played when the webpage display element is triggered. The webpage display element can be an appropriate element which is parsed and displayed by the webpage. Therefore, the analysis and the processing of the video object label are converted into the analysis and the processing of the webpage display element, so that the rich text data in the text display control can be comprehensively analyzed without an external program or control, and the webpage display of the video content in the rich text data through the text display control is realized.
The rich text data processing method of the present embodiment may be performed by any suitable electronic device having data processing capabilities, including but not limited to: mobile terminals (such as mobile phones, PADs, etc.), servers, PCs, etc.
EXAMPLE III
Referring to fig. 3, a flowchart illustrating steps of a rich text data processing method according to a third embodiment of the present invention is shown.
The embodiment describes a rich text data processing method provided by the embodiment of the invention in a specific example. The scheme of the embodiment is based on an Android system, and the text display control adopts a TextView control.
Based on this, the rich text data processing method of the present embodiment includes the steps of:
step S302: and transmitting rich text data to be analyzed to the TextView control, and then starting a preset label processor.
For example, rich text data to be parsed can be obtained through html.
In specific implementation, rich text data can be transmitted to the textView control through setText, and then a new Spanned object is generated through modification; or acquiring rich text data, modifying to generate a new Spanned object, and assigning to the TextView control through setText.
The span object is a container type object in the Android system, and can contain different data objects according to needs, such as: video span subjects, URLSpan subjects, ImageSpan subjects, and the like. In the embodiment of the invention, the video span object can be set based on an Android system, so that the video span object can at least obtain the content in the < video > tag in the rich text data and convert the content into the content which can be analyzed and displayed by a webpage. The specific setting mode of the VideoSpan object can be realized by any appropriate mode according to actual requirements by technical personnel in the field, and the specific setting mode only needs to realize the functions.
In this embodiment, the richhtmtltagthandler is customized, and the Spanned object can be acquired through the richhttmltagthandler. In addition, in this embodiment, RichHtmlTagHandler may be used to parse tags that are not supported by the native TextView control, including but not limited to: < ul > tag, < ol > tag, < video > tag, < source > tag, sub-tag < source > tag of < video > tag, and obtain < video > tag poster cover attribute value, < source > tag src attribute, etc.
Step S304: and if the label processor analyzes the < video > label, generating a corresponding webpage display element VideoDispan object.
For example, when RichHtmlTagHandler resolves to a < video > tag, a post cover address is acquired by reflection, and then a custom clickable VideoSpan object (a span object supported by the Android system) based on DynamicDrawableSpan is generated and saved in RichHtmlTagHandler; then, wait a few milliseconds before executing the startActivity call Activity. Wherein, by the dynamicDrawableSpan, a potter can be set to the VideoSpan object.
When the poster cover surface is obtained through reflection, the field value of the New element of the XMLReader object can be obtained through reflection, the field value of the atts is obtained according to the reflection of the New element object, wherein all the attribute values of the current label are contained, and then the poster value, namely the poster cover surface address, is obtained according to the getValue method of the Attributes.
Alternatively, the RichHtmlTagHandler may traverse the Spanned object, download the cover image according to its cover address post when encountering the VideoSpan, and calculate the presentation size of the VideoSpan object in the getSize method of the VideoSpan object according to the cover image size, so as to present the cover image through the VideoSpan object in the same size.
Through the steps, the < video > tag in the rich text data can be processed through RichTMlTagHandler, and the video cover corresponding to the < video > tag is obtained, so that the placeholder image of the video span object is generated.
Step S306: and acquiring the video object address and setting the video object address to the video on span object.
For example, if the video object is not empty, the < source > tag of the video object may be resolved, and then the reflection acquires an attribute value (i.e., a video address) of the src attribute of the < source > tag, and sets the attribute value of the src attribute to the video object, and then the video object stored in the richhtmtltagthandler may be empty.
Wherein, the VideoSpan object is initialized when the handleTag method of the RichTmlTagHandler processes to the < video > tag. The handleTag method is used for traversing the whole rich text data, and when the < source > tag is analyzed, the attribute value of the src attribute is obtained, so that the analysis of the current VideoSpan object is completed. Furthermore, the location of the current VideoSpan object can be set through editable. The null fault tolerance processing can be realized by nulling the VideoBan object stored in the RichTmlTagHandler, and the < source > tag is not processed when the < source > tag exists but does not exist in the VideoBan.
Step S308: and adding a video playing button for the VideoSpan object.
For example, when the draw method of the video span object is executed, a video play button is added in the middle of the display area of the video span object, and the display position of the video span object (i.e. the position of the cover image displayed by the video span object in the TextView control) is recorded as the Rect object of Location.
Step S310: and associating a video playing control VideoPlayView for the VideoDispan object.
For example, a customized video playing control, videoplay view, may be added to the top view of the current interface through activity.
It should be noted that, the video playing control videoplay view may also be set in other manners, for example, a new area is created on the top layer of the layout of each display interface, so as to set the video playing control videoplay view for playing the video.
Step S312: and carrying out corresponding processing according to the control state.
For example, when an external parent control of a TextView control (e.g., a ListView control or other scrollable View control) scrolls, a scroll distance is obtained and setTranslationY is called to set the offset distance of the VideoPlayView.
For another example, when the VideoPlayView moves out of the screen, the playback is paused and hidden.
According to the embodiment, the Android TextView control supports video display, and switching of rich text data between the WebView control and the TextView control is facilitated.
The rich text data processing method of the present embodiment may be performed by any suitable electronic device having data processing capabilities, including but not limited to: mobile terminals (such as mobile phones, PADs, etc.), servers, PCs, etc.
Example four
Referring to fig. 4, a block diagram of a rich text data processing apparatus according to a fourth embodiment of the present invention is shown.
The rich text data processing apparatus of the present embodiment includes: the parsing module 402 is configured to perform label parsing on rich text data in the text display control; a generating module 404, configured to generate a webpage display element corresponding to the video object tag if it is determined that the current tag is the video object tag according to the parsing result; a setting module 406, configured to obtain a video address of a video object corresponding to the video object tag, and set the video address as a content address of the webpage display element; the association module 408 is configured to associate a video playing control with the webpage display element, so that when the webpage display element is triggered in a display interface, the video object is obtained from the content address and is played through the video playing control.
The rich text data processing apparatus of this embodiment is configured to implement a corresponding rich text data processing method in the foregoing method embodiments, and has the beneficial effects of the corresponding method embodiments, which are not described herein again. In addition, the functional implementation of each module in the rich text data processing apparatus of this embodiment can refer to the description of the corresponding part in the foregoing method embodiment, and is not repeated here.
EXAMPLE five
Referring to fig. 5, a block diagram of a rich text data processing apparatus according to a fifth embodiment of the present invention is shown.
The rich text data processing apparatus of the present embodiment includes: the parsing module 502 is configured to perform label parsing on rich text data in the text display control; a generating module 504, configured to generate a webpage display element corresponding to the video object tag if it is determined that the current tag is the video object tag according to the parsing result; a setting module 506, configured to obtain a video address of a video object corresponding to the video object tag, and set the video address as a content address of the webpage display element; the association module 508 is configured to associate a video playing control with the webpage display element, so that when the webpage display element is triggered in a display interface, the video object is obtained from the content address and is played through the video playing control.
Optionally, the generating module 504 includes: a determining module 5042, configured to determine, according to the parsing result, that the current tag is a video object tag; the calling module is used for acquiring the cover page address of the video object through reflection calling; a cover module 5044, configured to generate a webpage display element corresponding to the video object tag according to a cover image obtained from the cover address.
Optionally, the cover module 5044 is configured to obtain image information and size information of a cover image from the cover address; and generating a webpage display element corresponding to the video object label according to the image information and the size information of the cover image.
Optionally, the rich text data processing apparatus of this embodiment further includes: a button module 510, configured to set a video playing button in a display area of the webpage display element before the association module 508 associates the video playing control with the webpage display element, where the video playing button is used to invoke the video playing control when receiving a trigger operation of a user.
Optionally, the association module 508 is configured to set a video playing control in a top-level view of a display interface displaying the webpage display element; and associating the video playing control with the webpage display element so as to acquire the video object from the content address and play the video object through the video playing control when the webpage display element is triggered in a display interface.
Optionally, the webpage display element is a span object element.
Optionally, the parsing module 502 is configured to obtain rich text data through the text display control, and generate a container class object corresponding to the rich text data; performing label traversal on the container class object, and acquiring a label in the rich text data according to a traversal result; or generating a corresponding container class object according to the rich text data, and assigning the container class object to the text display control; and traversing labels of the container class objects in the text display control, and acquiring the labels in the rich text data according to a traversal result.
Optionally, the rich text data processing apparatus of this embodiment further includes: a first operation module 512, configured to obtain a moving distance if it is detected that a parent control of the text display control moves; and moving the video playing control according to the moving distance.
Optionally, the rich text data processing apparatus of this embodiment further includes: a second operation module 514, configured to stop playing the video object if it is detected that the video playing control moves out of the current display area.
The rich text data processing apparatus of this embodiment is configured to implement a corresponding rich text data processing method in the foregoing method embodiments, and has the beneficial effects of the corresponding method embodiments, which are not described herein again. In addition, the functional implementation of each module in the rich text data processing apparatus of this embodiment can refer to the description of the corresponding part in the foregoing method embodiment, and is not repeated here.
EXAMPLE six
Referring to fig. 6, a schematic structural diagram of an electronic device according to a sixth embodiment of the present invention is shown, and the specific embodiment of the present invention does not limit the specific implementation of the electronic device.
As shown in fig. 6, the electronic device may include: a processor (processor)602, a communication Interface 604, a memory 606, and a communication bus 608.
Wherein:
the processor 602, communication interface 604, and memory 606 communicate with one another via a communication bus 608.
A communication interface 604 for communicating with other electronic devices or servers.
The processor 602 is configured to execute the program 610, and may specifically perform relevant steps in the foregoing rich text data processing method embodiment.
In particular, program 610 may include program code comprising computer operating instructions.
The processor 602 may be a central processing unit CPU or an application specific Integrated circuit asic or one or more Integrated circuits configured to implement embodiments of the present invention. The intelligent device comprises one or more processors which can be the same type of processor, such as one or more CPUs; or may be different types of processors such as one or more CPUs and one or more ASICs.
And a memory 606 for storing a program 610. Memory 606 may comprise high-speed RAM memory, and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
The program 610 may specifically be configured to cause the processor 602 to perform the following operations: label analysis is carried out on rich text data in the text display control; if the current label is determined to be the video object label according to the analysis result, generating a webpage display element corresponding to the video object label; acquiring a video address of a video object corresponding to the video object label, and setting the video address as a content address of the webpage display element; and associating a video playing control with the webpage display element so as to acquire the video object from the content address and play the video object through the video playing control when the webpage display element is triggered in a display interface.
In an alternative embodiment, the program 610 is further configured to enable the processor 602, when generating the webpage display element corresponding to the video object tag, to obtain a cover page address of the video object through a reflection call; and generating a webpage display element corresponding to the video object tag according to a cover image acquired from the cover address.
In an alternative embodiment, the program 610 is further configured to cause the processor 602 to obtain image information and size information of a cover image from the cover address when generating a webpage display element corresponding to the video object tag according to the cover image obtained from the cover address; and generating a webpage display element corresponding to the video object label according to the image information and the size information of the cover image.
In an optional implementation manner, the program 610 is further configured to enable the processor 602 to set a video playing button in a display area of the web page display element before associating a video playing control with the web page display element, where the video playing button is configured to invoke the video playing control when receiving a triggering operation of a user.
In an alternative embodiment, the program 610 is further configured to enable the processor 602, when the video playing control is associated with the webpage display element, to set a video playing control in a top view of a display interface displaying the webpage display element; and associating the video playing control with the webpage display element.
In an alternative embodiment, the web page presentation element is a span object element.
In an optional implementation manner, the program 610 is further configured to enable the processor 602, when performing label parsing on rich text data in a text display control, to obtain the rich text data through the text display control, and generate a container class object corresponding to the rich text data; performing label traversal on the container class object, and acquiring a label in the rich text data according to a traversal result; or generating a corresponding container class object according to the rich text data, and assigning the container class object to the text display control; and traversing labels of the container class objects in the text display control, and acquiring the labels in the rich text data according to a traversal result.
In an alternative embodiment, the program 610 is further configured to enable the processor 602 to obtain a movement distance if the parent control of the text display control is detected to have moved; and moving the video playing control according to the moving distance.
In an alternative embodiment, the program 610 is further configured to enable the processor 602 to stop the playing of the video object if the video playing control is detected to move out of the current display area.
For specific implementation of each step in the program 610, reference may be made to corresponding steps and corresponding descriptions in units in the foregoing rich text data processing method embodiment, which are not described herein again. It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described devices and modules may refer to the corresponding process descriptions in the foregoing method embodiments, and are not described herein again.
By the electronic equipment, aiming at rich text data in the text display control, if a video object label indicating a video object is analyzed, a webpage display element is generated, a video address of the video object is used as a content address of the webpage display element, and the webpage display element is associated with the video playing control, so that the video object is played when the webpage display element is triggered. The webpage display element can be an appropriate element which is parsed and displayed by the webpage. Therefore, the analysis and the processing of the video object label are converted into the analysis and the processing of the webpage display element, so that the rich text data in the text display control can be comprehensively analyzed without an external program or control, and the webpage display of the video content in the rich text data through the text display control is realized.
It should be noted that, according to the implementation requirement, each component/step described in the embodiment of the present invention may be divided into more components/steps, and two or more components/steps or partial operations of the components/steps may also be combined into a new component/step to achieve the purpose of the embodiment of the present invention.
The above-described method according to an embodiment of the present invention may be implemented in hardware, firmware, or as software or computer code storable in a recording medium such as a CD ROM, a RAM, a floppy disk, a hard disk, or a magneto-optical disk, or as computer code originally stored in a remote recording medium or a non-transitory machine-readable medium downloaded through a network and to be stored in a local recording medium, so that the method described herein may be stored in such software processing on a recording medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware such as an ASIC or FPGA. It will be appreciated that the computer, processor, microprocessor controller or programmable hardware includes memory components (e.g., RAM, ROM, flash memory, etc.) that can store or receive software or computer code that, when accessed and executed by the computer, processor or hardware, implements the rich text data processing methods described herein. Further, when a general-purpose computer accesses code for implementing the rich-text data processing method shown herein, execution of the code transforms the general-purpose computer into a special-purpose computer for executing the rich-text data processing method shown herein.
Those of ordinary skill in the art will appreciate that the various illustrative elements and method steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present embodiments.
The above embodiments are only for illustrating the embodiments of the present invention and not for limiting the embodiments of the present invention, and those skilled in the art can make various changes and modifications without departing from the spirit and scope of the embodiments of the present invention, so that all equivalent technical solutions also belong to the scope of the embodiments of the present invention, and the scope of patent protection of the embodiments of the present invention should be defined by the claims.

Claims (20)

1. A rich text data processing method, comprising:
label analysis is carried out on rich text data in the text display control;
if the current label is determined to be the video object label according to the analysis result, generating a webpage display element corresponding to the video object label;
acquiring a video address of a video object corresponding to the video object label, and setting the video address as a content address of the webpage display element;
and associating a video playing control with the webpage display element so as to acquire the video object from the content address and play the video object through the video playing control when the webpage display element is triggered in a display interface.
2. The method of claim 1, wherein the generating a web page presentation element corresponding to the video object tag comprises:
acquiring a cover page address of the video object through reflection calling;
and generating a webpage display element corresponding to the video object tag according to a cover image acquired from the cover address.
3. The method of claim 2, wherein the generating a web page presentation element corresponding to the video object tag from the cover image obtained from the cover address comprises:
acquiring image information and size information of a cover image from the cover address;
and generating a webpage display element corresponding to the video object label according to the image information and the size information of the cover image.
4. The method of claim 1, wherein prior to said exposing an element-associated video playback control for the web page, the method further comprises:
and setting a video playing button in a display area of the webpage display element, wherein the video playing button is used for calling the video playing control when receiving the triggering operation of a user.
5. The method of claim 1, wherein said exposing the element-associated video playback control for the web page comprises:
setting a video playing control in a top view of a display interface for displaying the webpage display elements;
and associating the video playing control with the webpage display element.
6. The method of any of claims 1-5, wherein the web page presentation element is a span object element.
7. The method of any of claims 1-5, wherein the label parsing rich text data in the text display control comprises:
acquiring rich text data through the text display control, and generating a container class object corresponding to the rich text data; performing label traversal on the container class object, and acquiring a label in the rich text data according to a traversal result;
alternatively, the first and second electrodes may be,
generating a corresponding container class object according to the rich text data, and assigning the container class object to the text display control; and traversing labels of the container class objects in the text display control, and acquiring the labels in the rich text data according to a traversal result.
8. The method of any of claims 1-5, wherein the method further comprises:
if the parent control of the text display control is detected to move, acquiring a moving distance;
and moving the video playing control according to the moving distance.
9. The method of any of claims 1-5, wherein the method further comprises:
and if the video playing control is detected to move out of the current display area, stopping playing the video object.
10. A rich-text data processing apparatus comprising:
the analysis module is used for carrying out label analysis on the rich text data in the text display control;
the generation module is used for generating a webpage display element corresponding to the video object label if the current label is determined to be the video object label according to the analysis result;
the setting module is used for acquiring a video address of a video object corresponding to the video object label and setting the video address as a content address of the webpage display element;
and the association module is used for associating a video playing control with the webpage display element so as to acquire the video object from the content address and play the video object through the video playing control when the webpage display element is triggered in a display interface.
11. The apparatus of claim 10, wherein the generating means comprises:
the determining module is used for determining the current label as a video object label according to the analysis result; the calling module is used for acquiring the cover page address of the video object through reflection calling;
and the cover module is used for generating webpage display elements corresponding to the video object tags according to the cover images acquired from the cover addresses.
12. The apparatus of claim 11, wherein the cover module is configured to obtain image information and size information of a cover image from the cover address; and generating a webpage display element corresponding to the video object label according to the image information and the size information of the cover image.
13. The apparatus of claim 10, wherein the apparatus further comprises:
and the button module is used for setting a video playing button in a display area of the webpage display element before the association module associates the video playing control with the webpage display element, wherein the video playing button is used for calling the video playing control when receiving the triggering operation of a user.
14. The apparatus according to claim 10, wherein the association module is configured to set a video playing control in a top-level view of a presentation interface that presents the web page presentation element; and associating the video playing control with the webpage display element so as to acquire the video object from the content address and play the video object through the video playing control when the webpage display element is triggered in a display interface.
15. The apparatus of any of claims 10-14, wherein the web page presentation element is a span object element.
16. The apparatus according to any one of claims 10 to 14, wherein the parsing module is configured to obtain rich text data through the text display control, and generate a container class object corresponding to the rich text data; performing label traversal on the container class object, and acquiring a label in the rich text data according to a traversal result; or generating a corresponding container class object according to the rich text data, and assigning the container class object to the text display control; and traversing labels of the container class objects in the text display control, and acquiring the labels in the rich text data according to a traversal result.
17. The apparatus of any of claims 10-14, wherein the apparatus further comprises:
the first operation module is used for acquiring a moving distance if the parent control of the text display control is detected to move; and moving the video playing control according to the moving distance.
18. The apparatus of any of claims 10-14, wherein the apparatus further comprises:
and the second operation module is used for stopping the playing of the video object if the video playing control is detected to move out of the current display area.
19. An electronic device, comprising: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication through the communication bus;
the memory is used for storing at least one executable instruction which causes the processor to execute the operation corresponding to the rich text data processing method according to any one of claims 1-9.
20. A computer storage medium having stored thereon a computer program which, when executed by a processor, implements a rich text data processing method as claimed in any one of claims 1-9.
CN201910106451.6A 2019-02-02 2019-02-02 Rich text data processing method and device, electronic equipment and computer storage medium Active CN111523065B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910106451.6A CN111523065B (en) 2019-02-02 2019-02-02 Rich text data processing method and device, electronic equipment and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910106451.6A CN111523065B (en) 2019-02-02 2019-02-02 Rich text data processing method and device, electronic equipment and computer storage medium

Publications (2)

Publication Number Publication Date
CN111523065A true CN111523065A (en) 2020-08-11
CN111523065B CN111523065B (en) 2023-04-25

Family

ID=71900041

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910106451.6A Active CN111523065B (en) 2019-02-02 2019-02-02 Rich text data processing method and device, electronic equipment and computer storage medium

Country Status (1)

Country Link
CN (1) CN111523065B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112001153A (en) * 2020-08-12 2020-11-27 腾讯科技(深圳)有限公司 Text processing method and device, computer equipment and storage medium
CN113656006A (en) * 2021-08-18 2021-11-16 广东触电传媒科技有限公司 Rich text rendering method and rendering equipment
CN113784194A (en) * 2020-09-03 2021-12-10 北京沃东天骏信息技术有限公司 Embedding method and device of video player

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2608079A1 (en) * 2011-12-21 2013-06-26 The Boeing Company Panoptic visualization document layout
CN104144357A (en) * 2013-05-10 2014-11-12 中国电信股份有限公司 Video playing method and system
CN104581401A (en) * 2013-10-10 2015-04-29 腾讯科技(深圳)有限公司 Method and device for playing data
US20150244661A1 (en) * 2012-11-14 2015-08-27 Tencent Technology (Shenzhen) Company Limited Method and apparatus for displaying rich text message on network platform, and computer storage medium
CN105208442A (en) * 2014-06-27 2015-12-30 贝壳网际(北京)安全技术有限公司 Video playing method of video playing application program and apparatus thereof
CN105843787A (en) * 2016-03-24 2016-08-10 武汉斗鱼网络科技有限公司 Rich text editing method and system
CN106095743A (en) * 2016-06-21 2016-11-09 武汉斗鱼网络科技有限公司 A kind of RichText Edition method and device
CN106484232A (en) * 2016-10-08 2017-03-08 福州市马尾区小微发明信息科技有限公司 A kind of interface display system
CN107656941A (en) * 2016-07-26 2018-02-02 阿里巴巴集团控股有限公司 Document analysis method, apparatus and editor

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2608079A1 (en) * 2011-12-21 2013-06-26 The Boeing Company Panoptic visualization document layout
US20150244661A1 (en) * 2012-11-14 2015-08-27 Tencent Technology (Shenzhen) Company Limited Method and apparatus for displaying rich text message on network platform, and computer storage medium
CN104144357A (en) * 2013-05-10 2014-11-12 中国电信股份有限公司 Video playing method and system
CN104581401A (en) * 2013-10-10 2015-04-29 腾讯科技(深圳)有限公司 Method and device for playing data
CN105208442A (en) * 2014-06-27 2015-12-30 贝壳网际(北京)安全技术有限公司 Video playing method of video playing application program and apparatus thereof
CN105843787A (en) * 2016-03-24 2016-08-10 武汉斗鱼网络科技有限公司 Rich text editing method and system
CN106095743A (en) * 2016-06-21 2016-11-09 武汉斗鱼网络科技有限公司 A kind of RichText Edition method and device
CN107656941A (en) * 2016-07-26 2018-02-02 阿里巴巴集团控股有限公司 Document analysis method, apparatus and editor
CN106484232A (en) * 2016-10-08 2017-03-08 福州市马尾区小微发明信息科技有限公司 A kind of interface display system

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
STEVEN J.: "Will HTML 5 Restandardize the Web?" *
冯兴利;洪丹丹;罗军锋;锁志海;: "视频自适应技术在网页设计中的实现" *
王欢欢;吴毅坚;赵文耘;: "Web应用界面跨浏览器兼容性的自动检测方法" *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112001153A (en) * 2020-08-12 2020-11-27 腾讯科技(深圳)有限公司 Text processing method and device, computer equipment and storage medium
CN112001153B (en) * 2020-08-12 2024-05-17 腾讯科技(深圳)有限公司 Text processing method, device, computer equipment and storage medium
CN113784194A (en) * 2020-09-03 2021-12-10 北京沃东天骏信息技术有限公司 Embedding method and device of video player
CN113656006A (en) * 2021-08-18 2021-11-16 广东触电传媒科技有限公司 Rich text rendering method and rendering equipment
CN113656006B (en) * 2021-08-18 2023-06-30 广东触电传媒科技有限公司 Rich text rendering method and rendering device

Also Published As

Publication number Publication date
CN111523065B (en) 2023-04-25

Similar Documents

Publication Publication Date Title
US9342237B2 (en) Automated testing of gesture-based applications
CN105354013A (en) Application interface rendering method and apparatus
CN108021583B (en) Page loading method and client
CN111523065A (en) Rich text data processing method and device, electronic equipment and computer storage medium
US8671389B1 (en) Web application resource manager on the web and localizable components
CN105975393B (en) Page display detection method and system
CN112256990B (en) Image processing method and device and computer readable storage medium
CN102693238B (en) Widget application process, system and multimedia terminal
CN101963992A (en) Method and browser for increasing webpage display speed
CN111708535A (en) Image-text display control method and device and electronic equipment
CN110780868A (en) Website development method, device, equipment and storage medium based on componentized template
CN110674444B (en) Method and terminal for downloading dynamic webpage
CN112835809A (en) Test data setting method, device, equipment and medium based on browser
CN111783008B (en) Information display method, device, equipment and medium
CN112306594A (en) Rendering method and device based on mobile terminal and storage medium
CN110263279B (en) Page generation method and device, electronic equipment and computer readable storage medium
CN111475237A (en) Menu processing method and device, electronic equipment and storage medium
CN117519877A (en) Rendering method and device of quick application card, storage medium and electronic equipment
CN109558186B (en) Page display method and device
CN114730341A (en) Protecting user privacy in user interface data collection for native applications
CN102637290B (en) Operating system based on browser and compiling method
CN110244948B (en) Method for switching button states based on programming language and electronic equipment
CN113961279A (en) Page rendering method, device, server and storage medium
CN110647695A (en) Method and device for converting webpage data into picture attachment
CN112765526B (en) Page screenshot method and device, terminal equipment and medium

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