Detailed Description
The terms "first", "second", "third", and the like in the embodiments of the present application are used for distinguishing different objects or for distinguishing different processes for the same object, and are not used for describing a specific order of the objects. For example, the first multimedia file and the second multimedia file are different multimedia files.
With the widespread use of terminals, more and more users use terminals to browse multimedia contents more and more frequently. Since the size ratio of the multimedia contents is various, the size of the display area of the display screen of the terminal is fixed. Therefore, the terminal firstly adjusts the size of the multimedia content so that the adjusted multimedia content can be adapted to the display area of the display screen; and displaying the adjusted multimedia content in the display area of the display screen.
Currently, a first scaling manner may be adopted when the size of the multimedia content is adjusted, that is, the multimedia content is scaled according to the aspect ratio of the multimedia content, so that the height of the scaled multimedia content is not greater than the height of the display area, and the width of the scaled multimedia content is not greater than the height of the display area. In this way, it is achieved that the display area can completely display the scaled multimedia content, but since the aspect ratio of the multimedia content and the aspect ratio of the display area may be different, the height of the scaled multimedia content is smaller than the height of the display area, or the width of the scaled multimedia content is smaller than the width of the display area. That is, the zoomed multimedia content is only displayed in a partial area of the display area, and the utilization rate of the zoomed multimedia content to the display area is low.
Secondly, a second scaling mode can be adopted when the size of the multimedia content is adjusted, namely the multimedia content is scaled according to the aspect ratio of the multimedia content, so that the height of the scaled multimedia content is larger than or equal to the height of the display area, and the width of the scaled multimedia content is larger than or equal to the height of the display area; and then cutting the part of the zoomed multimedia content exceeding the display area. In this way, the clipped multimedia content completely fills the display area, but since the aspect ratio of the multimedia content and the aspect ratio of the display area may be different, the portion of the zoomed multimedia content beyond the display area is clipped. The clipped multimedia content may lack a part of the content, which may cause the information expressed by the clipped multimedia content to be unclear and inaccurate.
In summary, the terminal processes the multimedia content in the scaling manner, so that the processed multimedia content is adapted to the display area (i.e., the processed multimedia content is displayed by fully utilizing the display area), and there are problems that information of the multimedia content displayed after being processed by the adapted display area is unclear and inaccurate, and the content display effect is poor.
Further, if the display screen is a special-shaped screen (e.g., a bang screen), the area type of the display area is a special-shaped display area. When the multimedia content is displayed on the special-shaped screen in the zooming mode, the special-shaped area which is complementary to the display area in shape on the special-shaped screen cannot display the multimedia content, and the special-shaped area can possibly shield part of the zoomed multimedia content or part of the cut multimedia content, so that information expressed by the multimedia content displayed on the special-shaped screen is unclear and inaccurate, and the content display effect is poor.
Illustratively, taking the bang screen as an example, the process of presenting the multimedia content by using the first zooming manner and the second zooming manner is described separately. The bang screen refers to a solution adopted right above a display screen (such as a display screen of a mobile phone) due to pursuit of a minimum frame of the surface where the display screen is located; it is named after Liu Hai Er. The bang screen comprises a display area and a bang area complementary in shape to the display area; the bang area cannot display multimedia content. The size of the display area of the bang screen actually refers to the size of the area comprised of the bang area and the display area.
In the case of the first scaling manner, the scaled multimedia content is only displayed in a partial area of the display area, that is, the utilization rate of the scaled multimedia content to the display area is low. Second, the height of the zoomed multimedia content may be equal to the height of the display area of the bang screen, which is actually the height of the area made up of the bang area and the display area, and the bang area cannot display the multimedia content. Thus, the bang area may occlude the top portion of the scaled multimedia content. And the information expressed by the multimedia content displayed on the bang screen is unclear and inaccurate, and the content display effect is poor due to partial content shielded by the bang area.
In the case of the second scaling manner, the clipped multimedia content can occupy the display area, that is, the utilization rate of the scaled multimedia content to the display area is high. However, since the height of the clipped multimedia content is equal to the height of the display area of the bang screen, the height of the display area of the bang screen is actually the height of the area consisting of the bang area and the display area, and the bang area cannot display the multimedia content. Therefore, the bang area may block a portion of the clipped multimedia content that is located at the top. The information expressed by the multimedia content displayed on the bang screen may be unclear and inaccurate due to the part of the content blocked by the bang area.
To sum up, the bang screen processes the multimedia content in the scaling manner, so that the processed multimedia content is adapted to the display area (i.e., the processed multimedia content is displayed by fully utilizing the display area), and the problems that the information of the multimedia content displayed after being processed by determining the adapted display area is unclear and inaccurate exist, and the content display effect is poor.
The embodiment of the application provides a method for displaying multimedia content, which avoids the multimedia content abnormity (content loss or missing and the like) caused by the display of the display area in an adaptive manner, and realizes the flexible adaptation of the multimedia content for the display areas with different sizes or different types so as to enable the display area to display more complete multimedia content. Furthermore, the clarity and the accuracy of the information expressed by the multimedia content displayed on the display area are improved, and the content display effect is good.
Embodiments of the present application will be described in detail below with reference to the accompanying drawings.
Please refer to fig. 1, which illustrates an implementation environment of a method for displaying multimedia content according to an embodiment of the present application. As shown in fig. 1, the implementation environment may include aserver 101 and a plurality of terminals, and the plurality of terminals may include a terminal 102 (e.g., a mobile phone with a display screen of a bang screen) and a terminal 103 (e.g., a mobile phone with a display screen that is not a special-shaped screen). Wherein, special-shaped screen includes the bang screen.
In one embodiment, theserver 101 may provide a plurality of multimedia contents (e.g., video, image), a content size of each multimedia content (e.g., an aspect ratio of each multimedia content), and element position information of a target content element included in each multimedia content to a plurality of terminals. The target content element may be information in the multimedia content that affects whether the information expressed by the multimedia content is clear and accurate, for example, the target content element may be text content. The element position information characterizes a position of a target content element in the multimedia content. Theserver 101 may return a download address of the first multimedia content to a terminal (e.g., the terminal 102 or the terminal 103) when receiving a Hyper Text Transfer Protocol (HTTP) request about the first multimedia content sent by the terminal. The first multimedia content is one of a plurality of multimedia contents. The terminal may acquire the first multimedia content, the content size of the first multimedia content, and the element position information of the target content element included in the first multimedia content from the download address.
Each terminal (e.g., the terminal 102 or the terminal 103) may capture a multimedia content through the camera module, and upload the multimedia content to theserver 101. Then, theserver 101 may acquire the content size of the multimedia content; the target content element in the multimedia content is also identified by a multimedia content identification (MMU) module, and element location information of the target content element included in the multimedia content is obtained. Theserver 101 again stores the multimedia content, the content size of the multimedia content, and the element position information of the target content element included in the multimedia content, and generates a download address representing a position at which the multimedia content, the content size of the multimedia content, and the element position information of the target content element included in the multimedia content are stored.
In another embodiment, a terminal (e.g., terminal 102 or terminal 103) receives a display request of a user for the first multimedia content, and acquires the first multimedia content. For example, the first multimedia content is downloaded from theserver 101 or retrieved from a local storage module. Then, the terminal acquires the content size of the first multimedia content; the target content element in the first multimedia content is also identified by the MMU module, and element position information of the target content element included in the multimedia content is obtained.
With any of the above embodiments, after obtaining the first multimedia content, the content size of the first multimedia content, and the element position information of the target content element included in the first multimedia content, the terminal may fully utilize the display screen to display the first multimedia content based on the content size of the first multimedia content and the element position information of the target content element included in the first multimedia content.
If the first multimedia content is a video, the first multimedia content includes a first number of frame images, N represents the first number, and N is a positive integer greater than 1. Then, the element position information of the target content element included in the first multimedia content is used to characterize the position of the region containing all the target content elements of the N-frame images in any one of the N-frame images. Secondly, the content sizes of the N frames of images are the same, and the content size of any one frame of image in the N frames of images, namely the content size of the first multimedia content, can be obtained.
For example, the terminal in the embodiment of the present application may be a mobile phone including a display screen. Other electronic devices including a display screen are also possible, such as smart televisions, tablets, laptops, etc. The embodiment of the present application does not specifically limit the specific form of the terminal.
It should be noted that the method for displaying multimedia content provided in the embodiment of the present application may be applied to any of the terminals (e.g., the terminal 102 or the terminal 103) including the display screen. The terminal may also be referred to as an electronic device. The execution main body of the method for displaying multimedia content provided by the embodiment of the application can be a display device of multimedia content, and the display device of multimedia content can be the electronic equipment. The display device of the multimedia content can also be an Application (APP) installed with a display function capable of providing the multimedia content; alternatively, the display device of the multimedia content may be a Central Processing Unit (CPU) of the electronic device; or a control module in the electronic device for performing the display of the multimedia content.
Please refer to fig. 2, which is a flowchart illustrating a method for displaying multimedia content according to an embodiment of the present disclosure. As shown in fig. 2, the method is applied to a terminal including a display screen, and may include S201-S203.
S201, the terminal responds to the received display trigger instruction, acquires first multimedia content corresponding to the display trigger instruction, and acquires content display parameters of the first multimedia content; the content display parameters include at least a content size of the first multimedia content and element position information of a target content element included in the first multimedia content.
The terminal can generate a display trigger instruction when detecting that a user views the operation of the first multimedia content through the first application APP; and responding to the display triggering instruction, and acquiring the first multimedia content and the content display parameters of the first multimedia content. The first APP may be one of all APPs installed in the terminal, and may also be one APP running in the terminal.
In the embodiment of the application, the terminal acquires the content size and the first position information of the first multimedia content, and uses the first position information as the element position information of the target content element included in the first multimedia content. The target content element is text content, and the first position information is position information of the text content in the first multimedia content.
Wherein the content size of the first multimedia content may include an aspect ratio of the first multimedia content.
It can be understood that the text content in a multimedia content is often the important content of the multimedia content, and can convey accurate and clear information to the user. That is to say, when the terminal displays the multimedia content, the completeness of the text content in the multimedia content displayed by the terminal directly affects whether the information expressed by the multimedia content displayed by the terminal is clear and accurate. Thus, the terminal acquires first location information characterizing the location of the text content in the first multimedia content in each multimedia content. Furthermore, when the terminal processes the first multimedia content by using the first position information, the integrity of the text content in the processed multimedia content can be controlled, and the clarity and the accuracy of the information expressed by the multimedia content displayed on the display area can be ensured by displaying the complete text content.
It should be noted that, in addition to acquiring the first position information for the text content in the multimedia content, the first position information may also be acquired for other content in the multimedia content that can convey accurate and clear information, for example, an image of the target object. The embodiment of the present application takes text content as an example, and details a display method of multimedia content.
S202, the terminal processes the first multimedia content according to the content display parameters and the area display parameters of the display area for displaying the multimedia content to obtain second multimedia content comprising target content elements; the region display parameters include at least a region type and a region size of the display region.
Wherein the display area may be all areas of the display screen for displaying the multimedia content.
In the embodiment of the application, the area type of the display area may be a special-shaped display area or a non-special-shaped display area. The area type of the display area of the special-shaped screen is a special-shaped display area; the area type of the display area of the non-shaped screen is a non-shaped display area.
If the region type of the display region is a non-irregular display region, the region size of the display region may include at least one of an aspect ratio of the display region, a height of the display region, and a width of the display region. If the area type of the display area is the special-shaped display area, the area size of the display area may include at least one of an aspect ratio of the display area, a height of the display area, and a width of the display area, and further include a size of a special-shaped portion of the display area; the size of the shaped portion of the display area is equal to the size of the shaped area that is complementary in shape to the display area.
In the embodiment of the application, the display screen can be displayed in a full screen mode or not. If the display screen is full-screen display, the height of the whole display area of the display screen is equal to the height of the display screen, and the width of the whole display area of the display screen is equal to the width of the display screen. If the display screen is not displayed in a full screen mode, the height of the whole display area of the display screen is smaller than the height of the Liuhai screen, and/or the width of the whole display area of the display screen is smaller than the width of the Liuhai screen. The full-screen display means that all areas capable of displaying the picture contents of the display screen are used for displaying the picture contents, and all the areas capable of displaying the picture contents of the display screen are the whole display area of the display screen.
In the embodiment of the present application, taking the display screen as full-screen display as an example, a specific process of obtaining the height and the aspect ratio of the display area in the display screen is described. For a full-screen display screen, the display area for displaying multimedia content may be equal to or smaller than the entire display area of the display screen of the terminal. If the display screen does not include the navigation bar, the display area is equal to the whole display area of the display screen of the terminal, the height of the display area is equal to the height of the display screen, and the width of the display area is equal to the width of the display screen. If the display screen comprises the navigation bar, the display area is smaller than the whole display area of the display screen of the terminal, the area of the whole display area of the display screen of the terminal except the navigation bar is the display area, the height of the display area is equal to the difference of the height of the display screen minus the height of the navigation bar, and the width of the display area is equal to the difference of the width of the display screen minus the height of the navigation bar.
The Navigation Bar (Navigation Bar) in the application is a shortcut button Bar at the bottom of a terminal screen, and generally appears at the bottom end of the terminal screen in the form of virtual keys, and the Navigation Bar defaults to include three buttons, namely a Back key, a Home key and a Recent (Recent) key, wherein the Back key is used for returning to a previous interface, the Home key is used for returning to a desktop, and the Recent key is used for displaying an application which is used recently.
Illustratively, as shown in fig. 3A, thebang screen 30 includes anavigation bar 31, and theBack key 311, theHome key 312, and thepercent key 313 are included in thenavigation bar 31. The height Hz of thedisplay area 32 is equal to the height Hl of thebang screen 30 minus the height Hd of thenavigation bar 31, the width Wz of thedisplay area 32 is equal to the width Wl of thebang screen 30, and the aspect ratio of thedisplay area 32 is Hz: wz ═ (Hl-Hd): and (Wl).
Illustratively, as shown in FIG. 3B, theLiu screen 30 does not include a navigation bar, the height Hz of thedisplay area 32 is equal to the height Hl of theLiu screen 30, the width Wz of thedisplay area 32 is equal to the width Wl of theLiu screen 30, and the aspect ratio of thedisplay area 32 is Hz: wz ═ Hl: and (Wl).
And S203, the terminal displays the second multimedia content through the display area.
The terminal may display the second multimedia content in the middle of the display area, or display the second multimedia content in the display area in a bottom-aligned manner (that is, the bottom of the second multimedia content is close to the bottom of the display area), or display the second multimedia content in another display manner, which is not limited in the embodiment of the present application.
It can be understood that the terminal processes the multimedia content by acquiring the content display parameters including the multimedia content and using the element position information of the target content element and the area display parameters of the display area included in the content display parameters, so as to ensure that the multimedia content displayed after the processing of the adaptive display area includes the key target content element, avoid the multimedia content abnormity (content loss or missing and the like) caused by the display of the adaptive display area, realize the flexible adaptive processing of the multimedia content for the display of the display areas with different sizes or different types, and ensure the content display effect.
In an embodiment of the present application, the content size of the first multimedia content includes an aspect ratio of the first multimedia content. The area type of the display area is a special-shaped display area; the area size of the display area includes: a height of the display area, an aspect ratio of the display area, and a size of the shaped portion of the display area; the size of the shaped portion of the display area is equal to the size of the shaped area that is complementary in shape to the display area. The terminal can properly scale the first multimedia content according to the area size of the display area, the aspect ratio of the first multimedia content and the first position information, and obtain the second multimedia content which fully utilizes the special-shaped display area. Specifically, as the display method of multimedia contents shown in fig. 4, S202 may include S2021-S2023.
S2021, if the aspect ratio of the first multimedia content is smaller than that of the display area and is greater than or equal to a preset aspect ratio threshold, the terminal zooms the first multimedia content according to the aspect ratio of the first multimedia content to obtain the multimedia content to be selected, the height of which is equal to that of the display area.
The terminal judges whether the aspect ratio of the first multimedia content is smaller than that of the display area or not and whether the aspect ratio of the first multimedia content is larger than or equal to a preset aspect ratio threshold or not. If the aspect ratio of the first multimedia content is smaller than the aspect ratio of the display area and the aspect ratio of the first multimedia content is greater than or equal to the preset aspect ratio threshold, the terminal may first scale the height of the first multimedia content to be equal to the height of the display area; and then, the width is zoomed according to the aspect ratio of the first multimedia content to obtain the multimedia content to be selected. The aspect ratio of the to-be-selected multimedia content is equal to that of the first multimedia content, the width of the to-be-selected multimedia content is larger than that of the display area, and the height of the to-be-selected multimedia content is equal to that of the display area.
Wherein, the aspect ratio of the display area is larger than the preset aspect ratio threshold. The preset aspect ratio threshold is the minimum aspect ratio that represents that the multimedia content is suitable for being displayed on the whole screen of the bang screen. Although the aspect ratio of the first multimedia content is smaller than the aspect ratio of the display area, the aspect ratio of the first multimedia content is greater than or equal to the minimum aspect ratio, and thus, the gap between the width of the second multimedia content and the width of the display area is not too large. That is, the second multimedia content does not extend beyond the display area much.
Wherein, the preset aspect ratio threshold may be set to the aspect ratio of the multimedia content which is most used among the aspect ratios of all the current multimedia contents, for example, 16:9 or 4: 3.
S2022, the terminal acquires second position information based on the first position information; and the second position information is the position information of the text content in the multimedia content to be selected.
In an embodiment of the present application, the first location information may include: the ratio of the distance between the upper edge of the text content in the first multimedia content and the upper edge of the first multimedia content to the height of the first multimedia content is denoted as a first upper ratio. Alternatively, the first location information may include: the distance between the upper side edge of the text content in the first multimedia content and the upper side edge of the first multimedia content is denoted as the first upper side distance.
Wherein, if the first position information includes: the first upper ratio, the second position information includes: and recording the ratio of the distance between the upper side edge of the text content in the multimedia content to be selected and the upper side edge of the multimedia content to be selected to the height of the multimedia content to be selected as a second upper side ratio. Wherein the second position information is equal to the first position information, i.e. the second upper ratio is equal to the first upper ratio. For this, the terminal takes the first location information as the second location information.
Alternatively, if the first location information includes: the first upper side distance, the second position information includes: and recording the distance between the upper side edge of the text content in the multimedia content to be selected and the upper side edge of the multimedia content to be selected as a second upper side distance. And the terminal determines the second position information according to the first position information and the zoom times of the multimedia file to be selected compared with the first multimedia file. Specifically, the terminal multiplies the first upper side distance by the scaling factor to obtain a second upper side distance.
It can be understood that, in the case that the area type of the display area is the special-shaped display area and the special-shaped area is located at the top end of the display area, since the height of the to-be-selected multimedia content is equal to the height of the display area, the special-shaped area may block the content at the top end of the to-be-selected multimedia content. For this, the first position information obtained by the terminal may include a first upper side distance, and the second position information includes a second upper side ratio, where the second upper side ratio is a ratio of a distance between an upper side edge of the text content in the to-be-selected multimedia content and an upper side edge of the to-be-selected multimedia content to a height of the to-be-selected multimedia content. The terminal can judge whether the height ratio of the height of the special-shaped area in the display area is larger than the second upper side ratio or not by utilizing the second upper side ratio, and if the height ratio of the height of the special-shaped area in the display area is larger than the second upper side ratio, the terminal indicates that the special-shaped area blocks the content at the top end of the multimedia content to be selected; and if the height ratio of the special-shaped area to the display area is not more than the second upper ratio, the special-shaped area does not block the top content of the multimedia content to be selected.
S2023, if the display area is determined to be capable of completely displaying the text content in the to-be-selected multimedia content according to the size of the special-shaped part of the display area and the second position information, the terminal determines that the to-be-selected multimedia content is the second multimedia content.
In the embodiment of the application, if the terminal determines that the special-shaped area does not shield the text content in the multimedia content to be selected according to the size of the special-shaped part of the display area and the second position information, and determines that the part of the multimedia content to be selected, which exceeds the display area, does not include the text content according to the width of the multimedia content to be selected and the second position information, the multimedia content to be selected is determined to be the second multimedia content.
Wherein, in case that the special-shaped area is located at the top of the display area, the size of the special-shaped portion of the display area may be the height of the special-shaped portion of the display area (i.e. the height of the special-shaped area). And if the terminal determines that the special-shaped area does not shield the text content in the to-be-selected multimedia content according to the height and the second position of the special-shaped part of the display area, and determines that the part of the to-be-selected multimedia content exceeding the display area does not include the text content according to the width and the second position information of the to-be-selected multimedia content, determining that the to-be-selected multimedia content is the second multimedia content.
For example, the shaped region of the bang screen is a bang region, the bang region is located at a top end of the display region, and the size of the shaped portion of the display region can include the height of the bang region.
In this embodiment of the application, under the condition that the special-shaped area is located at the top end of the display area, the process of the terminal determining whether the special-shaped area blocks the text content in the multimedia content to be selected may include: if the second position information comprises the second upper ratio, the terminal calculates the ratio of the height of the special-shaped part of the display area (namely the height of the special-shaped area) to the height of the display area; judging whether the ratio of the height of the special-shaped part of the display area to the height of the display area is larger than a second upper side ratio or not; if the ratio of the height of the special-shaped part of the display area to the height of the display area is not larger than the second upper side ratio, the terminal determines that the text content in the second multimedia content is not shielded by the special-shaped area; and if the ratio of the height of the special-shaped part of the display area to the height of the display area is greater than the second upper side ratio, the terminal determines that the special-shaped area blocks the text content in the second multimedia content.
Or if the second position information comprises the second upper side distance, the terminal calculates the ratio of the height of the special-shaped area to the height of the display area, and the ratio of the second upper side distance to the height of the multimedia content to be selected; wherein, the ratio of the second upper side distance to the height of the multimedia content to be selected is equal to the second upper side ratio; the specific process that the terminal judges whether the special-shaped area blocks the text content in the multimedia content to be selected according to the ratio of the height of the special-shaped area to the height of the display area, the ratio of the second upper side distance to the height of the multimedia content to be selected, and the specific process that the terminal judges whether the special-shaped area blocks the text content in the multimedia content to be selected according to the ratio of the height of the special-shaped area to the height of the display area and the second upper side ratio are the same.
In this embodiment of the application, the first location information may further include: the ratio of the distance between the left edge of the text content in the first multimedia content and the left edge of the first multimedia content to the width of the first multimedia content is recorded as a first left ratio; and the ratio of the distance between the right edge of the text content in the first multimedia content and the right edge of the first multimedia content to the width of the first multimedia content is recorded as a first right ratio. Accordingly, the second location information may further include: the ratio of the distance between the left edge of the text content in the second multimedia content and the left edge of the second multimedia content to the width of the second multimedia content is recorded as a second left ratio; and the ratio of the distance between the right edge of the text content in the second multimedia content and the right edge of the second multimedia content to the width of the second multimedia content is recorded as a second right ratio. The first right ratio may also be equal to 1 minus the first left ratio and the ratio of the width of the text content to the width of the display area.
Alternatively, the first location information may further include: recording a distance between a left edge of text content in the first multimedia content and a left edge of the first multimedia content as a first left distance; the distance between the right edge of the text content in the first multimedia content and the right edge of the first multimedia content is denoted as the first right distance. Accordingly, the second location information may further include: recording a distance between a left edge of the text content in the second multimedia content and a left edge of the second multimedia content as a second left distance; the distance between the right edge of the text content in the second multimedia content and the right edge of the second multimedia content is denoted as the second right distance.
The second left ratio is equal to the first left ratio, and the second right ratio is equal to the first right ratio. For this, the terminal takes the first location information as the second location information.
And the terminal multiplies the first left distance by the scaling multiple of the second multimedia file compared with the first multimedia file to obtain a second left distance. And the terminal multiplies the first right distance by the scaling multiple to obtain a second right distance.
It can be understood that, since the aspect ratio of the multimedia content to be selected is smaller than the aspect ratio of the display area, the height of the multimedia content to be selected is equal to the height of the display area, and then the width of the multimedia content to be selected is larger than the width of the display area. That is, the left and right sides of the selected multimedia content exceed the display area, so as to avoid that the part of the selected multimedia content exceeding the display area includes text content, which results in unclear and inaccurate information expressed by the multimedia content displayed on the display area. And further judging whether the parts of the left side and the right side of the selected multimedia content, which exceed the display area, comprise text content according to the width of the selected multimedia content, the second left side distance and the second right side distance.
Further, under the condition that the special-shaped area is located at the top end of the display area, on the premise that the to-be-selected multimedia content is displayed in the middle of the display area, the specific process that the terminal judges whether the part of the to-be-selected multimedia content exceeding the display area includes the text content according to the width of the to-be-selected multimedia content and the second left-side ratio and the second right-side ratio in the second position information includes: the terminal divides the difference value between the width of the multimedia content to be selected and the width of the display area by 2 to obtain the cut width of the multimedia content to be selected when the multimedia content to be selected is displayed in the display area in a centered mode; then calculating the ratio of the cut width to the width of the multimedia content to be selected; if the ratio of the cut width to the width of the multimedia content to be selected is not more than the second left ratio and the ratio of the cut width to the width of the multimedia content to be selected is not more than the second right ratio, the terminal determines that the part of the multimedia content to be selected, which exceeds the display area, does not include text content; and if the ratio of the cut width to the width of the to-be-selected multimedia content is greater than the second left ratio, or the ratio of the cut width to the width of the to-be-selected multimedia content is greater than the second right ratio, determining that the part of the to-be-selected multimedia content, which exceeds the display area, comprises text content.
Further, on the premise that the to-be-selected multimedia content is displayed in the display area in the middle, the specific process that the terminal judges whether the part of the to-be-selected multimedia content exceeding the display area includes the text content according to the width of the to-be-selected multimedia content and the second left distance and the second right distance in the second position information includes: and the terminal calculates the ratio of the second left distance to the width of the multimedia content to be selected and the ratio of the second right distance to the width of the multimedia content to be selected. The ratio of the second left distance to the width of the to-be-selected multimedia content is equal to a second left ratio, and the ratio of the second right distance to the width of the to-be-selected multimedia content is equal to a second right ratio; then, the terminal performs a process that is the same as the specific process of judging whether the part of the to-be-selected multimedia content exceeding the display area includes the text content according to the width of the to-be-selected multimedia content and the second left-side ratio and the second right-side ratio in the second position information, which is not described herein again in this embodiment of the application.
It is understood that the terminal may scale the first multimedia content according to the aspect ratio of the first multimedia content when it is determined that the aspect ratio of the first multimedia content is smaller than the aspect ratio of the display area and the aspect ratio of the first multimedia content is greater than or equal to the preset aspect ratio threshold. In this way, the second multimedia content having a height equal to the height of the display area can be obtained.
Wherein, the aspect ratio of the first multimedia content is smaller than that of the display area; therefore, the first multimedia content is zoomed according to the aspect ratio of the first multimedia content, namely, the first multimedia content is zoomed under the condition that the aspect ratio of the first multimedia content is kept unchanged, and if the zoomed second multimedia content is ensured to be capable of fully covering the display area; then it is necessary to ensure that the height of the second multimedia content is equal to the height of the display area. At this time, the width of the second multimedia content is larger than the bandwidth of the display area, and the second multimedia content can be spread over the display area. Thus, the display area can be fully utilized to display the second multimedia content.
Secondly, because the width of the to-be-selected multimedia content is greater than the height of the display area, and the height of the to-be-selected multimedia content is equal to the height of the display area, the special-shaped area may block part of the content in the to-be-selected multimedia content, and the content exceeding the display area in the to-be-selected multimedia content may include text content. Therefore, according to the size of the special-shaped part of the display area and the second position information, the text content in the multimedia content to be selected is determined not to be shielded by the special-shaped area, and the content exceeding the display area in the multimedia content to be selected does not include the text content, so that the multimedia content to be selected is displayed in the display area. At this time, the display area can show the complete text content in the second multimedia content, the clarity and the accuracy of the information expressed by the multimedia content shown on the display area are improved, and the content display effect is good.
In conclusion, the terminal can display the multimedia content by fully utilizing the display area and can also display the complete text content in the multimedia content, thereby avoiding the omission of the multimedia content caused by the display in the adaptive display area. Therefore, the clarity and the accuracy of the information expressed by the multimedia content displayed on the display area are improved, and the content display effect is good.
In an embodiment of the present application, the content size of the first multimedia content includes an aspect ratio of the first multimedia content. If the region type of the display region is a non-special-shaped display region, the region size of the display region may include an aspect ratio of the display region. The terminal can properly scale the first multimedia content according to the aspect ratio of the first multimedia content, the aspect ratio of the display area and the first position information, and obtain the second multimedia content which fully utilizes the non-special-shaped display area. Specifically, as the display method of multimedia content shown in FIG. 5, S202 may include S202a-S202 c.
S202a, if the aspect ratio of the first multimedia content is smaller than the aspect ratio of the display area and the aspect ratio of the first multimedia content is greater than or equal to the preset aspect ratio threshold, the terminal zooms the first multimedia content according to the aspect ratio of the first multimedia content to obtain the multimedia content to be selected, wherein the height of the multimedia content to be selected is equal to the height of the display area.
S202b, the terminal acquires second position information based on the first position information; and the second position information is the position information of the text content in the multimedia content to be selected.
S202c, if the terminal determines that the part of the selected multimedia content beyond the display area does not include the text content according to the width of the selected multimedia content and the second position information, determining that the selected multimedia content is the second multimedia content.
It should be noted that, for the specific processes of S202a-S202c, reference may be made to the detailed descriptions of the parts in S2021-S2023 that are the same as the parts in S202a-S202c, and the details of the embodiments of the present application are not repeated herein.
It can be understood that, for the non-special-shaped display area, the width of the selected multimedia content is greater than the height of the display area, and the height of the selected multimedia content is equal to the height of the display area, then the content in the selected multimedia content beyond the display area may include text content. Therefore, according to the width and the second position information of the multimedia content to be selected, the content exceeding the display area in the multimedia content to be selected is determined not to include the text content, and the multimedia content to be selected is displayed in the display area. At the moment, the display area is fully utilized to display the multimedia content, and the more complete text content in the multimedia content is displayed, so that the omission of the multimedia content caused by the display in the adaptive display area is avoided. Therefore, the clarity and the accuracy of the information expressed by the multimedia content displayed on the display area are improved, and the content display effect is good.
In the embodiment of the application, in addition to the first multimedia content with the aspect ratio between the aspect ratio of the display area in the bang screen and the preset aspect ratio threshold, the first multimedia content with the aspect ratio not between the aspect ratio of the display area in the bang screen and the preset aspect ratio threshold is also included; secondly, besides the display area can completely display the text content in the multimedia content to be selected, the display area can not completely display the text content in the multimedia content to be selected. Therefore, the terminal can select a proper scaling mode to obtain the second multimedia content when the first multimedia content with the aspect ratio in different ranges and the display area can not completely display the text content in the to-be-selected multimedia content, and the display area is fully utilized to display the second multimedia content.
Taking the area type of the display area as the special-shaped display area as an example, a specific process of the terminal scaling the multimedia content for the first multimedia content with the aspect ratio in different ranges and the case that the display area cannot completely display the text content in the multimedia content to be selected is described below, and referring to fig. 6, the specific process may include S601-S612.
S601, the terminal responds to the received display trigger instruction, and acquires first multimedia content, an aspect ratio of the first multimedia content and first position information corresponding to the display trigger instruction.
The first position information is position information of text content in the first multimedia content.
S602, under the condition that the area type of the display area is the special-shaped display area, the terminal acquires the height of the display area, the aspect ratio of the display area and the height of the special-shaped part of the display area.
Wherein the height of the shaped portion of the display area is equal to the height of the shaped area complementary in shape to the display area, i.e. the height of the shaped area.
It should be noted that, for the specific process of S601-S602, reference may be made to the detailed description of the same parts as S601-S602 in S201-S202, and details are not repeated herein in this embodiment of the application.
S603, the terminal judges whether the aspect ratio of the first multimedia content is smaller than that of the display area.
The terminal determines that the aspect ratio of the first multimedia content is not less than the aspect ratio of the display area, and performs S604. The terminal determines that the aspect ratio of the first multimedia content is smaller than the aspect ratio of the display area, and performs S605.
S604, the terminal zooms the first multimedia content according to the aspect ratio of the first multimedia content to obtain a second multimedia content with the width equal to that of the display area, and displays the second multimedia content in the display area.
The terminal may first scale the width of the first multimedia content to be equal to the width of the display area, and then scale the height according to the aspect ratio of the first multimedia content to obtain the second multimedia content. The second multimedia content is then presented in the display area. The aspect ratio of the second multimedia content is equal to that of the first multimedia content, and the height of the second multimedia content is greater than that of the display area.
If the second multimedia content is an image, the display area can only display a part of the second multimedia content, and other parts of the second multimedia content can be browsed in an up-and-down scrolling manner.
It can be appreciated that for a first multimedia content having an aspect ratio greater than or equal to the aspect ratio of the display area, the first multimedia content is scaled to a second multimedia content having a width equal to the width of the display area. The height of the second multimedia content having a width equal to the width of the display area is also much greater than the width of the second multimedia content. Although the height of the second multimedia content far exceeds the display area, because the height of the second multimedia content with the width equal to the width of the display area is far larger than the width of the second multimedia content, the proportion of the part of the second multimedia content displayed by the display area can be ensured to be proper, so that the part of the second multimedia content displayed by the display area is clear, and whether the text content in the first multimedia content is blocked by the special-shaped area can be not considered.
S605, the terminal judges whether the aspect ratio of the first multimedia content is smaller than a preset aspect ratio threshold.
The terminal determines that the aspect ratio of the first multimedia content is less than the preset aspect ratio threshold, and executes S606. The terminal determines that the aspect ratio of the first multimedia content is not less than the preset aspect ratio threshold, and executes S607.
S606, the terminal zooms the first multimedia content according to the aspect ratio of the first multimedia content to obtain a second multimedia content with the width equal to that of the display area, and displays the second multimedia content in the display area.
If the aspect ratio of the first multimedia content is smaller than that of the display area, the terminal determines that the aspect ratio of the first multimedia content is smaller, and if the display area is to be fully paved, the part of the first multimedia content, which exceeds the display area after being scaled according to the original scale of the first multimedia content, is too much, so that the first multimedia content is not suitable for being paved into the display area.
The terminal may first scale the width of the first multimedia content to be equal to the width of the display area; and then, the height is zoomed according to the aspect ratio of the first multimedia content to obtain a second multimedia content. The second multimedia content is then presented in the display area. Wherein, the aspect ratio of the second multimedia content is equal to that of the first multimedia content, and the height of the second multimedia content is less than that of the display area. At this time, when the second multimedia content is displayed in the display area, the display area has a black border around the second multimedia content in addition to the second multimedia content.
The black border is a black area around the multimedia file except the displayed multimedia file. The black border is caused after converting the size of the first multimedia content due to the difference between the size (e.g., height, width) of the first multimedia content and the size of the display area, and may also be referred to as a video black border (Letter box).
It can be understood that, for the first multimedia content with the aspect ratio smaller than the preset aspect ratio threshold, in order to avoid that the first multimedia content scales and fills the display area, there are too many portions beyond the display area, i.e. the integrity of the displayed content is poor. Thus, the first multimedia content is scaled to a second multimedia content having a width equal to the width of the display area. Therefore, the multimedia content is displayed by fully utilizing the display area, and the integrity of the multimedia content displayed by the display area is also ensured.
S607, the terminal zooms the first multimedia content according to the aspect ratio of the first multimedia content to obtain the multimedia content to be selected with the height equal to the height of the display area.
S608, the terminal acquires second position information based on the first position information.
Because the height of the multimedia content to be selected is equal to that of the display area, the special-shaped area in the display screen covers part of the top end of the multimedia content to be selected, and in order to ensure that the multimedia content displayed on the display screen is clear and accurate, second position information is obtained and is used for judging whether the text content in the multimedia content to be selected is covered by the special-shaped area.
Wherein the first position information includes the first upper ratio and the second position information includes the second upper ratio. Alternatively, the first position information includes the first upper side distance, and the second position information includes the second upper side distance.
It should be noted that, for the specific processes of S607-S608, reference may be made to the above detailed description of S2021-S2022, and details are not repeated herein in this embodiment of the application.
And S609, the terminal judges whether the special-shaped area blocks the text content in the multimedia content to be selected according to the height of the special-shaped part of the display area and the second position information.
And the terminal determines that the special-shaped area blocks the text content in the multimedia content to be selected, and S612 is executed. And the terminal determines that the special-shaped area does not shield the text content in the multimedia content to be selected, and executes S610.
It should be noted that, for a specific process of S609, reference may be made to the detailed description about determining whether the special-shaped area blocks the text content in the to-be-selected multimedia content in S2023, which is not described herein again in this embodiment of the present application.
S610, the terminal judges whether the part of the multimedia content to be selected, which exceeds the display area, comprises text content according to the width of the multimedia content to be selected and the second position information.
The terminal determines that the portion of the multimedia content to be selected, which exceeds the display area, includes text content, and performs S612. The terminal determines that the portion of the multimedia content to be selected, which exceeds the display area, does not include the text content, and performs S611.
S611, the terminal takes the multimedia content to be selected as second multimedia content and displays the second multimedia content in the display area.
The terminal may present the second multimedia content centrally in the display area.
S612, the terminal zooms the first multimedia content according to the aspect ratio of the first multimedia content to obtain a second multimedia content with the width equal to that of the display area, and displays the second multimedia content in the display area.
If the abnormal area is determined to shield the text content in the multimedia content to be selected, and/or the part of the multimedia content to be selected, which exceeds the display area, is determined to comprise the text content, the display area cannot show part of the text content in the multimedia content to be selected, and the display expressed by the multimedia content shown in the display area is unclear and inaccurate. Thus, the first multimedia content is rescaled to obtain the second multimedia content. The width of the second multimedia content is equal to the width of the display area, and the height of the second multimedia content is smaller than the width of the display area.
Wherein, if the bang screen includes the navigation bar, the terminal can show the bottom of this second multimedia content along with the bottom of display area. The height-to-width ratio of the second multimedia content is greater than or equal to the preset height-to-width ratio threshold, so that the height of the second multimedia content is slightly smaller than the height of the display area. The bottom of the second multimedia content is displayed along with the bottom of the display area, so that the problem that the picture displayed by the display area is not consistent due to the narrow black edge existing between the second multimedia content and the navigation bar is solved.
It can be understood that, for a first multimedia content with an aspect ratio smaller than that of the display area and greater than or equal to a preset aspect ratio threshold, the candidate multimedia content obtained by scaling the first multimedia content may fill the display area. And if the special-shaped area does not shield the text content in the multimedia content to be selected and the part of the multimedia content to be selected, which exceeds the display area, does not include the text content, the terminal takes the multimedia content to be selected as second multimedia content and displays the second multimedia content. And if the text content in the to-be-selected multimedia content is blocked by the special-shaped area or the part of the to-be-selected multimedia content exceeding the display area comprises the text content, the terminal rescales the first multimedia content to obtain and display a second multimedia content. Therefore, the display area is fully utilized to display the multimedia content, the complete text content in the multimedia content can be displayed, and the omission of the multimedia content caused by the display in the adaptive display area is avoided. Thereby improving the clarity and accuracy of the information expressed by the multimedia content presented on the bang screen.
In addition, the terminal flexibly adapts and processes the first multimedia content with the aspect ratio in different ranges to the special-shaped display area for displaying, so that the multimedia content which is adapted to the special-shaped display area and displayed after processing is clear and complete, and the content display effect is ensured.
In the embodiment of the application, the specific process of the display method of the multimedia content is described by taking the display screen as the bang screen as an example. As shown in fig. 7, the method is applied to a terminal including a bang screen, and the method may include S701-S705.
S701, the terminal responds to the received display trigger instruction, and obtains first multimedia content, the aspect ratio of the first multimedia content and first position information corresponding to the display trigger instruction; the first position information is position information of text content in the first multimedia content.
If the first multimedia content is a video, the first multimedia content includes a first number N of frames of images, where N is a positive integer greater than 1. Then, the first position information corresponding to the first multimedia content is used for representing the position of the region containing all the text contents of the N frames of images in any one of the N frames of images. Secondly, the height-width ratio of the N frames of images is the same, and the height and the width of any one frame of image in the N frames of images can be obtained; and dividing the height of any frame of image by the width of any frame of image to obtain the aspect ratio of the first multimedia content. Wherein, the height and the width of any frame image can be numerical values in pixel units.
S702, the terminal acquires the height and the height-width ratio of a display area in the Liuhai screen; the display area includes all areas in the bang screen for displaying multimedia content.
The terminal can acquire the height and the width of a display area in the bang screen; and dividing the height of the display area by the width of the display area to obtain the aspect ratio of the display area. Wherein both the height and the width of the display area may be values in units of pixel pixels.
S703, if the aspect ratio of the first multimedia content is smaller than that of the display area and the aspect ratio of the first multimedia content is greater than or equal to a preset aspect ratio threshold, the terminal zooms the first multimedia content according to the aspect ratio of the first multimedia content to obtain the multimedia content to be selected, wherein the height of the multimedia content to be selected is equal to that of the display area.
The terminal judges whether the aspect ratio of the first multimedia content is smaller than that of the display area or not and whether the aspect ratio of the first multimedia content is not smaller than a preset aspect ratio threshold or not. If the aspect ratio of the first multimedia content is smaller than the aspect ratio of the display area and the aspect ratio of the first multimedia content is greater than or equal to the preset aspect ratio threshold, the terminal may first scale the height of the first multimedia content to be equal to the height of the display area; and then, the width is zoomed according to the aspect ratio of the first multimedia content to obtain the multimedia content to be selected. The aspect ratio of the to-be-selected multimedia content is equal to that of the first multimedia content, and the width of the to-be-selected multimedia content is larger than that of the display area.
S704, the terminal acquires second position information based on the first position information; and the second position information is used for representing the position of the text content in the multimedia content to be selected.
S705, if the fact that the text content in the to-be-selected multimedia content is not shielded by the Liuhai area is determined according to the height of the Liuhai area in the Liuhai screen and the second position information, the terminal takes the to-be-selected multimedia content as second multimedia content and displays the second multimedia content in the display area.
And the terminal judges whether the Liuhai area covers the text content in the second multimedia content or not according to the height of the Liuhai area and the second position information. And if the text content in the second multimedia content is not shielded in the bang area, the terminal displays the second multimedia content in the display area. And if the text content in the second multimedia content is blocked by the bang area, the terminal does not display the second multimedia content in the display area, and rescales the first multimedia content.
Illustratively, if the display method of the multimedia content is executed by a first APP in the terminal, the terminal may transmit the instruction to the first APP in response to the instruction. The first APP responds to the instruction, and obtains the aspect ratio of the first multimedia content and the first position information. Then, the first APP may obtain the height and width of the display area in the bang screen from the operating system through an Application Programming Interface (API) provided by the operating system of the terminal; and then calculating to obtain the aspect ratio of the display area. The first APP re-executes S703-S705.
It can be understood that when the terminal determines that the aspect ratio of the first multimedia content is smaller than the aspect ratio of the display area in the liu hai screen and the aspect ratio of the first multimedia content is greater than or equal to the preset aspect ratio threshold, the terminal scales the first multimedia content according to the aspect ratio of the first multimedia content to obtain the to-be-selected multimedia content with the height equal to the height of the display area. And zooming the first multimedia content under the condition of keeping the aspect ratio of the first multimedia content unchanged to obtain the height of the to-be-selected multimedia content equal to the height of the display area. Because the top of the display area is in a concave shape, the middle lower area of the concave shape on the bang screen is a bang area which does not display the picture content, and therefore when the height of the multimedia content to be selected is equal to that of the display area, the bang area on the bang screen can shield part of the content in the multimedia content to be selected. And then, according to the height and the second position information of the Liuhai area, determining that the Liuhai area does not shield the text content in the multimedia content to be selected, and displaying the multimedia content to be selected in the display area. At this time, the text content in the multimedia content to be selected is not blocked by the bang area, that is, the display area is fully utilized to display the multimedia content, and the more complete text content in the multimedia content can be displayed, so that omission of the multimedia content caused by display in the adaptive display area is avoided. Therefore, the clarity and the accuracy of the information expressed by the multimedia content displayed on the display area are improved, and the content display effect is good.
In the embodiment of the application, in addition to the first multimedia content with the aspect ratio between the aspect ratio of the display area in the bang screen and the preset aspect ratio threshold, the first multimedia content with the aspect ratio not between the aspect ratio of the display area in the bang screen and the preset aspect ratio threshold is also included; therefore, the terminal executes the display method of the multimedia content, and can more accurately display the first multimedia content with the aspect ratio in different ranges. Specifically, referring to fig. 8, a method for displaying multimedia content provided by the embodiment of the present application may include S801-S812.
S801, the terminal responds to the received display trigger instruction, and acquires first multimedia content, an aspect ratio of the first multimedia content and first position information corresponding to the display trigger instruction.
The first position information is used for representing the position of the text content in the first multimedia content.
S802, the terminal obtains the height and the height-width ratio of a display area in the Liuhai screen.
S803, the terminal judges whether the aspect ratio of the first multimedia content is smaller than that of the display area.
The terminal determines that the aspect ratio of the first multimedia content is not less than the aspect ratio of the display area, and performs S804. The terminal determines that the aspect ratio of the first multimedia content is smaller than the aspect ratio of the display area, and performs S805.
S804, the terminal zooms the first multimedia content according to the aspect ratio of the first multimedia content to obtain a second multimedia content with the width equal to that of the display area, and displays the second multimedia content in the display area.
S805, the terminal judges whether the aspect ratio of the first multimedia content is smaller than a preset aspect ratio threshold.
Wherein the preset aspect ratio threshold is smaller than the aspect ratio of the display area.
The terminal determines that the aspect ratio of the first multimedia content is less than the preset aspect ratio threshold, and executes S806. The terminal determines that the aspect ratio of the first multimedia content is not less than the preset aspect ratio threshold, and performs S807.
S806, the terminal zooms the first multimedia content according to the aspect ratio of the first multimedia content to obtain a second multimedia content with the width equal to that of the display area, and displays the second multimedia content in the display area.
S807, the terminal zooms the first multimedia content according to the aspect ratio of the first multimedia content to obtain the multimedia content to be selected with the height equal to the height of the display area.
And S808, the terminal acquires second position information based on the first position information.
Because the height of the multimedia content to be selected is equal to the height of the display area, the bang area in the bang screen covers part of the top content of the multimedia content to be selected, and in order to ensure that the multimedia content displayed by the bang screen is clear and accurate, the second position information is acquired so as to be used for judging whether the text content in the multimedia content to be selected is covered by the bang area.
Wherein the first position information may include the first upper ratio and the second position information includes the second upper ratio.
And S809, judging whether the Liu Hai area shields the text content in the multimedia content to be selected or not by the terminal according to the height and the second position information of the Liu Hai area in the Liu Hai screen.
And the terminal determines that the bang area blocks the text content in the multimedia content to be selected, and S812 is executed. And the terminal determines that the text content in the multimedia content to be selected is not shielded in the bang area, and S810 is executed.
And S810, judging whether the part of the to-be-selected multimedia content, which exceeds the display area, comprises text content or not by the terminal according to the width of the to-be-selected multimedia content and the second position information.
The terminal determines that the portion of the multimedia content to be selected beyond the display area includes text content, and performs S812. The terminal determines that the portion of the multimedia content to be selected beyond the display area does not include the text content, and performs S811.
The first position information may further include the first left ratio and the first right ratio. Accordingly, the second position information further includes the second left ratio and the second right ratio.
Illustratively, as shown in fig. 9, the first multimedia content 90 has a height of H0, a width of W0, and an aspect ratio of H0/W0, and the distance between the upper side edge of thetext content 91 in the first multimedia content 90 and the upper side edge of the first multimedia content 90 is Tt, i.e., the first upper side distance is Tt. The distance between the left edge of thetext content 91 in the first multimedia content 90 and the left edge of the first multimedia content 90 is Lt, i.e. the first left distance is Lt. The distance between the right edge of thetext content 91 in the first multimedia content 90 and the right edge of the first multimedia content 90 is Rt, i.e. the first right distance is Rt. The ratio of Tt to the height H0 of the first multimedia content 90 is Tt/H0, i.e., the first upper ratio is Tt/H0. The ratio of Lt to the width W0 of the first multimedia content 90 is Lt/W0, i.e., the first left ratio is Lt/W0. The ratio of Rt to the width W0 of the first multimedia content 90 is Rt/W0, i.e., the first right-side ratio is Rt/W0. Wherein the black boxes outside the first multimedia content 90 in fig. 9 may not be present in the actual display. Thetext content 91 in the first multimedia content 90 is interspersed with pictures. It can be appreciated that the upper, left and right sides of thetext content 91 in the first multimedia file 90 refer to the upper, left and right sides of the area including all the text content in the first multimedia content 90, the area including all the text content in the first multimedia content 90 including the picture.
It should be noted that the upper side, the left side, and the right side of the text content in the first multimedia file all refer to the upper side, the left side, and the right side of the area including all the text content in the first multimedia content. For example, a picture may be interspersed among text content in the first multimedia content, and then the region including all text content in the first multimedia content includes the picture.
S811, the terminal takes the multimedia content to be selected as second multimedia content, and the second multimedia content is displayed in the display area.
The terminal may present the second multimedia content centrally in the display area.
S812, the terminal zooms the first multimedia content according to the aspect ratio of the first multimedia content to obtain a second multimedia content with the width equal to that of the display area, and displays the second multimedia content in the display area.
If the fact that the Liuhai area blocks the text content in the multimedia content to be selected is determined, and/or the fact that the part of the multimedia content to be selected, which exceeds the display area, comprises the text content indicates that the display area cannot show part of the text content in the multimedia content to be selected, and therefore the display expressed by the multimedia content shown in the display area is unclear and inaccurate. Thus, the first multimedia content is rescaled to obtain the second multimedia content. The width of the second multimedia content is equal to the width of the display area, and the height of the second multimedia content is smaller than the width of the display area.
It can be understood that, for a first multimedia content with an aspect ratio not greater than the aspect ratio of the display area and less than a preset aspect ratio threshold, the candidate multimedia content obtained by scaling the first multimedia content may fill the display area. And if the text content in the to-be-selected multimedia content is determined not to be shielded in the bang area and the part of the to-be-selected multimedia content exceeding the display area does not comprise the text content, the terminal takes the to-be-selected multimedia content as the second multimedia content and displays the second multimedia content. And if the fact that the text content in the to-be-selected multimedia content is shielded by the Liuhai area or the text content is included in the part of the to-be-selected multimedia content exceeding the display area is determined, the terminal rescales the first multimedia content to obtain a second multimedia content and displays the second multimedia content. Therefore, the display area is fully utilized to display the multimedia content, the complete text content in the multimedia content can be displayed, and the omission of the multimedia content caused by the display in the adaptive display area is avoided. Therefore, the clarity and the accuracy of the information expressed by the multimedia content displayed on the Liuhai screen are improved, and the content display effect is good.
Illustratively, taking thebang screen 30 including thenavigation bar 31 shown in fig. 3A and the first multimedia file 90 shown in fig. 9 as an example, the method for displaying multimedia content provided by the embodiment of the present application may include steps a1-a 10. In fig. 9, only a small aspect ratio of the first multimedia file 90 is shown, and in the embodiment of the present invention, the aspect ratio of the first multimedia file 90 may be larger or smaller than the aspect ratio of the first multimedia file 90 shown in fig. 9, and is not limited by the aspect ratio of the first multimedia file 90 shown in fig. 9.
A1, the terminal acquires the aspect ratio H0/W0 of the first multimedia content 90 and the first position information; wherein the first location information comprises: a first upper side ratio Tt/H0, a first left side ratio Lt/W0, and a first right side ratio Rt/W0.
A2, the terminal acquires the height Hz, the width Wz and the aspect ratio Hz of thedisplay area 32 in the bang screen 30: wz.
A3, if H0/W0 is not less than Hz: wz, the terminal scales the first multimedia content according to the aspect ratio H0/W0 of the first multimedia content, resulting in thesecond multimedia content 101 having a width equal to the width Wz of thedisplay area 32, and presents thesecond multimedia content 101 in the middle of thedisplay area 32. As shown in fig. 10A, the height of thesecond multimedia content 101 is greater than the height Hz of thedisplay area 32; when thesecond multimedia content 101 is centrally displayed on thedisplay area 32, both the top end and the bottom end of thesecond multimedia content 101 exceed thedisplay area 32 and are not displayed on thedisplay area 32, and the portions of the top end and the bottom end of thesecond multimedia content 101 exceeding thedisplay area 32 are dotted line portions in fig. 10A.
A4, in Hz: wz > H0/W0 is more than or equal to 16:9, the terminal scales the first multimedia content 90 according to the aspect ratio H0/W0 of the first multimedia content 90 to obtain thecandidate multimedia content 102 with the height equal to the height Hz of thedisplay area 32. As shown in fig. 10B, the width W102 of the to-be-selected multimedia content 102 is greater than the width Wz of thedisplay area 32, where W102 is W0 (Hz/H0). The portions of the left and right sides of thecandidate multimedia content 102 that exceed thedisplay area 32 are dotted line portions in fig. 10B. Wherein the preset aspect ratio threshold is 16: 9.
a5, the terminal takes the first position information as second position information corresponding to themultimedia content 102 to be selected; wherein the second location information comprises: the second upper ratio is equal to Tt/H0, the second left ratio is equal to Lt/W0, and the second right ratio is equal to Rt/W0. Wherein the second right ratio is also equal to 1-Lt/W0-Wt/W0, Wt being the width of the text content in themultimedia content 102 to be selected.
A6, the terminal calculates the ratio Hp/Hz of the height Hp of the bang area 33 and the height Hz of thedisplay area 32 in thebang screen 30. If (Hp/Hz) is not less than Tt/H0, the Liu Hai area 33 is determined to block the text content in themultimedia content 102 to be selected. If (Hp/Hz) < Tt/H0, it is determined that the bang region 33 does not occlude the text content in themultimedia content 102 to be selected.
For example, the terminal may calculate a boolean value, boolcoveredText, (Hp/Hz) ≧ Tt/H0, indicating whether the Liu region occludes text content in thecandidate multimedia content 102. If (Hp/Hz) is not less than Tt/H0, the bouol coveredText is true or 1. If (Hp/Hz) < Tt/H0, the boul coveredText is false or 0.
A7, if it is determined that the bang area 33 does not block the text content in the to-be-selected multimedia content 102, the width W102 of the to-be-selected multimedia content 102 of the terminal is obtained, and the width of the to-be-selected multimedia content 102 is obtained by dividing the difference between the width W102 of the to-be-selected multimedia content 102 and the width Wz of thedisplay area 32 by 2, wherein the width of the to-be-selected multimedia content 102 is cut off on the left side and the right side when the to-be-selected multimedia. The terminal then calculates the ratio of the clipped width to the width W102 of themultimedia content 102 to be selected, which is equal to ((W102-Wz)/2)/W102. If ((W102-Wz)/2)/W102> Lt/W0 and/or ((W102-Wz)/2)/W102> Rt/W0), it is determined that the portion of themultimedia content 102 to be selected beyond thedisplay area 32 includes text content. If ((W102-Wz)/2)/W102 ≦ Lt/W0 and ((W102-Wz)/2)/W102 ≦ Rt/W0), the terminal determines that the portion of themultimedia content 102 to be selected beyond thedisplay area 32 does not include text content.
And A8, if the Liu Hai area 33 is determined not to obstruct the text content in the selectedmultimedia content 102 and the part of the selectedmultimedia content 102 beyond thedisplay area 32 is determined not to include the text content, the selectedmultimedia content 102 is taken as the second multimedia content and is displayed in thedisplay area 32, as shown in FIG. 10B.
A9, if it is determined that the bang region 33 blocks the text content in themultimedia content 102 to be selected, or it is determined that the part of themultimedia content 102 to be selected beyond thedisplay region 32 includes the text content, the terminal scales the first multimedia content 90 according to the aspect ratio H0/W0 of the first multimedia content 90 to obtain thesecond multimedia content 103 with the width equal to the width Wz of thedisplay region 32, and displays the bottom of thesecond multimedia content 103 against the bottom of thedisplay region 32, as shown in fig. 10C. Thesecond multimedia content 103 is different from thesecond multimedia content 101, and the height of thesecond multimedia content 103 is smaller than the height of thedisplay area 32.
Wherein, since the height of thesecond multimedia content 103 is less than the height of thedisplay area 32, in the case that the bottom of thesecond multimedia content 103 is shown against the bottom of thedisplay area 32, thedisplay area 32 further includes a black border above thesecond multimedia content 103.
It should be noted that, since the aspect ratio of thesecond multimedia content 103 is greater than or equal to 16:9, the height of thesecond multimedia content 103 is therefore slightly less than the height of thedisplay area 32. At this time, if thesecond multimedia content 103 is displayed on thedisplay area 32 in the center, the black border between thesecond multimedia content 103 and thenavigation bar 31 is narrow, which causes the displayed picture of thedisplay area 32 to be inconsistent, and therefore, the bottom of thesecond multimedia content 103 is displayed against the bottom of thedisplay area 32.
A10, if H0/W0< 16:9, the terminal then scales the first multimedia content 90 according to the aspect ratio H0/W0 of the first multimedia content 90 to obtain thesecond multimedia content 104 with a width equal to the width Wz of thedisplay area 32, and presents thesecond multimedia content 104 in the middle of thedisplay area 32, as shown in fig. 10D. Thesecond multimedia content 104 is different from thesecond multimedia content 101 and thesecond multimedia content 103. Thesecond multimedia content 104 is smaller in height than thesecond multimedia content 103. Wherein, since the height of thesecond multimedia content 104 is less than the height of thedisplay area 32, in case thesecond multimedia content 104 is centrally presented by thedisplay area 32, thedisplay area 32 further comprises black borders above and below thesecond multimedia content 104.
It should be noted that thesecond multimedia content 101, thecandidate multimedia content 102, thesecond multimedia content 103, and thesecond multimedia content 104 represent different multimedia contents generated after the same scaling is performed on the first multimedia content 90 with different aspect ratios.
It can be understood that, according to the aspect ratio of the first multimedia content, the method for displaying multimedia content provided in the embodiment of the present application adopts a suitable scaling manner and a suitable presentation manner for the first multimedia content. Therefore, the display area is fully utilized to display the multimedia content, the black edges on the display area are reduced, and the picture effect when the display area displays the multimedia content is improved. And complete text content in the multimedia content is displayed, so that the clarity and accuracy of information expressed by the multimedia content displayed on the display area are improved. In addition, the first multimedia contents with different aspect ratios are zoomed according to the aspect ratio of the first multimedia contents, the multimedia contents with unchanged aspect ratios are displayed after being zoomed, and the displayed multimedia contents and the first multimedia contents are ensured to have almost the same visual effect.
In the embodiment of the present application, taking the example that the first multimedia content includes N frames of images, a specific process of the terminal (or the server) identifying text content in the first multimedia content through the MMU to obtain first location information corresponding to the first multimedia content is described in detail, which may include steps B1-B3.
B1, MMU obtaining M frames of images with preset number from N frames of images according to preset interval frame number; m is less than N, and M is a positive integer.
B2, MMU identifies the text content in each frame of image in M frames of images, and superposes the text content in the M frames of images according to the position of the text content in each frame of image in the M frames of images in the images to obtain the superposed text area.
The MMU may input a preset text recognition model for each of the M frames of images, output a height and a width of a text region where text content in each of the frames of images is located, and output information indicating a position of the text region in one of the frames of images, for example, vertex coordinates, which are coordinates of an upper left corner of the text region in the first coordinate system. In the first coordinate system, the upper left corner of a frame of image where the text region is located is used as an origin, the x-axis is perpendicular to the upper side and the lower side of the frame of image where the text region is located, the x-axis positive direction is from the upper side to the lower side, the y-axis is perpendicular to the left side and the right side of the frame of image where the text region is located, and the y-axis positive direction is from the left side to the right side. Then, the MMU may superimpose the text regions in the M frames of images according to the height and width of the text region where the text content in each frame of image is located, and the information indicating the position of the text region in one frame of image, to obtain the superimposed text region. The superimposed text region is the smallest region that can cover all the text regions in the M-frame image.
The preset text recognition model is obtained by training a large number of image samples comprising character areas based on a certain type of neural network. Some type of neural network may be an existing neural network suitable for image recognition, and the embodiments of the present application are not limited thereto.
Illustratively, the M frame images include the 1 st, 2 nd, and M th frame images P2, …. The MMU identifies a text region where the text content in each frame image is located, as shown in fig. 11, atext region 111 where the text content in the 1 st frame image shown in (a) in fig. 11 is located, atext region 112 where the text content in the 2 nd frame image shown in (b) in fig. 11 is located, and a text region 11M where the text content in the M th frame image shown in (c) in fig. 11 is located.
The MMU superimposes the text content in the M frames of images again to obtain the superimposedtext region 121, as shown in fig. 12. The superimposedtext area 121 is the smallest area that can cover thetext area 111, thetext areas 112 and …, and the text area 11M.
B3, MMU determines the position of the superimposed text area relative to any frame image, and obtains first position information.
Illustratively, the MMU determines the position of the superimposedtext region 121 relative to any frame image, and obtains first position information, which includes: the height Ht121 of the superimposedtext region 121, the width Wt121 of the superimposedtext region 121, the ratio of the distance Tt12 between the upper side edge of the superimposedtext region 121 and the upper side edge of any frame image to the height H121 of any frame image, the ratio of the distance Lt12 between the left side edge of the superimposedtext region 121 and the left side edge of any frame image to the width W121 of any frame image, and the ratio of the distance Rt12 between the right side edge of the superimposedtext region 121 and the right side edge of any frame image to the width W121 of any frame image.
It will be appreciated that the above method may be implemented by a display device of multimedia content. The multimedia content display apparatus includes hardware structures and/or software modules for performing the respective functions in order to implement the above-described functions. Those of skill in the art will readily appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as hardware or combinations of hardware and computer software. Whether a function is performed as hardware or computer software drives hardware depends upon the particular application and design constraints imposed on the solution. 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 embodiments of the present application.
In the embodiment of the present application, the display device of the multimedia content and the like may be divided into functional modules according to the method example, for example, each functional module may be divided according to each function, or two or more functions may be integrated into one processing module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. It should be noted that, in the embodiment of the present application, the division of the module is schematic, and is only one logic function division, and there may be another division manner in actual implementation.
In the case of dividing each functional module by corresponding functions, fig. 13 shows a schematic diagram of a possible structure of the terminal according to the above embodiment, where the terminal 13 includes: aninformation acquisition module 131, azoom module 132, and adisplay control module 133.
Theinformation obtaining module 131 is configured to obtain an aspect ratio of the first multimedia content and obtain first position information; the height and aspect ratio of the display area in the bang screen are obtained. Thescaling module 132 is configured to scale the first multimedia content according to the aspect ratio of the first multimedia content to obtain a second multimedia content with a height equal to the height of the display area if the aspect ratio of the first multimedia content is smaller than the aspect ratio of the display area and the aspect ratio of the first multimedia content is greater than or equal to a preset aspect ratio threshold. Theinformation obtaining module 131 is further configured to obtain second location information based on the first location information. Thedisplay control module 133 is configured to display the second multimedia content in the display area if it is determined that the text content in the second multimedia content is not occluded by the bang area according to the height of the bang area in the bang screen and the second position information. The first position information is used for representing the position of the text content in the first multimedia content; the display area includes all areas in the liu hai screen for displaying the picture content. The second location information is used to characterize a location of the text content in the second multimedia content.
In one possible embodiment, the first location information comprises: a ratio of a distance between an upper side edge of the text content in the first multimedia content and an upper side edge of the first multimedia content to a height of the first multimedia content. The second location information includes: a ratio of a distance between an upper side edge of the text content in the second multimedia content and an upper side edge of the second multimedia content to a height of the second multimedia content. Wherein the second location information is equal to the first location information.
In another possible embodiment, the first location information further includes: a distance between a left edge of the text content in the first multimedia content and a left edge of the first multimedia content, and a width of the first multimedia content, and a distance between a right edge of the text content in the first multimedia content and a right edge of the first multimedia content, and a width of the first multimedia content. The second location information further includes: a distance between a left edge of the text content in the second multimedia content and a left edge of the second multimedia content, and a width of the second multimedia content, and a distance between a right edge of the text content in the second multimedia content and a right edge of the second multimedia content, and a width of the second multimedia content.
In another possible embodiment, thedisplay control module 133 is specifically configured to display the second multimedia content in the display area if it is determined that the text content in the second multimedia content is not occluded by the bang area according to the height and the second position information of the bang area in the bang screen, and it is determined that the portion of the second multimedia content beyond the display area does not include the text content according to the width and the second position information of the second multimedia content.
In another possible implementation, thescaling module 132 is further configured to, if it is determined that the bang region blocks the text content in the second multimedia content according to the height and the second position information of the bang region in the bang screen, scale the first multimedia content according to the aspect ratio of the first multimedia content to obtain a third multimedia content having a width equal to the width of the display region; thedisplay control module 133 is further configured to display the third multimedia content in the display area.
In another possible implementation, thescaling module 132 is further configured to scale the first multimedia content according to the aspect ratio of the first multimedia content to obtain a third multimedia content with a width equal to the width of the display area if it is determined that the portion of the second multimedia content beyond the display area includes the text content according to the width of the second multimedia content and the second position information; thedisplay control module 133 is further configured to display the third multimedia content in the display area.
In another possible implementation, thescaling module 132 is further configured to scale the first multimedia content according to the aspect ratio of the first multimedia content to obtain a third multimedia content with a width equal to the width of the display area if the aspect ratio of the first multimedia content is greater than or equal to the aspect ratio of the display area, or the aspect ratio of the first multimedia content is smaller than a preset aspect ratio threshold; thedisplay control module 133 is further configured to display the third multimedia content in the display area.
In another possible embodiment, the bang screen includes a navigation bar therein. Wherein the height of the display area is equal to the height of the bang screen minus the height of the navigation bar.
In another possible implementation, the first multimedia content comprises N frames of images, N being a positive integer greater than 1. Theinformation obtaining module 131 is specifically configured to: acquiring M frame images from the N frame images according to the preset interval frame number; m is less than N, and M is a positive integer; recognizing text content in each frame of image in the M frames of images, and overlapping the text content in the M frames of images according to the positions of the text content in each frame of image in the M frames of images in the images to obtain an overlapped text area; and determining the position of the superimposed text region relative to any frame image to obtain first position information.
In the case of an integrated unit, fig. 14 shows a possible structural diagram of the terminal 14 referred to in the above-described embodiment. The terminal 14 may include: aprocessor 1401, amemory 1402, and acommunication module 1403. Theprocessor 1401 is configured to control and manage the operation of the terminal. Amemory 1402 for storing program codes and data of the terminal, such as a display method of multimedia contents, first location information, etc. Thecommunication module 1403 is used for supporting communication between the terminal and other network entities to implement functions such as data interaction, for example, thecommunication module 1403 supports communication between the terminal and the server to implement a data interaction function.
Processor 1401 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like, among others.Processor 1401 may include an Application Processor (AP), a modem processor, a Graphics Processing Unit (GPU), an Image Signal Processor (ISP), a controller, a memory, a video codec, a Digital Signal Processor (DSP), a baseband processor, and/or a neural-Network Processing Unit (NPU), etc. The different processing units may be separate devices or may be integrated into one or more processors.
Memory 1402 may include one or more computer-readable storage media, which may be non-transitory.Memory 1402 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 inmemory 1402 is used to store at least one instruction for execution byprocessor 1401 to implement a method of displaying multimedia content as provided by an embodiment of the present application.
Embodiments of the present application further provide a computer-readable storage medium, which includes computer instructions, and when the computer instructions are executed on the terminal, the terminal is caused to perform the functions or steps in the above method embodiments. For example, the computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a Compact Disc Read-Only Memory (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, and the like.
Embodiments of the present application further provide a computer program product, which, when run on a terminal, causes the terminal to perform the respective functions or steps of the above method embodiments.
Through the description of the above embodiments, it is clear to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional modules is merely used 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 device may be divided into different functional modules to complete all or part of the above described functions.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described embodiments of the apparatus are merely illustrative, and for example, a module or a unit may be divided into only one logic function, and may be implemented in other ways, for example, a plurality of units or components may be combined or integrated into another apparatus, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
Units described as separate parts may or may not be physically separate, and parts displayed as units may be one physical unit or a plurality of physical units, may be located in one place, or may be distributed to a plurality of different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application may be essentially or partially contributed to by the prior art, or all or part of the technical solutions may be embodied in the form of a software product, where the software product is stored in a storage medium and includes several instructions to enable a device (which may be a single chip, a chip, or the like) or a processor (processor) to execute all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a U disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk.
The above description is only an embodiment of the present application, but the scope of the present application is not limited thereto, and any changes or substitutions within the technical scope of the present disclosure should be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.