WO2021103363A1 - 弹幕呈现方法和系统 - Google Patents

弹幕呈现方法和系统 Download PDF

Info

Publication number
WO2021103363A1
WO2021103363A1 PCT/CN2020/081490 CN2020081490W WO2021103363A1 WO 2021103363 A1 WO2021103363 A1 WO 2021103363A1 CN 2020081490 W CN2020081490 W CN 2020081490W WO 2021103363 A1 WO2021103363 A1 WO 2021103363A1
Authority
WO
WIPO (PCT)
Prior art keywords
barrage
data
launched
content
barrage data
Prior art date
Application number
PCT/CN2020/081490
Other languages
English (en)
French (fr)
Inventor
武修然
谭兆歆
Original Assignee
上海哔哩哔哩科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 上海哔哩哔哩科技有限公司 filed Critical 上海哔哩哔哩科技有限公司
Priority to US17/778,784 priority Critical patent/US11924503B2/en
Publication of WO2021103363A1 publication Critical patent/WO2021103363A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/431Generation of visual interfaces for content selection or interaction; Content or additional data rendering
    • H04N21/4312Generation of visual interfaces for content selection or interaction; Content or additional data rendering involving specific graphical features, e.g. screen layout, special fonts or colors, blinking icons, highlights or animations
    • H04N21/4316Generation of visual interfaces for content selection or interaction; Content or additional data rendering involving specific graphical features, e.g. screen layout, special fonts or colors, blinking icons, highlights or animations for displaying supplemental content in a region of the screen, e.g. an advertisement in a separate window
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/431Generation of visual interfaces for content selection or interaction; Content or additional data rendering
    • H04N21/4312Generation of visual interfaces for content selection or interaction; Content or additional data rendering involving specific graphical features, e.g. screen layout, special fonts or colors, blinking icons, highlights or animations
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/485End-user interface for client configuration
    • H04N21/4858End-user interface for client configuration for modifying screen layout parameters, e.g. fonts, size of the windows
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/488Data services, e.g. news ticker
    • H04N21/4884Data services, e.g. news ticker for displaying subtitles

Definitions

  • the embodiments of the present application relate to the field of communications, and in particular to a method, system, computer device, and computer-readable storage medium for presenting a bullet screen.
  • Barrage refers to the presentation of commentary text, emoticons, patterns, etc. at the same time when the video is presented.
  • barrage has become an important element for many viewers to watch videos and live broadcasts. It not only enables users to express their feelings about watching programs, but also enables users to watch other users' comments on programs, and realizes the interactivity of users when watching videos.
  • the inventor realizes that the current barrage may be affected by the network environment, and there is a problem of poor barrage playback.
  • the purpose of the embodiments of this application is to provide a bullet screen presentation method, system, computer equipment, and computer-readable storage medium, which are used to solve the current bullet screen may be affected by the network environment, and the bullet screen playback effect appears. Poor problem.
  • One aspect of the embodiments of the present application provides a method for presenting a bullet screen, including: acquiring a video playback page; acquiring a plurality of original bullet screen data, each of which includes the content of the bullet screen and the launch time of the bullet screen; Multiple original barrage data to obtain multiple barrage data; obtain multiple target barrage data from the multiple barrage data according to the barrage launch time of each barrage data; and combine the multiple target barrage data At least one barrage content in the screen data is presented in the barrage playback area of the video playback page.
  • obtaining multiple target barrage data from the multiple barrage data according to the barrage launch time of each barrage data includes: traversing the multiple barrage data through a barrage calculator to obtain Several barrage data matching the current time of the barrage timeline; and determining the several barrage data as the multiple target barrage data.
  • the barrage timeline and the barrage calculator work in parallel in a frame rendering mode called recursively.
  • the barrage playing area includes multiple barrage tracks; presenting at least one barrage content in the multiple target barrage data in the barrage play area includes: The target barrage data is added to the barrage queue to be launched; and the current state of each barrage track is judged according to the virtual barrage track, the virtual barrage track is a pre-configured nested array, and the nested array includes multiple Sub-arrays, each sub-array is mapped to one of the multiple barrage tracks; and according to the current state of each barrage track, it is determined whether to transfer at least one target barrage data in the to-be-launched barrage queue Launch to present at least one barrage content in the at least one target barrage data in the barrage play area.
  • judging the current status of each barrage track according to the virtual barrage track including: S1, judging whether the i-th sub-array is empty, and the i-th sub-array corresponds to the i-th barrage track; S2, if said If the i-th sub-array is empty, it is determined that the current state of the i-th barrage track is an idle state.
  • judging the current status of each barrage track according to the virtual barrage track includes: S3, if the i-th sub-array is not empty, then judging the first bullet of the team to be launched in the barrage queue to be launched Whether the content of the first barrage of the team in the screen data and the content of the tail barrage in the launched tail barrage data will collide, wherein the first barrage data of the team to be launched is located at the head of the queue of the to-be-launched barrage
  • the target barrage data of the part, the launched tail barrage data is the launched barrage data at the end of the i-th array; S4, if the first barrage content in the first barrage data of the to-be-launched team If there is no collision with the tail barrage content in the launched tail barrage data, it is determined that the current state of the i-th barrage track is an idle state.
  • determining whether the content of the first barrage in the first barrage data of the to-be-launched team in the queue of barrage to be launched and the tail barrage content of the launched tail barrage data will collide including: According to the launch time t 1 and the movement time t 2 in the launched tail barrage data, the presentation time t 1 +t of the tail barrage content in the launched tail barrage data in the barrage playback area is calculated 2 ; Calculate the first barrage of the to-be-launched team based on the launch time t 3 , the movement time t 4 , the barrage width w 2 and the display width w 1 of the barrage playback area of the first barrage data of the team to be launched The arrival time t 3 +[w 1 *t 4 /(w 1 +w 2 )] when the content of the team’s first barrage in the data reaches the left boundary of the barrage play area; judging the presentation time t 1 +t 2 Is it less than the arrival time t 3 +[
  • judging the current status of each barrage track according to the virtual barrage track further including: S5, if the content of the first barrage in the first barrage data of the to-be-launched team and the data of the launched tail barrage are in If the content of the tail barrage of is collided, it is determined that the current state of the i-th barrage track is the crowded state.
  • judging the current status of each barrage track according to the virtual barrage track further includes: updating the value of i, and executing steps S1 to S4 based on the updated value of i until i is equal to M; where 1 ⁇ i ⁇ M, the initial value of i is 1, and M represents the number of the multiple barrage tracks.
  • each barrage track it is determined whether to launch at least one target barrage data in the to-be-launched barrage queue, so as to transmit at least one barrage data in the at least one target barrage data
  • the content presented in the barrage playing area includes: if it is determined that the first track to the M-th track are in a crowded state, deleting the multiple target barrage data in the queue of to-be-launched barrage.
  • each barrage track it is determined whether to launch at least one target barrage data in the to-be-launched barrage queue, so as to transmit at least one barrage data in the at least one target barrage data
  • the content is presented in the barrage playing area, including: if it is determined that the current state of the i-th barrage track is idle: adding the first barrage data of the team to be launched in the barrage queue to be launched to all In the i-th array; add the first barrage data of the team to be launched in the queue to be launched to the rendering list to add the content of the first barrage corresponding to the first barrage data of the team to be launched After the rendering operation, it is presented on the i-th barrage track in the barrage playing area; and the first barrage data of the team to be launched in the queue to be launched is updated.
  • An aspect of the embodiments of the present application further provides a bullet screen presentation system.
  • the bullet screen presentation system includes: a first acquisition module configured to acquire a video playback page, and the video playback page includes a system for presenting a video stream. Barrage playback area; the second acquisition module, used to obtain multiple original barrage data, each original barrage data includes the content of the barrage and the launch time of the barrage; the cloning module, used to clone the multiple original barrage data To obtain multiple barrage data; the third acquisition module is used to obtain multiple target barrage data from the multiple barrage data according to the barrage launch time of each barrage data; the presentation module is used to combine all the barrage data At least one barrage content in the multiple target barrage data is presented in the barrage play area of the video play page.
  • An aspect of the embodiments of the present application further provides a computer device.
  • the computer device includes a memory, a processor, and computer-readable instructions stored in the memory and running on the processor, and the processor executes the computer
  • the readable instructions are used to implement the following steps: obtain the video playback page; obtain multiple original barrage data, each of which includes the content of the barrage and the launch time of the barrage; clone the multiple original barrage data to obtain Multiple barrage data; obtain multiple target barrage data from the multiple barrage data according to the barrage launch time of each barrage data; and combine at least one barrage of the multiple target barrage data
  • the content is presented in the barrage play area of the video play page.
  • An aspect of the embodiments of the present application further provides a computer-readable storage medium, in which computer-readable instructions are stored, and the computer-readable instructions can be executed by at least one processor in the following steps: Obtain the video playback page; obtain multiple original barrage data, each of which includes the content of the barrage and the launch time of the barrage; clone the multiple original barrage data to obtain multiple barrage data; according to each barrage Data of the barrage launch time, obtaining multiple target barrage data from the multiple barrage data; and presenting at least one barrage content of the multiple target barrage data on the video playback page Screen play area.
  • the method, system, device, and computer-readable storage medium for presenting bullet screens provided by the embodiments of the present application, after acquiring the multiple original bullet screen data, use the multiple original bullet screen data as the original data; clone multiple original bullet screens
  • the screen data gets multiple barrage data corresponding to the cloning operation, and the multiple barrage data corresponding to the cloning operation is used for the barrage display operation.
  • the clone is taken as the original
  • the multiple original barrage data of the data obtain multiple barrage data corresponding to the re-cloning operation, and the multiple barrage data corresponding to the re-cloning operation is used for the barrage display operation. Therefore, when the playback progress bar is pulled back to the previous playback time node each time, there is no need to request the download again, and the clone operation can be performed again, which improves the efficiency of the bullet screen playback.
  • FIG. 1 schematically shows an application environment diagram of a method for presenting a bullet screen according to an embodiment of the present application
  • FIG. 2 schematically shows a flowchart of a method for presenting a barrage screen according to Embodiment 1 of the present application
  • FIG. 3 schematically shows a flowchart of step S206 in FIG. 2;
  • FIG. 4 schematically shows a flowchart of a barrage presentation method according to Embodiment 2 of the present application
  • FIG. 5 schematically shows a flowchart of step S410 in FIG. 4;
  • FIG. 6 schematically shows another flowchart of step S410 in FIG. 4;
  • FIG. 7 schematically shows a flowchart of step S604 in FIG. 6;
  • FIG. 8 schematically shows a flowchart of step S412 in FIG. 4;
  • FIG. 9 schematically shows another flowchart of the barrage presentation method according to the second embodiment of the present application.
  • Fig. 10 schematically shows a block diagram of a communication system according to the third embodiment of the present application.
  • FIG. 11 schematically shows a schematic diagram of the hardware architecture of a computer device suitable for implementing the method for presenting a bullet screen according to the fourth embodiment of the present application.
  • Fig. 1 schematically shows an environmental application diagram of the method for presenting a bullet screen according to an embodiment of the present application.
  • the provider network 2 can connect multiple computer devices 10 through the network 9.
  • the content service 3 is provided by the provider network 2.
  • the content service 3 may be provided by an independent content provider connected to the provider network 2.
  • the content service 3 may include a content streaming service such as an Internet protocol video streaming service.
  • the content streaming service can be configured to distribute content via various transmission technologies.
  • the content service 3 may be configured to provide content such as video, audio, text data, a combination thereof, and the like.
  • the content may include a content stream (for example, a video stream, an audio stream, an information stream), a content file (for example, a video file, an audio file, a text file), and/or other data.
  • the provider network 2 may implement a bullet screen service that is configured to allow users to comment and/or share comments associated with the content.
  • the content of the barrage can be presented on the same screen together with the content.
  • the barrage content can be displayed in an overlay above the content.
  • the content of the barrage may have an animation effect when displayed.
  • the barrage content can be displayed as scrolling on the content (for example, from right to left, from left to right, from top to bottom, from bottom to top), this animation effect can be based on CSS3 (cascading style sheets, cascading style sheets) Style sheet) transition attribute.
  • the provider network 2 may be located in a data center such as a single location, or distributed in different geographic locations (for example, in multiple locations).
  • the provider network 2 can provide services via one or more networks 9.
  • the network 9 includes various network devices, such as routers, switches, multiplexers, hubs, modems, bridges, repeaters, firewalls, proxy devices, and/or the like.
  • the network 9 may include physical links, such as coaxial cable links, twisted pair cable links, optical fiber links, combinations thereof, and the like.
  • the network 9 may include wireless links, such as cellular links, satellite links, Wi-Fi links, and so on.
  • the provider network 2 may include a messaging service 5.
  • the message service 5 can be configured to receive multiple messages.
  • the plurality of messages may include a plurality of barrage contents associated with the content and information related to the plurality of barrage contents.
  • the message service 5 can be configured to manage messages for various content items.
  • the user can browse the content and access different content items to view comments on specific content, such as comments posted by other users on the specific content. Comments from users associated with a specific content item may be output to other users who view the specific content item. For example, all users who access a content item (e.g., a video clip) can view comments associated with the content item.
  • the input barrage content can be output in real time or near real time.
  • the message service 5 can be configured to process multiple messages.
  • the message service 5 may implement a queue of multiple messages or prioritize processing in other ways based on the information (e.g., timestamp, incremented identifier) associated with the corresponding barrage content.
  • the message service 5 can be configured to use load balancing to process multiple messages.
  • the message service 5 may be configured to use one or more of multiple processing nodes to process multiple messages, prioritize the messages, load balance the messages, and so on.
  • the message service 5 can store multiple messages at least temporarily.
  • the message service 5 can store multiple messages in a data store such as a database.
  • the message service 5 may be configured to process messages by performing a grouping process.
  • the grouping process may include grouping multiple messages based on characteristics. If two messages have the same characteristics or are within the threshold range of the characteristics, the two messages can be grouped together.
  • Messages associated with a particular content item e.g., stream, file, show, movie, song, game session
  • the message may include or be associated with a content identifier. The content identifier can uniquely identify the content item. If the content identifier is found in the message, or is associated with the message (e.g., sent separately), the message service 5 may associate the message with the group associated with the content item.
  • the message service 5 can perform natural language processing, topic recognition, pattern recognition, artificial intelligence, etc., to automatically determine the characteristics of the message and/or group the messages.
  • frequently occurring phrases or patterns can be identified as topics.
  • a database of topics associated with content can be maintained. Topics can include genre (for example, action, drama, comedy), personality (for example, actor, actress, director), language, and so on.
  • the messages can be grouped based on the characteristics of the client device and/or the user sending the message. Demographics, interests, history, and/or the like can be stored for multiple users to determine potential groupings of messages.
  • the message service 5 may be further configured to process messages by generating output data.
  • the output data may include instructions for enabling the output of comments based on the corresponding context.
  • the output data may include application data for instructing the application to cover the comment based on the context.
  • the output data may include instructions for generating (e.g., encoding) content corresponding to the comment.
  • the output data can be used to generate (e.g., encode) output barrage content, such as an output content stream.
  • the output review content can be combined (for example, multiplexed) with original content items such as content provided by the content service 3.
  • the resulting combination may include the contents of a single package (e.g., container, shipping container, shipping stream).
  • the package may include the original content item and the output barrage content (for example, displayed on top of the original content item).
  • the message service 5 may be further configured to process messages by performing a screening process.
  • the screening process can include rejecting or marking messages that match the screening criteria.
  • the screening criteria can specify terms and/or phrases, such as profanity, hate speech, indecent language, etc.
  • the filter criteria can specify characters, such as symbols, fonts, etc.
  • the screening criteria can specify language, computer readable code pattern, etc.
  • the provider network 2 may further include processing services 6.
  • the processing service 6 may be configured to provide processing of various services, such as the service of the provider network 2.
  • the processing service 6 may include multiple network nodes 8. Multiple network nodes 8 can handle tasks associated with the message service 5.
  • the multiple network nodes 8 may be implemented as one or more computing devices, one or more processors, one or more virtual computing instances, combinations thereof, and/or the like.
  • the multiple network nodes 8 may be implemented by one or more computing devices.
  • One or more computing devices may include virtualized computing instances.
  • Virtualized computing instances may include virtual machines, such as simulations of computer systems, operating systems, and servers.
  • the computing device may load the virtual machine by the computing device based on the virtual image and/or other data defining specific software (for example, operating system, dedicated application, server) for simulation. As the requirements for different types of processing services change, different virtual machines can be loaded and/or terminated on one or more computing devices.
  • a hypervisor can be implemented to manage the use of different virtual machines on the same computing device.
  • multiple network nodes 8 can process events submitted by multiple computer devices. These events can be associated with discussions on real-time news, videos, social hot spots, reports on certain user accounts, etc. In other embodiments, multiple network nodes 8 can handle performance evaluations of multiple user accounts for reviewing events in the network community. In some implementations, these services can be implemented as dedicated computing devices, dedicated processors, dedicated virtual machine instances, and/or the like. In other implementations, various nodes can implement any functions associated with these services.
  • Multiple computer devices 10 may be configured to access the content and services of the provider network 2.
  • the plurality of computer devices 10 may include any type of electronic devices, such as mobile devices, tablet devices, laptop computers, workstations, virtual reality devices, gaming devices, set-top boxes, digital streaming media devices, vehicle terminals, smart TVs, set-top boxes, electronic devices Book reader etc.
  • Multiple computer devices 10 may be associated with one or more users. A single user can use one or more of the multiple computer devices 10 to access the provider network 2. Multiple computer devices 10 can travel to various locations and use different networks to access the provider network 2.
  • the computer device 10 may include an application 12.
  • the application 12 outputs (e.g., displays, renders, and presents) the content to the user.
  • the application 12 may be a video client (such as a bilibili client), a browser client, or a WeChat applet based on WeChat.
  • the content may include video, audio, barrage content, and/or the like.
  • the content of the barrage can be text, emoticons, patterns, etc., and can have different colors, sizes, animations, scrolling directions, and the like.
  • the application 12 may send reports for certain users to the processing service, and the application 12 may also send comments on the reports to the processing service 6.
  • Events or comments sent from multiple computer devices 10 include the reason for submitting the event, content attributes associated with the event, user account information, and so on.
  • Fig. 2 schematically shows a flowchart of a method for presenting a barrage screen according to the first embodiment of the present application. It can be understood that this method embodiment may be executed in the computer device 10, and the flowchart of this method embodiment is not used to limit the order of execution of the steps.
  • the method for presenting a barrage screen may include steps S200 to S208, where:
  • Step S200 Obtain a video playback page.
  • Step S202 Obtain multiple original barrage data, and each original barrage data includes the content of the barrage and the launch time of the barrage.
  • Step S204 Clone the multiple original barrage data to obtain multiple barrage data.
  • Step S206 Acquire multiple target barrage data from the multiple barrage data according to the barrage launch time of each barrage data.
  • Step S208 Present at least one barrage content of the multiple target barrage data in the barrage play area of the video play page.
  • the computer device 10 initiates a request for original barrage data to the provider network 2.
  • the computer device 10 receives the XML (extensible mariup language) file returned by the provider network 2 in response to the page access request.
  • XML extensible mariup language
  • the XML file is compiled into an Element object, and multiple original barrage data are obtained from the Element object, such as the barrage content, launch time, barrage color, movement time and other attributes (original barrage data).
  • the attributes are converted into json data format and stored in the local array, and multiple original barrage data stored in the local array are obtained.
  • the multiple original barrage data may be obtained by multiple pushes from the provider network, and the multiple original barrage data include historical original barrage data and real-time original barrage data.
  • the computer device 10 clones the multiple original barrage data to obtain multiple barrage data.
  • the status of the barrage may change.
  • the barrage data can no longer be used due to the status change, and often needs to be obtained from the provider's network 2. Request download again.
  • the advantages of the cloning operation are as follows: After obtaining the multiple original barrage data, use the multiple original barrage data as the original data; clone multiple original barrage data to obtain multiple barrage data corresponding to the first cloning operation , Use the multiple barrage data corresponding to the first cloning operation for the barrage display operation, and when the playback progress bar is pulled back to a certain previous playback time node, the multiple original barrage data as the original data will be cloned Data, multiple barrage data corresponding to the second cloning operation is obtained, and the multiple barrage data corresponding to the second cloning operation is used for the barrage display operation. It is not difficult to understand that in this embodiment, when the playback progress bar is pulled back to the previous playback time node each time, there is no need to request a download from the provider network 2 again, and the cloning operation can be performed again.
  • the computer device 10 obtains multiple target barrage data from the multiple barrage data according to the barrage launch time of each barrage data.
  • the bullet screen calculator and the bullet screen timeline are located in the logic layer of application 12 (such as browsers, WeChat applets), and the frame of the bullet screen timeline and the bullet screen calculator can be called recursively through the logic layer.
  • the rendering modes work in parallel.
  • the step S206 further includes steps S300 to S302, wherein: step S300, traverse the multiple barrage data through the barrage calculator, and obtain the timeline of the barrage Several barrage data matching the current time of.
  • step S302 Determine the several barrage data as the multiple target barrage data. Specifically: the barrage calculator traverses and filters the multiple barrage data, wherein several barrage data that meet the launch time will be added to the barrage queue to be launched, and at the same time, these barrage data will be added to the barrage to be launched Several barrage data in the queue will be deleted from the multiple barrage data to reduce the number of subsequent traversals.
  • the barrage calculator When the barrage calculator detects that the data of the multiple cloned screens has been launched, the barrage calculator and the barrage timeline terminate the operation and reset the barrage system. In addition, if the computer device 10 detects that the user has clicked the pause button or the video playback is completed, the barrage calculator and the barrage timeline will also be paused or terminated at the same time.
  • the computer device 10 presents at least one barrage content of the multiple target barrage data in the barrage play area of the video play page.
  • the computer device 10 traverses to find whether there is an idle barrage track in the barrage playing area. If all barrage tracks are not currently in an idle state, discard multiple target barrage data in the barrage queue to be launched. If there are one or more barrage tracks in idle state, add one or more target barrage data in the queue to be launched to the rendering list, and use the transition property in CSS3 as the content of each barrage In the motion animation, update the view layer data to notify the view layer to update the rendering.
  • the rendering process and the display process are functions encapsulated by the WeChat applet framework according to the MVC (model-view-controller) model.
  • the rendering is done by the WeChat applet framework.
  • This barrage data is bound to the element in the WXML (WeChat Markup Language, WeiXinMariup Language) file.
  • WXML WeChat Markup Language, WeiXinMariup Language
  • the WeChat applet will render it based on this barrage data
  • a barrage content with a white font color, "I am the text content of a barrage” a movement method of linear movement from the origin to 100% of its own width, and a movement time of 0.6 seconds.
  • This kind of animation effect can be realized based on the transition property of CSS3.
  • FIG. 4 schematically shows a flowchart of a method for presenting a barrage screen according to the second embodiment of the present application.
  • the barrage presentation method may include steps S400 to S412, wherein:
  • Step S400 Obtain a video playback page.
  • Step S402 Obtain multiple original barrage data, and each original barrage data includes the content of the barrage and the launch time of the barrage.
  • the original barrage data can include the following information:
  • Step S404 Clone the multiple original barrage data to obtain multiple barrage data.
  • Step S406 Acquire multiple target barrage data from the multiple barrage data according to the barrage launch time of each barrage data.
  • Step S408 Add the multiple target barrage data to the queue of to-be-launched barrage.
  • the computer device 10 performs a data update operation on the view layer, and performs a first rendering operation according to the barrage data in the to-be-launched state.
  • the method may further include the step of updating the multiple barrage data to delete the multiple target barrage data from the multiple barrage data. That is, after each target barrage data is added to the queue of barrage to be launched, the target barrage data will be deleted from the multiple barrage data.
  • Step S410 Determine the current status of each barrage track according to the virtual barrage track.
  • the barrage playing area includes a plurality of barrage tracks.
  • the virtual barrage track is a pre-configured nested array, the nested array includes a plurality of sub-arrays, and each sub-array is mapped to one of the multiple barrage tracks.
  • the so-called virtual barrage track is proposed, in order to achieve a good barrage visual effect, each barrage content cannot be obscured by other barrage content, which requires that each barrage content does not overlap with each other.
  • the virtual barrage track essentially simulates the relationship between the barrage content and the barrage track in the data format of an array nested array.
  • the barrage data in the virtual barrage track does not participate in the rendering of the view layer, but uses the form of data to map the relationship between the current barrage content and the barrage track.
  • the working principle of the virtual barrage track is: the same number of array objects are pushed back into an array object through the number of barrage tracks configured when the barrage system is initialized, similar to [[], [], [], [ ],...] Such a form.
  • Each sub-array in the nested array represents a barrage track.
  • step S410 may include steps S500 to S506:
  • Step S500 Determine whether the i-th sub-array is empty, and the i-th sub-array corresponds to the i-th barrage track. If yes, go to step S502; otherwise, go to step S504.
  • Step S502 Determine that the current state of the i-th barrage track is an idle state.
  • Step S504 Determine that the current state of the i-th barrage track is a congested state.
  • Step S506 Update the value of i, and perform steps S500 to S506 based on the updated value of i until i is equal to M; where 1 ⁇ i ⁇ M, the initial value of i is 1, and M represents the multiple bombs The number of curtain tracks.
  • step S410 may include steps S600 to S608:
  • Step S600 Determine whether the i-th sub-array is empty, and the i-th sub-array corresponds to the i-th barrage track. If yes, go to step S602; if not, it means that there is already a moving barrage content on the i-th barrage track, and go to step S604.
  • Step S602 Determine that the current state of the i-th barrage track is an idle state.
  • Step S604 Determine whether the content of the first barrage in the first barrage data of the to-be-launched team in the queue of barrage to be launched and the tail barrage content of the launched tail barrage data will collide. If not, go to step S602; otherwise, go to S606.
  • the first barrage data of the to-be-launched team is target barrage data located at the head of the to-be-launched barrage queue.
  • the launched tail barrage data is the launched barrage data at the end of the i-th array, and the launched tail barrage data corresponds to the last barrage data in the i-th array, and the tail bullet
  • the screen content corresponds to the latest barrage content that is presented in the i-th barrage track.
  • step S604 can be implemented through steps S700 to S708, wherein: step S700, according to the launch time t 1 and the movement time t 2 in the launched tail barrage data, Calculate the presentation time t 1 +t 2 of the tail barrage content in the barrage play area in the launched tail barrage data; step S702, according to the launch time t 3 of the first barrage data of the team to be launched, The movement time t 4 , the barrage width w 2 and the display width w 1 of the barrage play area, calculate that the first barrage content in the first barrage data of the to-be-launched team reaches the left boundary of the barrage play area (It can also be other boundaries, depending on the position of the end point of the movement) at the time of reaching t 3 +[w 1 *t 4 /(w 1 +w 2 )]; step S704, judging the presentation time t 1 +t 2 Is it less than the arrival time t 3 +[w 1 *
  • Step S606 Determine that the current state of the i-th barrage track is a congested state.
  • Step S608 Update the value of i, and perform steps 600 to S608 based on the updated value of i until i is equal to M; where 1 ⁇ i ⁇ M, the initial value of i is 1, and M represents the multiple bombs The number of curtain tracks.
  • Step S412 according to the current state of each barrage track, determine whether to launch at least one target barrage data in the to-be-launched barrage queue, so as to transmit at least one barrage content in the at least one target barrage data Presented in the barrage play area of the video play page.
  • the barrage play area can be a video play area or other areas.
  • the barrage track can be idle or crowded.
  • the current state of the i-th barrage track is idle, it is determined to launch at least one target barrage data in the queue to be launched, so as to transmit at least one bullet in the at least one target barrage data
  • the screen content is presented in the barrage playing area.
  • the current state of the i-th barrage track is a crowded state, it is determined not to launch at least one target barrage data in the barrage queue to be launched.
  • the current state of the i-th barrage track is the idle state.
  • the step S412 may include steps S800 to S804, wherein: step S800, the first bullet of the queue to be launched in the barrage queue to be launched The screen data is added to the i-th array; step S802, the first barrage data of the team to be launched in the queue to be launched is added to the rendering list to add the first barrage of the team to be launched The content of the first barrage corresponding to the data is presented on the i-th barrage track in the barrage playback area after the rendering operation; step S804, updating the first barrage data of the to-be-launched barrage queue in the to-be-launched barrage queue .
  • the queue to be launched barrage from the head to the end of the queue are target barrage data A1, target barrage data A2, target barrage data A3, ..., the queue to be launched in the barrage queue to be launched The first barrage data is currently the target barrage data A1.
  • the barrage data is deleted to update the subsequent target barrage data of the target barrage data A1 (ie, the target barrage data A2) to the first barrage data of the team to be launched in the barrage queue to be launched.
  • the barrage content in the target barrage data A1 in the rendering list will undergo the following operations: update the rendering motion animation style, etc.
  • the target barrage data A2 in the first sub-array is used to indicate that the barrage content of the target barrage data 2 currently exists in the first barrage track.
  • the fourth sub-array is used to determine the current state of the fourth barrage track.
  • the target barrage data at the head of the to-be-launched barrage queue will be deleted, so that subsequent target barrage data of this target barrage data (such as , The subsequent target barrage data whose position is second only to this target barrage data) is updated to the first barrage data of the to-be-launched team in the to-be-launched barrage queue.
  • This target barrage data will be removed from the to-be-launched barrage queue. been deleted.
  • the second sub-array is used to determine the current state of the second barrage track.
  • the third sub-array is used to determine the current state of the third barrage track.
  • step S900 an initialization operation is performed on the WeChat applet page.
  • step S902 a request for original barrage data is initiated.
  • the bullet screen loader initiates an original bullet screen data request to the provider network 2, and receives an XML (extensible mariup language) file returned by the provider network 2.
  • XML extensible mariup language
  • the barrage loader is located in the logic layer of the WeChat applet page.
  • the logic layer also includes a barrage calculator and a barrage timeline.
  • Step S904 Compile the XML file to obtain multiple original barrage data.
  • the XML file is compiled into an Element object, and multiple original barrage data are obtained from the Element object, such as the barrage content, launch time, barrage color, movement time and other attributes (original barrage data).
  • the attributes are converted into json data format and stored in the local array, and multiple original barrage data stored in the local array are obtained. Then, the multiple original barrage data are cloned to obtain the multiple barrage data.
  • the status of the barrage may change.
  • the barrage data can no longer be used due to the status change, and often needs to be obtained from the provider's network 2. Request download again.
  • the obtained multiple original barrage data are located in the original data and are not used for the barrage playback operation; the method is as follows: clone multiple original barrage data to obtain multiple barrage data corresponding to the first cloning operation, Use the multiple barrage data corresponding to the first cloning operation for the barrage playback operation, and when the playback progress bar is pulled back to a certain previous play time node, the multiple original barrage data as the original data are cloned , Obtain multiple barrage data corresponding to the second cloning operation, and use the multiple barrage data corresponding to the second cloning operation for the barrage playback operation. It is not difficult to understand that in this embodiment, when the playback progress bar is pulled back to the previous playback time node each time, there is no need to request a download from the provider network 2 again, and the cloning operation can be performed again.
  • the multiple barrage data are used for subsequent barrage playback operations.
  • the barrage calculator is used for barrage screening and calculation.
  • the barrage timeline is used to manage the barrage timeline, that is, the current playback time of the synchronized video stream.
  • the bullet screen calculator and the bullet screen timeline are located in the logic layer of application 12 (such as browsers, WeChat applets), and the frame of the bullet screen timeline and the bullet screen calculator can be called recursively through the logic layer.
  • the rendering modes work in parallel.
  • the barrage calculator and the barrage timeline stop running and reset the barrage system.
  • the computer device 10 detects that the user has clicked the pause button or the video playback is completed, the barrage calculator and the barrage timeline will also be paused or terminated at the same time.
  • step S908 each barrage data is traversed through the barrage calculator to calculate and filter whether each barrage data is in a to-be-launched state or in an expired state.
  • step S910 it is judged whether the barrage data j has reached the launch time. If yes, go to step S912, otherwise go to step S914.
  • the barrage content in the barrage data j has reached the launch time, that is, whether the barrage data j is currently in a waiting state for launch.
  • step S912 the bullet screen data j is added to the bullet screen queue to be launched, and the view layer is notified to perform a data update operation to perform the first rendering operation. Go to step S918.
  • the barrage data j added to the queue of barrage to be launched will be deleted from the multiple barrage data to reduce the number of subsequent traversals.
  • Step S914 Determine whether the barrage data j is in an expired state. If yes, go to step S916; otherwise, the barrage data j will wait for the next traversal operation.
  • Step S916 destroy the barrage data j.
  • the barrage data j is deleted from the multiple barrage data to reduce the number of subsequent traversals.
  • step S918 it is judged whether there is an idle barrage track currently. If yes, go to step S920, otherwise go to step S916.
  • the barrage width of the barrage element obtained by the first rendering operation is obtained. According to the barrage width of the barrage element, it is determined whether the barrage rails in the idle state are included in the multiple barrage tracks.
  • Step S920 Add a virtual bullet screen trajectory and a rendering queue, and notify the view layer to perform a data update operation to perform a second rendering operation.
  • Fig. 10 schematically shows a block diagram of a barrage presentation system according to the third embodiment of the present application.
  • the barrage presentation system can be divided into one or more program modules, and the one or more program modules are stored in a storage medium, It is executed by one or more processors to complete the embodiments of the present application.
  • the program module referred to in the embodiment of the present application refers to a series of computer-readable instruction segments that can complete specific functions. The following description will specifically introduce the function of each program module in this embodiment.
  • the bullet screen presentation system 1000 may include a first acquisition module 810, a second acquisition module 1020, a clone module 1030, a third acquisition module 1040, and a presentation module 1050, wherein:
  • the first obtaining module 1010 is used to obtain a video playback page.
  • the second acquisition module 1020 is configured to acquire multiple original barrage data, and each original barrage data includes the content of the barrage and the launch time of the barrage.
  • the cloning module 1030 is used to clone the multiple original barrage data to obtain multiple barrage data.
  • the third obtaining module 1040 is configured to obtain multiple target barrage data from the multiple barrage data according to the barrage launch time of each barrage data.
  • the presentation module 1050 is configured to present at least one barrage content of the multiple target barrage data in the barrage play area of the video play page.
  • the third obtaining module 1040 is further configured to: traverse the multiple barrage data through the barrage calculator to obtain several barrage data matching the current time of the barrage timeline; And determining the plurality of barrage data as the plurality of target barrage data.
  • the barrage timeline and the barrage calculator work in parallel in a frame rendering mode called recursively.
  • the barrage playing area includes a plurality of barrage tracks; the presentation module 1050 is further configured to: add the multiple target barrage data to the queue of barrage to be launched; and according to the virtual The barrage track judges the current state of each barrage track.
  • the virtual barrage track is a pre-configured nested array.
  • the nested array includes a plurality of sub-arrays, and each sub-array maps one of the multiple barrage tracks.
  • a barrage content is presented in the barrage playing area.
  • the presentation module 1050 is further configured to: S1, determine whether the i-th sub-array is empty, and the i-th sub-array corresponds to the i-th barrage track; S2, if the i-th sub-array is If the array is empty, it is determined that the current state of the i-th barrage track is the idle state.
  • the presentation module 1050 is further configured to: S3, if the i-th sub-array is not empty, determine the team in the first barrage data of the to-be-launched barrage queue Whether the content of the first barrage and the content of the tail barrage in the launched tail barrage data collide, wherein the first barrage data of the to-be-launched team is the target barrage at the head of the to-be-launched barrage queue Data, the launched tail barrage data is the launched barrage data at the end of the i-th array; S4, if the content of the team’s first barrage in the team’s first barrage data to be launched and the launched barrage data If the tail barrage content in the tail barrage data does not collide, it is determined that the current state of the i-th barrage track is an idle state.
  • the collision includes: calculating the presentation time of the tail barrage content in the launched tail barrage data in the barrage playback area according to the launch time t 1 and the movement time t 2 in the launched tail barrage data t 1 +t 2 ; According to the launch time t 3 of the first barrage data of the to-be-launched team, the movement time t 4 , the barrage width w 2 and the display width w 1 of the barrage playback area, calculate the to-be-launched The arrival time t 3 +[w 1 *t 4 /(w 1 +w 2 )] when the content of the team's first barrage in the team's first barrage data reaches the left boundary of the barrage play area; determine the presentation time Whether t 1 +t 2 is less than the arrival time
  • the presentation module 1050 is further used for: S5, if the content of the first barrage in the first barrage data of the to-be-launched team and the content of the tail barrage in the launched tail barrage data If a collision occurs, it is determined that the current state of the i-th barrage track is a crowded state.
  • the presentation module 1050 is further configured to: update the value of i, and execute steps S1 to S4 based on the updated value of i until i is equal to M; where 1 ⁇ i ⁇ M, i The initial value of is 1, and M represents the number of the multiple barrage tracks.
  • the presentation module 1050 is further configured to: if it is determined that the first track to the M-th track are all in a crowded state, delete the multiple target barrage in the queue of to-be-launched barrage data.
  • the presentation module 1050 is further configured to: if it is determined that the current state of the i-th barrage track is in an idle state: the first barrage data of the team to be launched in the queue to be launched Add to the i-th array; add the first barrage data of the to-be-launched team in the queue to be launched into the rendering list, so as to add the first barrage data of the to-be-launched team to the team leader After the rendering operation, the content of the barrage is presented on the i-th barrage track in the barrage playing area; and the first barrage data of the team to be launched in the queue to be launched is updated.
  • FIG. 11 schematically shows a schematic diagram of the hardware architecture of a computer device suitable for implementing the method for presenting a bullet screen according to the fourth embodiment of the present application.
  • the computer device 10 is a device that can automatically perform numerical calculation and/or information processing in accordance with pre-set or stored instructions.
  • the computer device 10 can be, for example, a smart phone, a computer, a projector, a set-top box, etc., or a virtual machine host process and one or more virtual machine instances, or a rack server, a blade server, a tower server, or a cabinet type. Servers (including independent servers, or server clusters composed of multiple servers), etc.
  • the computer device 10 at least includes but is not limited to: a memory 1110, a processor 1120, and a network interface 1130 that can communicate with each other through a system bus. among them:
  • the memory 1110 includes at least one type of computer-readable storage medium.
  • the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), and static random access memory.
  • SRAM read-only memory
  • ROM read-only memory
  • EEPROM electrically erasable programmable read-only memory
  • PROM programmable read-only memory
  • magnetic memory magnetic disk, optical disk, etc.
  • the memory 1110 may be an internal storage module of the computer device 10, such as a hard disk or a memory of the computer device 10.
  • the memory 1110 may also be an external storage device of the computer device 10, for example, a plug-in hard disk equipped on the computer device 10, a smart memory card (Smart Media Card, referred to as SMC), and a secure digital (Secure Digital). Digital, abbreviated as SD) card, flash card (Flash Card), etc.
  • the memory 1110 may also include both an internal storage module of the computer device 10 and an external storage device thereof.
  • the memory 1110 is generally used to store an operating system and various application software installed in the computer device 10, such as program code of a bullet screen presentation method.
  • the memory 1110 can also be used to temporarily store various types of data that have been output or will be output.
  • the processor 1120 may be a central processing unit (Central Processing Unit, CPU for short), a controller, a microcontroller, a microprocessor, or other data processing chips.
  • the processor 1120 is generally used to control the overall operation of the computer device 10, for example, to perform data interaction or communication-related control and processing with the computer device 10.
  • the processor 1120 is configured to run program codes stored in the memory 1110 or process data.
  • the network interface 1130 may include a wireless network interface or a wired network interface, and the network interface 1130 is generally used to establish a communication link between the computer device 10 and other computer devices.
  • the network interface 1130 is used to connect the computer device 10 to an external terminal through a network, and to establish a data transmission channel and a communication link between the computer device 10 and the external terminal.
  • the network can be Intranet, Internet, Global System of Mobile communication (GSM), Wideband Code Division Multiple Access (WCDMA), 4G network , 5G network, Bluetooth (Bluetooth), Wi-Fi and other wireless or wired networks.
  • FIG. 11 only shows a computer device with components 1010-1030, but it should be understood that it is not required to implement all the components shown, and more or fewer components may be implemented instead.
  • the barrage presentation method stored in the memory 1110 can also be divided into one or more program modules and executed by one or more processors (processor 1120 in this embodiment) to complete This application.
  • This embodiment also provides a computer-readable storage medium on which computer-readable instructions are stored, and when the computer-readable instructions are executed by a processor, the following steps are implemented:
  • each original barrage data includes the content of the barrage and the launch time of the barrage;
  • the computer-readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disks, optical disks, etc.
  • the computer-readable storage medium may be an internal storage unit of a computer device, such as a hard disk or memory of the computer device.
  • the computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk equipped on the computer device, a smart memory card (Smart Media Card, referred to as SMC), and a secure digital (SMC). Secure Digital, referred to as SD card, Flash Card, etc.
  • the computer-readable storage medium may also include both the internal storage unit and the external storage device of the computer device.
  • the computer-readable storage medium is generally used to store the operating system and various application software installed in the computer device, such as the program code of the bullet screen presentation method in the embodiment.
  • the computer-readable storage medium can also be used to temporarily store various types of data that have been output or will be output.
  • modules or steps of the embodiments of the present application described above can be implemented by a general computing device, and they can be concentrated on a single computing device, or distributed among multiple computing devices.
  • they can be implemented by the program code executable by the computing device, so that they can be stored in the storage device for execution by the computing device, and in some cases, they can be different from here.
  • the steps shown or described are executed in the order of, or they are respectively fabricated into individual integrated circuit modules, or multiple modules or steps of them are fabricated into a single integrated circuit module to achieve. In this way, the embodiments of the present application are not limited to any specific combination of hardware and software.

Abstract

本申请实施例公开了一种弹幕呈现方法,包括:获取视频播放页面;获取多个原始弹幕数据,每个原始弹幕数据包括弹幕内容和弹幕发射时间;克隆所述多个原始弹幕数据,得到多个弹幕数据;根据各个弹幕数据的弹幕发射时间,从所述多个弹幕数据中获取多个目标弹幕数据;将所述多个目标弹幕数据中的至少一个弹幕内容呈现在所述视频播放页面的弹幕播放区域中。本申请还提供了弹幕呈现系统、计算机设备及计算机可读存储介质。本申请实施例,将所述多个原始弹幕数据作为原始数据,克隆得到的多个弹幕数据用于弹幕播放,当播放进度条每次拉回到先前的播放时间节点,无需再次请求下载,再次执行克隆操作即可。

Description

弹幕呈现方法和系统
本申请申明2019年11月25日递交的申请号为201911166832.X、名称为“弹幕呈现方法和系统”的中国专利申请的优先权,该中国专利申请的整体内容以参考的方式结合在本申请中。
技术领域
本申请实施例涉及通信领域,尤其涉及一种弹幕呈现方法、系统、计算机设备及计算机可读存储介质。
背景技术
弹幕,指的是在呈现视频时同时呈现评论性文字、表情、图案等。目前,弹幕成了为很多观众观看视频、直播的重要元素,其不仅能够使用户表达观看节目感受,而且还能使用户观看其他用户对节目的评论内容,实现用户观看视频时的互动性。然而,发明人意识到,现在的弹幕可能会受到网络环境的影响,出现弹幕播放效果差的问题。
发明内容
有鉴于此,本申请实施例的目的是提供一种弹幕呈现方法、系统、计算机设备及计算机可读存储介质,用于解决现在的弹幕可能会受到网络环境的影响,出现弹幕播放效果差的问题。
本申请实施例的一个方面提供了一种弹幕呈现方法,包括:获取视频播放页面;获取多个原始弹幕数据,每个原始弹幕数据包括弹幕内容和弹幕发射时间;克隆所述多个原始弹幕数据,得到多个弹幕数据;根据各个弹幕数据的弹幕发射时间,从所述多个弹幕数据中获取多个目标弹幕数据;及将所述多个目标弹幕数据中的至少一个弹幕内容呈现在所述视频播放页面的弹幕播放区域中。
可选的,根据各个弹幕数据的弹幕发射时间,从所述多个弹幕数据中获取多个目标弹幕数据,包括:通过弹幕计算器遍历所述多个弹幕数据,获取与弹幕时间线的当前时间匹配的若干个弹幕数据;及将所述若干个弹幕数据确定为所述多个目标弹幕数据。
可选的,所述弹幕时间线与所述弹幕计算器是以递归调用的帧渲染模式并行工作的。
可选的,所述弹幕播放区域包括多个弹幕轨道;将所述多个目标弹幕数据中的至少一个弹幕内容呈现在所述弹幕播放区域中,包括:将所述多个目标弹幕数据添加到待发射弹幕队列中;及根据虚拟弹幕轨道判断各个弹幕轨道的当前状态,所述虚拟弹幕轨道为预先配置的嵌套数组,所述嵌套数组中包括多个子数组,每个子数组映射所述多个弹幕轨道中的其中一个弹幕轨道;及根据各个弹幕轨道的当前状态,确定是否将所述待发射弹幕队列中的至少一个目标弹幕数据发射出去,以将所述至少一个目标弹幕数据中的至少一个弹幕内容呈现在所述弹幕播放区域中。
可选的,根据虚拟弹幕轨道判断各个弹幕轨道的当前状态,包括:S1,判断第i个子数组是否为空,所述第i个子数组对应第i个弹幕轨道;S2,如果所述第i个子数组为空, 则确定所述第i个弹幕轨道的当前状态为空闲状态。
可选的,根据虚拟弹幕轨道判断各个弹幕轨道的当前状态,还包括:S3,如果所述第i个子数组不为空,则判断所述待发射弹幕队列中的待发射队首弹幕数据中的队首弹幕内容和所述已发射尾部弹幕数据中的尾部弹幕内容是否会发生碰撞,其中,所述待发射队首弹幕数据为位于所述待发射弹幕队列头部的目标弹幕数据,所述已发射尾部弹幕数据为位于所述第i个数组尾部的已发射弹幕数据;S4,如果所述待发射队首弹幕数据中的队首弹幕内容和所述已发射尾部弹幕数据中的尾部弹幕内容不会发生碰撞,则确定所述第i个弹幕轨道的当前状态为空闲状态。
可选的,判断所述待发射弹幕队列中的待发射队首弹幕数据中的队首弹幕内容和所述已发射尾部弹幕数据中的尾部弹幕内容是否会发生碰撞,包括:根据所述已发射尾部弹幕数据中的发射时间t 1和运动时间t 2,计算所述已发射尾部弹幕数据中的尾部弹幕内容在所述弹幕播放区域的呈现时间t 1+t 2;根据所述待发射队首弹幕数据的发射时间t 3、运动时间t 4、弹幕宽度w 2和所述弹幕播放区域的显示宽度w 1,计算所述待发射队首弹幕数据中的队首弹幕内容达到所述弹幕播放区域的左边界时的达到时间t 3+[w 1*t 4/(w 1+w 2)];判断所述呈现时间t 1+t 2是否小于所述到达时间t 3+[w 1*t 4/(w 1+w 2)];如果所述呈现时间t 1+t 2小于所述到达时间t 3+[w 1*t 4/(w 1+w 2)],则确定所述待发射队首弹幕数据中的队首弹幕内容和所述已发射尾部弹幕数据中的尾部弹幕内容不会发生碰撞;及如果所述呈现时间t 1+t 2不小于所述到达时间t 3+[w 1*t 4/(w 1+w 2)],则确定所述待发射队首弹幕数据中的队首弹幕内容和所述已发射尾部弹幕数据中的尾部弹幕内容会发生碰撞。
可选的,根据虚拟弹幕轨道判断各个弹幕轨道的当前状态,还包括:S5,如果所述待发射队首弹幕数据中的队首弹幕内容和所述已发射尾部弹幕数据中的尾部弹幕内容会发生碰撞,则确定所述第i个弹幕轨道的当前状态为拥挤状态。
可选的,根据虚拟弹幕轨道判断各个弹幕轨道的当前状态,还包括:更新i的取值,并基于更新后的i的取值执行步骤S1~S4直至i等于M;其中,1≤i≤M,i的初始值为1,M表示所述多个弹幕轨道的数量。
可选的,根据各个弹幕轨道的当前状态,确定是否将所述待发射弹幕队列中的至少一个目标弹幕数据发射出去,以将所述至少一个目标弹幕数据中的至少一个弹幕内容呈现在所述弹幕播放区域中,包括:如果确定第一个轨道至第M个轨道均处于拥挤状态,则删除所述待发射弹幕队列中的所述多个目标弹幕数据。
可选的,根据各个弹幕轨道的当前状态,确定是否将所述待发射弹幕队列中的至少一个目标弹幕数据发射出去,以将所述至少一个目标弹幕数据中的至少一个弹幕内容呈现在所述弹幕播放区域中,包括:如果确定所述第i个弹幕轨道的当前状态为空闲状态:将所述待发射弹幕队列中的待发射队首弹幕数据添加到所述第i个数组中;将所述待发射弹幕队列中的待发射队首弹幕数据添加到所述渲染列表中,以将所述待发射队首弹幕数据对应的队首弹幕内容经渲染操作后呈现在所述弹幕播放区域中的第i个弹幕轨道上;及更新所述待发射弹幕队列中的待发射队首弹幕数据。
本申请实施例的一个方面又提供了一种弹幕呈现系统,所述弹幕呈现系统包括:第一获取模块,用于获取视频播放页面,所述视频播放页面中包括用于呈现视频流的弹幕播放区域;第二获取模块,用于获取多个原始弹幕数据,每个原始弹幕数据包括弹幕内容和弹幕发射时间;克隆模块,用于克隆所述多个原始弹幕数据,得到多个弹幕数据;第三获取模块,用于根据各个弹幕数据的弹幕发射时间,从所述多个弹幕数据中获取多个目标弹幕数据;呈现模块,用于将所述多个目标弹幕数据中的至少一个弹幕内容呈现在所述视频播放页面的弹幕播放区域中。
本申请实施例的一个方面又提供了一种计算机设备,所述计算机设备包括存储器、处理器以及存储在存储器上并可在处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时用于实现以下步骤:获取视频播放页面;获取多个原始弹幕数据,每个原始弹幕数据包括弹幕内容和弹幕发射时间;克隆所述多个原始弹幕数据,得到多个弹幕数据;根据各个弹幕数据的弹幕发射时间,从所述多个弹幕数据中获取多个目标弹幕数据;及将所述多个目标弹幕数据中的至少一个弹幕内容呈现在所述视频播放页面的弹幕播放区域中。
本申请实施例的一个方面又提供了一种计算机可读存储介质,所述计算机可读存储介质内存储有计算机可读指令,所述计算机可读指令可被至少一个处理器所执行以下步骤:获取视频播放页面;获取多个原始弹幕数据,每个原始弹幕数据包括弹幕内容和弹幕发射时间;克隆所述多个原始弹幕数据,得到多个弹幕数据;根据各个弹幕数据的弹幕发射时间,从所述多个弹幕数据中获取多个目标弹幕数据;及将所述多个目标弹幕数据中的至少一个弹幕内容呈现在所述视频播放页面的弹幕播放区域中。
本申请实施例提供的弹幕呈现方法、系统、设备及计算机可读存储介质,获取所述多个原始弹幕数据之后,将所述多个原始弹幕数据作为原始数据;克隆多个原始弹幕数据得到克隆操作对应的多个弹幕数据,将克隆操作对应的多个弹幕数据用于弹幕显示操作,当播放进度条拉回到先前的某个播放时间节点时,则克隆作为原始数据的所述多个原始弹幕数据,得到再次克隆操作对应的多个弹幕数据,将再次克隆操作对应的多个弹幕数据用于弹幕显示操作。因此,当播放进度条每次拉回到先前的播放时间节点,无需再次请求下载,再次执行克隆操作即可,提供了弹幕播放的效率。
附图说明
图1示意性示出了根据本申请实施例的弹幕呈现方法的应用环境图;
图2示意性示出了根据本申请实施例一的弹幕呈现方法的流程图;
图3示意性示出了图2中步骤S206的流程图;
图4示意性示出了根据本申请实施例二的弹幕呈现方法的流程图;
图5示意性示出了图4中步骤S410的流程图;
图6示意性示出了图4中步骤S410的另一流程图;
图7示意性示出了图6中步骤S604的流程图;
图8示意性示出了图4中步骤S412的流程图;
图9示意性示出了根据本申请实施例二的弹幕呈现方法的另一流程图;
图10示意性示出了根据本申请实施例三的通信系统的框图;及
图11示意性示出了根据本申请实施例四的适于实现弹幕呈现方法的计算机设备的硬件架构示意图。
具体实施方式
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本申请,并不用于限定本申请。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
图1示意性示出了根据本申请实施例的弹幕呈现方法的环境应用示意图。
提供商网络2可以通过网络9连接多个计算机设备10。在一些实施例中,内容服务3由提供商网络2提供。在其他实施例中,内容服务3可以由与提供商网络2连接的独立内容商提供。
内容服务3可以包括诸如互联网协议视频流服务之类的内容流服务。内容流服务可以被配置为经由各种传输技术来分发内容。内容服务3可以被配置为提供诸如视频,音频,文本数据,其组合等的内容。内容可以包括内容流(例如,视频流,音频流,信息流),内容文件(例如,视频文件,音频文件,文本文件)和/或其他数据。
提供商网络2可以实现弹幕服务,该弹幕服务被配置为允许用户评论和/或共享与内容相关联的评论。弹幕内容可以与内容一起呈现在同一屏幕上。例如,弹幕内容可以在内容上方的覆盖图中显示。弹幕内容在显示时可能会带有动画效果。例如,弹幕内容可以被显示为在内容上滚动(例如,从右到左,从左到右,从上到下,从下到上),这种动画效果可以基于CSS3(cascading style sheets,层叠样式表)的transition属性实现的。
提供商网络2可以位于诸如单个场所之类的数据中心,或者分布在不同的地理位置(例如,在多个场所)中。提供商网络2可以经由一个或多个网络9提供服务。网络9包括各种网络设备,例如路由器,交换机,多路复用器,集线器,调制解调器,网桥,中继器,防火墙,代理设备和/或类似。网络9可以包括物理链路,例如同轴电缆链路,双绞线电缆链路,光纤链路,其组合等。网络9可以包括无线链路,诸如蜂窝链路,卫星链路,Wi-Fi链路等。
提供商网络2可以包括消息服务5。消息服务5可以被配置为接收多个消息。所述多个消息可以包括与内容相关联的多个弹幕内容以及与所述多个弹幕内容有关的信息。
消息服务5可以被配置为管理用于各种内容项的消息。用户可以浏览内容并访问不同的内容项以查看针对特定内容的评论,例如其他用户针对该特定内容发布的评论。来自与特定内容项目相关联的用户的评论可以被输出到观看该特定内容项目的其他用户。例如,访问内容项目(例如,视频剪辑)的所有用户可以查看与该内容项目相关联的评论。输入的弹幕内容可以实时或接近实时地输出。
消息服务5可以被配置为处理多个消息。消息服务5可以基于与相应弹幕内容相关联 的信息(例如,时间戳,递增的标识符)来实现对多个消息的队列或以其他方式优先处理。消息服务5可以被配置为使用负载平衡来处理多个消息。例如,消息服务5可以被配置为使用多个处理节点中的一个或多个来处理多个消息,对消息进行优先级排序,对消息进行负载平衡等。消息服务5可以至少临时地存储多个消息。消息服务5可以将多个消息存储在诸如数据库的数据存储中。
消息服务5可以被配置为通过执行分组过程来处理消息。分组过程可以包括基于特征对多个消息进行分组。如果两个消息具有相同的特征或在特征的阈值范围内,则可以将这两个消息分为一组。与特定内容项(例如,流,文件,节目,电影,歌曲,游戏会话)相关联的消息可以与同一组相关联。例如,消息可以包括内容标识符或与内容标识符相关联。内容标识符可以唯一地标识内容项。如果在消息中找到了内容标识符,或者与消息相关联(例如,单独发送),则消息服务5可以将消息与与内容项相关联的组相关联。
消息服务5可以执行自然语言处理,主题识别,模式识别,人工智能等,以自动确定消息的特征和/或对消息进行分组。作为示例,频繁出现的短语或模式可以被识别为主题。作为另一个示例,可以维护与内容相关联的主题的数据库。主题可以包括流派(例如,动作,戏剧,喜剧),个性(例如,演员,女演员,导演),语言等。可以基于客户端设备和/或发送消息的用户的特征对消息进行分组。可以存储人口统计学,兴趣,历史和/或类似物以供多个用户确定消息的潜在分组。
消息服务5可以进一步被配置为通过生成输出数据来处理消息。输出数据可以包括用于实现基于相应上下文输出评论的指令。输出数据可以包括用于基于上下文指示应用覆盖评论的应用数据。输出数据可以包括用于生成(例如,编码)与评论相对应的内容的指令。
输出数据可以用于生成(例如,编码)输出弹幕内容,例如输出内容流。输出的评论内容可以与诸如内容服务3所提供的内容之类的原始内容项进行组合(例如,多路复用)。所得的组合可以包括单个包装(例如,容器,运输容器,运输流)中的内容。包可包括原始内容项以及输出的弹幕内容(例如,显示在原始内容项的顶部)。
消息服务5可以进一步被配置为通过执行筛选过程来处理消息。筛选过程可以包括拒绝或标记与筛选标准匹配的消息。筛选标准可以指定术语和/或短语,例如亵渎,仇恨言论,不雅语言等。筛选标准可以指定字符,例如符号,字体等。筛选标准可以指定语言,计算机可读代码模式等。
提供商网络2可以进一步包括处理服务6。处理服务6可以被配置为提供对各种服务的处理,例如提供商网络2的服务。处理服务6可以包括多个网络节点8。多个网络节点8可以处理与消息服务5相关联的任务。多个网络节点8可以被实现为一个或多个计算设备,一个或多个处理器,一个或多个虚拟计算实例,它们的组合,和/或类似的东西。
多个网络节点8可以由一个或多个计算设备实现。一个或多个计算设备可以包括虚拟化的计算实例。虚拟化的计算实例可以包括虚拟机,例如计算机系统,操作系统,服务器等的仿真。计算设备可以基于虚拟映像和/或定义用于仿真的特定软件(例如,操作系统,专用应用程序,服务器)的其他数据,由计算设备加载虚拟机。随着对不同类型的处理服 务的需求改变,可以在一个或多个计算设备上加载和/或终止不同的虚拟机。可以实现管理程序来管理同一计算设备上不同虚拟机的使用。
在一些实施例中,多个网络节点8可以处理由多个计算机设备提交的事件。这些事件可以与讨论实时新闻,视频,社交热点,针对某些用户帐户的报告等相关联。在其他实施例中,多个网络节点8可以处理针对审阅网络社区中的事件的多个用户账户的性能评估。在一些实现中,这些服务可以被实现为专用计算设备,专用处理器,专用虚拟机实例和/或类似物。在其他实现中,各种不同的节点可以实现与这些服务相关联的任何功能。
多个计算机设备10可以被配置为访问提供商网络2的内容和服务。多个计算机设备10可以包括任何类型的电子设备,诸如移动设备、平板设备、膝上型计算机、工作站、虚拟现实设备,游戏设备、机顶盒、数字流媒体设备、车辆终端、智能电视、机顶盒、电子书阅读器等。
多个计算机设备10可以与一个或多个用户相关联。单个用户可以使用多个计算机设备10中的一个或多个来访问提供商网络2。多个计算机设备10可以旅行到各种位置并使用不同的网络来访问提供商网络2。
计算机设备10可以包括应用12。应用12将内容输出(例如,显示、渲染、呈现)给用户。所述应用12可以是视频客户端(如bilibili客户端)、浏览器客户端或基于微信的微信小程序等。内容可以包括视频,音频,弹幕内容和/或类似物。所述弹幕内容可以是文字、表情、图案等,可以有不同的颜色、大小、动画、滚动方向等。
作为示例,应用程序12可以将针对某些用户的报告发送到处理服务,并且应用程序12还可以将关于报告的评论发送到处理服务6。从多个计算机设备10发送的事件或评论包括提交事件的原因,与事件相关联的内容属性,用户帐户信息等。
实施例一
图2示意性示出了根据本申请实施例一的弹幕呈现方法的流程图。可以理解,本方法实施例可以被执行在计算机设备10中,且本方法实施例的流程图不用于对执行步骤的顺序进行限定。
如图2所示,该弹幕呈现方法可以包括步骤S200~S208,其中:
步骤S200,获取视频播放页面。
步骤S202,获取多个原始弹幕数据,每个原始弹幕数据包括弹幕内容和弹幕发射时间。
步骤S204,克隆所述多个原始弹幕数据,得到多个弹幕数据。
步骤S206,根据各个弹幕数据的弹幕发射时间,从所述多个弹幕数据中获取多个目标弹幕数据。
步骤S208,将所述多个目标弹幕数据中的至少一个弹幕内容呈现在所述视频播放页面的弹幕播放区域中。
为了使得本申请更加清晰易懂,下面提供一个具体示例,需要说明的是,该示例并不 用于限制本申请。
①计算机设备10向提供商网络2发起原始弹幕数据请求。
②计算机设备10接收提供商网络2响应所述页面访问请求所返回的XML(extensible mariup language,可扩展标记语言)文件。
③编译XML文件以获取多个原始弹幕数据。
具体的,将XML文件编译为Element对象,从Element对象上获取到多个原始弹幕数据,如弹幕内容、发射时间、弹幕颜色、运动时间等属性(原始弹幕数据),并将这些属性转化为json的数据格式存储到本地数组中,得到存储在本地数组中的多个原始弹幕数据。所述多个原始弹幕数据可以是所述提供商网络多个推送得到的,所述多个原始弹幕数据包括历史原始弹幕数据和实时原始弹幕数据。
④计算机设备10克隆所述多个原始弹幕数据,得到多个弹幕数据。
在弹幕筛选和使用过程中,弹幕状态可能发生变化,当播放进度条拉回到先前的某个播放时间节点时,弹幕数据由于状态发生变化已经不能使用,往往需要从提供商网络2再次请求下载。
克隆操作的优势如下:获取所述多个原始弹幕数据之后,将所述多个原始弹幕数据作为原始数据;克隆多个原始弹幕数据得到第一次克隆操作对应的多个弹幕数据,将第一次克隆操作对应的多个弹幕数据用于弹幕显示操作,当播放进度条拉回到先前的某个播放时间节点时,则克隆作为原始数据的所述多个原始弹幕数据,得到第二次克隆操作对应的多个弹幕数据,将第二次克隆操作对应的多个弹幕数据用于弹幕显示操作。不难理解,本实施例中,当播放进度条每次拉回到先前的播放时间节点,无需从提供商网络2中再次请求下载,再次执行克隆操作即可。
⑤计算机设备10根据各个弹幕数据的弹幕发射时间,从所述多个弹幕数据中获取多个目标弹幕数据。
所述弹幕计算器和弹幕时间线是位于应用12(如浏览器、微信小程序)的逻辑层的,可以通过该逻辑层让让弹幕时间线与弹幕计算器以递归调用的帧渲染模式并行工作。
在示例性的实施例中,如图3所示,所述步骤S206进一步包括步骤S300~302,其中:步骤S300,通过弹幕计算器遍历所述多个弹幕数据,获取与弹幕时间线的当前时间匹配的若干个弹幕数据。步骤S302,将所述若干个弹幕数据确定为所述多个目标弹幕数据。具体的:由弹幕计算器对所述多个弹幕数据进行遍历筛选,其中满足发射时间的若干个弹幕数据将向后被添加待发射弹幕队列中,同时这些添加到待发射弹幕队列中的若干个弹幕数据会从所述多个弹幕数据中删除,以减少后续遍历次数。
当弹幕计算器检测所述多个克隆大幕数据发射完毕时,所述弹幕计算器和所述弹幕时间线终止运行并重置弹幕系统。另外,如果计算机设备10检测到用户点击了暂停按钮或者视频播放完毕时,所述弹幕计算器与所述弹幕时间线也会同时暂停或终止运行。
⑥计算机设备10将所述多个目标弹幕数据中的至少一个弹幕内容呈现在所述视频播放页面的弹幕播放区域中。
计算机设备10筛选出所述多个目标弹幕数据之后,遍历查找弹幕播放区域中是否有处于空闲状态下的弹幕轨道。如果所有弹幕轨道在当前均未处于空闲状态,则丢弃待发射弹幕队列中的多个目标弹幕数据。如果有一个或多个弹幕轨道处于空闲状态下,则将待发射弹幕队列中的一个或多个目标弹幕数据向后添加到渲染列表中,利用CSS3中的transition属性作为各个弹幕内容的运动动画,更新视图层数据通知视图层进行渲染更新。
以微信小程序为例:渲染过程和显示过程是微信小程序框架依据MVC(model–view–controller)模式思想封装的功能,渲染由微信小程序的框架来完成。以以下一条弹幕数据为例:
Figure PCTCN2020081490-appb-000001
Figure PCTCN2020081490-appb-000002
这条弹幕数据在WXML(微信标记语言,WeiXinMariup Language)文件中绑定在元素上,当前通过setData API通知微信小程序按照数据更新视图时,微信小程序就会依据这条弹幕数据渲染出一条字体颜色为白色、内容为“我是弹幕的文字内容”、运动方式为从原点运动到自身宽度100%距离进行线性运动且运动时间为0.6秒的弹幕内容。这种动画效果可以基于CSS3的transition属性实现的。
实施例二
图4示意性示出了根据本申请实施例二的弹幕呈现方法的流程图。该弹幕呈现方法可以包括步骤S400~步骤S412,其中:
步骤S400,获取视频播放页面。
步骤S402,获取多个原始弹幕数据,每个原始弹幕数据包括弹幕内容和弹幕发射时间。
例如,原始弹幕数据可以包括如下信息:
Figure PCTCN2020081490-appb-000003
Figure PCTCN2020081490-appb-000004
步骤S404,克隆所述多个原始弹幕数据,得到多个弹幕数据。
步骤S406,根据各个弹幕数据的弹幕发射时间,从所述多个弹幕数据中获取多个目标弹幕数据。
步骤S408,将所述多个目标弹幕数据添加到待发射弹幕队列中。
计算机设备10在所述视图层进行数据更新操作,根据所述处于待发射状态的弹幕数据执行第一次渲染操作。
如:在可视区之外,插入真实的弹幕元素,用户无法看到并且没有添加运动效果,这么做是为了获取弹幕元素的真实的弹幕宽度,来计算弹幕内容的运动初始位置和运动终点位置,以及用于作为判断多个弹幕轨道是否有处于空闲状态的弹幕轨道的依据之一。
为了减少后续遍历次数,还可以包括步骤:更新所述多个弹幕数据,以从所述多个弹幕数据中删除所述多个目标弹幕数据。即,在每个目标弹幕数据被功添加到所述待发射弹幕队列之后,就会将该目标弹幕数据从所述多个弹幕数据中删除。
步骤S410,根据虚拟弹幕轨道判断各个弹幕轨道的当前状态。
所述弹幕播放区域包括多个弹幕轨道。所述虚拟弹幕轨道为预先配置的嵌套数组,所述嵌套数组中包括多个子数组,每个子数组映射所述多个弹幕轨道中的其中一个弹幕轨道。
所谓虚拟弹幕轨道的提出,为了达到良好的弹幕视觉效果,每一条弹幕内容都不能被其他弹幕内容遮挡,这需要实现各个弹幕内容之间互相不重叠。虚拟弹幕轨道实质上是以数组嵌套数组的数据格式来模拟弹幕内容与弹幕轨道之间的关系。虚拟弹幕轨道内的弹幕数据并不参与视图层的渲染,而是通过数据的形式来映射当前的弹幕内容与弹幕轨道的关系。虚拟弹幕轨道的工作原理是:通过弹幕系统初始化时配置的弹幕轨道数量来向一个数组对象中向后推入相同数量的数组对象,类似于[[],[],[],[],…]这样的形式。其中嵌套数组中的每个子数组代表一条弹幕轨道。
为确保各个弹幕内容之间互相不重叠,提供以下判断机制:
判断机制1,如图5所示,所述步骤S410可以包括步骤S500~S506:
步骤S500:判断第i个子数组是否为空,所述第i个子数组对应第i个弹幕轨道。如果是,进入步骤S502;否则进入步骤S504。
步骤S502:确定所述第i个弹幕轨道的当前状态为空闲状态。
步骤S504:确定所述第i个弹幕轨道的当前状态为拥挤状态。
步骤S506:更新i的取值,并基于更新后的i的取值执行步骤S500~S506直至i等于M;其中,1≤i≤M,i的初始值为1,M表示所述多个弹幕轨道的数量。
判断机制2,如图6所示,所述步骤S410可以包括步骤S600~S608:
步骤S600:判断第i个子数组是否为空,所述第i个子数组对应第i个弹幕轨道。如果是,进入步骤S602;如果否,则说明第i个弹幕轨道上已经存在正在运动中的弹幕内容,进入步骤S604。
步骤S602:确定所述第i个弹幕轨道的当前状态为空闲状态。
步骤S604:判断所述待发射弹幕队列中的待发射队首弹幕数据中的队首弹幕内容和所述已发射尾部弹幕数据中的尾部弹幕内容是否会发生碰撞。如果不是,进入步骤S602;否则进入S606。
需要说明的是,所述待发射队首弹幕数据为位于所述待发射弹幕队列头部的目标弹幕数据。所述已发射尾部弹幕数据为位于所述第i个数组尾部的已发射弹幕数据,所述已发射尾部弹幕数据即对应第i个数组中最后的那个弹幕数据,所述尾部弹幕内容即对应于呈现在第i个弹幕轨道中的最晚发射的那个弹幕内容。
在示例性的实施例中,如图7所示,步骤S604可以通过步骤S700~S708实现,其中:步骤S700,根据所述已发射尾部弹幕数据中的发射时间t 1和运动时间t 2,计算所述已发射尾部弹幕数据中的尾部弹幕内容在所述弹幕播放区域的呈现时间t 1+t 2;步骤S702,根据所述待发射队首弹幕数据的发射时间t 3、运动时间t 4、弹幕宽度w 2和所述弹幕播放区域的显示宽度w 1,计算所述待发射队首弹幕数据中的队首弹幕内容达到所述弹幕播放区域的左边界(也可以是其他边界,视运动终点位置而定)时的达到时间t 3+[w 1*t 4/(w 1+w 2)];步骤S704,判断所述呈现时间t 1+t 2是否小于所述到达时间t 3+[w 1*t 4/(w 1+w 2)];如果所述呈现时间t 1+t 2小于所述到达时间t 3+[w 1*t 4/(w 1+w 2)],则进入步骤S706,否则进入步骤S708;步骤S706,确定所述待发射队首弹幕数据中的队首弹幕内容和所述已发射尾部弹幕数据中的尾部弹幕内容不会发生碰撞;步骤S708,确定所述待发射队首弹幕数据中的队首弹幕内容和所述已发射尾部弹幕数据中的尾部弹幕内容会发生碰撞。
不难理解,假设第i个弹幕轨道中最后一条弹幕内容的发射时间为t 1且运动时间为t 2,那么这最后一条弹幕内容完全消失在弹幕播放区域(可视区)的时间就是t 1+t 2,而所述待发射队首弹幕数据的发射时间t 3、运动时间t 4、弹幕宽度w 2和所述弹幕播放区域的显示宽度w 1,那么所述待发射队首弹幕数据的队首弹幕内容的运动速度为就是s 1=(w 1+w 2)/t 4,由此可以得出所述待发射队首弹幕数据的队首弹幕内容第一次到达弹幕播放区域的左边边界的时间为t 3+(w 1/s 1)。当t 1+t 2<t 3+(w 1/s 1)时,则表示当这最后一条弹幕内容完全消失在弹幕播放区域范围时,所述待发射队首弹幕数据的队首弹幕内容仍然没有追上这最后一条弹幕内容,也就意味着这最后一条弹幕内容和所述待发射队首弹幕数据的队首弹幕内容之间不会相撞,因此可以将所述第i个弹幕轨道的当前状态确定为空闲状态。
步骤S606:确定所述第i个弹幕轨道的当前状态为拥挤状态。
步骤S608:更新i的取值,并基于更新后的i的取值执行步骤600~S608直至i等于M;其中,1≤i≤M,i的初始值为1,M表示所述多个弹幕轨道的数量。
步骤S412,根据各个弹幕轨道的当前状态,确定是否将所述待发射弹幕队列中的至少一个目标弹幕数据发射出去,以将所述至少一个目标弹幕数据中的至少一个弹幕内容呈现 在所述视频播放页面的弹幕播放区域中。
弹幕播放区域可以是视频播放区域,也可以是其他区域。
弹幕轨道可以为空闲状态或拥挤状态。
如果第i个弹幕轨道的当前状态为空闲状态,则确定将所述待发射弹幕队列中的至少一个目标弹幕数据发射出去,以将所述至少一个目标弹幕数据中的至少一个弹幕内容呈现在所述弹幕播放区域中。
如果第i个弹幕轨道的当前状态为拥挤状态,则确定不将所述待发射弹幕队列中的至少一个目标弹幕数据发射出去。
示例1:
第i个弹幕轨道的当前状态为空闲状态,如图8所示,所述步骤S412可以包括步骤S800~S804,其中:步骤S800,将所述待发射弹幕队列中的待发射队首弹幕数据添加到所述第i个数组中;步骤S802,将所述待发射弹幕队列中的待发射队首弹幕数据添加到所述渲染列表中,以将所述待发射队首弹幕数据对应的队首弹幕内容经渲染操作后呈现在所述弹幕播放区域中的第i个弹幕轨道上;步骤S804,更新所述待发射弹幕队列中的待发射队首弹幕数据。
例如:所述待发射弹幕队列中从队首到队尾依次为目标弹幕数据A1、目标弹幕数据A2、目标弹幕数据A3、…,所述待发射弹幕队列中的待发射队首弹幕数据当前为目标弹幕数据A1。
①通过第一个子数组判断第二个弹幕轨道的当前状态。
②在第一个弹幕轨道的当前状态为空闲状态时,将目标弹幕数据A1向后分别添加到渲染列表中和第一个子数组中,并将目标弹幕数据A1从所述待发射弹幕数据删除,以将目标弹幕数据A1的后续目标弹幕数据(即,目标弹幕数据A2)更新为所述待发射弹幕队列中的待发射队首弹幕数据。位于渲染列表中的目标弹幕数据A1中的弹幕内容会经历如下操作:更新渲染运动动画样式等。位于第一个子数组中的目标弹幕数据A2用于表示所述第一个弹幕轨道中目前存在目标弹幕数据2的弹幕内容。
③接着通过第二个子数组判断第二个弹幕轨道的当前状态。
④在第二个弹幕轨道的当前状态为空闲状态时,将目标弹幕数据A2向后分别推入到渲染列表中和第二个子数组中,并将目标弹幕数据A2从所述待发射弹幕数据删除,以将目标弹幕数据A2的后续目标弹幕数据(即,目标弹幕数据A3)更新为所述待发射弹幕队列中的待发射队首弹幕数据。
⑤接着通过第三个子数组判断第三个弹幕轨道的当前状态。
⑥在第三个弹幕轨道的当前状态为拥挤状态时,则直接接着通过第四个子数组判断第四个弹幕轨道的当前状态。
依次类推,本文不再赘述。
另,在被添加到渲染列表和第i个子数组之后,位于所述待发射弹幕队列头部的这个目标弹幕数据会被删除,以将这个目标弹幕数据的后续目标弹幕数据(如,位置仅次于这 个目标弹幕数据的后续目标弹幕数据)更新为所述待发射弹幕队列中的待发射队首弹幕数据,这条目标弹幕数据会从待发射弹幕队列中被删除。
示例2:
如果所有弹幕轨道全部都处于拥挤状态,则认为当前弹幕数量过多并超出屏幕渲染能力,因此可以将所述待发射弹幕队列中的至少一个目标弹幕数据删除掉。
①通过第一个子数组判断第一个弹幕轨道的当前状态。
②在第一个弹幕轨道的当前状态为拥挤状态时,则直接接着通过第二个子数组判断第二个弹幕轨道的当前状态。
③在第二个弹幕轨道的当前状态为拥挤状态时,则直接接着通过第三个子数组判断第三个弹幕轨道的当前状态。
依次类推,如果所有弹幕轨道(M个轨道)均处于拥挤状态,则删除所述待发射弹幕队列中的所述多个目标弹幕数据。
如图9所示,下面提供一个用于辅助理解的具体示例,需要说明的是,该示例并不用于限制专利保护范围。
步骤S900,对微信小程序页面执行初始化操作。
步骤S902,发起原始弹幕数据请求。
在所述微信小程序页面完成初始化之后,弹幕加载器向提供商网络2发起原始弹幕数据请求,并接收提供商网络2返回的XML(extensible mariup language,可扩展标记语言)文件。
所述弹幕加载器位于微信小程序页面的逻辑层。该逻辑层还包括弹幕计算器和弹幕时间线。
步骤S904,编译XML文件以获取多个原始弹幕数据。
具体的,将XML文件编译为Element对象,从Element对象上获取到多个原始弹幕数据,如弹幕内容、发射时间、弹幕颜色、运动时间等属性(原始弹幕数据),并将这些属性转化为json的数据格式存储到本地数组中,得到存储在本地数组中的多个原始弹幕数据。然后,克隆所述多个原始弹幕数据,得到所述多个弹幕数据。理由如下:
在弹幕筛选和使用过程中,弹幕状态可能发生变化,当播放进度条拉回到先前的某个播放时间节点时,弹幕数据由于状态发生变化已经不能使用,往往需要从提供商网络2再次请求下载。
在本实施例中:获取的多个原始弹幕数据位于原始数据,不用于弹幕播放操作;其做法如下:克隆多个原始弹幕数据得到第一次克隆操作对应的多个弹幕数据,将第一次克隆操作对应的多个弹幕数据用于弹幕播放操作,当播放进度条拉回到先前的某个播放时间节点时,则克隆作为原始数据的所述多个原始弹幕数据,得到第二次克隆操作对应的多个弹幕数据,将第二次克隆操作对应的多个弹幕数据用于弹幕播放操作。不难理解,本实施例中,当播放进度条每次拉回到先前的播放时间节点,无需从提供商网络2中再次请求下载, 再次执行克隆操作即可。
所述多个弹幕数据用于后续的弹幕播放操作。
步骤S906,开始弹幕播放;
所述弹幕计算器用于弹幕筛选和计算。所述弹幕时间线用于管理弹幕时间线,即同步视频流的当前播放时间。
所述弹幕计算器和弹幕时间线是位于应用12(如浏览器、微信小程序)的逻辑层的,可以通过该逻辑层让让弹幕时间线与弹幕计算器以递归调用的帧渲染模式并行工作。
当弹幕计算器检测到所述多个弹幕数据发射完毕时,所述弹幕计算器和所述弹幕时间线终止运行并重置弹幕系统。另外,如果计算机设备10检测到用户点击了暂停按钮或者视频播放完毕时,所述弹幕计算器与所述弹幕时间线也会同时暂停或终止运行。
步骤S908,通过弹幕计算器遍历各个弹幕数据,以计算和筛选各个弹幕数据是否处于待发射状态或处于过期状态。
下面以其中一个弹幕数据j为例:
步骤S910,判断弹幕数据j是否到达发射时间。如果是,进入步骤S912,否则进入步骤S914。
根据视频流的当前播放时间和弹幕数据j中的发射时间,判断弹幕数据j中的弹幕内容是否达到发射时间,也就是说,弹幕数据j在当前是否处于待发射状态。
步骤S912,将弹幕数据j添加到待发射弹幕队列中,通知所述视图层进行数据更新操作以执行第一次渲染操作。进入步骤S918。
通知所述视图层进行数据更新操作,根据所述处于待发射状态的弹幕数据j执行第一次渲染操作。
如:在可视区之外,插入真实的弹幕元素,用户无法看到并且没有添加运动效果,这么做是为了获取弹幕元素的真实的弹幕宽度,来计算弹幕内容的运动初始位置和运动终点位置,以及用于作为判断多个弹幕轨道是否有处于空闲状态的弹幕轨道的依据之一。
添加到待发射弹幕队列中的弹幕数据j会从所述多个弹幕数据中删除,以减少后续遍历次数。
步骤S914,判断弹幕数据j是否处于过期状态。如果是,进入步骤S916;否则,该弹幕数据j将等待下一次遍历操作。
步骤S916,销毁弹幕数据j。例如,将弹幕数据j从所述多个弹幕数据删除,以减少后续遍历次数。
步骤S918,判断当前是否有空闲的弹幕轨道。如果是,进入步骤S920,否则进入步骤S916。
示例性的,获取所述第一次渲染操作得到的弹幕元素的弹幕宽度。根据所述弹幕元素的弹幕宽度,判断多个弹幕轨道中是否包括处于空闲状态下的弹幕轨道。
①判断第i个子数组是否为空,所述第i个子数组对应第i个弹幕轨道;
②如果所述第i个子数组为空,则确定所述第i个弹幕轨道的当前状态为空闲状态。
③如果所述第i个子数组不为空:假设第i个弹幕轨道中最后一条弹幕内容的发射时间为t 1且运动时间为t 2,那么这最后一条弹幕内容完全消失在弹幕播放区域(可视区)的时间就是t 1+t 2,而弹幕数据j的发射时间t 3、运动时间t 4、弹幕宽度w 2和所述弹幕播放区域的显示宽度w 1,那么弹幕数据j的运动速度为就是s 1=(w 1+w 2)/t 4,由此可以得出所述弹幕数据j的弹幕内容第一次到达弹幕播放区域的左边边界的时间为t 3+(w 1/s 1)。当t 1+t 2<t 3+(w 1/s 1)时,则表示当这最后一条弹幕内容完全消失在弹幕播放区域范围时,弹幕数据j的弹幕内容仍然没有追上这最后一条弹幕内容,也就意味着这最后一条弹幕内容和弹幕数据j的弹幕内容之间不会相撞,因此可以将所述第i个弹幕轨道的当前状态确定为空闲状态。
步骤S920,加入虚拟弹幕轨迹和渲染队列,通知所述视图层进行数据更新操作以执行第二次渲染操作。
①将所述待发射弹幕队列中的弹幕数据j加入到虚拟弹幕轨道中。其中,所述虚拟弹幕轨道用于判断各个弹幕轨道是否处于空闲状态。
②将所述待发射弹幕队列中的弹幕数据j加入到渲染列表中,以进一步创建相应的弹幕元素,如运动效果。
实施例三
图10示意性示出了根据本申请实施例三的弹幕呈现系统的框图,该弹幕呈现系统可以被分割成一个或多个程序模块,一个或者多个程序模块被存储于存储介质中,并由一个或多个处理器所执行,以完成本申请实施例。本申请实施例所称的程序模块是指能够完成特定功能的一系列计算机可读指令段,以下描述将具体介绍本实施例中各程序模块的功能。
如图10所示,该弹幕呈现系统1000可以包括第一获取模块810、第二获取模块1020、克隆模块1030、第三获取模块1040及呈现模块1050,其中:
第一获取模块1010,用于获取视频播放页面。
第二获取模块1020,用于获取多个原始弹幕数据,每个原始弹幕数据包括弹幕内容和弹幕发射时间。
克隆模块1030,用于克隆所述多个原始弹幕数据,得到多个弹幕数据。
第三获取模块1040,用于根据各个弹幕数据的弹幕发射时间,从所述多个弹幕数据中获取多个目标弹幕数据。
呈现模块1050,用于将所述多个目标弹幕数据中的至少一个弹幕内容呈现在所述视频播放页面的弹幕播放区域中。
在示例性的实施例中的,第三获取模块1040,还用于:通过弹幕计算器遍历所述多个弹幕数据,获取与弹幕时间线的当前时间匹配的若干个弹幕数据;及将所述若干个弹幕数据确定为所述多个目标弹幕数据。
在示例性的实施例中,所述弹幕时间线与所述弹幕计算器是以递归调用的帧渲染模式并行工作的。
在示例性的实施例中,所述弹幕播放区域包括多个弹幕轨道;呈现模块1050,还用于:将所述多个目标弹幕数据添加到待发射弹幕队列中;及根据虚拟弹幕轨道判断各个弹幕轨道的当前状态,所述虚拟弹幕轨道为预先配置的嵌套数组,所述嵌套数组中包括多个子数组,每个子数组映射所述多个弹幕轨道中的其中一个弹幕轨道;及根据各个弹幕轨道的当前状态,确定是否将所述待发射弹幕队列中的至少一个目标弹幕数据发射出去,以将所述至少一个目标弹幕数据中的至少一个弹幕内容呈现在所述弹幕播放区域中。
在示例性的实施例中,呈现模块1050,还用于::S1,判断第i个子数组是否为空,所述第i个子数组对应第i个弹幕轨道;S2,如果所述第i个子数组为空,则确定所述第i个弹幕轨道的当前状态为空闲状态。
在示例性的实施例中,呈现模块1050,还用于:S3,如果所述第i个子数组不为空,则判断所述待发射弹幕队列中的待发射队首弹幕数据中的队首弹幕内容和所述已发射尾部弹幕数据中的尾部弹幕内容是否会发生碰撞,其中,所述待发射队首弹幕数据为位于所述待发射弹幕队列头部的目标弹幕数据,所述已发射尾部弹幕数据为位于所述第i个数组尾部的已发射弹幕数据;S4,如果所述待发射队首弹幕数据中的队首弹幕内容和所述已发射尾部弹幕数据中的尾部弹幕内容不会发生碰撞,则确定所述第i个弹幕轨道的当前状态为空闲状态。
在示例性的实施例中,判断所述待发射弹幕队列中的待发射队首弹幕数据中的队首弹幕内容和所述已发射尾部弹幕数据中的尾部弹幕内容是否会发生碰撞,包括:根据所述已发射尾部弹幕数据中的发射时间t 1和运动时间t 2,计算所述已发射尾部弹幕数据中的尾部弹幕内容在所述弹幕播放区域的呈现时间t 1+t 2;根据所述待发射队首弹幕数据的发射时间t 3、运动时间t 4、弹幕宽度w 2和所述弹幕播放区域的显示宽度w 1,计算所述待发射队首弹幕数据中的队首弹幕内容达到所述弹幕播放区域的左边界时的达到时间t 3+[w 1*t 4/(w 1+w 2)];判断所述呈现时间t 1+t 2是否小于所述到达时间t 3+[w 1*t 4/(w 1+w 2)];如果所述呈现时间t 1+t 2小于所述到达时间t 3+[w 1*t 4/(w 1+w 2)],则确定所述待发射队首弹幕数据中的队首弹幕内容和所述已发射尾部弹幕数据中的尾部弹幕内容不会发生碰撞;及如果所述呈现时间t 1+t 2不小于所述到达时间t 3+[w 1*t 4/(w 1+w 2)],则确定所述待发射队首弹幕数据中的队首弹幕内容和所述已发射尾部弹幕数据中的尾部弹幕内容会发生碰撞。
在示例性的实施例中,呈现模块1050,还用于:S5,如果所述待发射队首弹幕数据中的队首弹幕内容和所述已发射尾部弹幕数据中的尾部弹幕内容会发生碰撞,则确定所述第i个弹幕轨道的当前状态为拥挤状态。
在示例性的实施例中,呈现模块1050,还用于:更新i的取值,并基于更新后的i的取值执行步骤S1~S4直至i等于M;其中,1≤i≤M,i的初始值为1,M表示所述多个弹幕轨道的数量。
在示例性的实施例中,呈现模块1050,还用于:如果确定第一个轨道至第M个轨道均处于拥挤状态,则删除所述待发射弹幕队列中的所述多个目标弹幕数据。
在示例性的实施例中,呈现模块1050,还用于:如果确定所述第i个弹幕轨道的当前 状态为空闲状态:将所述待发射弹幕队列中的待发射队首弹幕数据添加到所述第i个数组中;将所述待发射弹幕队列中的待发射队首弹幕数据添加到所述渲染列表中,以将所述待发射队首弹幕数据对应的队首弹幕内容经渲染操作后呈现在所述弹幕播放区域中的第i个弹幕轨道上;及更新所述待发射弹幕队列中的待发射队首弹幕数据。
实施例四
图11示意性示出了根据本申请实施例四的适于实现弹幕呈现方法的计算机设备的硬件架构示意图。本实施例中,计算机设备10是一种能够按照事先设定或者存储的指令,自动进行数值计算和/或信息处理的设备。计算机设备10可以是诸如智能手机、电脑、投影仪、机顶盒等,也可以是虚拟机主机进程和一个或多个虚拟机实例,或者是机架式服务器、刀片式服务器、塔式服务器或机柜式服务器(包括独立的服务器,或者多个服务器所组成的服务器集群)等。如图11所示,计算机设备10至少包括但不限于:可通过系统总线相互通信链接存储器1110、处理器1120、网络接口1130。其中:
存储器1110至少包括一种类型的计算机可读存储介质,可读存储介质包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、随机访问存储器(RAM)、静态随机访问存储器(SRAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、可编程只读存储器(PROM)、磁性存储器、磁盘、光盘等。在一些实施例中,存储器1110可以是计算机设备10的内部存储模块,例如该计算机设备10的硬盘或内存。在另一些实施例中,存储器1110也可以是计算机设备10的外部存储设备,例如该计算机设备10上配备的插接式硬盘,智能存储卡(Smart Media Card,简称为SMC),安全数字(Secure Digital,简称为SD)卡,闪存卡(Flash Card)等。当然,存储器1110还可以既包括计算机设备10的内部存储模块也包括其外部存储设备。本实施例中,存储器1110通常用于存储安装于计算机设备10的操作系统和各类应用软件,例如弹幕呈现方法的程序代码等。此外,存储器1110还可以用于暂时地存储已经输出或者将要输出的各类数据。
处理器1120在一些实施例中可以是中央处理器(Central Processing Unit,简称为CPU)、控制器、微控制器、微处理器、或其他数据处理芯片。该处理器1120通常用于控制计算机设备10的总体操作,例如执行与计算机设备10进行数据交互或者通信相关的控制和处理等。本实施例中,处理器1120用于运行存储器1110中存储的程序代码或者处理数据。
网络接口1130可包括无线网络接口或有线网络接口,该网络接口1130通常用于在计算机设备10与其他计算机设备之间建立通信链接。例如,网络接口1130用于通过网络将计算机设备10与外部终端相连,在计算机设备10与外部终端之间的建立数据传输通道和通信链接等。网络可以是企业内部网(Intranet)、互联网(Internet)、全球移动通讯系统(Global System of Mobile communication,简称为GSM)、宽带码分多址(Wideband Code Division Multiple Access,简称为WCDMA)、4G网络、5G网络、蓝牙(Bluetooth)、Wi-Fi等无线或有线网络。
需要指出的是,图11仅示出了具有部件1010-1030的计算机设备,但是应理解的是, 并不要求实施所有示出的部件,可以替代的实施更多或者更少的部件。
在本实施例中,存储于存储器1110中的弹幕呈现方法还可以被分割为一个或者多个程序模块,并由一个或多个处理器(本实施例为处理器1120)所执行,以完成本申请。
实施例五
本实施例还提供一种计算机可读存储介质,计算机可读存储介质其上存储有计算机可读指令,所述计算机可读指令被处理器执行时实现以下步骤:
获取视频播放页面;
获取多个原始弹幕数据,每个原始弹幕数据包括弹幕内容和弹幕发射时间;
克隆所述多个原始弹幕数据,得到多个弹幕数据;
根据各个弹幕数据的弹幕发射时间,从所述多个弹幕数据中获取多个目标弹幕数据;及
将所述多个目标弹幕数据中的至少一个弹幕内容呈现在所述视频播放页面的弹幕播放区域中。
本实施例中,计算机可读存储介质包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、随机访问存储器(RAM)、静态随机访问存储器(SRAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、可编程只读存储器(PROM)、磁性存储器、磁盘、光盘等。在一些实施例中,计算机可读存储介质可以是计算机设备的内部存储单元,例如该计算机设备的硬盘或内存。在另一些实施例中,计算机可读存储介质也可以是计算机设备的外部存储设备,例如该计算机设备上配备的插接式硬盘,智能存储卡(Smart Media Card,简称为SMC),安全数字(Secure Digital,简称为SD)卡,闪存卡(Flash Card)等。当然,计算机可读存储介质还可以既包括计算机设备的内部存储单元也包括其外部存储设备。本实施例中,计算机可读存储介质通常用于存储安装于计算机设备的操作系统和各类应用软件,例如实施例中的弹幕呈现方法的程序代码等。此外,计算机可读存储介质还可以用于暂时地存储已经输出或者将要输出的各类数据。
显然,本领域的技术人员应该明白,上述的本申请实施例的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,可选地,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本申请实施例不限制于任何特定的硬件和软件结合。
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。

Claims (20)

  1. 一种弹幕呈现方法,包括:
    获取视频播放页面;
    获取多个原始弹幕数据,每个原始弹幕数据包括弹幕内容和弹幕发射时间;
    克隆所述多个原始弹幕数据,得到多个弹幕数据;
    根据各个弹幕数据的弹幕发射时间,从所述多个弹幕数据中获取多个目标弹幕数据;及
    将所述多个目标弹幕数据中的至少一个弹幕内容呈现在所述视频播放页面的弹幕播放区域中。
  2. 根据权利要求1所述的弹幕呈现方法,根据各个弹幕数据的弹幕发射时间,从所述多个弹幕数据中获取多个目标弹幕数据,包括:
    通过弹幕计算器遍历所述多个弹幕数据,获取与弹幕时间线的当前时间匹配的若干个弹幕数据;及
    将所述若干个弹幕数据确定为所述多个目标弹幕数据。
  3. 根据权利要求2所述的弹幕呈现方法,所述弹幕时间线与所述弹幕计算器是以递归调用的帧渲染模式并行工作的。
  4. 根据权利要求1所述的弹幕呈现方法,所述弹幕播放区域包括多个弹幕轨道;将所述多个目标弹幕数据中的至少一个弹幕内容呈现在所述视频播放页面的弹幕播放区域中,包括:
    将所述多个目标弹幕数据添加到待发射弹幕队列中;及
    根据虚拟弹幕轨道判断各个弹幕轨道的当前状态,所述虚拟弹幕轨道为预先配置的嵌套数组,所述嵌套数组中包括多个子数组,每个子数组映射所述多个弹幕轨道中的其中一个弹幕轨道;及
    根据各个弹幕轨道的当前状态,确定是否将所述待发射弹幕队列中的至少一个目标弹幕数据发射出去,以将所述至少一个目标弹幕数据中的至少一个弹幕内容呈现在所述弹幕播放区域中。
  5. 根据权利要求4所述的弹幕呈现方法,根据虚拟弹幕轨道判断各个弹幕轨道的当前状态,包括:
    S1,判断第i个子数组是否为空,所述第i个子数组对应第i个弹幕轨道;
    S2,如果所述第i个子数组为空,则确定所述第i个弹幕轨道的当前状态为空闲状态。
  6. 根据权利要求5所述的弹幕呈现方法,根据虚拟弹幕轨道判断各个弹幕轨道的当前状态,还包括:
    S3,如果所述第i个子数组不为空,则判断所述待发射弹幕队列中的待发射队首弹幕数据中的队首弹幕内容和所述已发射尾部弹幕数据中的尾部弹幕内容是否会发生碰撞,其中,所述待发射队首弹幕数据为位于所述待发射弹幕队列头部的目标弹幕数据,所述已发射尾部弹幕数据为位于所述第i个数组尾部的已发射弹幕数据;
    S4,如果所述待发射队首弹幕数据中的队首弹幕内容和所述已发射尾部弹幕数据中的尾部弹幕内容不会发生碰撞,则确定所述第i个弹幕轨道的当前状态为空闲状态。
  7. 根据权利要求6所述的弹幕呈现方法,判断所述待发射弹幕队列中的待发射队首弹幕数据中的队首弹幕内容和所述已发射尾部弹幕数据中的尾部弹幕内容是否会发生碰撞,包括:
    根据所述已发射尾部弹幕数据中的发射时间t 1和运动时间t 2,计算所述已发射尾部弹幕数据中的尾部弹幕内容在所述弹幕播放区域的呈现时间t 1+t 2
    根据所述待发射队首弹幕数据的发射时间t 3、运动时间t 4、弹幕宽度w 2和所述弹幕播放区域的显示宽度w 1,计算所述待发射队首弹幕数据中的队首弹幕内容达到所述弹幕播放区域的左边界时的达到时间t 3+[w 1*t 4/(w 1+w 2)];
    判断所述呈现时间t 1+t 2是否小于所述到达时间t 3+[w 1*t 4/(w 1+w 2)];
    如果所述呈现时间t 1+t 2小于所述到达时间t 3+[w 1*t 4/(w 1+w 2)],则确定所述待发射队首弹幕数据中的队首弹幕内容和所述已发射尾部弹幕数据中的尾部弹幕内容不会发生碰撞;及
    如果所述呈现时间t 1+t 2不小于所述到达时间t 3+[w 1*t 4/(w 1+w 2)],则确定所述待发射队首弹幕数据中的队首弹幕内容和所述已发射尾部弹幕数据中的尾部弹幕内容会发生碰撞。
  8. 根据权利要求6所述的弹幕呈现方法,根据虚拟弹幕轨道判断各个弹幕轨道的当前状态,还包括:
    S5,如果所述待发射队首弹幕数据中的队首弹幕内容和所述已发射尾部弹幕数据中的尾部弹幕内容会发生碰撞,则确定所述第i个弹幕轨道的当前状态为拥挤状态。
  9. 根据权利要求8所述的弹幕呈现方法,根据虚拟弹幕轨道判断各个弹幕轨道的当前状态,还包括:
    更新i的取值,并基于更新后的i的取值执行步骤S1~S4直至i等于M;
    其中,1≤i≤M,i的初始值为1,M表示所述多个弹幕轨道的数量。
  10. 根据权利要求9所述的弹幕呈现方法,根据各个弹幕轨道的当前状态,确定是否将所述待发射弹幕队列中的至少一个目标弹幕数据发射出去,以将所述至少一个目标弹幕数据中的至少一个弹幕内容呈现在所述弹幕播放区域中,包括:
    如果确定第一个轨道至第M个轨道均处于拥挤状态,则删除所述待发射弹幕队列中的所述多个目标弹幕数据。
  11. 根据权利要求5~8中任意一项所述的弹幕呈现方法,根据各个弹幕轨道的当前状态,确定是否将所述待发射弹幕队列中的至少一个目标弹幕数据发射出去,以将所述至少一个目标弹幕数据中的至少一个弹幕内容呈现在所述弹幕播放区域中,包括:
    如果确定所述第i个弹幕轨道的当前状态为空闲状态:
    将所述待发射弹幕队列中的待发射队首弹幕数据添加到所述第i个数组中;
    将所述待发射弹幕队列中的待发射队首弹幕数据添加到所述渲染列表中,以将所述待 发射队首弹幕数据对应的队首弹幕内容经渲染操作后呈现在所述弹幕播放区域中的第i个弹幕轨道上;及
    更新所述待发射弹幕队列中的待发射队首弹幕数据。
  12. 一种弹幕呈现系统,包括:
    第一获取模块,用于获取视频播放页面;
    第二获取模块,用于获取多个原始弹幕数据,每个原始弹幕数据包括弹幕内容和弹幕发射时间;
    克隆模块,用于克隆所述多个原始弹幕数据,得到多个弹幕数据;
    第三获取模块,用于根据各个弹幕数据的弹幕发射时间,从所述多个弹幕数据中获取多个目标弹幕数据;及
    呈现模块,用于将所述多个目标弹幕数据中的至少一个弹幕内容呈现在所述视频播放页面的弹幕播放区域中。
  13. 一种计算机设备,包括存储器、处理器以及存储在存储器上并可在处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现以下步骤:
    获取视频播放页面;
    获取多个原始弹幕数据,每个原始弹幕数据包括弹幕内容和弹幕发射时间;
    克隆所述多个原始弹幕数据,得到多个弹幕数据;
    根据各个弹幕数据的弹幕发射时间,从所述多个弹幕数据中获取多个目标弹幕数据;
    将所述多个目标弹幕数据中的至少一个弹幕内容呈现在所述视频播放页面的弹幕播放区域中。
  14. 根据权利要求13所述的计算机设备,根据各个弹幕数据的弹幕发射时间,从所述多个弹幕数据中获取多个目标弹幕数据,包括:
    通过弹幕计算器遍历所述多个弹幕数据,获取与弹幕时间线的当前时间匹配的若干个弹幕数据;及
    将所述若干个弹幕数据确定为所述多个目标弹幕数据。
  15. 根据权利要求14所述的计算机设备,所述弹幕时间线与所述弹幕计算器是以递归调用的帧渲染模式并行工作的。
  16. 根据权利要求13所述的计算机设备,所述弹幕播放区域包括多个弹幕轨道;将所述多个目标弹幕数据中的至少一个弹幕内容呈现在所述视频播放页面的弹幕播放区域中,包括:
    将所述多个目标弹幕数据添加到待发射弹幕队列中;及
    根据虚拟弹幕轨道判断各个弹幕轨道的当前状态,所述虚拟弹幕轨道为预先配置的嵌套数组,所述嵌套数组中包括多个子数组,每个子数组映射所述多个弹幕轨道中的其中一个弹幕轨道;及
    根据各个弹幕轨道的当前状态,确定是否将所述待发射弹幕队列中的至少一个目标弹幕数据发射出去,以将所述至少一个目标弹幕数据中的至少一个弹幕内容呈现在所述弹幕 播放区域中。
  17. 根据权利要求16所述的计算机设备,根据虚拟弹幕轨道判断各个弹幕轨道的当前状态,包括:
    S1,判断第i个子数组是否为空,所述第i个子数组对应第i个弹幕轨道;
    S2,如果所述第i个子数组为空,则确定所述第i个弹幕轨道的当前状态为空闲状态。
  18. 根据权利要求17所述的计算机设备,根据虚拟弹幕轨道判断各个弹幕轨道的当前状态,还包括:
    S3,如果所述第i个子数组不为空,则判断所述待发射弹幕队列中的待发射队首弹幕数据中的队首弹幕内容和所述已发射尾部弹幕数据中的尾部弹幕内容是否会发生碰撞,其中,所述待发射队首弹幕数据为位于所述待发射弹幕队列头部的目标弹幕数据,所述已发射尾部弹幕数据为位于所述第i个数组尾部的已发射弹幕数据;
    S4,如果所述待发射队首弹幕数据中的队首弹幕内容和所述已发射尾部弹幕数据中的尾部弹幕内容不会发生碰撞,则确定所述第i个弹幕轨道的当前状态为空闲状态。
  19. 根据权利要求18所述的计算机设备,判断所述待发射弹幕队列中的待发射队首弹幕数据中的队首弹幕内容和所述已发射尾部弹幕数据中的尾部弹幕内容是否会发生碰撞,包括:
    根据所述已发射尾部弹幕数据中的发射时间t 1和运动时间t 2,计算所述已发射尾部弹幕数据中的尾部弹幕内容在所述弹幕播放区域的呈现时间t 1+t 2
    根据所述待发射队首弹幕数据的发射时间t 3、运动时间t 4、弹幕宽度w 2和所述弹幕播放区域的显示宽度w 1,计算所述待发射队首弹幕数据中的队首弹幕内容达到所述弹幕播放区域的左边界时的达到时间t 3+[w 1*t 4/(w 1+w 2)];
    判断所述呈现时间t 1+t 2是否小于所述到达时间t 3+[w 1*t 4/(w 1+w 2)];
    如果所述呈现时间t 1+t 2小于所述到达时间t 3+[w 1*t 4/(w 1+w 2)],则确定所述待发射队首弹幕数据中的队首弹幕内容和所述已发射尾部弹幕数据中的尾部弹幕内容不会发生碰撞;及
    如果呈现时间t 1+t 2不小于到达时间t 3+[w 1*t 4/(w 1+w 2)],则确定所述待发射队首弹幕数据中的队首弹幕内容和所述已发射尾部弹幕数据中的尾部弹幕内容会发生碰撞。
  20. 一种计算机可读存储介质,其上存储有计算机可读指令,所述计算机可读指令可被至少一个处理器所执行以下步骤:
    获取视频播放页面;
    获取多个原始弹幕数据,每个原始弹幕数据包括弹幕内容和弹幕发射时间;
    克隆所述多个原始弹幕数据,得到多个弹幕数据;
    根据各个弹幕数据的弹幕发射时间,从所述多个弹幕数据中获取多个目标弹幕数据;
    将所述多个目标弹幕数据中的至少一个弹幕内容呈现在所述视频播放页面的弹幕播放区域中。
PCT/CN2020/081490 2019-11-25 2020-03-26 弹幕呈现方法和系统 WO2021103363A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US17/778,784 US11924503B2 (en) 2019-11-25 2020-03-26 Bullet comment presentation method and system

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911166832.XA CN111031400B (zh) 2019-11-25 2019-11-25 弹幕呈现方法和系统
CN201911166832.X 2019-11-25

Publications (1)

Publication Number Publication Date
WO2021103363A1 true WO2021103363A1 (zh) 2021-06-03

Family

ID=70206583

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/081490 WO2021103363A1 (zh) 2019-11-25 2020-03-26 弹幕呈现方法和系统

Country Status (3)

Country Link
US (1) US11924503B2 (zh)
CN (1) CN111031400B (zh)
WO (1) WO2021103363A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115243078A (zh) * 2022-07-28 2022-10-25 上海幻电信息科技有限公司 弹幕展示方法及装置

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111538557B (zh) * 2020-07-09 2020-10-30 平安国际智慧城市科技股份有限公司 基于层叠样式表的弹幕渲染方法及相关设备
CN112423111A (zh) * 2020-11-05 2021-02-26 上海哔哩哔哩科技有限公司 图形引擎和适用于播放器的图形处理方法
CN112463017B (zh) * 2020-12-17 2021-12-14 中国农业银行股份有限公司 一种互动元素合成方法和相关装置
CN114173198B (zh) * 2021-12-08 2024-04-19 湖南快乐阳光互动娱乐传媒有限公司 弹幕渲染方法及装置、存储介质及电子设备
CN114339373B (zh) * 2022-03-17 2022-05-27 飞狐信息技术(天津)有限公司 一种队列弹幕生成方法、装置、存储介质和设备

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104967876A (zh) * 2014-09-30 2015-10-07 腾讯科技(深圳)有限公司 弹幕信息处理方法和装置、弹幕信息展示方法和装置
US20160366466A1 (en) * 2014-07-07 2016-12-15 Le Holdings(Beijing)Co., Ltd. Method for displaying bullet screen of video, and electronic device
CN106385613A (zh) * 2016-09-19 2017-02-08 广州华多网络科技有限公司 控制弹幕播放的方法及装置
CN108696766A (zh) * 2018-05-15 2018-10-23 北京字节跳动网络技术有限公司 弹幕显示方法、装置和计算机可读存储介质
CN109379604A (zh) * 2018-08-15 2019-02-22 深圳点猫科技有限公司 一种基于教育云平台的视频弹幕制作方法及电子设备
WO2019051837A1 (en) * 2017-09-18 2019-03-21 Arris Enterprises Llc MULTIMEDIA BUBBLE SCREEN ON TELEVISION VIA REMOTE CONTROL INPUT DEVICE AND DECODER HOUSING
US10284806B2 (en) * 2017-01-04 2019-05-07 International Business Machines Corporation Barrage message processing
CN110290414A (zh) * 2019-06-14 2019-09-27 湖南国科微电子股份有限公司 基于机顶盒的电视直播弹幕方法及系统

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7505169B2 (en) * 2003-08-27 2009-03-17 Kyocera Mita Corporation Image forming apparatus having writing space mode
CN103841121B (zh) * 2014-03-28 2017-03-29 中国科学技术大学 一种基于本地文件的评论和互动系统及方法
CN106469165B (zh) * 2015-08-18 2021-01-08 腾讯科技(深圳)有限公司 弹幕展示方法及弹幕展示装置
CN106060632B (zh) * 2016-05-31 2020-02-07 武汉斗鱼网络科技有限公司 一种节目现场弹幕控制系统及方法
CN106454485B (zh) * 2016-10-25 2018-04-10 华中科技大学 一种速度可变弹幕的弹道分配方法
CN106792225A (zh) * 2016-11-09 2017-05-31 武汉斗鱼网络科技有限公司 前端弹幕控制方法及装置
US20220179665A1 (en) * 2017-01-29 2022-06-09 Yogesh Rathod Displaying user related contextual keywords and controls for user selection and storing and associating selected keywords and user interaction with controls data with user
CN107092643B (zh) * 2017-03-06 2020-10-16 武汉斗鱼网络科技有限公司 一种弹幕渲染方法及装置
CN107087236B (zh) * 2017-03-22 2020-02-07 北京潘达互娱科技有限公司 一种直播信息展示方法及装置
CN107197355B (zh) * 2017-06-02 2020-02-21 北京潘达互娱科技有限公司 弹幕显示方法及装置
CN108696767B (zh) * 2018-05-15 2021-05-25 北京字节跳动网络技术有限公司 弹幕播放方法、装置、计算机可读存储介质和终端
CN110392293B (zh) * 2019-06-21 2023-04-07 平安普惠企业管理有限公司 基于canvas的弹幕控制方法、装置、设备及存储介质

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160366466A1 (en) * 2014-07-07 2016-12-15 Le Holdings(Beijing)Co., Ltd. Method for displaying bullet screen of video, and electronic device
CN104967876A (zh) * 2014-09-30 2015-10-07 腾讯科技(深圳)有限公司 弹幕信息处理方法和装置、弹幕信息展示方法和装置
CN106385613A (zh) * 2016-09-19 2017-02-08 广州华多网络科技有限公司 控制弹幕播放的方法及装置
US10284806B2 (en) * 2017-01-04 2019-05-07 International Business Machines Corporation Barrage message processing
WO2019051837A1 (en) * 2017-09-18 2019-03-21 Arris Enterprises Llc MULTIMEDIA BUBBLE SCREEN ON TELEVISION VIA REMOTE CONTROL INPUT DEVICE AND DECODER HOUSING
CN108696766A (zh) * 2018-05-15 2018-10-23 北京字节跳动网络技术有限公司 弹幕显示方法、装置和计算机可读存储介质
CN109379604A (zh) * 2018-08-15 2019-02-22 深圳点猫科技有限公司 一种基于教育云平台的视频弹幕制作方法及电子设备
CN110290414A (zh) * 2019-06-14 2019-09-27 湖南国科微电子股份有限公司 基于机顶盒的电视直播弹幕方法及系统

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115243078A (zh) * 2022-07-28 2022-10-25 上海幻电信息科技有限公司 弹幕展示方法及装置
CN115243078B (zh) * 2022-07-28 2024-04-16 上海幻电信息科技有限公司 弹幕展示方法及装置

Also Published As

Publication number Publication date
US20220408144A1 (en) 2022-12-22
CN111031400A (zh) 2020-04-17
CN111031400B (zh) 2021-04-27
US11924503B2 (en) 2024-03-05

Similar Documents

Publication Publication Date Title
WO2021103363A1 (zh) 弹幕呈现方法和系统
US10810434B2 (en) Movement and transparency of comments relative to video frames
US11061962B2 (en) Recommending and presenting comments relative to video frames
US11417341B2 (en) Method and system for processing comment information
US10681391B2 (en) Computerized system and method for automatic highlight detection from live streaming media and rendering within a specialized media player
WO2021103366A1 (zh) 基于微信小程序的弹幕处理方法和系统
US20200029119A1 (en) Generating masks and displaying comments relative to video frames using masks
US20180176272A1 (en) System, device, and method for interactive communications among mobile devices and ip-connected screens
WO2021103364A1 (zh) 弹幕处理方法和系统
US20160044115A1 (en) Remote browsing session management
CN108449409B (zh) 动画推送方法、装置、设备和存储介质
US20230029698A1 (en) Video interaction method and apparatus, electronic device, and computer-readable storage medium
CN110166810A (zh) 视频渲染引擎切换方法、装置、设备及可读存储介质
CN113225607B (zh) 直播间礼物展示的方法与系统
US11706496B2 (en) Echo bullet screen
WO2015162550A1 (en) System, device, and method for interactive communications among mobile devices and ip-connected screens
CN110035294B (zh) 一种直播间的处理方法、装置、计算机可读存储介质及计算机设备
JP7179194B2 (ja) 可変エンドポイントユーザインターフェースレンダリング
CN115278339B (zh) 混播处理方法及系统
US10042521B1 (en) Emulation of control resources for use with converted content pages
CN110569460A (zh) 推送信息展示方法、装置及存储介质
WO2021103365A1 (zh) 基于微信小程序的弹幕处理方法和系统
CN111327941A (zh) 一种离线视频播放方法、装置、设备及介质
WO2022188563A1 (zh) 动态封面设置方法和系统
CN115599252A (zh) 交互方法及装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20893459

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20893459

Country of ref document: EP

Kind code of ref document: A1