Bullet screen display method and device, equipment and storage medium
By establishing the mapping relationship between standard barrage trajectories and custom barrage trajectories in the streaming media system, the problem of high computational complexity during barrage trajectory switching is solved, and flexible switching and performance optimization of barrage trajectory are achieved.
Patent Information
- Application Number
- CN202510148517.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-11
- Publication Date
- 2025-05-27
AI Technical Summary
When switching barrage trajectory in the prior art, it is necessary to calculate the placement position of barrage on the new trajectory in real time, resulting in an increase in the use of client computing power and affecting performance.
By obtaining the mapping relationship between the custom barrage track and the standard barrage track associated with the current playback video, based on the current scrolling progress and mapping relationship, determine the target scroll position when the barrage scrolls on the custom track to the current progress, and display the barrage at that position.
The calculation process of barrage trajectory switching is simplified, the use of client computing power is reduced, the performance impact is avoided, and the flexible switch of barrage trajectory is realized.
Smart Images

Figure CN120050475A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to the field of streaming media technology, and in particular to a bullet screen display method, device, equipment and storage medium. Background Art
[0002] With the advancement and application of information technologies such as mobile Internet, cloud computing, and big data, streaming media applications have become an inseparable part of people's lives. In order to improve the user interaction mechanism, streaming media service providers have made barrages an important link between video content and users. Barrages not only add time tags to comments related to video content, but also greatly enrich video content. The most important thing is that they can make other users feel like they can interact and chat. When a consistent point of view appears in the barrage, it can strengthen the sense of identity with the video. With the continuous update of barrages, video content has been given the ability to re-produce or continuously produce. Even some classic old dramas have regained vitality in combination with the current barrages, effectively extending the life cycle of video content.
[0003] At present, in order to meet the needs of users who want the bullet screen trajectory to be novel and interesting, the bullet screen trajectory will be switched from the conventional horizontal bullet screen trajectory to other types of bullet screen trajectory when the video is playing certain plots. However, switching the bullet screen trajectory requires real-time calculation of the real-time display position of the bullet screen on other types of bullet screen trajectory, which increases the client computing power and affects the client performance. Summary of the invention
[0004] In order to solve the above technical problems or at least partially solve the above technical problems, the embodiments of the present disclosure provide a bullet screen display method, device, equipment and storage medium.
[0005] A first aspect of an embodiment of the present disclosure provides a bullet screen display method, the method comprising:
[0006] Obtain a custom bullet screen track associated with the currently playing video, wherein the custom bullet screen track is different from a standard bullet screen track, the standard bullet screen track includes a horizontal bullet screen track, the length of the standard bullet screen track is a first length, and the length of the custom bullet screen track is a second length;
[0007] When the currently played video is played to a first preset play position, determining a mapping relationship between the standard bullet screen track and the custom bullet screen track based on the first length and the second length;
[0008] Get the current scrolling progress of the bullet screen on the standard bullet screen track at the current moment;
[0009] Determine the target scrolling position of the bullet screen when it scrolls to the current scrolling progress on the custom bullet screen trajectory based on the current scrolling progress and the mapping relationship;
[0010] Display the bullet screen at the target scrolling position.
[0011] A second aspect of the embodiments of the present disclosure provides a bullet screen display device, which includes:
[0012] A first acquisition module, configured to acquire a custom bullet screen trajectory associated with the currently playing video, where the custom bullet screen trajectory is different from the standard bullet screen trajectory, the standard bullet screen trajectory includes a horizontal bullet screen trajectory, the length of the standard bullet screen trajectory is a first length, and the length of the custom bullet screen trajectory is a second length;
[0013] A first determination module, configured to determine the mapping relationship between the standard bullet screen trajectory and the custom bullet screen trajectory based on the first length and the second length when the currently playing video is played to a first preset playing position;
[0014] A second acquisition module, configured to acquire the current scrolling progress of the bullet screen on the standard bullet screen trajectory at the current moment;
[0015] A second determination module, configured to determine the target scrolling position of the bullet screen when it scrolls to the current scrolling progress on the custom bullet screen trajectory based on the current scrolling progress and the mapping relationship;
[0016] A first display module, configured to display the bullet screen at the target scrolling position.
[0017] A third aspect of the embodiments of the present disclosure provides an electronic device, which includes: a processor and a memory, where a computer program is stored in the memory, and when the computer program is executed by the processor, the processor executes the method of the first aspect above.
[0018] A fourth aspect of the embodiments of the present disclosure provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the method of the first aspect above can be implemented.
[0019] The technical solutions provided by the embodiments of the present disclosure have the following advantages compared with the prior art:
[0020] In an embodiment of the present disclosure, a custom bullet screen trajectory associated with the currently playing video can be obtained. Among them, the custom bullet screen trajectory is different from the standard bullet screen trajectory. The standard bullet screen trajectory includes a horizontal bullet screen trajectory, the length of the standard bullet screen trajectory is the first length, and the length of the custom bullet screen trajectory is the second length. When the currently playing video plays to the first preset playing position, based on the first length and the second length, a mapping relationship between the standard bullet screen trajectory and the custom bullet screen trajectory is determined; the current scrolling progress of the bullet screen on the standard bullet screen trajectory at the current moment is obtained; based on the current scrolling progress and the mapping relationship, the target scrolling position when the bullet screen scrolls to the current scrolling progress on the custom bullet screen trajectory is determined; the bullet screen is displayed at the target scrolling position. It can be seen that by adopting the above technical solution, the switching of the bullet screen trajectory can be realized simply by applying the mapping relationship, reducing the calculation overhead of the target scrolling position, thereby reducing the occupancy of the client's computing power and avoiding affecting the client performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The accompanying drawings herein are incorporated into the specification and constitute a part of this specification, showing embodiments consistent with the present disclosure and, together with the specification, are used to explain the principles of the present disclosure.
[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0023] Figure 1 is a flowchart of a bullet screen display method provided by an embodiment of the present disclosure;
[0024] Figure 2 is a schematic diagram of the scrolling of a custom bullet screen trajectory provided by an embodiment of the present disclosure;
[0025] Figure 3 is another schematic diagram of the scrolling of a custom bullet screen trajectory provided by an embodiment of the present disclosure;
[0026] Figure 4 is yet another schematic diagram of the scrolling of a custom bullet screen trajectory provided by an embodiment of the present disclosure;
[0027] Figure 5 is yet another schematic diagram of the scrolling of a custom bullet screen trajectory provided by an embodiment of the present disclosure;
[0028] Figure 6 is a schematic diagram of a preset text direction provided by an embodiment of the present disclosure;
[0029] Figure 7 is a schematic structural diagram of a bullet screen display system provided by an embodiment of the present disclosure;
[0030] Figure 8 It is a schematic structural diagram of a bullet screen display device provided by an embodiment of the present disclosure;
[0031] Figure 9 It is a schematic structural diagram of an electronic device in an embodiment of the present disclosure. Specific embodiments
[0032] In order to more clearly understand the above objects, features and advantages of the present disclosure, the solutions of the present disclosure will be further described below. It should be noted that, without conflict, the embodiments of the present disclosure and the features in the embodiments may be combined with each other.
[0033] Many specific details are set forth in the following description in order to provide a thorough understanding of the present disclosure, but the present disclosure may be practiced in other ways different from those described herein; obviously, the embodiments in the specification are only some embodiments of the present disclosure, rather than all embodiments.
[0034] Figure 1 It is a flowchart of a bullet screen display method provided by an embodiment of the present disclosure, and this method can be executed by an electronic device. The electronic device can be exemplarily understood as a bullet screen front end (i.e., a client) such as a mobile phone, a tablet computer, a notebook computer, a desktop computer, a smart TV, etc. As Figure 1 shown, the method provided in this embodiment includes the following steps:
[0035] S110. Obtain a custom bullet screen trajectory associated with the currently playing video, where the custom bullet screen trajectory is different from the standard bullet screen trajectory. The standard bullet screen trajectory includes a horizontal bullet screen trajectory, the length of the standard bullet screen trajectory is the first length, and the length of the custom bullet screen trajectory is the second length.
[0036] Specifically, the standard bullet screen trajectory includes a horizontal bullet screen trajectory. The horizontal bullet screen trajectory is the most common bullet screen scrolling method. The bullet screen enters from the right side of the video playback window, moves to the left, and finally disappears at the edge of the playback window. The length of the horizontal bullet screen trajectory (i.e., the first length) is the sum of the width of the playback window and the length of the bullet screen.
[0037] Specifically, the custom bullet screen trajectory is different from the standard bullet screen trajectory. The custom bullet screen trajectory can support various types of bullet screen trajectories and the scrolling direction can be arbitrarily defined. From the perspective of the line type, in some examples, the custom bullet screen trajectory is a straight-line bullet screen trajectory, such as a vertical straight-line bullet screen trajectory from bottom to top, or an oblique straight-line bullet screen trajectory from the upper left to the lower right (as Figure 2 shown), etc. In other examples, the custom bullet screen trajectory is a curved bullet screen trajectory (as Figure 3 and Figure 4 shown), for example, the custom bullet screen trajectory is in the shape of a heart (asFigure 4 as shown), circular, wavy, etc. In some other examples, the custom barrage trajectory is a composite barrage trajectory of a straight line + a curve (such as Figure 5 as shown). From the perspective of the number of included line segments, the custom barrage trajectory can be a single continuous line segment or can include multiple discontinuous line segments. From the perspective of closedness, the custom barrage trajectory can be a closed trajectory (such as Figure 4 as shown), or can be a non-closed trajectory (such as Figure 2 , Figure 3 and Figure 5 as shown), and the present disclosure does not make any limitation thereto.
[0038] In some embodiments, S110 includes: in response to a user's selection operation, determining, from multiple candidate custom barrage trajectories, the custom barrage trajectory selected by the user and associated with the currently playing video. In this way, not only can the viewing needs of users who hope that the barrage trajectory is novel and interesting be satisfied, but also the custom barrage trajectory applied to the currently playing video can better meet the user's preferences.
[0039] In some other embodiments, S110 includes: S111, obtaining the first position coordinates of a plurality of pre-configured control points sent by the barrage backend.
[0040] Specifically, an operator can configure the trajectory dotting information of the custom barrage trajectory at the barrage backend (exemplarily understood as electronic devices such as mobile phones, tablets, laptops, desktops, smart TVs, etc.), where the trajectory dotting information includes the first position coordinates of a plurality of control points of the custom barrage trajectory.
[0041] S112, calculating the second position coordinates of the plurality of control points in the playback window of the currently playing video based on the first position coordinates of the plurality of control points.
[0042] In some embodiments, the first position coordinates include normalized coordinates; wherein, S112 includes: for each control point, multiplying the abscissa of its first position coordinate by the width of the playback window to obtain the abscissa of its second position coordinate, and multiplying the ordinate of its first position coordinate by the height of the playback window to obtain the ordinate of its second position coordinate.
[0043] Specifically, the barrage backend can display a canvas. In response to a first configuration operation of the operator on the canvas to configure control points (for example, clicking on several positions on the canvas), the barrage backend can obtain the original coordinates of the control points on the canvas and map the original coordinates to a standardized range to obtain the first position coordinates of the control points, and this range is usually set to be between 0 and 1.
[0044] Specifically, the playback window refers to the rectangular area used to display the video. The width of the playback window refers to the length in the horizontal direction of the playback window, that is, the distance from left to right, and the height of the playback window refers to the length in the vertical direction of the playback window, that is, the distance from top to bottom.
[0045] Specifically, the front end of the bullet screen can receive the normalized coordinates of multiple control points of the custom bullet screen trajectory sent by the back end of the bullet screen. When the aspect ratio of the canvas is the same as the aspect ratio of the video associated with the custom bullet screen trajectory, for each control point, multiply the abscissa in the normalized coordinates of the control point by the width of the playback window and multiply the ordinate by the height of the playback window to obtain the second position coordinates of the control point in the playback window. In this way, no matter how the playback window is scaled proportionally relative to the canvas, the position of the control point can be adaptively adjusted, so as to achieve a relatively consistent layout of the control point in the playback window and the canvas.
[0046] Of course, if the aspect ratio of the canvas used to create multiple control points is different from the aspect ratio of the playback window, before S113, it may further include: determining the first ratio of the width of the playback window to the width of the canvas, and determining the second ratio of the height of the playback window to the height of the canvas; for each control point, multiply the abscissa of its second position coordinates by the first ratio and multiply the ordinate of its first position coordinates by the second ratio to update the second position coordinates. In this way, it can be ensured that no matter how the playback window is scaled non-proportionally relative to the canvas, the proportional position of the control point relative to the canvas is the same as the proportional position relative to the playback window, which helps to maintain the original design of the custom bullet screen trajectory.
[0047] In some other embodiments, the first position coordinates can also be the original coordinates of the control points on the canvas. At this time, based on the width and height of the canvas and the first position coordinates of multiple control points, the second position coordinates of multiple control points in the playback window of the currently playing video can be calculated.
[0048] S113. Using a preset fitting algorithm, perform fitting based on the second position coordinates of multiple control points to obtain a custom bullet screen trajectory, where the preset fitting algorithm includes a Bezier curve algorithm, a spline interpolation algorithm, or a least squares fitting algorithm.
[0049] Specifically, the Bezier curve algorithm includes a linear Bezier curve algorithm (requiring two control points), a quadratic Bezier curve algorithm (requiring three control points), a cubic Bezier curve algorithm (requiring four control points), or a higher-order Bezier curve (requiring more control points).
[0050] Specifically, the spline interpolation algorithm uses a third-order polynomial to fit the curve between each control point, ensuring that the first and second derivatives are continuous at the nodes, so as to obtain a smooth transition.
[0051] Specifically, the least squares fitting algorithm finds the best fitting curve such that the sum of the squares of the distances from all points to this curve is minimized.
[0052] Specifically, the step method is a numerical approximation technique that estimates the total length of the custom bullet screen trajectory by discretizing the custom bullet screen trajectory into a series of short line segments.
[0053] Specifically, the integration method is based on calculus theory and accurately calculates the length of the custom bullet screen trajectory by solving the integral expression of the curve arc length.
[0054] In some embodiments, the method further includes: obtaining the creation times of multiple control points sent by the bullet screen backend; wherein, S113 includes: determining the creation order of the multiple control points according to the creation times;
[0055] In the manner that the position order of the multiple control points in the custom bullet screen trajectory is the same as the creation order of the multiple control points, using a preset fitting algorithm, fitting based on the second position coordinates of the multiple control points to obtain the custom bullet screen trajectory.
[0056] Specifically, the creation times of the multiple control points record the moments when the operators create each control point. Correspondingly, the creation order of the multiple control points records the sequence in which the operators create each control point.
[0057] Specifically, the custom bullet screen trajectory includes multiple bullet screen trajectory points (whose coordinates are the second position coordinates), and the multiple bullet screen trajectory points correspond one-to-one with the multiple control points. Among the multiple bullet screen trajectory points, "the bullet screen trajectory point corresponding to the control point created first" is the starting position of the custom bullet screen trajectory. "The bullet screen trajectory point corresponding to the control point created last" is the ending position of the custom bullet screen trajectory. The remaining bullet screen trajectory points are located in the middle of the custom bullet screen trajectory, and for the remaining bullet screen trajectory points, the earlier the corresponding control point is created, the shorter the length between it and the starting position on the custom bullet screen trajectory (i.e., the earlier the bullet screen passes through this remaining bullet screen trajectory point when scrolling along the custom bullet screen trajectory).
[0058] It can be understood that by fitting according to the creation sequence of the control points, a smooth and expected custom bullet screen trajectory can be created, increasing the predictability of the custom bullet screen trajectory.
[0059] In other embodiments, it is also possible not to rely on the creation order of the multiple control points, use a preset fitting algorithm, and fit based on the second position coordinates of the multiple control points to obtain the custom bullet screen trajectory. In this way, the positions of the bullet screen trajectory points corresponding to the control points on the custom bullet screen trajectory can be more flexible, which is beneficial to implementing more complex and non-standard shaped custom bullet screen trajectories and making the custom bullet screen trajectory smoother.
[0060] It can be understood that by configuring control points for the custom barrage trajectory on the barrage backend and recording the first position coordinates of the control points, and then the barrage frontend calculates the second position coordinates of the control points in the playback window according to the first position coordinates, so that the custom barrage trajectory can maintain a consistent and accurate position on the barrage frontends with different screen sizes.
[0061] S120. When the currently playing video plays to the first preset playback position, based on the first length and the second length, determine the mapping relationship between the standard barrage trajectory and the custom barrage trajectory.
[0062] Specifically, the operator can also configure the trajectory activity information of the custom barrage trajectory on the barrage backend. Among them, the trajectory dotting information includes the video associated with the custom barrage trajectory and the first preset playback position and the second preset playback position associated in this video. The first preset playback position refers to the playback position when the barrage starts to scroll along the custom barrage trajectory, that is, when the currently playing video plays to the first preset playback position, and the second preset playback position refers to the playback position when the barrage ends scrolling along the custom barrage trajectory, that is, when the currently playing video plays to the second preset playback position, it is necessary to switch from the custom barrage trajectory to the standard barrage trajectory. Exemplarily, the trajectory dotting information of a certain custom barrage trajectory includes video A and from 10 minutes 15 seconds to 12 minutes 20 seconds. This trajectory dotting information indicates that when video A plays from 10 minutes 15 seconds to 12 minutes 20 seconds, the barrage scrolls along the custom barrage trajectory, and at other playback positions, the barrage scrolls along the standard barrage trajectory.
[0063] Specifically, when the currently playing video plays to the first preset playback position, it is necessary to determine the mapping relationship between the standard barrage trajectory and the custom barrage trajectory. Furthermore, during the process of the currently playing video playing from the first preset playback position to the first preset playback position, at each moment of displaying the barrage, based on the current scrolling progress of the barrage (that is, if the barrage scrolls on the standard barrage trajectory, the current scrolling progress of the barrage) and the mapping relationship, determine the target scrolling position of the barrage on the custom barrage trajectory (that is, if the barrage starts scrolling on the custom barrage trajectory from the beginning, the second scrolling position of the barrage on the custom barrage trajectory when scrolling to the current scrolling progress).
[0064] Specifically, there are various specific calculation methods for the second length, which are not limited here. Optionally, use a preset length algorithm to calculate the second length of the custom barrage trajectory, where the preset length algorithm includes the step method, or the integral method, but is not limited to this.
[0065] In some embodiments, determining the mapping relationship between the standard bullet screen trajectory and the custom bullet screen trajectory based on the first length and the second length includes: if the first length is greater than the second length, truncating the standard bullet screen trajectory so that the starting position of the standard bullet screen trajectory remains unchanged and the length is shortened to the second length;
[0066] if the first length is less than the second length, extending the standard bullet screen trajectory so that the starting position of the standard bullet screen trajectory remains unchanged and the length is extended to the second length;
[0067] For each first scrolling position in the standard bullet screen trajectory, locating a second scrolling position on the custom bullet screen trajectory that is mutually mapped to the first scrolling position to obtain the mapping relationship, where the first scrolling position and the second scrolling position that are mutually mapped have the following characteristics: the length between the first scrolling position and the starting position of the standard bullet screen trajectory is equal to the length between the second scrolling position and the starting position of the custom bullet screen trajectory.
[0068] Specifically, if the first length is greater than the second length, truncate the standard bullet screen trajectory so that the standard bullet screen trajectory and the custom bullet screen trajectory have the same length. If the first length is equal to the second length, do not process the standard bullet screen trajectory. If the first length is less than the second length, extend the standard bullet screen trajectory so that the standard bullet screen trajectory and the custom bullet screen trajectory have the same length.
[0069] Specifically, when the standard bullet screen trajectory has the same length as the custom bullet screen trajectory through truncation, remaining unchanged, or extension, the standard bullet screen trajectory with a length of the second length includes multiple first scrolling positions, and the custom bullet screen trajectory with a length of the second length includes multiple second scrolling positions, and the multiple first scrolling positions and the multiple second scrolling positions correspond one by one. For the corresponding first scrolling position and the second scrolling position, "the length between the first scrolling position and the starting position of the standard bullet screen trajectory" is equal to "the length between the second scrolling position and the starting position of the custom bullet screen trajectory". That is to say, the scrolling process of the bullet screen along the standard bullet screen trajectory with a length of the second length can be expressed as the following function: (x 标 , y 标 ) = f(t 标 ), where (x 标 , y 标 ) is the first scrolling position, 0 ≤ t 标 ≤ T 标1 , t 标 = 0 corresponds to the starting position of the standard bullet screen trajectory with a length of the second length, t 标 = T 标1 corresponds to the ending position of the standard bullet screen trajectory with a length of the second length, and the scrolling process of the bullet screen along the custom bullet screen trajectory can be expressed as the following function: (x自 , y 自 ) = f(t 自 ), where (x 自 , y 自 ) is the second scrolling position, 0 ≤ t 自 ≤ T 自 , T 自 = T 标1 , t 自 = 0 corresponds to the starting position of the custom barrage trajectory, t 自 = T 自 corresponds to the ending position of the custom barrage trajectory. Establish a mapping relationship between the (x 标 = t 自 ), y 标 ), y 标 ) and (x 自 ), y 自 ) corresponding to t
[0070] It can be understood that after processing the standard barrage trajectory to have the same length as the custom barrage trajectory, for each first scrolling position in the standard barrage trajectory, a second scrolling position that maps to the first scrolling position is located on the custom barrage trajectory to obtain the mapping relationship. This allows for a direct point-to-point mapping between the two, and the mapping relationship can be obtained without a complex algorithm, reducing the computational overhead.
[0071] In some other embodiments, based on the first length and the second length, determining the mapping relationship between the standard barrage trajectory and the custom barrage trajectory includes: dividing the second length by the first length to obtain a length ratio, and for each first scrolling position in the standard barrage trajectory, locating a second scrolling position on the custom barrage trajectory that maps to the first scrolling position to obtain the mapping relationship. The following feature exists between the mutually mapped first scrolling position and the second scrolling position: "the length between the first scrolling position and the starting position of the standard barrage trajectory" is equal to "the length between the second scrolling position and the starting position of the custom barrage trajectory divided by the length ratio".
[0072] S130. Obtain the current scrolling progress of the barrage at the current moment on the standard barrage trajectory.
[0073] Specifically, in a normal scenario, the barrage scrolls along the standard barrage trajectory. When the currently playing video plays to the first preset playing position, it is expected that the barrage starts to scroll along the custom barrage trajectory. Since it involves the switching from the standard barrage trajectory to the custom barrage trajectory, during the process of the currently playing video playing from the first preset playing position to the second preset playing position, at each moment when the barrage is displayed, it is necessary to obtain the current scrolling progress of the barrage, so as to subsequently determine the target scrolling position of the barrage on the custom barrage trajectory when it scrolls to the current scrolling progress based on the current scrolling progress and the mapping relationship, and then display the barrage at the target scrolling position, realizing the switching of the barrage from the standard barrage trajectory to the custom barrage trajectory.
[0074] Specifically, when the currently playing video plays to the first preset playing position, the current scrolling progress refers to the progress of the barrage actually scrolling on the standard trajectory; during the process of the currently playing video playing from after the first preset playing position to the second preset playing position, the current scrolling progress refers to the progress that the barrage theoretically scrolls if it continues to scroll on the standard trajectory.
[0075] In some embodiments, the current scrolling progress includes the current scrolling duration, where the current scrolling duration is the total duration that the barrage has scrolled through. Exemplarily, as of the current moment, the barrage has scrolled for 3 seconds on the standard barrage trajectory, then the current scrolling duration is 3 seconds.
[0076] In some other embodiments, the current scrolling progress includes the current scrolling length, where the current scrolling length is the total length (or total distance) that the barrage has scrolled through. Exemplarily, as of the current moment, the barrage has scrolled 3 centimeters on the standard barrage trajectory, then the current scrolling length is 3 centimeters.
[0077] In still some other embodiments, the current scrolling progress includes the current scrolling position, where the current scrolling position is the coordinate of the barrage on the standard barrage trajectory at present. Specifically, the scrolling process of the barrage along the standard barrage trajectory with a length of the first length can be expressed as the following function: (x 标 , y 标 ) = f(t 标 ), where 0 ≤ t 标 ≤ T 标 , the total time taken for the barrage to scroll from the starting position to the ending position of the standard barrage trajectory is T 标 , (x 标 , y 标 ) is the coordinate of the barrage on the standard barrage trajectory at time t 标 . Exemplarily, as of the current moment, the barrage has scrolled for 3 seconds on the standard barrage trajectory, then the current scrolling position is f(3).
[0078] S140. Determine the target scrolling position of the bullet screen when it scrolls to the current scrolling progress on the custom bullet screen trajectory based on the current scrolling progress and the mapping relationship.
[0079] Specifically, based on the current scrolling progress and the mapping relationship, the switching between the standard bullet screen trajectory and the custom bullet screen trajectory can be achieved through trajectory mapping. Since the lengths of the standard bullet screen trajectory and the custom bullet screen trajectory may not be exactly the same, different processing needs to be carried out for different scenarios during trajectory mapping. The following conducts trajectory mapping for three scenarios: the first length is greater than the second length, the first length is equal to the second length, and the first length is less than the second length.
[0080] In some embodiments, S140 includes: if the first length is greater than the second length, based on the current scrolling duration, determine the current scrolling position of the bullet screen on the standard bullet screen trajectory and the current scrolling length that has been scrolled through;
[0081] If the current scrolling length is greater than or equal to the second length, stop displaying the bullet screen;
[0082] If the current scrolling length is less than the second length, based on the mapping relationship, use the corresponding second scrolling position of the current scrolling position as the target scrolling position.
[0083] Specifically, as described above, the scrolling process of the bullet screen along the standard bullet screen trajectory with a length of the first length can be expressed as the following function: (x 标 , y 标 ) = f(t 标 ), where 0 ≤ t 标 ≤ T 标 . Substituting the current scrolling duration into the above function can obtain the current scrolling position, and then the current scrolling length can be obtained based on the current scrolling position.
[0084] Specifically, if the first length is greater than the second length, the standard bullet screen trajectory can be divided into a first segment and a second segment. The length of the first segment is the second length. One end of the first segment is at the starting position of the standard bullet screen trajectory and the other end is at the splitting point position. The length of the second segment is (the first length minus the second length). One end of the second segment is at the splitting point position and the other end is at the ending position of the standard bullet screen trajectory. There is a mapping relationship between the first segment and the custom bullet screen trajectory, and the total time taken for the bullet screen to scroll on the first segment is equal to the total time taken for the bullet screen to scroll on the custom bullet screen trajectory.
[0085] Specifically, if the current scrolling length is greater than or equal to the second length, it indicates that the bullet screen is on the second segment and cannot be mapped to the custom bullet screen trajectory. At this time, the display of the bullet screen is stopped. Of course, in some other examples, if the current scrolling length is greater than or equal to the second length, the bullet screen can also be hidden, that is, the bullet screen is not mapped to the custom bullet screen trajectory. Starting from the first preset playback position, the bullet screen is controlled to still scroll along the standard bullet screen trajectory in a way that hides the bullet screen (or the bullet screen is in a transparent state) until the current playing video plays to the second preset playback position or scrolls to the end position of the standard bullet screen trajectory. If the bullet screen has not scrolled to the end position of the standard bullet screen trajectory when the current playing video plays to the second preset playback position, the bullet screen is controlled to scroll along the standard bullet screen trajectory until it scrolls to the end position of the standard bullet screen trajectory, so as to realize the switching back from the custom bullet screen trajectory to the standard bullet screen trajectory.
[0086] Specifically, if the current scrolling length is less than the second length, it indicates that the bullet screen is on the first segment and can be mapped to the custom bullet screen trajectory. At this time, the corresponding second scrolling position of the current scrolling position is used as the target scrolling position. Of course, in some other examples, since the scrolling process of the bullet screen along the custom bullet screen trajectory can be expressed as the following function: (x 自 , y 自 ) = f(t 自 ), where 0 ≤ t 自 ≤ T 自 , the bullet screen takes a total of T 自 to scroll from the starting position to the ending position of the custom bullet screen trajectory. (x 自 , y 自 ) is the coordinate of the bullet screen on the custom bullet screen trajectory at time t 自 . Substituting the current scrolling duration into the above function can obtain the target scrolling position. Starting from the first preset playback position, the bullet screen is controlled to scroll along the custom bullet screen trajectory until the current playing video plays to the second preset playback position or scrolls to the end position of the custom bullet screen trajectory. Of course, if the bullet screen has not scrolled to the end position of the custom bullet screen trajectory when the current playing video plays to the second preset playback position, the scrolling duration of the bullet screen on the custom bullet screen trajectory is obtained, and this scrolling duration is substituted into (x 标 , y 标 ) = f(t 标 ) to obtain the scrolling position when switching back to the standard bullet screen trajectory. The bullet screen is displayed at this scrolling position, and the bullet screen is controlled to scroll along the standard bullet screen trajectory until it scrolls to the end position of the standard bullet screen trajectory, so as to realize the switching back from the custom bullet screen trajectory to the standard bullet screen trajectory.
[0087] In some other embodiments, S140 includes: if the first length is less than or equal to the second length, based on the current scrolling duration, determine the current scrolling position of the bullet screen on the standard bullet screen trajectory;
[0088] Based on the mapping relationship, use the second scrolling position corresponding to the current scrolling position as the target scrolling position.
[0089] Specifically, if the first length is equal to the second length, it indicates that the total time taken for the bullet screen to scroll on the standard bullet screen trajectory is equal to the total time taken for the bullet screen to scroll on the custom bullet screen trajectory. Regardless of the position of the bullet screen on the standard bullet screen trajectory, it can be mapped to the custom bullet screen trajectory. At this time, use the second scrolling position corresponding to the current scrolling position as the target scrolling position. Of course, in some other examples, the current scrolling duration can also be substituted into (x 自 , y 自 ) = f(t 自 ) to obtain the target scrolling position. Starting from the first preset playback position, control the bullet screen to scroll along the custom bullet screen trajectory until the current playing video plays to the second preset playback position or scrolls to the end position of the custom bullet screen trajectory. Of course, if the bullet screen has not scrolled to the end position of the custom bullet screen trajectory when the current playing video plays to the second preset playback position, then obtain the scrolling duration of the bullet screen on the custom bullet screen trajectory, substitute this scrolling duration into (x 标 , y 标 ) = f(t 标 ) to obtain the scrolling position when switching back to the standard bullet screen trajectory, display the bullet screen at this scrolling position, and control the bullet screen to scroll along the standard bullet screen trajectory until it scrolls to the end position of the standard bullet screen trajectory, thereby realizing the switch from the custom bullet screen trajectory back to the standard bullet screen trajectory.
[0090] Specifically, if the first length is less than the second length, since the total time taken for the bullet screen to scroll on the standard bullet screen trajectory is less than the total time taken for the bullet screen to scroll on the custom bullet screen trajectory, it is necessary to extend the length of the standard bullet screen trajectory to the second length, so that the total time taken for the bullet screen to scroll on the extended standard bullet screen trajectory is equal to the total time taken for the bullet screen to scroll on the custom bullet screen trajectory. Regardless of the position of the bullet screen on the extended standard bullet screen trajectory, it can be mapped to the custom bullet screen trajectory. Specifically, the standard bullet screen trajectory can be divided into a third segment and a fourth segment. The length of the third segment is the first length. One end of the third segment is at the starting position of the standard bullet screen trajectory and the other end is at the splitting point position (i.e., the original end position of the standard bullet screen trajectory). The length of the fourth segment is (the second length minus the first length). One end of the fourth segment is at the splitting point position and the other end is at the new end position of the standard bullet screen trajectory. At this time, the scrolling process of the bullet screen along the extended standard bullet screen trajectory can be updated to the following function: (x 标 , y 标 ) = f(t 标 ), where 0 ≤ t 标 ≤ T 标1 , T 标1 > T标 where \(0\leq t\) 标 \(\leq T\) 标 corresponding to the third paragraph, \(T\) 标 \(\leq t\) 标 \(\leq T\) 标1 corresponding to the fourth paragraph.
[0091] Specifically, the second scrolling position corresponding to the current scrolling position is taken as the target scrolling position. Of course, in some other examples, the current scrolling duration can also be substituted into \((x\) 自 , y 自 ) = f(t 自 ) to obtain the target scrolling position. Starting from the first preset playback position, control the bullet screen to scroll along the custom bullet screen trajectory until the current playing video plays to the second preset playback position or scrolls to the end position of the custom bullet screen trajectory. Of course, if when the current playing video plays to the second preset playback position, the bullet screen has not scrolled to the end position of the custom bullet screen trajectory, then obtain the scrolling duration of the bullet screen on the custom bullet screen trajectory, substitute this scrolling duration into \((x\) 标 , y 标 ) = f(t 标 ) to obtain the scrolling position when switching back to the extended standard bullet screen trajectory, display the bullet screen at this scrolling position, and control the bullet screen to scroll along the extended standard bullet screen trajectory until it scrolls to the end position of the extended standard bullet screen trajectory, thereby realizing the switch from the custom bullet screen trajectory to the standard bullet screen trajectory.
[0092] S150. Display the bullet screen at the target scrolling position.
[0093] Specifically, during the process of the current playing video playing from the first preset playback position to the first preset playback position, at each moment when the bullet screen is displayed, display the bullet screen at the target scrolling position corresponding to this moment.
[0094] Optionally, the method further includes: for each text in the bullet screen, if the text scrolls to the end position of the custom bullet screen trajectory, stop displaying the text.
[0095] It can be understood that in some bullet screen display scenarios, the custom bullet screen trajectory may be a closed trajectory. If the displayed bullet screen text is long (for example, in extreme cases, the length of the bullet screen itself > the second length), it may occur that the bullet screen that has already completed one circle will continue to run along the same trajectory, resulting in the situation where the text of the bullet screens overlaps each other. By setting that when the text of the bullet screen scrolls to the end position of the custom bullet screen trajectory, stop displaying the text, the situation where the text of the bullet screens overlaps each other can be improved.
[0096] In the embodiments of the present disclosure, considering that when switching between the standard bullet screen trajectory and the custom bullet screen trajectory by other methods, it may be necessary to make the standard bullet screen trajectory and the custom bullet screen trajectory mutually exclusive. For example, when the currently playing video reaches the first preset playing position, the bullet screens scrolling along the standard bullet screen trajectory need to be hidden, and then the bullet screens start to scroll from the starting position of the custom bullet screen trajectory. However, in the embodiments of the present disclosure, the switching between the standard bullet screen trajectory and the custom bullet screen trajectory is achieved by means of trajectory mapping, so that the bullet screens continue to scroll normally at the current scrolling progress, but only map the bullet screens from the standard bullet screen trajectory to the custom bullet screen trajectory. In this way, the trajectory switching can be achieved simply by applying the mapping relationship, reducing the computational overhead of switching between the standard bullet screen trajectory and the custom bullet screen trajectory, improving the switching efficiency, and the switching effect is relatively smooth, avoiding sudden jumps or discontinuities.
[0097] In another embodiment of the present disclosure, when displaying bullet screens, the display special effects of the bullet screens include at least one of the following: the text of the bullet screen gradually enlarges or gradually shrinks during the scrolling process;
[0098] the text of the bullet screen fades in at the starting position of the bullet screen trajectory and fades out at the ending position;
[0099] the text order of the bullet screen is a preset text order, and the preset text order includes forward order and / or reverse order;
[0100] the text direction of the bullet screen is a preset text direction, and the preset text direction includes the gravity direction, the normal direction, the reverse normal direction, the tangent direction, and / or the reverse tangent direction.
[0101] In the embodiments of the present disclosure, when the bullet screens scroll along the standard bullet screen trajectory and / or the custom bullet screen trajectory, the display special effects of the bullet screens can include any one of the above.
[0102] Specifically, when the text of the bullet screen gradually enlarges or gradually shrinks during the scrolling process, it supports the operation staff to specify the scaling ratios at the starting position and the ending position of the bullet screen trajectory at the back end of the bullet screen. Exemplarily, at the starting position, startScale = 0.5, and at the ending position, endScale = 2.0, then the bullet screen will be evenly enlarged from 0.5 times to 2 times during the process of scrolling along the bullet screen trajectory.
[0103] Specifically, the fact that the text of the bullet screen fades in at the starting position of the bullet screen trajectory and fades out at the ending position means that the bullet screen fades in when it appears and fades out when it disappears. It is used for the scenario where both the starting position and the ending position of the bullet screen trajectory are on the screen, reducing the abruptness of the appearance and disappearance of the bullet screen and optimizing the display effect.
[0104] Specifically, the text order of the bullet screen refers to the arrangement order of the text in the bullet screen. Exemplarily, when using a custom bullet screen trajectory and the custom bullet screen trajectory is a vertical bullet screen trajectory, that is, the bullet screen scrolls from top to bottom, if the text order of the bullet screen is in the forward order, the user needs to read the bullet screen from bottom to top, which affects the viewing experience. Therefore, it is supported to configure the text order of the bullet screen, and the text order of the bullet screen can be set to the reverse order.
[0105] Specifically, the text direction of the bullet screen refers to the positive direction of the text in the bullet screen. Exemplarily, Figure 6 is a schematic diagram of a preset text direction provided by an embodiment of the present disclosure. As Figure 6 shown, the preset text direction may include the gravity direction, the reverse normal direction, the normal direction, the tangent direction, and the reverse tangent direction. Among them, the gravity direction means that the positive direction of the text coincides with the gravity direction, that is, the text looks upright; the reverse normal direction means that at the position of the bullet screen on the bullet screen trajectory, the tangent has a normal, and the positive direction of the text coincides with the reverse normal direction; the normal direction means that at the position of the bullet screen on the bullet screen trajectory, the tangent has a normal, and the positive direction of the text coincides with the normal direction; the tangent direction means that at the position of the bullet screen on the bullet screen trajectory, the tangent has a tangent, and the positive direction of the text coincides with the tangent direction; the reverse tangent direction means that at the position of the bullet screen on the bullet screen trajectory, the tangent has a tangent, and the positive direction of the text coincides with the reverse tangent direction.
[0106] It can be understood that by setting the display special effects of the bullet screen, the gameplay of the bullet screen can be enriched, the display effect of the bullet screen can be enhanced, and the user experience can be further improved.
[0107] Next, a specific example is used to detail the bullet screen display method provided by the embodiments of the present disclosure. Exemplarily, Figure 7 is a schematic structural diagram of a bullet screen display system provided by an embodiment of the present disclosure. As Figure 7As shown in the figure, the bullet screen display system includes a bullet screen backend and a bullet screen frontend. The operator can configure the trajectory dotting information and trajectory activity information (including the first preset playback position and the second preset playback position) of the custom bullet screen trajectory through the bullet screen backend. The bullet screen frontend can obtain and parse the trajectory dotting information and trajectory activity information configured by the operator, generate a custom bullet screen trajectory by fitting according to the trajectory dotting information, and then calculate the length of the custom bullet screen trajectory. Then, when the video is played to the first preset playback position, according to the length of the standard bullet screen trajectory and the length of the custom bullet screen trajectory, the bullet screen is mapped from the standard bullet screen trajectory to the custom bullet screen trajectory through trajectory mapping, so as to realize the switching from the standard bullet screen trajectory to the custom bullet screen trajectory. Then, before the video is played to the second preset playback position, the bullet screen scrolls along the custom bullet screen trajectory. When the video is played to the second preset playback position, according to the length of the standard bullet screen trajectory and the length of the custom bullet screen trajectory, the bullet screen is mapped from the custom bullet screen trajectory to the standard bullet screen trajectory through trajectory mapping, so as to realize the switching from the custom bullet screen trajectory to the standard bullet screen trajectory. And when displaying the bullet screen, the display special effects of the bullet screen include at least one of the following: the text of the bullet screen gradually enlarges or gradually shrinks during the scrolling process; the text of the bullet screen fades in at the starting position of the bullet screen trajectory and fades out at the ending position; the text order of the bullet screen is the preset text order; the text direction of the bullet screen is the preset text direction. In the embodiments of the present disclosure, based on trajectory mapping, a set of solutions for bullet screen trajectory switching and various bullet screen display special effects are realized, which support the operator to flexibly and quickly configure the scrolling effect of the bullet screen on a certain plot screen, make the bullet screen display fit the video plot screen, bring a novel and interesting viewing experience to the user, and increase user stickiness.
[0108] Figure 8 FIG. is a schematic structural diagram of a bullet screen display device provided by an embodiment of the present disclosure. The bullet screen display device can be understood as the above-mentioned electronic device or some functional modules in the above-mentioned electronic device. As Figure 8 shown, the bullet screen display device includes:
[0109] A first acquisition module 810, configured to acquire a custom bullet screen trajectory associated with the currently played video, where the custom bullet screen trajectory is different from a standard bullet screen trajectory, the standard bullet screen trajectory includes a horizontal bullet screen trajectory, the length of the standard bullet screen trajectory is a first length, and the length of the custom bullet screen trajectory is a second length;
[0110] A first determination module 820, configured to determine a mapping relationship between the standard bullet screen trajectory and the custom bullet screen trajectory based on the first length and the second length when the currently played video is played to a first preset playback position;
[0111] A second acquisition module 830, configured to acquire a current scrolling progress of the bullet screen on the standard bullet screen trajectory at the current moment;
[0112] A second determination module 840, configured to determine a target scrolling position of the bullet screen when scrolling to the current scrolling progress on the custom bullet screen track based on the current scrolling progress and the mapping relationship;
[0113] A first display module 850, configured to display the bullet screen at the target scrolling position.
[0114] Optionally, the first determination module 820 is specifically configured to, when the currently playing video plays to a first preset playing position, calculate the second length of the custom bullet screen track by using a preset length algorithm, where the preset length algorithm includes a step method or an integration method;
[0115] If the first length is greater than the second length, truncate the standard bullet screen track so that the starting position of the standard bullet screen track remains unchanged and the length is shortened to the second length;
[0116] If the first length is less than the second length, extend the standard bullet screen track so that the starting position of the standard bullet screen track remains unchanged and the length is extended to the second length;
[0117] For each first scrolling position in the standard bullet screen track, locate a second scrolling position on the custom bullet screen track that is mapped to the first scrolling position to obtain the mapping relationship, where the first scrolling position and the second scrolling position that are mapped to each other have the following characteristics: the length between the first scrolling position and the starting position of the standard bullet screen track is equal to the length between the second scrolling position and the starting position of the custom bullet screen track.
[0118] Optionally, the current scrolling progress includes a current scrolling duration, where the current scrolling duration is the total duration that the bullet screen has scrolled.
[0119] Optionally, the second determination module 840 is specifically configured to, if the first length is greater than the second length, determine the current scrolling position and the current scrolling length that the bullet screen has scrolled on the standard bullet screen track based on the current scrolling duration;
[0120] If the current scrolling length is greater than or equal to the second length, stop displaying the bullet screen;
[0121] If the current scrolling length is less than the second length, based on the mapping relationship, use the second scrolling position corresponding to the current scrolling position as the target scrolling position.
[0122] Optionally, the second determination module 840 is specifically configured to, if the first length is less than or equal to the second length, determine the current scrolling position of the bullet screen on the standard bullet screen trajectory based on the current scrolling duration;
[0123] Based on the mapping relationship, use the second scrolling position corresponding to the current scrolling position as the target scrolling position.
[0124] Optionally, the device further includes: a stop display module, configured to, for each piece of text in the bullet screen, stop displaying the text if the text scrolls to the end position of the custom bullet screen trajectory.
[0125] The first acquisition module 810 includes: a first acquisition sub-module, configured to acquire the first position coordinates of a plurality of pre-configured control points sent by the bullet screen backend;
[0126] a first calculation sub-module, configured to calculate the second position coordinates of the plurality of control points in the playback window of the currently played video based on the first position coordinates of the plurality of control points;
[0127] a first fitting sub-module, configured to use a preset fitting algorithm to perform fitting based on the second position coordinates of the plurality of control points to obtain the custom bullet screen trajectory, where the preset fitting algorithm includes a Bezier curve algorithm, a spline interpolation algorithm, or a least squares fitting algorithm.
[0128] Optionally, the first position coordinates include normalized coordinates;
[0129] Among them, the first calculation sub-module is specifically configured to, for each of the control points, multiply the abscissa of its first position coordinate by the width of the playback window to obtain the abscissa of its second position coordinate, and multiply the ordinate of its first position coordinate by the height of the playback window to obtain the ordinate of its second position coordinate.
[0130] Optionally, the device further includes: a first update module, configured to, if the aspect ratio of the canvas used to create the plurality of control points is different from the aspect ratio of the playback window, before the method uses the preset fitting algorithm to perform fitting based on the second position coordinates of the plurality of control points to obtain the custom bullet screen trajectory, determine a first ratio of the width of the playback window to the width of the canvas, and determine a second ratio of the height of the playback window to the height of the canvas;
[0131] For each of the control points, multiply the abscissa of its second position coordinate by the first ratio, and multiply the ordinate of its first position coordinate by the second ratio to update the second position coordinate.
[0132] Optionally, the device further includes: a second acquisition module 830, configured to acquire the creation time of the plurality of control points sent by the bullet screen backend;
[0133] Wherein, the first fitting sub-module is specifically configured to determine the creation order of the plurality of control points according to the creation time;
[0134] In the manner that the position order of the plurality of control points in the custom bullet screen trajectory is the same as the creation order of the plurality of control points, use a preset fitting algorithm to perform fitting based on the second position coordinates of the plurality of control points to obtain the custom bullet screen trajectory.
[0135] Optionally, the device further includes a first special effect module, configured to when displaying the bullet screen, the display special effects of the bullet screen include at least one of the following:
[0136] The text of the bullet screen gradually enlarges or gradually shrinks during the scrolling process;
[0137] The text of the bullet screen fades in at the starting position of the bullet screen trajectory and fades out at the ending position;
[0138] The text order of the bullet screen is a preset text order, and the preset text order includes forward order and / or reverse order;
[0139] The text direction of the bullet screen is a preset text direction, and the preset text direction includes the gravity direction, the normal direction, the reverse normal direction, the tangent direction, and / or the reverse tangent direction.
[0140] The device provided in this embodiment can execute the method of any of the above embodiments, and its execution manner and beneficial effects are similar, which will not be elaborated here.
[0141] This embodiment of the present disclosure further provides an electronic device, which includes: a memory, in which a computer program is stored; a processor, configured to execute the computer program, and when the computer program is executed by the processor, the method of any of the above embodiments can be implemented.
[0142] Exemplarily, Figure 9 is a schematic structural diagram of an electronic device in this embodiment of the present disclosure. Specifically refer to the following Figure 9 , which shows a schematic structural diagram of an electronic device 900 suitable for implementing the present disclosure. The electronic device 900 in this embodiment of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Tablet Computers), PMPs (Portable Multimedia Players), in-vehicle terminals (such as in-vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 9The electronic device shown is merely an example and should not impose any limitations on the functions and scope of use of the embodiments of the present disclosure.
[0143] As Figure 9 shown, the electronic device 900 may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 901, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 902 or the program loaded from the storage device 908 into the random access memory (RAM) 903. In the RAM 903, various programs and data required for the operation of the electronic device 900 are also stored. The processing device 901, the ROM 902, and the RAM 903 are connected to each other through a bus 904. The input / output (I / O) interface 905 is also connected to the bus 904.
[0144] Generally, the following devices may be connected to the I / O interface 905: an input device 906 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 907 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 908 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 909. The communication device 909 may allow the electronic device 900 to communicate with other devices wirelessly or wiredly to exchange data. Although Figure 9 the electronic device 900 with various devices is shown, it should be understood that it is not required to implement or include all the shown devices. More or fewer devices may be alternatively implemented or included.
[0145] In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, the embodiments of the present disclosure include a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes program codes for performing the methods shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from the network through the communication device 909, or installed from the storage device 908, or installed from the ROM 902. When the computer program is executed by the processing device 901, the above functions defined in the methods of the embodiments of the present disclosure are executed.
[0146] It should be noted that the above-mentioned computer-readable medium in the present disclosure can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer-readable storage medium can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium can be any tangible medium that contains or stores a program, and this program can be used by or in combination with an instruction execution system, apparatus, or device. In the present disclosure, a computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, and this computer-readable signal medium can send, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0147] In some embodiments, the client and the server can communicate using any currently known or future-developed network protocol such as HTTP (HyperText Transfer Protocol), and can be interconnected with digital data communication in any form or medium (for example, a communication network). Examples of communication networks include local area networks ("LAN"), wide area networks ("WAN"), the Internet (for example, the Internet), and end-to-end networks (for example, ad hoc end-to-end networks), as well as any currently known or future-developed networks.
[0148] The above-mentioned computer-readable medium can be included in the above-mentioned electronic device; it can also exist separately without being assembled into the electronic device.
[0149] The above computer-readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: obtain a custom bullet screen trajectory associated with the currently playing video, where the custom bullet screen trajectory is different from the standard bullet screen trajectory, the standard bullet screen trajectory includes a horizontal bullet screen trajectory, the length of the standard bullet screen trajectory is a first length, and the length of the custom bullet screen trajectory is a second length; when the currently playing video plays to a first preset playing position, determine a mapping relationship between the standard bullet screen trajectory and the custom bullet screen trajectory based on the first length and the second length; obtain the current scrolling progress of the bullet screen on the standard bullet screen trajectory at the current moment; determine the target scrolling position when the bullet screen scrolls to the current scrolling progress on the custom bullet screen trajectory based on the current scrolling progress and the mapping relationship; and display the bullet screen at the target scrolling position.
[0150] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or combinations thereof. The programming languages include, but are not limited to, object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0151] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code that contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and the combinations of blocks in the block diagram and / or flowchart, may be implemented by a dedicated hardware-based system for performing the specified functions or operations, or may be implemented by a combination of dedicated hardware and computer instructions.
[0152] The units involved in the embodiments of the present disclosure can be implemented in software or in hardware. In some cases, the name of a unit does not constitute a limitation on the unit itself.
[0153] The functions described above herein can be performed, at least in part, by one or more hardware logic components. By way of example, and without limitation, the types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0154] In the context of the present disclosure, a machine-readable medium may be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0155] The embodiments of the present disclosure also provide a computer-readable storage medium having stored therein a computer program which, when executed by a processor, can implement the method of any of the foregoing embodiments, and the execution manner and beneficial effects are similar and will not be elaborated herein.
[0156] It should be noted that, in this document, relational terms such as "first" and "second" are used solely to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual such relationship or order between these entities or operations. Moreover, the terms "comprises", "comprising", or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a series of elements includes not only those elements, but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising a..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that comprises the element.
[0157] The above are only specific embodiments of the present disclosure, enabling those skilled in the art to understand or implement the present disclosure. Various modifications to these embodiments will be obvious to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to these embodiments described herein, but rather will be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A bullet screen display method, characterized in that: include: Obtain a custom bullet screen track associated with the currently playing video, wherein the custom bullet screen track is different from a standard bullet screen track, the standard bullet screen track includes a horizontal bullet screen track, the length of the standard bullet screen track is a first length, and the length of the custom bullet screen track is a second length; When the currently played video is played to a first preset play position, determining a mapping relationship between the standard bullet screen track and the custom bullet screen track based on the first length and the second length; Get the current scrolling progress of the bullet screen on the standard bullet screen track at the current moment; Based on the current scrolling progress and the mapping relationship, determining a target scrolling position when the bullet screen scrolls to the current scrolling progress on the custom bullet screen track; The bullet screen is displayed at the target scrolling position.
2. The method according to claim 1, characterized in that The determining, based on the first length and the second length, a mapping relationship between the standard bullet screen trajectory and the custom bullet screen trajectory includes: Calculate the second length of the custom bullet comment trajectory using a preset length algorithm, wherein the preset length algorithm includes a step method or an integral method; If the first length is greater than the second length, truncating the standard bullet chat track so that the starting position of the standard bullet chat track remains unchanged and the length is shortened to the second length; If the first length is less than the second length, extending the standard bullet screen trajectory so that the starting position of the standard bullet screen trajectory remains unchanged and the length is extended to the second length; For each first scrolling position in the standard barrage trajectory, a second scrolling position mapped to the first scrolling position is located on the custom barrage trajectory to obtain the mapping relationship, wherein the first scrolling position and the second scrolling position mapped to each other have the following characteristics: the length between the first scrolling position and the starting position of the standard barrage trajectory is equal to the length between the second scrolling position and the starting position of the custom barrage trajectory.
3. The method according to claim 2, characterized in that The current scrolling progress includes the current scrolling duration, wherein the current scrolling duration is the total duration that the bullet screen has scrolled.
4. The method according to claim 3, characterized in that The determining, based on the current scrolling progress and the mapping relationship, a target scrolling position when the bullet screen scrolls on the custom bullet screen track to the current scrolling progress includes: If the first length is greater than the second length, determining the current scrolling position of the bullet screen on the standard bullet screen track and the current scrolling length that has been scrolled based on the current scrolling duration; If the current scrolling length is greater than or equal to the second length, stop displaying the bullet screen; If the current scrolling length is less than the second length, based on the mapping relationship, the second scrolling position corresponding to the current scrolling position is used as the target scrolling position.
5. The method according to claim 3, characterized in that: The determining, based on the current scrolling progress and the mapping relationship, a target scrolling position when the bullet screen scrolls on the custom bullet screen track to the current scrolling progress includes: If the first length is less than or equal to the second length, determining a current scrolling position of the bullet screen on the standard bullet screen track based on the current scrolling duration; Based on the mapping relationship, a second scrolling position corresponding to the current scrolling position is used as the target scrolling position.
6. The method according to claim 1, characterized in that The method further comprises: For each text in the bullet screen, if the text scrolls to the end position of the custom bullet screen track, stop displaying the text.
7. The method according to claim 1, characterized in that The step of obtaining the custom bullet screen track associated with the currently playing video includes: Obtain the first position coordinates of multiple pre-configured control points sent by the bullet screen backend; Calculating second position coordinates of the multiple control points in the playback window of the currently playing video based on the first position coordinates of the multiple control points; Using a preset fitting algorithm, fitting is performed based on the second position coordinates of the multiple control points to obtain the custom barrage trajectory, wherein the preset fitting algorithm includes a Bezier curve algorithm, a spline interpolation algorithm, or a least squares fitting algorithm.
8. The method according to claim 7, characterized in that The first position coordinates include normalized coordinates; The step of calculating the second position coordinates of the multiple control points in the playback window of the currently playing video based on the first position coordinates of the multiple control points includes: For each control point, the horizontal coordinate of its first position coordinate is multiplied by the width of the playback window to obtain the horizontal coordinate of its second position coordinate, and the vertical coordinate of its first position coordinate is multiplied by the height of the playback window to obtain the vertical coordinate of its second position coordinate.
9. The method according to claim 7, characterized in that: If the aspect ratio of the canvas used to create the multiple control points is different from the aspect ratio of the playback window, before using a preset fitting algorithm to fit the second position coordinates of the multiple control points to obtain the custom bullet screen trajectory, the method further includes: Determining a first ratio of a width of the playback window to a width of the canvas, and determining a second ratio of a height of the playback window to a height of the canvas; For each of the control points, the abscissa of the second position coordinate is multiplied by the first ratio, and the ordinate of the first position coordinate is multiplied by the second ratio, so as to update the second position coordinate.
10. The method according to claim 7, characterized in that The method further comprises: Obtaining the creation time of the multiple control points sent by the bullet screen backend; The step of using a preset fitting algorithm to fit the second position coordinates of the plurality of control points to obtain the custom bullet screen trajectory includes: Determining a creation order of the plurality of control points according to the creation time; In such a manner that the position order of the multiple control points in the custom barrage trajectory is the same as the creation order of the multiple control points, a preset fitting algorithm is used to perform fitting based on the second position coordinates of the multiple control points to obtain the custom barrage trajectory.
11. The method according to any one of claims 1 to 10, characterized in that: The method further includes: when displaying the bullet screen, the display special effect of the bullet screen includes at least one of the following: The text of the bullet screen is gradually enlarged or reduced during the scrolling process; The text of the bullet screen gradually appears at the starting position of the bullet screen track and gradually disappears at the ending position; The text order of the bullet comments is a preset text order, and the preset text order includes ascending order and / or descending order; The text direction of the bullet screen is a preset text direction, and the preset text direction includes a gravity direction, a normal direction, a normal opposite direction, a tangent direction and / or a tangent opposite direction.
12. A bullet screen display device, characterized in that: include: A first acquisition module is used to acquire a custom bullet screen track associated with a currently playing video, wherein the custom bullet screen track is different from a standard bullet screen track, the standard bullet screen track includes a horizontal bullet screen track, the length of the standard bullet screen track is a first length, and the length of the custom bullet screen track is a second length; A first determining module, configured to determine, when the currently playing video is played to a first preset playing position, a mapping relationship between the standard bullet screen track and the custom bullet screen track based on the first length and the second length; The second acquisition module is used to obtain the current scrolling progress of the bullet screen on the standard bullet screen track at the current moment; A second determination module is used to determine, based on the current scrolling progress and the mapping relationship, a target scrolling position when the bullet screen scrolls on the custom bullet screen track to the current scrolling progress; The first display module is used to display the bullet screen at the target scrolling position.
13. An electronic device, characterized in that: include: A processor and a memory, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor executes the method according to any one of claims 1 to 11.
14. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 11 is implemented.