WO2020097803A1 - Overlay comment processing method and apparatus, electronic device, and computer-readable storage medium - Google Patents

Overlay comment processing method and apparatus, electronic device, and computer-readable storage medium Download PDF

Info

Publication number
WO2020097803A1
WO2020097803A1 PCT/CN2018/115274 CN2018115274W WO2020097803A1 WO 2020097803 A1 WO2020097803 A1 WO 2020097803A1 CN 2018115274 W CN2018115274 W CN 2018115274W WO 2020097803 A1 WO2020097803 A1 WO 2020097803A1
Authority
WO
WIPO (PCT)
Prior art keywords
video file
barrage
electronic device
barrage data
offline video
Prior art date
Application number
PCT/CN2018/115274
Other languages
French (fr)
Chinese (zh)
Inventor
魏伟
Original Assignee
深圳市欢太科技有限公司
Oppo广东移动通信有限公司
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 深圳市欢太科技有限公司, Oppo广东移动通信有限公司 filed Critical 深圳市欢太科技有限公司
Priority to PCT/CN2018/115274 priority Critical patent/WO2020097803A1/en
Priority to CN201880098222.8A priority patent/CN112771881B/en
Publication of WO2020097803A1 publication Critical patent/WO2020097803A1/en

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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/472End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content

Definitions

  • the present application relates to the technical field of video processing, and more specifically, to a method, device, electronic device, and computer-readable storage medium for barrage processing.
  • the phenomenon of displaying comments in the form of subtitles in the playing video screen is called a barrage. Users can use the form of a barrage to watch barrage and communicate with other users in barrage discussions.
  • the existing video barrage is in the form of online play or live broadcast.
  • the barrage is collected from each user terminal and displayed on the corresponding time period of the video.
  • This application proposes a method, device, electronic equipment, and computer readable storage medium for barrage processing to improve the above-mentioned defects.
  • an embodiment of the present application provides a barrage processing method, which is applied to an electronic device, and a client is installed on the electronic device.
  • the method includes: acquiring a playback request of an offline video file, the offline video file is pre-stored in the electronic device; acquiring the barrage data to be displayed corresponding to the offline video file; in the video playback interface of the client Play the offline video file and display the barrage data to be displayed in the video playback interface.
  • an embodiment of the present application further provides a barrage processing device, which is applied to an electronic device, and the electronic device is installed with a client.
  • the device includes: an acquisition unit, a determination unit, and a display unit.
  • the obtaining unit is used for obtaining a playback request of an offline video file, the offline video file is stored in the electronic device in advance.
  • the determining unit is used to obtain the barrage data to be displayed corresponding to the offline video file.
  • the display unit is configured to play the offline video file in the video playback interface of the client and display the barrage data to be displayed in the video playback interface.
  • an embodiment of the present application further provides an electronic device, including: one or more processors; a memory; a client; one or more application programs, wherein the one or more application programs are stored in the The memory is configured to be executed by the one or more processors, and the one or more programs are configured to perform the above method.
  • an embodiment of the present application further provides a computer-readable storage medium.
  • the computer-readable storage medium stores program code, and the program code can be called by a processor to execute the above method.
  • the barrage processing method, device, electronic equipment and computer readable storage medium provided by this application, when you want to play the offline video file pre-stored in the electronic device, first find the barrage data to be displayed corresponding to the offline video file, Then, the offline video file is played in the video playback interface of the client, and the barrage data to be displayed is displayed in the video playback interface. Therefore, when playing an offline video file, the barrage data corresponding to the offline video file is displayed together, so that the user can also see the barrage data of the video file when viewing the offline video file, that is, the offline video file .
  • FIG. 1 shows a schematic diagram of barrage data in a video playback interface provided by an embodiment of the present application
  • FIG. 2 shows a schematic diagram of a video playback system provided by an embodiment of the present application
  • FIG. 3 shows a schematic diagram of a barrage input area in a video playback interface provided by an embodiment of the present application
  • FIG. 5 shows a schematic diagram of a video list interface of a client provided by an embodiment of the present application
  • FIG. 6 shows a method flowchart of a barrage processing method provided by another embodiment of the present application.
  • FIG. 7 shows a schematic diagram of a video playback system provided by another embodiment of the present application.
  • FIG. 8 shows a method flowchart of a barrage processing method provided by another embodiment of the present application.
  • FIG. 10 shows a schematic diagram of reminder information provided by another embodiment of the present application.
  • FIG. 11 shows a schematic diagram of a local barrage data list provided by an embodiment of the present application.
  • FIG. 13 shows a method flowchart of a barrage processing method provided by yet another embodiment of the present application.
  • FIG. 14 shows a block diagram of a barrage processing device provided by an embodiment of the present application.
  • FIG. 15 shows a structural block diagram of an electronic device provided by an embodiment of the present application.
  • FIG. 16 shows a storage unit for storing or carrying program codes for implementing a barrage processing method according to an embodiment of the present application.
  • Barrage refers to the comment subtitles that pop up when watching videos on the Internet.
  • video images, barrage data, and subtitle data are displayed on the interface.
  • the relatively dense commentary text displayed at the top of the interface is barrage data, as shown in FIG. "Awesome”, “Pretty”, “I am looking at the barrage”, etc.
  • the subtitle data is displayed at the bottom of the interface, as shown in "The beautiful building in Figure 1 embodies the huge values of the Chinese nation" ".
  • the video playback interface is a client interface.
  • the client is installed in the electronic device 100, and the electronic device 100 and the server 200 are located in a wireless network or a wired network.
  • the electronic device 100 and the server 200 perform data interaction.
  • the electronic device 100 may be a mobile phone or a smart phone (for example, an iPhone based on TM, an Android-based phone), a portable game device (for example, Nintendo DS, TM, PlayStation Portable TM, Gameboy Advance TM, iPhone TM), laptop Computers, PDAs, portable Internet devices, music players, and data storage devices.
  • a mobile phone or a smart phone for example, an iPhone based on TM, an Android-based phone
  • a portable game device for example, Nintendo DS, TM, PlayStation Portable TM, Gameboy Advance TM, iPhone TM
  • laptop Computers PDAs
  • portable Internet devices for example, music players, and data storage devices.
  • the client is installed in the electronic device 100, for example, it may be an application program installed in the electronic device 100.
  • all information corresponding to the account can be stored in the storage space of the server 200.
  • the server 200 may be a separate server, a server cluster, a local server, or a cloud server.
  • the server 200 may store a video file that can be played on the client, and barrage data, subtitle data, and other information corresponding to the video file.
  • the user can watch the video file online, so that the server sends the video file to the client, the client plays the video file on the video playback interface, and at the same time, it can also send the barrage data corresponding to the video file to the client. Display the barrage data on the video playback interface.
  • the client is also provided with a barrage input area 101.
  • the barrage input area 101 is provided with a text input box. The user clicks the text input box to pop up a virtual keyboard on the current interface. The user can input a barrage through the virtual keyboard and click Sending can send the barrage to the server, and the server stores the barrage in the network barrage data corresponding to the video file, and the network barrage data is sent to all the video files that are playing and connected to the server Client, which is displayed on the video playback interface of the client.
  • the user can post a comment on the video file by inputting a barrage, and upload it to the server for storage, and then from the server to each client, and other users can see the barrage, which can achieve User interaction.
  • the inventor found in the research that because the video file and the barrage data are separated from each other, if you watch a video online, you can see the barrage data corresponding to the video, but if you download the video to an electronic device , When watching the video offline, you ca n’t see the barrage of the video file at the same time when watching the video, and some barrages are very interesting, and you can also get some information related to the video file through the barrage. If the barrage cannot be seen, it will reduce the user's viewing experience.
  • embodiments of the present application provide a barrage processing method. As shown in FIG. 4, the method is applied to a client of an electronic device. Specifically, the method includes: S401 to S403.
  • S401 Acquire a playback request of an offline video file, the offline video file is pre-stored in the electronic device.
  • the electronic device can obtain the video file to be played, and then decode the video file.
  • the video file can be decoded by soft decoding or hard decoding.
  • the multi-frame image data to be rendered corresponding to the video file can be obtained, and then the multi-frame image data needs to be rendered before it can be displayed on the display screen to complete the display of the video file.
  • the client includes a video file list, specifically, it may include an online video file list and an offline video file list, where the identifier of the video file displayed in the offline video file list is offline that has been stored in the electronic device Video files, and the video files displayed in the online video file list can be accessed through the network.
  • the video playback request can be obtained from the touch state of the play buttons corresponding to different video files on the client interface.
  • the client ’s video list interface displays multiple video
  • the display content as shown in FIG. 5, the display content corresponding to multiple videos includes a thumbnail corresponding to each video, the thumbnail can be used as a touch button, the user clicks on the thumbnail, the client can detect the user selected Click on the thumbnail to determine the video file to be played.
  • the video list interface shown in FIG. 5 may be an offline video file list, and each thumbnail displayed is a thumbnail corresponding to each offline video file. Specifically, it may be a certain frame image in the offline video file.
  • the client responds to the video selected by the user in the video list, enters the video playback interface, and clicks the play button on the playback interface.
  • the client can detect the video file currently clicked by the user by monitoring the user's touch operation.
  • the video playback interface when the user clicks on the thumbnail of the video file shown in FIG. 5, the video playback interface can be displayed and the video file can be automatically played without the user needing to click the play button of the video playback interface again.
  • the file playback request may be generated when the user clicks the thumbnail of the video file shown in FIG. 5.
  • the client detects the user's click operation in the interface shown in FIG. 5, and if a thumbnail of an offline video file is clicked, it is determined that a playback request of the offline video file is obtained.
  • the video playback interface when the user clicks on the thumbnail of the video file shown in FIG. 5, the video playback interface can be displayed, but it does not automatically play. The user needs to click the play button in the playback interface to play the video file. Therefore, the client can determine the offline video file corresponding to the video playback interface when the playback button is pressed by monitoring the status of the playback button, so as to obtain the playback request of the offline video file.
  • the barrage data to be displayed corresponding to the offline video file may be stored in the electronic device, the server, or the storage medium, such as a mobile hard disk.
  • the way to obtain the barrage data to be displayed corresponding to the offline video file may be to traverse a device capable of storing the barrage data and search sequentially.
  • the server can first find the barrage corresponding to the offline video file to be displayed Data, specifically, the client sends the identifier of the offline video file to the server, and the server searches for the barrage data corresponding to the identifier and sends it to the client. If the barrage data of the offline video file cannot be found in the server, it is searched locally in the electronic device, that is, whether the electronic device stores the barrage data corresponding to the offline video file, and if it exists, the local storage The barrage data corresponding to the offline video file is used as the barrage data to be displayed.
  • the server since acquiring the barrage data to be displayed in the server consumes current network resources, and it takes a certain time to complete the download of the barrage data, you can first find out whether the electronic device stores the offline video If the barrage data corresponding to the file exists, the barrage data corresponding to the locally stored offline video file is used as the barrage data to be displayed. If it does not exist, the server will download the barrage data to be displayed.
  • S403 Play the offline video file in the video playback interface of the client and display the barrage data to be displayed in the video playback interface.
  • the display method of the barrage data and the offline video file to be displayed may be that two display interfaces are set in the video playback interface of the client, one of which is a video interface and the barrage interface, and the barrage interface covers the video interface.
  • the barrage interface is completely transparent, the barrage interface is used to display the barrage data to be displayed, and the video interface is used to display each frame of the image of the offline video file.
  • the barrage interface does not affect the user to view the offline video file displayed on the video interface, and the barrage data is displayed on the barrage interface At this time, the phenomenon that the user is watching is that a barrage is displayed above the layer of the offline video file.
  • the display time point of the barrage data to be displayed corresponds to the playback time point of the offline video file, for example, when the playback progress of the video file is the first progress, the first Barrage, and the first barrage is barrage data input through the barrage input area when the user plays the video to the first progress when watching the video.
  • the barrage data is displayed in the video playback interface.
  • the barrage data corresponding to the offline video file is displayed together, so that the user can also see the barrage data of the video file when viewing the offline video file, that is, the offline video file .
  • the client when the client is playing offline video files, it may already be connected to the server, or may be disconnected from the server. In two different connection situations, the client obtains the way to display the barrage data corresponding to the offline video file. Different, specifically, will be explained separately in subsequent embodiments.
  • FIG. 6 shows a barrage processing method provided by an embodiment of the present application.
  • the method is applied to a client of an electronic device, and describes that the electronic device obtains a barrage to be displayed when the electronic device is disconnected from the server.
  • Data implementation. Specifically, the method includes: S601 to S605.
  • S601 Acquire a playback request of an offline video file, the offline video file is pre-stored in the electronic device.
  • S602 Determine whether the electronic device is connected to the server.
  • the electronic device sends a beacon to the server every certain time interval. After the server obtains the beacon sent by the electronic device, it returns a specified message, which is used to indicate that the server successfully obtained the beacon. Then after the electronic device obtains the specified message, it can be determined that the electronic device and the server are in a connected state, and if the specified message is not received within a predetermined time or after a predetermined number of beacons are sent, the Specifying the message determines that the electronic device is not connected to the server, that is, the electronic device is disconnected from the server.
  • the electronic device obtains the beacon sent by the server every certain time interval, and if the beacon sent by the server is not received within a predetermined time, it is determined that the electronic device and the server are not connected, that is The electronic device is disconnected from the server.
  • the way that the electronic device is disconnected from the server may also be that the electronic device is currently in a state of disconnecting from the network, the electronic device determines whether it is currently in the airplane mode, and if so, determines to disconnect from the server Connect, if not, then determine whether it is connected to the server through the above beacon determination.
  • the electronic device and the server are connected through a gateway, then the network system shown in FIG. 2 may be as shown in FIG. 7, the electronic device 100 is connected to the gateway 300, the gateway 300 is connected to the server 200, and the electronic device 100 is connected to the gateway 300 Located in a local area network, and the gateway 300 and the server 200 are located in a wide area network, the gateway 300 may be a base station or a wireless hotspot.
  • S603 Determine whether local barrage data corresponding to the offline video file is stored in the electronic device.
  • the electronic device If the electronic device is not connected to the server, it is determined whether the local barrage data corresponding to the offline video file is stored in the electronic device.
  • a storage area is preset in the electronic device, and the storage area is used to store local barrage data.
  • the local barrage data may be barrage data that the electronic device has downloaded or barrage data input by a user operating the client of the electronic device, and the barrage data is stored in correspondence with the video file corresponding to the barrage data. As shown in Table 1:
  • Video file identification Barrage data storage location Video 1 Barrage 1 Position 1 Video 2 Barrage 2 Position 2 Video 3 Barrage 3 Position 3
  • the identification of the video file may be the name of the video file, and the barrage data corresponding to each video file is all the barrage data corresponding to the video file.
  • the new barrage data When new barrage data is downloaded or When input, the new barrage data will be stored in the barrage data, that is, the barrage data will be updated, and new barrage data will be added.
  • the storage location corresponds to the storage address of the memory of the electronic device, which may be a pointer that points to a storage space. Obtain the barrage data stored in the storage space in the storage space specified by the storage location.
  • whether the local barrage data corresponding to the offline video file is stored in the electronic device may be implemented by searching whether the local barrage data corresponding to the video file is included in the storage area of the electronic device. 1 As an example, obtain the identifier of the offline video file, and find in Table 1 above whether there is an identifier that matches the identifier of the offline video file. If so, determine that the local barrage data corresponding to the video file is stored locally.
  • S604 Obtain local barrage data corresponding to the offline video file as barrage data to be displayed.
  • the electronic device and the server are not connected, if the connection to the local area network is not disconnected, for example, the electronic device is still connected to the gateway, you can obtain the barrage data of other clients located in the same local area network , So that the user of the client in a local area network can still interact through the barrage, specific implementations will be introduced in subsequent embodiments.
  • S605 Play the offline video file in the video playback interface of the client and display the barrage data to be displayed in the video playback interface.
  • this method is applied to the client of the electronic device, and describes the process of acquiring the barrage data from the local area network when the electronic device is disconnected from the server. Specifically, the method includes: S801 to S808.
  • S801 Acquire a playback request of an offline video file, the offline video file is pre-stored in the electronic device.
  • S802 Determine whether the electronic device is connected to the server.
  • S803 Determine whether local barrage data corresponding to the offline video file is stored in the electronic device.
  • S805 is performed, and if the local barrage data corresponding to the offline video file is not stored in the electronic device, S804 is performed.
  • S804 Obtain local barrage data corresponding to the offline video files stored in other electronic devices in the same local area network as the electronic device as barrage data to be displayed.
  • the three electronic devices connected to the gateway 300 are located in the same local area network. If the connection between the gateway and the server is disconnected, the connection between the electronic device and the server is disconnected, but due to the normal connection between the electronic device and the gateway, Then, the electronic device can interact with other electronic devices in the local area network.
  • the client of the electronic device in the local area network when playing a video file offline, sends a query request to all electronic devices in the local area network when it is determined that the connection to the server is disconnected but the gateway remains connected.
  • the inquiry request is used to inquire whether the electronic device receiving the inquiry request needs to obtain the barrage data of the offline video file, then the inquiry request includes an identifier of the offline video file.
  • the electronic device plays the offline video file
  • the connection with the server is disconnected but the connection with the gateway is maintained, and it is determined that the local barrage data corresponding to the offline video file is not stored locally
  • the corresponding local barrage data is sent to the electronic device that replies to receive the instruction information. Therefore, the electronic device can determine that the local barrage data corresponding to the offline video file is not stored locally, and obtain the local barrage data corresponding to the offline video file stored by other electronic devices in the local area network.
  • the specific implementation manner of the electronic device acquiring local barrage data corresponding to the offline video files stored in other electronic devices in the same local area network is that the electronic device is in the same local area network All other electronic devices send a barrage acquisition request, and the barrage acquisition request includes the identifier of the offline video file; acquiring the local corresponding to the offline video file returned by the other electronic device based on the barrage acquisition request Barrage data.
  • the barrage acquisition request includes the identifier of the offline video file, which can be set according to the data or title of the offline video file.
  • an offline video file identifier is generated according to the video data of the offline video file; a barrage acquisition request is generated according to the offline video file identifier.
  • the video data of the offline video file may be a video summary of the offline video file, specifically, the corresponding feature value may be obtained according to the text or picture of the video summary, for example, the feature of the video summary is obtained by using a hash algorithm Value to get the ID of the offline video file.
  • the identifier of the corresponding video file can also be generated according to the video stream or audio stream data of the offline video file.
  • Video files are composed of two parts: video stream and audio stream.
  • the packaging formats of audio and video in different video formats are definitely different.
  • the process of synthesizing audio streams and video streams into files is called muxer, while the process of separating audio streams and video streams from media files is called demuxer.
  • the playback module is a system playback module.
  • the system playback module is the default playback module in the operating system of the electronic device, that is, when the client installed in the electronic device plays a video file, the system playback module is called to play the video file by default.
  • the system playback module may be a Media Framework module.
  • the playback module may be a non-default playback module embedded in the operating system of the electronic device, for example, it may be an FFmpeg module.
  • the FFmpeg module is an open source cross-platform video and audio streaming framework, which is free software and uses the LGPL or GPL license (depending on the selected component). It provides a complete solution for recording, converting and streaming audio and video. It contains the very advanced audio / video codec library libavcodec.
  • the FFmpeg module integrates multiple formats of audio and video encoders, and has audio and video playback functions, as well as video file analysis functions.
  • the identifier of the offline video file can be obtained according to the video stream or audio stream. Since the data size of the audio stream is smaller, in order to reduce the amount of calculation and reduce the power of the electronic device Consumption, you can obtain the identification of the video file by finding the characteristic value of the audio stream data. Specifically, you can obtain the characteristic value of the audio stream data, where the characteristic value can be an MD5 value or a SHA1 value that can identify a data Unique characteristic value.
  • the feature value of the audio stream data is used as the identifier of the offline video file, thus, due to the uniqueness of the feature value, the feature value can be used as the identifier of the offline video file, and used to associate the offline video file with other The difference between video files.
  • the identification of the video file and the barrage data are stored correspondingly, and the identification of the video file also adopts the above characteristic values.
  • the identifier of the offline video file may also be generated according to the title of the video file.
  • the title of the video file may be the name of the video file, for example, 123456.MP4, or the name of the video file described in the video summary of the video file, for example, the video summary includes the name and content summary of the video, etc.
  • the name of the video in the video summary is used as the title of the video file.
  • a barrage acquisition request is generated according to the identifier of the offline video file.
  • the identifier of the offline video file may be packaged to generate the barrage acquisition according to a communication protocol between various electronic devices request. Then, the barrage acquisition request is sent to each electronic device in the local area network.
  • the electronic device that sends the barrage acquisition request in a local area network is named the first electronic device, and the remaining electronic devices are named the second electronic device.
  • the first electronic device sends the barrage acquisition request to all second electronic devices. 2.
  • the electronic device parses the barrage acquisition request to obtain the identifier of the offline video file, and then searches for the barrage data corresponding to the identifier of the offline video file and sends it to the first electronic device.
  • the first electronic device is sent to all electronic devices in the local area network by means of broadcast messages, for example, it may be sent by using a broadcast address resolution protocol (Address Resolution Protocol, ARP) message.
  • ARP Address Resolution Protocol
  • the first electronic device packages the barrage acquisition request into an ARP message, and then broadcasts it to each second electronic device in the local area network. After the second electronic device obtains the ARP message, the ARP message can be obtained by parsing the ARP message. Barrage acquisition request.
  • the electronic device can display reminder information in a preset interface, where the preset interface may be the interface displayed by the current electronic device, and the reminder information is used to remind the user of the local area network Other electronic devices in the request to obtain local barrage data, and the user can select whether to send the local barrage data to the electronic device requesting to obtain barrage data based on the reminder information.
  • the reminder message may be a pop-up window.
  • the reminder information is displayed in a pop-up window, and the reminder information and the button for determining or rejecting are displayed in the pop-up window, for example, “Device 1 requests to obtain the target video ’s barrage data” as the reminder information, then the reminder information
  • the identifier of the electronic device that sent the barrage acquisition request is prompted inside, specifically, the barrage acquisition request includes an electronic device that requests to obtain the local barrage data of the offline video file in addition to the identifier of the offline video file
  • the identification of the electronic device may be information such as the device ID or MAC address of the electronic device, or may be the name of the electronic device set by the user.
  • the second electronic device After the user clicks the "Allow" button in the pop-up window, he enters a confirmation sending instruction. Specifically, taking the above first electronic device and second electronic device as an example, the second electronic device obtains the barrage obtained by the first electronic device. Upon request, the second electronic device displays reminder information on the current interface. Specifically, as shown in FIG. 9, the reminder information is displayed in a pop-up window to detect whether a user has received an instruction to send based on the reminder information, and if the instruction is detected , The local barrage data corresponding to the offline video file stored locally is sent to the first electronic device.
  • the reminder information is displayed on the top status bar.
  • the reminder information is displayed on the top status bar of the current interface.
  • “Device 1 requests to obtain the barrage data of the target video” is the reminder information displayed on the top status bar.
  • the top status bar is highlighted, such as the background color is yellow, If there is other information that needs to be displayed on the top status bar at this time, such as short message reminder information or call reminder information received by the second electronic device, the reminder information and the status information are alternately displayed on the top status bar.
  • the user can click on the top status bar, and the electronic device responds to the user's touch operation on the top status bar, and displays a local barrage data list interface.
  • the local barrage data list interface displays There are multiple barrage data, and each barrage data is displayed in the form of a thumbnail. The logo of the video file and the key frame image of the video file are displayed in the thumbnail.
  • the user can click the thumbnail of a video file to Select the video file corresponding to the thumbnail, and then click Send to send the barrage data selected by the user to the first electronic device.
  • the barrage data displayed in the local barrage data list interface may be multiple versions of barrage data corresponding to the offline video file, and the user may select one or more barrage data to send to the first electronic device.
  • the reminder information can also remind the user of the second electronic device that the first electronic device is requesting to obtain the data of the second electronic device, so that the privacy of the user of the second electronic device can be protected.
  • the first electronic device After acquiring the local barrage data of all the second electronic devices in the local area network, the first electronic device uses all the acquired local barrage data as the barrage data to be displayed. Thereby, when the electronic device cannot connect to the Internet, it can interact with the electronic device in the local area network, and when the first electronic device cannot obtain local barrage data locally, the local area can be obtained from the local area network.
  • the barrage data is used as the barrage data of the offline video file being played by the first electronic device, thereby improving the user experience when viewing the offline video file.
  • the local barrage data corresponding to the offline video file is stored locally, in addition to displaying the locally stored barrage data as the barrage data to be displayed on the video playback interface, offline videos of other electronic devices in the local area network can also be obtained The local barrage data corresponding to the file, so that the barrage data released by users of other electronic devices in the local area network in real time can also be displayed on the video playback interface.
  • S806 Obtain local barrage data corresponding to the offline video files stored in other electronic devices in the same local area network as the electronic device.
  • S807 Integrate all the acquired local barrage data into new local barrage data as the barrage data to be displayed.
  • the first electronic device After the first electronic device obtains the local barrage data corresponding to the offline video file stored locally, it sends a barrage acquisition request to the same electronic device as the first electronic device. All second electronic devices in the local area network, and the second electronic device sends local barrage data corresponding to the offline video file stored locally to the first electronic device.
  • the barrage data corresponding to the offline video file stored locally by the first electronic device is named local barrage data 1
  • the barrage data corresponding to the offline video file sent by the second electronic device obtained by the first electronic device is named local barrage Data 2
  • the local barrage data 2 can be searched for the barrage data that is different from the local barrage data 1, and then the differentiated barrage data Integrated into the local barrage data 1, because each barrage information in the barrage data corresponds to a playback time point of the video file, according to the playback time point, the different barrage data is found and played according to The time point is inserted into the local barrage data 1 to integrate and form new local barrage data as the barrage data to be displayed.
  • the local barrage data of the offline video file stored locally by other electronic devices can be obtained from the local area network, so that the displayed barrage data can be Show the barrage of other users in the local area network to increase interactivity.
  • S808 Play the offline video file in the video playback interface of the client and display the barrage data to be displayed in the video playback interface.
  • the first electronic device may send a barrage acquisition request to the second electronic device to obtain barrage data of other electronic devices in the local area network in real time.
  • the new barrage can be synchronized to other electronic devices in the local area network, and the barrage data can be sent to the server when the Internet is connected To store.
  • the network barrage data corresponding to the offline video file can be obtained from the server.
  • FIG. 12 shows a barrage processing method provided by an embodiment of the present application. The method is applied to a client of an electronic device, and describes that the electronic device obtains a barrage when connected to a server The process of data. Specifically, the method includes: S1201 to S1206.
  • S1201 Acquire a playback request of an offline video file, the offline video file is pre-stored in the electronic device.
  • S1202 Determine whether the electronic device is connected to the server.
  • S1203 Determine whether local barrage data corresponding to the offline video file is stored in the electronic device.
  • S1204 Obtain local barrage data corresponding to the offline video file as barrage data to be displayed.
  • S1205 Play the offline video file in the video playback interface of the client and display the barrage data to be displayed in the video playback interface.
  • S1206 Send a barrage acquisition request to the server, and use the obtained network barrage data as the barrage data to be displayed.
  • the barrage acquisition request can be sent to the server through a predetermined communication protocol.
  • the electronic device can send the barrage acquisition request to the server through the TCP protocol.
  • the barrage acquisition request includes an identifier of the offline video file
  • the barrage acquisition request is used to instruct the server to search for corresponding network barrage data according to the identifier of the offline video file and pop the network Screen data is sent to the client.
  • the server sends the network barrage data corresponding to the stored offline video file to the electronic device, so that the electronic device can obtain the barrage data of the video file from the server when playing the offline video file , So that the user can view the barrage data when playing the pre-downloaded video file, and the barrage data in the server saves the barrage data uploaded by multiple clients, so that each user can communicate through the barrage data .
  • the specific implementation manner that the electronic device sends the barrage acquisition request to the server may be: generating an offline video file identifier according to the video data of the offline video file; generating a barrage acquisition request according to the offline video file identifier; Sending a barrage acquisition request to the server.
  • the implementation of generating the offline video file identifier based on the video data of the offline video file is to parse the offline video file to obtain the audio stream data of the offline video file; obtain the characteristic value of the audio stream data; The feature value of the audio stream data is used as the identifier of the offline video file.
  • the identifier of the offline video file can also be generated according to the title of the video file, specifically, the identifier of the offline video file is generated according to the title of the offline video file; the barrage acquisition request is generated according to the identifier of the offline video file; Screen acquisition request to the server.
  • the barrage data corresponding to sending the barrage acquisition request to the server and downloading the offline video file from the server will occupy a certain network bandwidth
  • the implementation of sending the barrage acquisition request to the server is: determining whether the local barrage data corresponding to the offline video file is stored in the electronic device; if If it is not stored, the barrage acquisition request is sent to the server. If it is stored, the barrage acquisition request is not sent to the server.
  • the local barrage data corresponding to the offline video file is detected locally, and the local barrage data corresponding to the offline video file is obtained; detection Whether the update time of the local barrage data is earlier than a preset time point; if it is earlier than the preset time point, a barrage acquisition request is sent to the server.
  • the storage time is set for the barrage data, that is, the storage time is increased on the basis of the above Table 1, and Table 1 becomes Table 2.
  • the storage time shown in Table 2 above is the time of the latest update.
  • the barrage data corresponding to video 1 is updated, the barrage 1 corresponding to video 1 is updated, and the time 1 corresponding to video 1 is updated. Therefore, the storage time of the barrage data of the video file recorded by the electronic device represents The latest update time of the barrage data.
  • the preset time point is a time point set by the user according to needs
  • the preset time point may be the day before the current time
  • the way to determine the preset time point is to determine the current date corresponding to the current time, using the zero point of the previous day of the current date as the preset time point, of course, it can also be set
  • the interval between the preset time point and the current time is relatively short.
  • the time point of the first 2 hours of the current time is used as the preset time point. For example, if the current time is 10:50, the preset time point is 8:50.
  • different preset time points may be set when the electronic device is in different time periods.
  • the interval between the preset time period and the current time is defined as the preset interval, and the preset time point is before the current time.
  • the preset interval is set to the first time length; if it is the second time period, the preset interval is set to the second Time length, specifically, the first time period is 18:00 to 24:00 and 00:00 to 01:00, the second time period is a time period other than the first time period, and the first time period is less than the second time
  • the length for example, the first time length is 30 minutes, and the second time length is 2 hours.
  • the current time is 20:20, it is located in the first time period, and the preset time point is 19:50.
  • the preset time point is 13:20.
  • the possibility of generating new barrage data is higher. Therefore, it is necessary to update the barrage data more frequently, that is, the set preset time point It is closer to the current moment, so the first time length needs to be shorter. Then, if the barrage data stored locally is greater than the preset time point, the barrage data may be considered to be old, and new barrage data needs to be downloaded from the server.
  • the method provided in the embodiments of the present application can also be used to watch When the video is offline, enter the barrage data.
  • FIG. 13 shows a method for processing barrage provided by an embodiment of the present application. This method is applied to a client of an electronic device and describes how to play an offline video. In the case of a file, the process of acquiring the barrage data input by the user and playing it. Specifically, the method includes: S1301 to S1306.
  • S1301 Acquire a playback request of an offline video file, the offline video file is pre-stored in the electronic device.
  • S1303 Play the offline video file in the video playback interface of the client and display the barrage data to be displayed in the video playback interface.
  • S1304 Obtain target barrage data input by the user through the barrage input area of the video playback interface of the client.
  • the barrage input area is an area where a user enters text information in the video playback interface of the client. Specifically, it may be the area indicated by reference numeral 101 in FIG. 3. For details, refer to the foregoing embodiment. Repeat again.
  • S1305 Determine a playback time point of the offline video file corresponding to the target barrage data.
  • the playback progress of the video file is taken as the playback time point of the offline video file corresponding to the target barrage data.
  • the currently played offline video file will be paused, and the playback progress of the video file at this time is recorded as the playback time corresponding to the target barrage data input by the user point.
  • S1306 Display the target barrage data in the video playback interface according to the playback time point.
  • the user can select the display information of the barrage data, where the display information includes the display Position, display font and color, etc.
  • the display modes corresponding to different display positions are also different, for example, when displayed at the top of the video playback interface, the display mode is to swipe from the right to the left of the video playback interface, When displayed at the bottom of the video playback interface, it is displayed at the middle of the bottom flashing.
  • the display mode can also be set separately, then the above display information can include the display mode in addition to the included display position, display font and color.
  • the barrage input area can also be called out through the operation gesture input by the user, that is, it is hidden when the video is usually played.
  • the barrage input area is displayed on the video playback interface, for example, The user can call out the barrage input area by clicking the bottom of the video playback interface, that is, the barrage input area is displayed on the video playback interface.
  • the user when watching offline video files, the user can input target barrage data and display them on the video playback interface of the video file.
  • the electronic device can also detect whether the electronic device and the server are in a connected state.
  • the target barrage data is stored in the local barrage data corresponding to the offline video file in the electronic device, specifically, the target barrage data is used to update the local barrage corresponding to the offline video file stored in the electronic device Data, that is, the target barrage data is added to the local barrage data corresponding to the offline video file.
  • the target can be written to the target at the position corresponding to the playback time point of the local barrage data according to the playback time point corresponding to the target barrage data Barrage data.
  • a storage request is sent to the server.
  • the storage request includes the target barrage data.
  • the storage request is used to instruct the server to
  • the target barrage data is stored in the network barrage data corresponding to the offline video file.
  • a barrage input area can be provided, and the target barrage data input by the user through the area can be obtained, and the target barrage data can be displayed on the video playback interface.
  • the target barrage data input by the user can still be displayed on the video playback interface.
  • the server is not currently connected, first store the target barrage data in the local barrage data of the electronic device. If the network connection is restored, that is, after detecting that the electronic device has established a connection with the server, the barrage data is sent to the server Internal storage, so that when users play offline video files offline, they can also input barrage data to the video files.
  • a specific implementation manner of sending a storage request to the server is: after detecting that the electronic device establishes a connection with the server, acquiring the playback status of the offline video file, if the playback status meets the specified conditions To send a storage request to the server.
  • the playback condition of the offline video file may be playback progress, playback times, or system time point when playing the video file, etc.
  • the playback condition may be playback progress.
  • the playback condition meeting the specified condition may be that the ratio of the playback progress to the overall playback progress of the offline video file is greater than a preset value, where the preset value may be data between 50% and 100%, including 50% and 100 %.
  • the preset value may be data between 50% and 100%, including 50% and 100 %.
  • the preset value can be freely set according to the needs of the user.
  • the implementation manner of sending a storage request to the server is: judging whether the playback progress is completed playback; if it is completed playback, acquiring the ongoing playback In the process of the offline video file, all barrage data input by the user is used as target barrage data; and a storage request is sent to the server.
  • the playback progress is completed playback, which may be the ratio of the current playback progress to the overall playback progress of the offline video file is 100%, or may be greater than a preset ratio, where the preset ratio is at the end of the offline video file
  • the ratio of the playback progress to the overall playback progress of the offline video file For example, the overall playback time of the offline video file is 20 minutes, and the ending song is at the position of 18 minutes, the preset ratio is the ratio of 18 to 20, which is 90% .
  • all barrage data input by the user during the playback of the offline video file is acquired.
  • the user will enter the barrage data multiple times, and there may be other users who enter the barrage data, and all the barrage obtained during the playback process will be
  • the data is temporarily stored in the local storage space of the electronic device, and after the end of the playback, the barrage data stored in the offline video file playback process are all sent to the server.
  • a storage request is sent to the server.
  • the storage request may be a data packet.
  • the data packet stores the target barrage data and the identifier of the offline video file.
  • the server After obtaining the data packet, the server parses the data packet. Then, the identifier of the video file is acquired, so as to find the network barrage data corresponding to the identifier of the offline video file, and the acquired target barrage data is stored in the network barrage data.
  • the specific implementation of sending a storage request to the server may also be: acquiring a communication link between the electronic device and the server Communication quality; if the communication quality meets a preset standard, send the target barrage data and the identification of the video file to the server.
  • the communication quality may be the signal strength between the electronic device and the server. If the signal strength is greater than the preset strength value, it is determined that the communication quality meets the preset standard, and the target barrage data and the identification of the video file are determined. Send to the server.
  • the communication quality may also be the channel quality between the electronic device and the server.
  • the channel quality may be the error vector amplitude of the channel, the number of access points, and signal strength.
  • EVM Error Vector Magnitude
  • EVM specifically represents the signal received by the receiving terminal.
  • the closeness of the IQ component generated during demodulation to the ideal signal component is an indicator of the quality of the modulated signal.
  • the smaller the EVM the better the channel quality of the channel.
  • the number of access points can also be obtained during the channel scan, and the number of access points on each channel can be determined. The more the number of access points, The worse the channel quality, the better.
  • the signal strength can also be obtained during channel scanning. The higher the signal strength, the higher the channel quality, and vice versa, the lower.
  • a mobile terminal When a mobile terminal enters a new network environment, it scans multiple supported channels according to the preset channel scanning order, and during the scanning process of each channel, it can obtain the wireless access point on the channel In this way, the channel where each wireless access point is located can be determined.
  • the electronic device and the server are connected through the wireless access point, and the wireless access point may be a Wi-Fi access point.
  • the channel where the connected wireless audio playback device is located can be determined, and then the error vector magnitude corresponding to the channel can be obtained.
  • the target barrage data and the identification of the video file are sent to the server.
  • the barrage processing device 1400 may include: an obtaining unit 1401, a determining unit 1402, and a display unit 1403.
  • the obtaining unit 1401 is used to obtain a playback request of an offline video file, which is stored in the electronic device in advance.
  • the determining unit 1402 is used to obtain the barrage data to be displayed corresponding to the offline video file.
  • the determining unit 1402 is also used to determine whether the electronic device and the server are in a connected state; if not, determine whether the local barrage data corresponding to the offline video file is stored in the electronic device; If stored, the local barrage data corresponding to the offline video file is obtained as the barrage data to be displayed. If it is not stored, the local barrage data corresponding to the offline video files stored in other electronic devices in the same local area network as the electronic device is acquired as the barrage data to be displayed.
  • the determining unit 1402 acquires the local barrage data corresponding to the offline video files stored in other electronic devices in the same local area network as the electronic device in the same local area network: Sending a barrage acquisition request, where the barrage acquisition request includes the identifier of the offline video file; and acquiring local barrage data corresponding to the offline video file returned by the other electronic device based on the barrage acquisition request.
  • the determining unit 1402 is further configured to send a barrage acquisition request to the server, where the barrage acquisition request includes an identifier of the offline video file, and the barrage acquisition request is used to instruct the server according to the offline video
  • the file identifier searches for the corresponding network barrage data, and sends the network barrage data to the client; the obtained network barrage data is used as the barrage data to be displayed.
  • the determining unit 1402 determines whether the local barrage data corresponding to the offline video file is stored in the electronic device; if not, sends a barrage acquisition request to the server.
  • the determining unit 1402 obtains the local barrage data corresponding to the offline video file; detects whether the update time of the local barrage data is earlier than a preset time point; If it is earlier than the preset time point, a barrage acquisition request is sent to the server.
  • the display unit 1403 is used to play the offline video file in the video playback interface of the client and display the barrage data to be displayed in the video playback interface.
  • the input unit also includes an input unit, a barrage display unit and a recording unit.
  • the input unit is used to obtain target barrage data input by a user through a barrage input area of the video playback interface of the client; determine a playback time point of the offline video file corresponding to the target barrage data.
  • the barrage display unit is used to display the target barrage data in the video playback interface according to the playback time point.
  • the recording unit is used to detect whether the electronic device is connected to the server; if not, store the target barrage data into local barrage data corresponding to the offline video file in the electronic device .
  • the recording unit is further used to send a storage request to the server after detecting that the electronic device establishes a connection with the server, the storage request includes the target barrage data, and the storage request is used to instruct the server Storing the target barrage data into the network barrage data corresponding to the offline video file.
  • the coupling between the modules may be electrical, mechanical, or other forms of coupling.
  • each functional module in each embodiment of the present application may be integrated into one processing module, or each module may exist alone physically, or two or more modules may be integrated into one module.
  • the above integrated modules may be implemented in the form of hardware or software function modules.
  • the electronic device 100 may be an electronic device capable of running an application program such as a smart phone, a tablet computer, an e-book.
  • the electronic device 100 in this application may include one or more of the following components: a processor 110, a memory 120, and one or more application programs, where one or more application programs may be stored in the memory 120 and configured to be One or more processors 110 execute, and one or more programs are configured to execute the method as described in the foregoing method embodiments.
  • the processor 110 may include one or more processing cores.
  • the processor 110 connects various parts of the entire electronic device 100 by using various interfaces and lines, executes or executes instructions, programs, code sets or instruction sets stored in the memory 120, and calls data stored in the memory 120 to execute Various functions and processing data of the electronic device 100.
  • the processor 110 may use at least one of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA).
  • DSP Digital Signal Processing
  • FPGA field programmable gate array
  • PLA programmable logic array
  • the processor 110 may integrate one or a combination of a central processing unit (Central Processing Unit, CPU), an image processing unit (Graphics Processing Unit, GPU), and a modem.
  • CPU mainly deals with operating system, user interface and application program, etc .
  • GPU is used for rendering and rendering of display content
  • modem is used for handling wireless communication. It can be understood that the above-mentioned modem may not be integrated into the processor 110, and may be implemented by a communication chip alone.
  • the memory 120 may include random access memory (RAM) or read-only memory (Read-Only Memory).
  • the memory 120 may be used to store instructions, programs, codes, code sets, or instruction sets.
  • the memory 120 may include a storage program area and a storage data area, where the storage program area may store instructions for implementing an operating system and instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.) , Instructions for implementing the following method embodiments.
  • the storage data area may also store data created by the electronic device 100 in use (such as a phone book, audio and video data, chat history data), and the like.
  • each unit in the barrage processing device shown in FIG. 14 is used as a function module such as a program package, each unit in the barrage processing device is stored in the memory 120 and can be called by the processor and execute the corresponding function .
  • the acquiring unit and the determining unit are the CPU of the electronic device and the display unit may be the GPU of the electronic device.
  • FIG. 16 shows a structural block diagram of a computer-readable storage medium provided by an embodiment of the present application.
  • the computer readable storage medium 1600 stores program codes, and the program codes can be called by a processor to execute the method described in the foregoing method embodiments.
  • the computer-readable storage medium 1600 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read Only Memory), EPROM, hard disk, or ROM.
  • the computer-readable storage medium 1600 includes a non-transitory computer-readable storage medium.
  • the computer-readable storage medium 1600 has storage space for the program code 1610 to perform any of the method steps described above. These program codes can be read from or written into one or more computer program products.
  • the program code 1610 may be compressed in an appropriate form, for example.

Abstract

Embodiments of the present application disclose an overlay comment processing method and apparatus, an electronic device, and a computer-readable storage medium, relating to the technical field of video processing. The method comprises: acquiring a request to play an offline video file, wherein the offline video file is pre-stored in an electronic device; acquiring overlay comment data to be displayed corresponding to the offline video file; and playing the offline video file in a video playing interface of a client, and displaying the overlay comment data in the video playing interface. In the present application, when the offline video file is playing, the overlay comment data corresponding to the offline video file is simultaneously displayed, such that when viewing the offline video file, that is, a non-online video file, a user can also view the overlay comment data of the video file.

Description

弹幕处理方法、装置、电子设备及计算机可读取存储介质Barrage processing method, device, electronic equipment and computer readable storage medium 技术领域Technical field
本申请涉及视频处理技术领域,更具体地,涉及一种弹幕处理方法、装置、电子设备及计算机可读取存储介质。The present application relates to the technical field of video processing, and more specifically, to a method, device, electronic device, and computer-readable storage medium for barrage processing.
背景技术Background technique
在播放视频画面中以字幕形式显示评论的现象称为弹幕。用户可以通过弹幕的形式边看视频边与其它用户进行弹幕讨论沟通。The phenomenon of displaying comments in the form of subtitles in the playing video screen is called a barrage. Users can use the form of a barrage to watch barrage and communicate with other users in barrage discussions.
现有的视频弹幕都是通过在线播放或直播的形式,在线播放视频或直播的过程中从各个用户端收集弹幕后在视频对应的时间段上进行展现。而用户在本地播放的视频是没有弹幕的,导致视频播放效果不佳。The existing video barrage is in the form of online play or live broadcast. During the online video play or live broadcast, the barrage is collected from each user terminal and displayed on the corresponding time period of the video. However, there is no barrage for the video played locally by the user, resulting in poor video playback.
发明内容Summary of the invention
本申请提出了一种弹幕处理方法、装置、电子设备及计算机可读取存储介质,以改善上述缺陷。This application proposes a method, device, electronic equipment, and computer readable storage medium for barrage processing to improve the above-mentioned defects.
第一方面,本申请实施例提供了一种弹幕处理方法,应用于电子设备,所述电子设备安装有客户端。所述方法包括:获取离线视频文件的播放请求,所述离线视频文件预先存储在所述电子设备内;获取所述离线视频文件对应的待显示弹幕数据;在所述客户端的视频播放界面内播放所述离线视频文件并将所述待显示弹幕数据在所述视频播放界面内显示。In a first aspect, an embodiment of the present application provides a barrage processing method, which is applied to an electronic device, and a client is installed on the electronic device. The method includes: acquiring a playback request of an offline video file, the offline video file is pre-stored in the electronic device; acquiring the barrage data to be displayed corresponding to the offline video file; in the video playback interface of the client Play the offline video file and display the barrage data to be displayed in the video playback interface.
第二方面,本申请实施例还提供了一种弹幕处理装置,应用于电子设备,所述电子设备安装有客户端。所述装置包括:获取单元、确定单元和显示单元。获取单元,用于获取离线视频文件的播放请求,所述离线视频文件预先存储在所述电子设备内。确定单元,用于获取所述离线视频文件对应的待显示弹幕数据。显示单元,用于在所述客户端的视频播放界面内播放所述离线视频文件并将所述待显示弹幕数据在所述视频播放界面内显示。In a second aspect, an embodiment of the present application further provides a barrage processing device, which is applied to an electronic device, and the electronic device is installed with a client. The device includes: an acquisition unit, a determination unit, and a display unit. The obtaining unit is used for obtaining a playback request of an offline video file, the offline video file is stored in the electronic device in advance. The determining unit is used to obtain the barrage data to be displayed corresponding to the offline video file. The display unit is configured to play the offline video file in the video playback interface of the client and display the barrage data to be displayed in the video playback interface.
第三方面,本申请实施例还提供了一种电子设备,包括:一个或多个处理器;存储器;客户端;一个或多个应用程序,其中所述一个或多个应用程序被存储在所述存储器中并被配置为由所述一个或多个处理器执行,所述一个或多个程序配置用于执行上述方法。In a third aspect, an embodiment of the present application further provides an electronic device, including: one or more processors; a memory; a client; one or more application programs, wherein the one or more application programs are stored in the The memory is configured to be executed by the one or more processors, and the one or more programs are configured to perform the above method.
第四方面,本申请实施例还提供了一种计算机可读取存储介质,计算机可读取存储介质中存储有程序代码,所述程序代码可被处理器调用执行上述方法。According to a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium. The computer-readable storage medium stores program code, and the program code can be called by a processor to execute the above method.
本申请提供的弹幕处理方法、装置、电子设备及计算机可读取存储介质,在欲播放预先存储在电子设备内的离线视频文件时,先查找该离线视频文件对应的待显示弹幕数据,然后,再在所述客户端的视频播放界面内播放所述离线视频文件,并且将所述待显示弹幕数据在所述视频播放界面内显示。因此,在播放离线视频文件的时候,会将该离线视频文件对应的弹幕数据一起显示,使得用户在观看离线视频文件即非在线视频文件的时候,也能够看到该视频文件的弹幕数据。The barrage processing method, device, electronic equipment and computer readable storage medium provided by this application, when you want to play the offline video file pre-stored in the electronic device, first find the barrage data to be displayed corresponding to the offline video file, Then, the offline video file is played in the video playback interface of the client, and the barrage data to be displayed is displayed in the video playback interface. Therefore, when playing an offline video file, the barrage data corresponding to the offline video file is displayed together, so that the user can also see the barrage data of the video file when viewing the offline video file, that is, the offline video file .
附图说明BRIEF DESCRIPTION
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly explain the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required in the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those skilled in the art, without paying any creative work, other drawings can be obtained based on these drawings.
图1示出了本申请一实施例提供的视频播放界面内的弹幕数据的示意图;1 shows a schematic diagram of barrage data in a video playback interface provided by an embodiment of the present application;
图2示出了本申请一实施例提供的视频播放系统的示意图;2 shows a schematic diagram of a video playback system provided by an embodiment of the present application;
图3示出了本申请一实施例提供的视频播放界面内的弹幕输入区域的示意图;3 shows a schematic diagram of a barrage input area in a video playback interface provided by an embodiment of the present application;
图4示出了本申请一实施例提供的弹幕处理方法的方法流程图;4 shows a method flowchart of a barrage processing method provided by an embodiment of the present application;
图5示出了本申请实施例提供的客户端的视频列表界面的示意图;5 shows a schematic diagram of a video list interface of a client provided by an embodiment of the present application;
图6示出了本申请另一实施例提供的弹幕处理方法的方法流程图;6 shows a method flowchart of a barrage processing method provided by another embodiment of the present application;
图7示出了本申请另一实施例提供的视频播放系统的示意图;7 shows a schematic diagram of a video playback system provided by another embodiment of the present application;
图8示出了本申请又一实施例提供的弹幕处理方法的方法流程图;8 shows a method flowchart of a barrage processing method provided by another embodiment of the present application;
图9示出了本申请一实施例提供的提醒信息的示意图;9 shows a schematic diagram of reminder information provided by an embodiment of the present application;
图10示出了本申请另一实施例提供的提醒信息的示意图;10 shows a schematic diagram of reminder information provided by another embodiment of the present application;
图11示出了本申请实施例提供的本地弹幕数据列表的示意图;11 shows a schematic diagram of a local barrage data list provided by an embodiment of the present application;
图12示出了本申请再一实施例提供的弹幕处理方法的方法流程图;12 shows a method flowchart of a barrage processing method provided by yet another embodiment of the present application;
图13示出了本申请再又一实施例提供的弹幕处理方法的方法流程图;13 shows a method flowchart of a barrage processing method provided by yet another embodiment of the present application;
图14示出了本申请实施例提供的弹幕处理装置的模块框图;14 shows a block diagram of a barrage processing device provided by an embodiment of the present application;
图15示出了本申请实施例提供的电子设备的结构框图;15 shows a structural block diagram of an electronic device provided by an embodiment of the present application;
图16示出了本申请实施例的用于保存或者携带实现根据本申请实施例的弹幕处理方法的程序代码的存储单元。FIG. 16 shows a storage unit for storing or carrying program codes for implementing a barrage processing method according to an embodiment of the present application.
具体实施方式detailed description
为了使本技术领域的人员更好地理解本申请方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。In order to enable those skilled in the art to better understand the solution of the present application, the technical solutions in the embodiments of the present application will be described clearly and completely in conjunction with the drawings in the embodiments of the present application.
弹幕(barrage),指的是在网络上观看视频时弹出的评论性字幕。如图1所示的视频播放界面,在该界面上显示有视频画面、弹幕数据和字幕数据,具体地,在该界面顶部显示的比较密集的评论性文字就是弹幕数据,如图1中的“太棒了”、“好漂亮”、“我是来看弹幕的”等,则字幕数据显示在界面的底部,如图1中的“如此宏伟的建筑,体现了中华民族庞大的价值观”。Barrage refers to the comment subtitles that pop up when watching videos on the Internet. As shown in the video playback interface shown in FIG. 1, video images, barrage data, and subtitle data are displayed on the interface. Specifically, the relatively dense commentary text displayed at the top of the interface is barrage data, as shown in FIG. "Awesome", "Pretty", "I am looking at the barrage", etc., the subtitle data is displayed at the bottom of the interface, as shown in "The magnificent building in Figure 1 embodies the huge values of the Chinese nation" ".
作为一种实施方式,该视频播放界面为一个客户端的界面,如图2所示的视频播放系统,该客户端安装在电子设备100内,电子设备100和服务器200位于无线网络或有线网络中,电子设备100和服务器200进行数据交互。As an embodiment, the video playback interface is a client interface. As shown in the video playback system shown in FIG. 2, the client is installed in the electronic device 100, and the electronic device 100 and the server 200 are located in a wireless network or a wired network. The electronic device 100 and the server 200 perform data interaction.
其中,电子设备100可以为移动电话或智能电话(例如,基于iPhone TM,基于Android TM的电话),便携式游戏设备(例如Nintendo DS TM,PlayStation Portable TM,Gameboy Advance TM,iPhone TM)、膝上型电脑、PDA、便携式互联网设备、音乐播放器以及数据存储设备。Among them, the electronic device 100 may be a mobile phone or a smart phone (for example, an iPhone based on TM, an Android-based phone), a portable game device (for example, Nintendo DS, TM, PlayStation Portable TM, Gameboy Advance TM, iPhone TM), laptop Computers, PDAs, portable Internet devices, music players, and data storage devices.
在一些实施例中,客户端安装在电子设备100内,例如,可以是安装在电子设备100的应用程序。用户在客户端通过帐号登录,则该帐号对应的所有信息可以存储在服务器200的存储空间内。其中,服务器200可以是单独的服务器,也可以是服务器集群,可以是本地服务器,也可以是云端服务器。In some embodiments, the client is installed in the electronic device 100, for example, it may be an application program installed in the electronic device 100. When a user logs in through an account on the client, all information corresponding to the account can be stored in the storage space of the server 200. The server 200 may be a separate server, a server cluster, a local server, or a cloud server.
具体地,服务器200可以存储能够在客户端上播放的视频文件,以及该视频文件对应的弹幕数据、字幕数据以及其他的信息。用户可以在线观看该视频文件,从而服务器将该视频文件发送至客户端,客户端在视频播放界面播放该视频文件,同时,还可以将视频文件对应的弹幕数据发送至客户端,客户端也将弹幕数据在视频播放界面上显示。Specifically, the server 200 may store a video file that can be played on the client, and barrage data, subtitle data, and other information corresponding to the video file. The user can watch the video file online, so that the server sends the video file to the client, the client plays the video file on the video playback interface, and at the same time, it can also send the barrage data corresponding to the video file to the client. Display the barrage data on the video playback interface.
另外,客户端还设置有弹幕输入区域101,该弹幕输入区域101设置有文本输入框,用户点击该文本输入框能够在当前界面弹出虚拟键盘,用户通过该虚拟键盘能够输入弹幕,点击发送就能够将该弹幕发送至服务器,由服务器将该弹幕存储至该视频文件对应的网络弹幕数据内,并该网络弹幕数据下发至所有的正在播放该视频文件且与服务器连接的客户端,从而在客户端的视频播放界面上显示。In addition, the client is also provided with a barrage input area 101. The barrage input area 101 is provided with a text input box. The user clicks the text input box to pop up a virtual keyboard on the current interface. The user can input a barrage through the virtual keyboard and click Sending can send the barrage to the server, and the server stores the barrage in the network barrage data corresponding to the video file, and the network barrage data is sent to all the video files that are playing and connected to the server Client, which is displayed on the video playback interface of the client.
用户能够通过输入弹幕的方式发表对该视频文件的评论,并且上传至服务器内存储,再由服务器下方至各个客户端,由其他的用户看到该弹幕,能够实现在观看视频时与其他用户的交互。The user can post a comment on the video file by inputting a barrage, and upload it to the server for storage, and then from the server to each client, and other users can see the barrage, which can achieve User interaction.
但是,发明人在研究中发现,由于视频文件和弹幕数据是相互分离的,因此,如果在线观看某个视频,可以看到该视频对应的弹幕数据,但是如果将该视频下载至电子设备,离线观看该视频的时候,就无法在观看视频的时候同时看到该视频文件的弹幕,而有些弹幕是很有趣的,并且也通过该弹幕获取一些与该视频文件相关的信息,如果无法看到弹幕,会降低用户的观看体验。However, the inventor found in the research that because the video file and the barrage data are separated from each other, if you watch a video online, you can see the barrage data corresponding to the video, but if you download the video to an electronic device , When watching the video offline, you ca n’t see the barrage of the video file at the same time when watching the video, and some barrages are very interesting, and you can also get some information related to the video file through the barrage. If the barrage cannot be seen, it will reduce the user's viewing experience.
因此,为了解决上述缺陷,本申请实施例提供了一种弹幕处理方法,如图4所示,该方法应用于电子设备的客户端,具体地,该方法包括:S401至S403。Therefore, in order to solve the above defects, embodiments of the present application provide a barrage processing method. As shown in FIG. 4, the method is applied to a client of an electronic device. Specifically, the method includes: S401 to S403.
S401:获取离线视频文件的播放请求,所述离线视频文件预先存储在所述电子设备内。S401: Acquire a playback request of an offline video file, the offline video file is pre-stored in the electronic device.
具体地,当电子设备的客户端播放视频的时候,电子设备能够获取欲播放的视频文件,然后再 对视频文件解码,具体地,可以采用软解码或者硬解码对视频文件解码,在解码之后就能够获取视频文件对应的待渲染的多帧图像数据,之后需要将多帧图像数据渲染之后才能够在显示屏上以完成视频文件的显示。Specifically, when the client of the electronic device plays the video, the electronic device can obtain the video file to be played, and then decode the video file. Specifically, the video file can be decoded by soft decoding or hard decoding. The multi-frame image data to be rendered corresponding to the video file can be obtained, and then the multi-frame image data needs to be rendered before it can be displayed on the display screen to complete the display of the video file.
作为一种实施方式,客户端包括视频文件列表,具体地,可以包括在线视频文件列表和离线视频文件列表,其中,离线视频文件列表所显示的视频文件的标识为已经存储在电子设备内的离线视频文件,而在线视频文件列表内展示的可以通过网络访问的视频文件。As an embodiment, the client includes a video file list, specifically, it may include an online video file list and an offline video file list, where the identifier of the video file displayed in the offline video file list is offline that has been stored in the electronic device Video files, and the video files displayed in the online video file list can be accessed through the network.
具体地,可以对客户端的界面上的不同的视频文件对应的播放按钮的触控状态,获取视频播放请求,具体地,如图5所示,客户端的视频列表界面内显示有多个视频对应的显示内容,如图5中所示,多个视频对应的显示内容包括每个视频对应的缩略图,该缩略图可以作为一个触摸按键使用,用户点击该缩略图,客户端能够检测到用户所选点击的缩略图,也就能够确定欲播放的视频文件。则图5所显示的视频列表界面可以是离线视频文件列表,所展示的各个缩略图为各个离线视频文件对应的缩略图,具体地,可以是该离线视频文件内的某帧图像。Specifically, the video playback request can be obtained from the touch state of the play buttons corresponding to different video files on the client interface. Specifically, as shown in FIG. 5, the client ’s video list interface displays multiple video The display content, as shown in FIG. 5, the display content corresponding to multiple videos includes a thumbnail corresponding to each video, the thumbnail can be used as a touch button, the user clicks on the thumbnail, the client can detect the user selected Click on the thumbnail to determine the video file to be played. Then, the video list interface shown in FIG. 5 may be an offline video file list, and each thumbnail displayed is a thumbnail corresponding to each offline video file. Specifically, it may be a certain frame image in the offline video file.
客户端响应用户在视频列表内选中的视频,进入视频的播放界面,点击该播放界面的播放按钮,客户端通过对用户触控操作的监听,能够检测到用户当前所点击的视频文件。The client responds to the video selected by the user in the video list, enters the video playback interface, and clicks the play button on the playback interface. The client can detect the video file currently clicked by the user by monitoring the user's touch operation.
在一些实施例中,用户点击图5所示的视频文件的缩略图时,能够显示视频播放界面并且自动播放该视频文件,而无需用户再点击该视频播放界面的播放按钮,则上述的离线视频文件的播放请求可以是用户点击图5所示的视频文件的缩略图时而生成。具体地,客户端检测在用户在图5所示的界面内的点击操作,如果点击了某一个离线视频文件的缩略图,就判定获取到该离线视频文件的播放请求。In some embodiments, when the user clicks on the thumbnail of the video file shown in FIG. 5, the video playback interface can be displayed and the video file can be automatically played without the user needing to click the play button of the video playback interface again. The file playback request may be generated when the user clicks the thumbnail of the video file shown in FIG. 5. Specifically, the client detects the user's click operation in the interface shown in FIG. 5, and if a thumbnail of an offline video file is clicked, it is determined that a playback request of the offline video file is obtained.
在另一些实施例中,用户点击图5所示的视频文件的缩略图时,能够显示视频播放界面,但是不会自动播放,用户需要点击该播放界面内的播放按钮才能够播放该视频文件,因此,客户端可以通过监测播放按钮的状态,在播放按钮被按下时确定该视频播放界面所对应的离线视频文件,从而获取该离线视频文件的播放请求。In other embodiments, when the user clicks on the thumbnail of the video file shown in FIG. 5, the video playback interface can be displayed, but it does not automatically play. The user needs to click the play button in the playback interface to play the video file. Therefore, the client can determine the offline video file corresponding to the video playback interface when the playback button is pressed by monitoring the status of the playback button, so as to obtain the playback request of the offline video file.
S402:获取所述离线视频文件对应的待显示弹幕数据。S402: Obtain the barrage data to be displayed corresponding to the offline video file.
离线视频文件对应的待显示弹幕数据可以存储在电子设备内,也可以存储在服务器内,还可以存储在存储介质内,例如移动硬盘。The barrage data to be displayed corresponding to the offline video file may be stored in the electronic device, the server, or the storage medium, such as a mobile hard disk.
在获取离线视频文件对应的待显示弹幕数据的方式可以是将能够存储该弹幕数据的设备遍历一边,依次查找。The way to obtain the barrage data to be displayed corresponding to the offline video file may be to traverse a device capable of storing the barrage data and search sequentially.
作为一种实施方式,由于服务器内的弹幕数据更新的比较快,能够记录最近上传的该离线视频文件的弹幕数据,因此,可以先在服务器内查找该离线视频文件对应的待显示弹幕数据,具体地,客户端将离线视频文件的标识发送至服务器,服务器查找与该标识对应的弹幕数据并发送至客户端。如果无法在服务器内查找到该离线视频文件的弹幕数据,则再在电子设备的本地查找,即查找电子设备是否存储与该离线视频文件对应的弹幕数据,如果存在,则将该本地存储的离线视频文件对应的弹幕数据作为待显示弹幕数据。As an embodiment, since the barrage data in the server is updated relatively quickly and can record the barrage data of the recently uploaded offline video file, the server can first find the barrage corresponding to the offline video file to be displayed Data, specifically, the client sends the identifier of the offline video file to the server, and the server searches for the barrage data corresponding to the identifier and sends it to the client. If the barrage data of the offline video file cannot be found in the server, it is searched locally in the electronic device, that is, whether the electronic device stores the barrage data corresponding to the offline video file, and if it exists, the local storage The barrage data corresponding to the offline video file is used as the barrage data to be displayed.
作为另一种实施方式,由于在服务器内获取待显示弹幕数据会消耗当前的网络资源,并且还需要一定时间完成该弹幕数据的下载,因此,可以先查找电子设备是否存储与该离线视频文件对应的弹幕数据,如果存在,则将该本地存储的离线视频文件对应的弹幕数据作为待显示弹幕数据,如果不存在,再由服务器内下载该待显示弹幕数据。As another embodiment, since acquiring the barrage data to be displayed in the server consumes current network resources, and it takes a certain time to complete the download of the barrage data, you can first find out whether the electronic device stores the offline video If the barrage data corresponding to the file exists, the barrage data corresponding to the locally stored offline video file is used as the barrage data to be displayed. If it does not exist, the server will download the barrage data to be displayed.
S403:在所述客户端的视频播放界面内播放所述离线视频文件并将所述待显示弹幕数据在所述视频播放界面内显示。S403: Play the offline video file in the video playback interface of the client and display the barrage data to be displayed in the video playback interface.
具体地,待显示弹幕数据和离线视频文件的显示方式可以是,客户端的视频播放界面内设定两个显示界面,其中一个是视频界面一个是弹幕界面,弹幕界面覆盖在视频界面之上,且弹幕界面为完全透明的,弹幕界面用于显示待显示弹幕数据,视频界面用于显示离线视频文件的每帧图像。这样在该弹幕界面上不显示弹幕的时候,由于弹幕界面是透明的,则弹幕界面不会影响用户观看视频界面上所显示的离线视频文件,在弹幕界面上显示弹幕数据时,用户所观看的现象是在离线视频文件的图层之上显示了弹幕。Specifically, the display method of the barrage data and the offline video file to be displayed may be that two display interfaces are set in the video playback interface of the client, one of which is a video interface and the barrage interface, and the barrage interface covers the video interface. The barrage interface is completely transparent, the barrage interface is used to display the barrage data to be displayed, and the video interface is used to display each frame of the image of the offline video file. In this way, when the barrage is not displayed on the barrage interface, since the barrage interface is transparent, the barrage interface does not affect the user to view the offline video file displayed on the video interface, and the barrage data is displayed on the barrage interface At this time, the phenomenon that the user is watching is that a barrage is displayed above the layer of the offline video file.
由此,在获取到待显示弹幕数据之后,将待显示弹幕数据的显示时间点与离线视频文件的播放时间点对应,例如,在视频文件的播放进度为第一进度时,显示第一弹幕,而该第一弹幕为用户在观看视频的时候,在该视频播放至第一进度时,通过弹幕输入区域而输入的弹幕数据。根据离线视频文件的播放进度和每个弹幕数据所对应的视频文件的播放时间点,将弹幕数据在视频播放界面内显示。Thus, after acquiring the barrage data to be displayed, the display time point of the barrage data to be displayed corresponds to the playback time point of the offline video file, for example, when the playback progress of the video file is the first progress, the first Barrage, and the first barrage is barrage data input through the barrage input area when the user plays the video to the first progress when watching the video. According to the playback progress of the offline video file and the playback time point of the video file corresponding to each barrage data, the barrage data is displayed in the video playback interface.
因此,在播放离线视频文件的时候,会将该离线视频文件对应的弹幕数据一起显示,使得用户在观看离线视频文件即非在线视频文件的时候,也能够看到该视频文件的弹幕数据。Therefore, when playing an offline video file, the barrage data corresponding to the offline video file is displayed together, so that the user can also see the barrage data of the video file when viewing the offline video file, that is, the offline video file .
另外,客户端在播放离线视频文件时,可能已经与服务器连接状态,也可能与服务器断开连接,则两种不同的连接情况下,客户端获取离线视频文件对应的待显示弹幕数据的方式不同,具体地,将在后续实施例中分开说明。In addition, when the client is playing offline video files, it may already be connected to the server, or may be disconnected from the server. In two different connection situations, the client obtains the way to display the barrage data corresponding to the offline video file. Different, specifically, will be explained separately in subsequent embodiments.
请参阅图6,示出了本申请实施例提供的一种弹幕处理方法,该方法应用于电子设备的客户端,描述了电子设备在与服务器断开连接的情况下,获取待显示弹幕数据的实施方式。具体地,该方法包括:S601至S605。Please refer to FIG. 6, which shows a barrage processing method provided by an embodiment of the present application. The method is applied to a client of an electronic device, and describes that the electronic device obtains a barrage to be displayed when the electronic device is disconnected from the server. Data implementation. Specifically, the method includes: S601 to S605.
S601:获取离线视频文件的播放请求,所述离线视频文件预先存储在所述电子设备内。S601: Acquire a playback request of an offline video file, the offline video file is pre-stored in the electronic device.
S602:判断所述电子设备与所述服务器是否处于连接状态。S602: Determine whether the electronic device is connected to the server.
作为一种实施方式,电子设备每间隔一定时间发送一个信标至服务器,服务器获取到电子设备发送的信标之后会反馈指定消息,该指定消息用于指示服务器成功获取到该信标。则在电子设备获取到该指定消息之后,就能够确定电子设备与服务器之间处于连接状态,而如果在预定时间内没有收到该指定消息或者在发送了预定次数的信标之后没有获取到该指定消息,就判定电子设备与所述服务器未处于连接状态,即电子设备与所述服务器断开连接。As an implementation manner, the electronic device sends a beacon to the server every certain time interval. After the server obtains the beacon sent by the electronic device, it returns a specified message, which is used to indicate that the server successfully obtained the beacon. Then after the electronic device obtains the specified message, it can be determined that the electronic device and the server are in a connected state, and if the specified message is not received within a predetermined time or after a predetermined number of beacons are sent, the Specifying the message determines that the electronic device is not connected to the server, that is, the electronic device is disconnected from the server.
作为另一种实施方式,电子设备每间隔一定时间获取到服务器发送的信标,则如果在预定时间内没有收到服务器发送的信标,就判定电子设备与所述服务器未处于连接状态,即电子设备与所述服务器断开连接。As another implementation manner, the electronic device obtains the beacon sent by the server every certain time interval, and if the beacon sent by the server is not received within a predetermined time, it is determined that the electronic device and the server are not connected, that is The electronic device is disconnected from the server.
作为又一种实施方式,电子设备与服务器断开连接的方式还可以是电子设备目前处于断开网络连接的状态,则电子设备判定当前是否处于飞行模式下,如果是,则判定与服务器断开连接,如果否,则通过上述信标判定的方式判定与服务器是否处于连接状态。另外,电子设备与服务器之间通过网关连接,则图2所示的网络系统可以如图7所示,电子设备100与网关300连接,网关300与服务器200连接,电子设备100与网关300之间位于一个局域网内,而网关300与服务器200位于广域网内,则网关300可以是基站,也可以是无线热点等。As yet another embodiment, the way that the electronic device is disconnected from the server may also be that the electronic device is currently in a state of disconnecting from the network, the electronic device determines whether it is currently in the airplane mode, and if so, determines to disconnect from the server Connect, if not, then determine whether it is connected to the server through the above beacon determination. In addition, the electronic device and the server are connected through a gateway, then the network system shown in FIG. 2 may be as shown in FIG. 7, the electronic device 100 is connected to the gateway 300, the gateway 300 is connected to the server 200, and the electronic device 100 is connected to the gateway 300 Located in a local area network, and the gateway 300 and the server 200 are located in a wide area network, the gateway 300 may be a base station or a wireless hotspot.
则在一些实施例中,判断电子设备是否与网关处于连接状态,若未连接状态,则判定电子设备与服务器未连接,如果电子设备与网关连接,则再根据上述信标的方式判断电子设备与服务器的连接状态。其中,电子设备与网关的连接也可以通过信标的方式确定。In some embodiments, it is determined whether the electronic device is connected to the gateway. If it is not connected, it is determined that the electronic device is not connected to the server. If the electronic device is connected to the gateway, the electronic device and the server are determined according to the above beacon method. Connection status. Among them, the connection between the electronic device and the gateway can also be determined by means of a beacon.
S603:判断所述电子设备内是否存储有所述离线视频文件对应的本地弹幕数据。S603: Determine whether local barrage data corresponding to the offline video file is stored in the electronic device.
如果电子设备未与服务器连接,则判断所述电子设备内是否存储有所述离线视频文件对应的本地弹幕数据。If the electronic device is not connected to the server, it is determined whether the local barrage data corresponding to the offline video file is stored in the electronic device.
具体地,在电子设备内预先设定一个存储区域,该存储区域用于存储本地弹幕数据。则本地弹幕数据可以是电子设备曾下载过的弹幕数据或者用户操作电子设备的客户端而输入的弹幕数据,并且将弹幕数据与该弹幕数据对应的视频文件对应存储。如表1所示:Specifically, a storage area is preset in the electronic device, and the storage area is used to store local barrage data. The local barrage data may be barrage data that the electronic device has downloaded or barrage data input by a user operating the client of the electronic device, and the barrage data is stored in correspondence with the video file corresponding to the barrage data. As shown in Table 1:
表1Table 1
视频文件的标识Video file identification 弹幕数据Barrage data 存储位置storage location
视频1Video 1 弹幕1Barrage 1 位置1Position 1
视频2Video 2 弹幕2Barrage 2 位置2Position 2
视频3Video 3 弹幕3Barrage 3 位置3Position 3
如上述表1所示,该视频文件的标识可以是视频文件的名称,每个视频文件对应的弹幕数据为该视频文件所对应的所有弹幕数据,当有新的弹幕数据被下载或被输入时,会将该新的弹幕数据存储至弹幕数据内,即对该弹幕数据更新,而加入新的弹幕数据。则存储位置对应电子设备的存储器的存储地址,可以是一个指针,该指针指向一个存储空间。在该存储位置指定的存储空间内获取该存储空间内存储的弹幕数据。As shown in Table 1 above, the identification of the video file may be the name of the video file, and the barrage data corresponding to each video file is all the barrage data corresponding to the video file. When new barrage data is downloaded or When input, the new barrage data will be stored in the barrage data, that is, the barrage data will be updated, and new barrage data will be added. Then, the storage location corresponds to the storage address of the memory of the electronic device, which may be a pointer that points to a storage space. Obtain the barrage data stored in the storage space in the storage space specified by the storage location.
则判断所述电子设备内是否存储有所述离线视频文件对应的本地弹幕数据的实施方式可以是,在电子设备的存储区域内查找是否包括该视频文件对应的本地弹幕数据,以上述表1为例,获取离线视频文件的标识,在上述表1内查找是否存在与该离线视频文件的标识匹配的标识,如果存在,则判定本地存储有视频文件对应的本地弹幕数据。Then, whether the local barrage data corresponding to the offline video file is stored in the electronic device may be implemented by searching whether the local barrage data corresponding to the video file is included in the storage area of the electronic device. 1 As an example, obtain the identifier of the offline video file, and find in Table 1 above whether there is an identifier that matches the identifier of the offline video file. If so, determine that the local barrage data corresponding to the video file is stored locally.
S604:获取所述离线视频文件对应的本地弹幕数据,作为待显示弹幕数据。S604: Obtain local barrage data corresponding to the offline video file as barrage data to be displayed.
将所查找到的离线视频文件对应的本地弹幕数据作为待显示弹幕数据,由此就能够在未连接服务器的情况下,甚至在未连接互联网的情况下,获取到该离线视频文件对应的待显示弹幕数据。Use the local barrage data corresponding to the found offline video file as the barrage data to be displayed, so that the offline video file corresponding to the offline video file can be obtained without connecting to the server or even without the Internet connection Data to be displayed.
另外,虽然电子设备与服务器处于未连接的状态,但是,如果与局域网的连接未断开,例如, 电子设备仍然与网关处于连接状态,则可以获取位于同一个局域网内的其他客户端的弹幕数据,使得处于一个局域网内的客户端的用户,依然能够通过弹幕而交互,则具体的实施方式在后续实施例中介绍。In addition, although the electronic device and the server are not connected, if the connection to the local area network is not disconnected, for example, the electronic device is still connected to the gateway, you can obtain the barrage data of other clients located in the same local area network , So that the user of the client in a local area network can still interact through the barrage, specific implementations will be introduced in subsequent embodiments.
S605:在所述客户端的视频播放界面内播放所述离线视频文件并将所述待显示弹幕数据在所述视频播放界面内显示。S605: Play the offline video file in the video playback interface of the client and display the barrage data to be displayed in the video playback interface.
需要说明的是,上述步骤中为详细描述的部分,可参考前述实施例,在此不再赘述。It should be noted that the above steps are described in detail, and reference may be made to the foregoing embodiment, which will not be repeated here.
另外,在电子设备本地未存储该离线视频文件对应的弹幕数据的时候,如果该电子设备所在的局域网内有其他的电子设备,可以通过其他电子设备内获取该离线视频文件对应的弹幕数据。具体地,请参阅图8,该方法应用于电子设备的客户端,描述了电子设备在与服务器断开连接的情况下,由局域网获取弹幕数据的过程。具体地,该方法包括:S801至S808。In addition, when the barrage data corresponding to the offline video file is not stored locally in the electronic device, if there are other electronic devices in the local area network where the electronic device is located, the barrage data corresponding to the offline video file can be obtained through other electronic devices . Specifically, referring to FIG. 8, this method is applied to the client of the electronic device, and describes the process of acquiring the barrage data from the local area network when the electronic device is disconnected from the server. Specifically, the method includes: S801 to S808.
S801:获取离线视频文件的播放请求,所述离线视频文件预先存储在所述电子设备内。S801: Acquire a playback request of an offline video file, the offline video file is pre-stored in the electronic device.
S802:判断所述电子设备与所述服务器是否处于连接状态。S802: Determine whether the electronic device is connected to the server.
S803:判断所述电子设备内是否存储有所述离线视频文件对应的本地弹幕数据。S803: Determine whether local barrage data corresponding to the offline video file is stored in the electronic device.
如果电子设备内存储有所述离线视频文件对应的本地弹幕数据,则执行S805,如果电子设备内未存储有所述离线视频文件对应的本地弹幕数据,则执行S804。If the local barrage data corresponding to the offline video file is stored in the electronic device, S805 is performed, and if the local barrage data corresponding to the offline video file is not stored in the electronic device, S804 is performed.
S804:获取与所述电子设备处于同一个局域网内的其他电子设备内存储的所述离线视频文件对应的本地弹幕数据,作为待显示弹幕数据。S804: Obtain local barrage data corresponding to the offline video files stored in other electronic devices in the same local area network as the electronic device as barrage data to be displayed.
如图7所示,与网关300连接的三个电子设备位于同一个局域网内,如果网关与服务器的连接断开,导致电子设备与服务器的连接断开,但是由于电子设备与网关的正常连接,则电子设备能够与局域网内的其他电子设备数据交互。As shown in FIG. 7, the three electronic devices connected to the gateway 300 are located in the same local area network. If the connection between the gateway and the server is disconnected, the connection between the electronic device and the server is disconnected, but due to the normal connection between the electronic device and the gateway, Then, the electronic device can interact with other electronic devices in the local area network.
作为一种实施方式,局域网内的电子设备的客户端在播放离线视频文件的时候,并且在判定与服务器的连接断开但是与网关保持连接的情况下,发送一个询问请求至局域网内的所有电子设备,该询问请求用于询问接收该询问请求的电子设备是否需要获取该离线视频文件的弹幕数据,则该询问请求内包括离线视频文件的标识。As an embodiment, when playing a video file offline, the client of the electronic device in the local area network sends a query request to all electronic devices in the local area network when it is determined that the connection to the server is disconnected but the gateway remains connected. Device, the inquiry request is used to inquire whether the electronic device receiving the inquiry request needs to obtain the barrage data of the offline video file, then the inquiry request includes an identifier of the offline video file.
则电子设备在播放离线视频文件的时候,如果与服务器的连接断开但是与网关保持连接的情况,并且判定本地未存储该离线视频文件对应的本地弹幕数据,则监测是否获取到局域网内其他电子设备发送的询问请求,如果获取到,则回复一个接收指示信息至发送该询问请求的电子设备,则发送该询问请求的电子设备在接收到该接收指示信息之后,将所存储的离线视频文件对应的本地弹幕数据发送至回复接收指示信息的电子设备。从而,电子设备能够在判定本地未存储该离线视频文件对应的本地弹幕数据,获取到局域网内的其他电子设备所存储的该离线视频文件对应的本地弹幕数据。When the electronic device plays the offline video file, if the connection with the server is disconnected but the connection with the gateway is maintained, and it is determined that the local barrage data corresponding to the offline video file is not stored locally, it is monitored whether other devices in the LAN are obtained. If the inquiry request sent by the electronic device is obtained, it will reply a receiving instruction information to the electronic device sending the inquiry request, and then the electronic device sending the inquiry request will store the stored offline video file after receiving the receiving instruction information The corresponding local barrage data is sent to the electronic device that replies to receive the instruction information. Therefore, the electronic device can determine that the local barrage data corresponding to the offline video file is not stored locally, and obtain the local barrage data corresponding to the offline video file stored by other electronic devices in the local area network.
作为另一种实施方式,电子设备获取与所述电子设备处于同一个局域网内的其他电子设备内存储的所述离线视频文件对应的本地弹幕数据的具体实施方式为,向处于同一个局域网内的其他电子设备均发送弹幕获取请求,所述弹幕获取请求包括所述离线视频文件的标识;获取所述其他电子设备基于所述弹幕获取请求而返回的所述离线视频文件对应的本地弹幕数据。As another embodiment, the specific implementation manner of the electronic device acquiring local barrage data corresponding to the offline video files stored in other electronic devices in the same local area network is that the electronic device is in the same local area network All other electronic devices send a barrage acquisition request, and the barrage acquisition request includes the identifier of the offline video file; acquiring the local corresponding to the offline video file returned by the other electronic device based on the barrage acquisition request Barrage data.
其中,弹幕获取请求包括离线视频文件的标识,可以根据离线视频文件的数据或者标题而设定的。Among them, the barrage acquisition request includes the identifier of the offline video file, which can be set according to the data or title of the offline video file.
作为一种实施方式,根据所述离线视频文件的视频数据生成离线视频文件的标识;根据所述离线视频文件的标识生成弹幕获取请求。其中,离线视频文件的视频数据可以是离线视频文件的视频摘要,具体地,可以是根据该视频摘要的文字或者图片而得到对应的特征值,例如,采用哈希算法而得到该视频摘要的特征值,从而得到离线视频文件的标识。另外,还可以根据离线视频文件的视频流或者音频流数据而生成对应的视频文件的标识。As an implementation manner, an offline video file identifier is generated according to the video data of the offline video file; a barrage acquisition request is generated according to the offline video file identifier. The video data of the offline video file may be a video summary of the offline video file, specifically, the corresponding feature value may be obtained according to the text or picture of the video summary, for example, the feature of the video summary is obtained by using a hash algorithm Value to get the ID of the offline video file. In addition, the identifier of the corresponding video file can also be generated according to the video stream or audio stream data of the offline video file.
具体地,客户端在获取到离线视频文件时,将该视频文件发送至播放模块,播放模块在获取到离线视频文件之后,将该离线视频文件解析以获得视频流和音频流。视频文件都有视频流和音频流两部分组成,不同的视频格式音视频的封装格式肯定不一样。将音频流和视频流合成文件的过程称为muxer,反之从媒体文件中分离音频流和视频流的过程称为demuxer。Specifically, when the client obtains the offline video file, the video file is sent to the playback module, and after the playback module obtains the offline video file, the offline video file is parsed to obtain a video stream and an audio stream. Video files are composed of two parts: video stream and audio stream. The packaging formats of audio and video in different video formats are definitely different. The process of synthesizing audio streams and video streams into files is called muxer, while the process of separating audio streams and video streams from media files is called demuxer.
作为一种实施方式,播放模块为系统播放模块。其中,系统播放模块为电子设备的操作系统内默认的播放模块,即在电子设备内安装的客户端播放视频文件时,默认为调用该系统播放模块对视频文件播放。于安卓系统内,该系统播放模块可以是Media Framework模块。As an embodiment, the playback module is a system playback module. The system playback module is the default playback module in the operating system of the electronic device, that is, when the client installed in the electronic device plays a video file, the system playback module is called to play the video file by default. In an Android system, the system playback module may be a Media Framework module.
作为另一种实施方式,播放模块可以是植入到电子设备的操作系统内的非默认播放模块,例如,可以是FFmpeg模块。其中,FFmpeg模块是一个开源的跨平台的视频和音频流框架,属于自由软件,采用LGPL或GPL许可证(依据所选择的组件)。它提供了录制、转换以及流化音视频的完整解决 方案。它包含了非常先进的音频/视频编解码库libavcodec。FFmpeg模块集成了多种格式的音频和视频的编码器,并且具有音视频播放功能,还具有视频文件的解析功能。As another embodiment, the playback module may be a non-default playback module embedded in the operating system of the electronic device, for example, it may be an FFmpeg module. Among them, the FFmpeg module is an open source cross-platform video and audio streaming framework, which is free software and uses the LGPL or GPL license (depending on the selected component). It provides a complete solution for recording, converting and streaming audio and video. It contains the very advanced audio / video codec library libavcodec. The FFmpeg module integrates multiple formats of audio and video encoders, and has audio and video playback functions, as well as video file analysis functions.
在获取到离线视频文件的视频流和音频流之后,可以根据该视频流或者音频流而得到离线视频文件的标识,则由于音频流的数据大小更小,为了减少计算量以及降低电子设备的功耗,可以采用对音频流的数据求特征值的方式得到该视频文件的标识,具体地,获取该音频流数据的特征值,其中,该特征值可以是MD5值或SHA1值等能够标识一个数据的唯一性的特征值。将所述音频流数据的特征值作为所述离线视频文件的标识,由此,由于特征值的唯一性,则该特征值能够作为离线视频文件的标识,而用于将该离线视频文件与其他视频文件区别。另外,在其他的电子设备以及服务器内,存储弹幕数据的时候,将视频文件的标识与弹幕数据对应存储,且该视频文件的标识也采用上述特征值。After obtaining the video stream and audio stream of the offline video file, the identifier of the offline video file can be obtained according to the video stream or audio stream. Since the data size of the audio stream is smaller, in order to reduce the amount of calculation and reduce the power of the electronic device Consumption, you can obtain the identification of the video file by finding the characteristic value of the audio stream data. Specifically, you can obtain the characteristic value of the audio stream data, where the characteristic value can be an MD5 value or a SHA1 value that can identify a data Unique characteristic value. The feature value of the audio stream data is used as the identifier of the offline video file, thus, due to the uniqueness of the feature value, the feature value can be used as the identifier of the offline video file, and used to associate the offline video file with other The difference between video files. In addition, when the barrage data is stored in other electronic devices and servers, the identification of the video file and the barrage data are stored correspondingly, and the identification of the video file also adopts the above characteristic values.
作为另一种实施方式,还可以根据视频文件的标题生成离线视频文件的标识。其中,视频文件的标题可以是视频文件的名称,例如,123456.MP4,也可以是视频文件的视频摘要内所描述的视频文件的名称,例如,视频摘要内包括视频的名称和内容概要等,则将视频摘要内的视频的名称作为视频文件的标题。As another implementation manner, the identifier of the offline video file may also be generated according to the title of the video file. The title of the video file may be the name of the video file, for example, 123456.MP4, or the name of the video file described in the video summary of the video file, for example, the video summary includes the name and content summary of the video, etc. The name of the video in the video summary is used as the title of the video file.
在获取到离线视频文件的标识之后,根据所述离线视频文件的标识生成弹幕获取请求,具体地,可以是按照各个电子设备之间的通信协议将该离线视频文件的标识打包生成弹幕获取请求。然后,再将该弹幕获取请求发送至局域网内的各个电子设备。After acquiring the identifier of the offline video file, a barrage acquisition request is generated according to the identifier of the offline video file. Specifically, the identifier of the offline video file may be packaged to generate the barrage acquisition according to a communication protocol between various electronic devices request. Then, the barrage acquisition request is sent to each electronic device in the local area network.
假设在一个局域网内发送弹幕获取请求的电子设备命名为第一电子设备,而其余的电子设备命名为第二电子设备,第一电子设备发送弹幕获取请求至所有的第二电子设备,第二电子设备在获取到该弹幕获取请求之后,解析该弹幕获取请求以获得离线视频文件的标识,然后查找该离线视频文件的标识对应的弹幕数据并发送至第一电子设备。作为一种实施方式,第一电子设备通过广播报文的方式发送至局域网内的所有电子设备,例如,可以是采用广播地址解析协议(Address Resolution Protocol,ARP)报文的方式发送。具体地,第一电子设备将弹幕获取请求打包成ARP报文,然后广播给局域网内的每个第二电子设备,第二电子设备获取到该ARP报文之后解析该ARP报文能够获取到弹幕获取请求。Suppose that the electronic device that sends the barrage acquisition request in a local area network is named the first electronic device, and the remaining electronic devices are named the second electronic device. The first electronic device sends the barrage acquisition request to all second electronic devices. 2. After acquiring the barrage acquisition request, the electronic device parses the barrage acquisition request to obtain the identifier of the offline video file, and then searches for the barrage data corresponding to the identifier of the offline video file and sends it to the first electronic device. As an implementation manner, the first electronic device is sent to all electronic devices in the local area network by means of broadcast messages, for example, it may be sent by using a broadcast address resolution protocol (Address Resolution Protocol, ARP) message. Specifically, the first electronic device packages the barrage acquisition request into an ARP message, and then broadcasts it to each second electronic device in the local area network. After the second electronic device obtains the ARP message, the ARP message can be obtained by parsing the ARP message. Barrage acquisition request.
在一些实施例中,电子设备在获取到弹幕获取请求之后能够在预设界面内显示提醒信息,其中,该预设界面可以是当前电子设备所显示的界面,而提醒信息用于提醒用户局域网内的其他电子设备请求获取本地弹幕数据,而用户可以基于该提醒信息选择是否将本地弹幕数据发送至请求获取弹幕数据的电子设备。In some embodiments, after acquiring the barrage acquisition request, the electronic device can display reminder information in a preset interface, where the preset interface may be the interface displayed by the current electronic device, and the reminder information is used to remind the user of the local area network Other electronic devices in the request to obtain local barrage data, and the user can select whether to send the local barrage data to the electronic device requesting to obtain barrage data based on the reminder information.
作为一种实施方式,该提醒信息可以是一个弹窗。如图9所示,提醒信息以弹窗的方式显示,该弹窗内显示提醒信息以及确定或拒绝的按钮,例如,“设备1请求获取目标视频的弹幕数据”为提醒信息,则提醒信息内提示了发送该弹幕获取请求的电子设备的标识,则具体地,在弹幕获取请求内除了包括离线视频文件的标识之外还包括请求获取该离线视频文件的本地弹幕数据的电子设备的标识,作为一种实施方式,电子设备的标识可以是电子设备的设备ID或者MAC地址等信息,也可以是用户设定的电子设备的名称。As an implementation, the reminder message may be a pop-up window. As shown in FIG. 9, the reminder information is displayed in a pop-up window, and the reminder information and the button for determining or rejecting are displayed in the pop-up window, for example, “Device 1 requests to obtain the target video ’s barrage data” as the reminder information, then the reminder information The identifier of the electronic device that sent the barrage acquisition request is prompted inside, specifically, the barrage acquisition request includes an electronic device that requests to obtain the local barrage data of the offline video file in addition to the identifier of the offline video file As an embodiment, the identification of the electronic device may be information such as the device ID or MAC address of the electronic device, or may be the name of the electronic device set by the user.
用户点击该弹窗内的“允许”按钮之后,输入确定发送指令,具体地,以上述的第一电子设备和第二电子设备为例,第二电子设备获取第一电子设备发送的弹幕获取请求,第二电子设备在当前界面显示提醒信息,具体地,如图9所示,在弹窗内显示该提醒信息,检测是否获取到用户基于该提醒信息输入确定发送指令,如果检测到该指令,则将本地所存储的离线视频文件对应的本地弹幕数据发送至第一电子设备。After the user clicks the "Allow" button in the pop-up window, he enters a confirmation sending instruction. Specifically, taking the above first electronic device and second electronic device as an example, the second electronic device obtains the barrage obtained by the first electronic device. Upon request, the second electronic device displays reminder information on the current interface. Specifically, as shown in FIG. 9, the reminder information is displayed in a pop-up window to detect whether a user has received an instruction to send based on the reminder information, and if the instruction is detected , The local barrage data corresponding to the offline video file stored locally is sent to the first electronic device.
作为另一种实施方式,该提醒信息在顶部状态栏显示,如图10所示,当第二电子设备获取第一电子设备发送的弹幕获取请求之后,在当前界面的顶部状态栏显示提醒信息,如图10中所示的“设备1请求获取目标视频的弹幕数据”为在顶部状态栏显示的提醒信息,在一些实施例中,该顶部状态栏高亮显示,如背景色为黄色,如果此时存在其他需要在顶部状态栏显示的信息,如第二电子设备接收的短消息提醒信息或者通话提醒信息等状态信息,则在顶部状态栏将提醒信息与状态信息交替显示。As another embodiment, the reminder information is displayed on the top status bar. As shown in FIG. 10, after the second electronic device obtains the barrage acquisition request sent by the first electronic device, the reminder information is displayed on the top status bar of the current interface As shown in FIG. 10, “Device 1 requests to obtain the barrage data of the target video” is the reminder information displayed on the top status bar. In some embodiments, the top status bar is highlighted, such as the background color is yellow, If there is other information that needs to be displayed on the top status bar at this time, such as short message reminder information or call reminder information received by the second electronic device, the reminder information and the status information are alternately displayed on the top status bar.
用户可以点击该顶部状态栏,电子设备响应用户针对该顶部状态栏的触控操作,并显示本地弹幕数据列表界面,如图11所示,在该本地弹幕数据列表界面显示了本地存储的多个弹幕数据,且每个弹幕数据以缩略图的形式显示,在该缩略图内显示视频文件的标识以及该视频文件的关键帧图像,用户点击某个视频文件的缩略图能够将该缩略图对应的视频文件选中,然后再点击发送,就能够将用户选定的弹幕数据发送至第一电子设备。例如,该本地弹幕数据列表界面内所显示的弹幕数 据可以是该离线视频文件对应的多个版本的弹幕数据,用户可以选择其中一个或多个弹幕数据发送至第一电子设备。The user can click on the top status bar, and the electronic device responds to the user's touch operation on the top status bar, and displays a local barrage data list interface. As shown in FIG. 11, the local barrage data list interface displays There are multiple barrage data, and each barrage data is displayed in the form of a thumbnail. The logo of the video file and the key frame image of the video file are displayed in the thumbnail. The user can click the thumbnail of a video file to Select the video file corresponding to the thumbnail, and then click Send to send the barrage data selected by the user to the first electronic device. For example, the barrage data displayed in the local barrage data list interface may be multiple versions of barrage data corresponding to the offline video file, and the user may select one or more barrage data to send to the first electronic device.
另外,该提醒信息还可以提醒第二电子设备的用户,第一电子设备正在请求获取第二电子设备的数据,从而能够保护第二电子设备的用户的隐私。In addition, the reminder information can also remind the user of the second electronic device that the first electronic device is requesting to obtain the data of the second electronic device, so that the privacy of the user of the second electronic device can be protected.
第一电子设备在获取到局域网内的所有第二电子设备的本地弹幕数据之后,将所获取的所有本地弹幕数据作为待显示弹幕数据。由此,能够在电子设备无法连接至互联网的时候,通过与局域网内的电子设备交互,而且还可以在第一电子设备在本地无法获取到本地弹幕数据的时候,能够从局域网内获取该本地弹幕数据,以作为第一电子设备正在播放的离线视频文件的弹幕数据,从而提高用户在观看离线视频文件时的用户体验度。After acquiring the local barrage data of all the second electronic devices in the local area network, the first electronic device uses all the acquired local barrage data as the barrage data to be displayed. Thereby, when the electronic device cannot connect to the Internet, it can interact with the electronic device in the local area network, and when the first electronic device cannot obtain local barrage data locally, the local area can be obtained from the local area network. The barrage data is used as the barrage data of the offline video file being played by the first electronic device, thereby improving the user experience when viewing the offline video file.
S805:获取所述离线视频文件对应的本地弹幕数据。S805: Obtain the local barrage data corresponding to the offline video file.
如果本地存储有离线视频文件对应的本地弹幕数据,则除了将本地存储的弹幕数据作为待显示弹幕数据在视频播放界面上显示之外,还可以获取局域网内的其他电子设备的离线视频文件对应的本地弹幕数据,从而能够将局域网内的其他电子设备的用户实时发布的弹幕数据也在视频播放界面上显示。If the local barrage data corresponding to the offline video file is stored locally, in addition to displaying the locally stored barrage data as the barrage data to be displayed on the video playback interface, offline videos of other electronic devices in the local area network can also be obtained The local barrage data corresponding to the file, so that the barrage data released by users of other electronic devices in the local area network in real time can also be displayed on the video playback interface.
S806:获取与所述电子设备处于同一个局域网内的其他电子设备内存储的所述离线视频文件对应的本地弹幕数据。S806: Obtain local barrage data corresponding to the offline video files stored in other electronic devices in the same local area network as the electronic device.
具体地,获取其他的本地弹幕数据的过程可参考前述S804的实施例,在此不再赘述。Specifically, for the process of acquiring other local barrage data, reference may be made to the foregoing embodiment of S804, and details are not described herein again.
S807:将所获取的所有的本地弹幕数据整合成新的本地弹幕数据,作为待显示弹幕数据。S807: Integrate all the acquired local barrage data into new local barrage data as the barrage data to be displayed.
以上述的第一电子设备和第二电子设备为例,在第一电子设备获取到本地存储的离线视频文件对应的本地弹幕数据之后,发送弹幕获取请求至与第一电子设备处于同一个局域网内的所有第二电子设备,第二电子设备将本地存储的离线视频文件对应的本地弹幕数据发送至第一电子设备。Taking the above first electronic device and second electronic device as examples, after the first electronic device obtains the local barrage data corresponding to the offline video file stored locally, it sends a barrage acquisition request to the same electronic device as the first electronic device. All second electronic devices in the local area network, and the second electronic device sends local barrage data corresponding to the offline video file stored locally to the first electronic device.
假设第一电子设备本地存储的离线视频文件对应的弹幕数据命名为本地弹幕数据1,第一电子设备所获取的第二电子设备发送的离线视频文件对应的弹幕数据命名为本地弹幕数据2,将本地弹幕数据1和本地弹幕数据2整合,具体地,可以是在本地弹幕数据2中查找与本地弹幕数据1区别的弹幕数据,再将相区别的弹幕数据整合至本地弹幕数据1中,则由于弹幕数据中的每个弹幕信息都对应视频文件的一个播放时间点,则根据该播放时间点,将相区别的弹幕数据找中,按照播放时间点插入至本地弹幕数据1,以整合形成新的本地弹幕数据,作为待显示弹幕数据。Assume that the barrage data corresponding to the offline video file stored locally by the first electronic device is named local barrage data 1, and the barrage data corresponding to the offline video file sent by the second electronic device obtained by the first electronic device is named local barrage Data 2, integrate the local barrage data 1 and the local barrage data 2, specifically, the local barrage data 2 can be searched for the barrage data that is different from the local barrage data 1, and then the differentiated barrage data Integrated into the local barrage data 1, because each barrage information in the barrage data corresponds to a playback time point of the video file, according to the playback time point, the different barrage data is found and played according to The time point is inserted into the local barrage data 1 to integrate and form new local barrage data as the barrage data to be displayed.
从而,能够在第一电子设备本都存储了离线视频文件的弹幕数据的基础上,从局域网内获取其他电子设备本地存储的离线视频文件的本地弹幕数据,使得所显示的弹幕数据能够展现局域网内的其他用户的弹幕,增加互动性。Therefore, on the basis that the first electronic device already stores the barrage data of the offline video file, the local barrage data of the offline video file stored locally by other electronic devices can be obtained from the local area network, so that the displayed barrage data can be Show the barrage of other users in the local area network to increase interactivity.
S808:在所述客户端的视频播放界面内播放所述离线视频文件并将所述待显示弹幕数据在所述视频播放界面内显示。S808: Play the offline video file in the video playback interface of the client and display the barrage data to be displayed in the video playback interface.
需要说明的是,上述步骤中为详细描述的部分,可参考前述实施例,在此不再赘述。It should be noted that the above steps are described in detail, and reference may be made to the foregoing embodiment, which will not be repeated here.
另外,考虑到弹幕的实时性,可以每间隔一定时间,第一电子设备就发送弹幕获取请求至第二电子设备,以实时获取局域网内的其他电子设备的弹幕数据。同时,也可以在用户在第一电子设备输入新的弹幕的时候,将新的弹幕同步至局域网内的其他电子设备上,并且在连接有互联网的情况下,将弹幕数据发送至服务器以存储。In addition, considering the real-time nature of the barrage, every certain interval, the first electronic device may send a barrage acquisition request to the second electronic device to obtain barrage data of other electronic devices in the local area network in real time. At the same time, when the user enters a new barrage in the first electronic device, the new barrage can be synchronized to other electronic devices in the local area network, and the barrage data can be sent to the server when the Internet is connected To store.
另外,如果在电子设备内的客户端播放离线视频文件的时候,电子设备与服务器处于连接状态,则可以由服务器内获取到离线视频文件对应的网络弹幕数据。则具体地,请参阅图12,示出了本申请实施例提供的一种弹幕处理方法,该方法应用于电子设备的客户端,描述了电子设备在与服务器连接的情况下,获取弹幕数据的过程。具体地,该方法包括:S1201至S1206。In addition, if the electronic device and the server are connected when the client in the electronic device plays the offline video file, the network barrage data corresponding to the offline video file can be obtained from the server. Specifically, please refer to FIG. 12, which shows a barrage processing method provided by an embodiment of the present application. The method is applied to a client of an electronic device, and describes that the electronic device obtains a barrage when connected to a server The process of data. Specifically, the method includes: S1201 to S1206.
S1201:获取离线视频文件的播放请求,所述离线视频文件预先存储在所述电子设备内。S1201: Acquire a playback request of an offline video file, the offline video file is pre-stored in the electronic device.
S1202:判断所述电子设备与所述服务器是否处于连接状态。S1202: Determine whether the electronic device is connected to the server.
S1203:判断所述电子设备内是否存储有所述离线视频文件对应的本地弹幕数据。S1203: Determine whether local barrage data corresponding to the offline video file is stored in the electronic device.
S1204:获取所述离线视频文件对应的本地弹幕数据,作为待显示弹幕数据。S1204: Obtain local barrage data corresponding to the offline video file as barrage data to be displayed.
S1205:在所述客户端的视频播放界面内播放所述离线视频文件并将所述待显示弹幕数据在所述视频播放界面内显示。S1205: Play the offline video file in the video playback interface of the client and display the barrage data to be displayed in the video playback interface.
上述S1201至S1205的具体实施方式可参考前述实施例,在此不再赘述。For specific implementations of the foregoing S1201 to S1205, reference may be made to the foregoing embodiments, and details are not described herein again.
S1206:发送弹幕获取请求至所述服务器,将所获取的网络弹幕数据作为待显示弹幕数据。S1206: Send a barrage acquisition request to the server, and use the obtained network barrage data as the barrage data to be displayed.
电子设备与服务器之间通过互联网连接,则可以通过预先约定的通信协议将弹幕获取请求发送至服务器,例如,电子设备通过TCP协议将弹幕获取请求发送至服务器。When the electronic device and the server are connected via the Internet, the barrage acquisition request can be sent to the server through a predetermined communication protocol. For example, the electronic device can send the barrage acquisition request to the server through the TCP protocol.
其中,所述弹幕获取请求包括所述离线视频文件的标识,所述弹幕获取请求用于指示所述服务器根据所述离线视频文件的标识查找对应的网络弹幕数据,将所述网络弹幕数据发送至所述客户端。Wherein, the barrage acquisition request includes an identifier of the offline video file, and the barrage acquisition request is used to instruct the server to search for corresponding network barrage data according to the identifier of the offline video file and pop the network Screen data is sent to the client.
则服务器响应该弹幕获取请求将所存储的离线视频文件对应的网络弹幕数据发送至电子设备,从而电子设备在播放离线视频文件的时候,能够从服务器内获取到该视频文件的弹幕数据,以使用户在播放预先下载的视频文件的时候能够观看到弹幕数据,并且,服务器内的弹幕数据保存了多个客户端上传的弹幕数据,使得各个用户能够通过弹幕数据而交流。In response to the barrage acquisition request, the server sends the network barrage data corresponding to the stored offline video file to the electronic device, so that the electronic device can obtain the barrage data of the video file from the server when playing the offline video file , So that the user can view the barrage data when playing the pre-downloaded video file, and the barrage data in the server saves the barrage data uploaded by multiple clients, so that each user can communicate through the barrage data .
另外,电子设备发送弹幕获取请求至所述服务器的具体实施方式可以是:根据所述离线视频文件的视频数据生成离线视频文件的标识;根据所述离线视频文件的标识生成弹幕获取请求;发送弹幕获取请求至所述服务器。其中,根据所述离线视频文件的视频数据生成离线视频文件的标识的实施方式为解析所述离线视频文件获取所述离线视频文件的音频流数据;获取所述音频流数据的特征值;将所述音频流数据的特征值作为所述离线视频文件的标识。In addition, the specific implementation manner that the electronic device sends the barrage acquisition request to the server may be: generating an offline video file identifier according to the video data of the offline video file; generating a barrage acquisition request according to the offline video file identifier; Sending a barrage acquisition request to the server. Wherein, the implementation of generating the offline video file identifier based on the video data of the offline video file is to parse the offline video file to obtain the audio stream data of the offline video file; obtain the characteristic value of the audio stream data; The feature value of the audio stream data is used as the identifier of the offline video file.
另外,还可以根据视频文件的标题生成离线视频文件的标识,具体地,根据所述离线视频文件的标题生成离线视频文件的标识;根据所述离线视频文件的标识生成弹幕获取请求;发送弹幕获取请求至所述服务器。In addition, the identifier of the offline video file can also be generated according to the title of the video file, specifically, the identifier of the offline video file is generated according to the title of the offline video file; the barrage acquisition request is generated according to the identifier of the offline video file; Screen acquisition request to the server.
上述生成离线视频文件的标识以及根据该标识生成弹幕获取请求的具体实施方式可以参考前述实施例,在此不再赘述。For a specific implementation manner of generating the identifier of the offline video file and generating a barrage acquisition request according to the identifier, reference may be made to the foregoing embodiment, and details are not described herein again.
另外,由于发送弹幕获取请求至服务器以及从服务器下载离线视频文件对应的弹幕数据会占用一定的网络带宽,则在发送弹幕获取请求至所述服务器之前,先判断电子设备的本地是否存储有离线视频文件对应的本地弹幕数据,具体地,发送弹幕获取请求至所述服务器的实施方式为:判断所述电子设备内是否存储有所述离线视频文件对应的本地弹幕数据;若未存储有,发送弹幕获取请求至所述服务器,若存储有,不发送弹幕获取请求至所述服务器。In addition, since the barrage data corresponding to sending the barrage acquisition request to the server and downloading the offline video file from the server will occupy a certain network bandwidth, before sending the barrage acquisition request to the server, first determine whether the electronic device is stored locally There is local barrage data corresponding to the offline video file. Specifically, the implementation of sending the barrage acquisition request to the server is: determining whether the local barrage data corresponding to the offline video file is stored in the electronic device; if If it is not stored, the barrage acquisition request is sent to the server. If it is stored, the barrage acquisition request is not sent to the server.
从而,在本地存储离现视频文件对应的本地弹幕数据的情况下,可以节省网络带宽而不必发送弹幕获取请求至服务器,即可以选择不从服务器内下载该离线视频文件对应的网络弹幕数据。Therefore, in the case where the local barrage data corresponding to the off-site video file is stored locally, network bandwidth can be saved without sending a barrage acquisition request to the server, that is, the network barrage corresponding to the offline video file cannot be downloaded from the server data.
另外,考虑到本地所存储的离线视频文件对应的弹幕数据比较旧,所以在检测到本地存储有离线视频文件对应的本地弹幕数据,获取所述离线视频文件对应的本地弹幕数据;检测所述本地弹幕数据的更新时间是否早于预设时间点;若早于预设时间点,则发送弹幕获取请求至所述服务器。In addition, considering that the barrage data corresponding to the offline video file stored locally is relatively old, the local barrage data corresponding to the offline video file is detected locally, and the local barrage data corresponding to the offline video file is obtained; detection Whether the update time of the local barrage data is earlier than a preset time point; if it is earlier than the preset time point, a barrage acquisition request is sent to the server.
具体地,电子设备在本地存储弹幕数据的时候,会为弹幕数据设定存储时间,即在上述表1的基础上增加存储时间,则表1变为表2。Specifically, when the electronic device stores the barrage data locally, the storage time is set for the barrage data, that is, the storage time is increased on the basis of the above Table 1, and Table 1 becomes Table 2.
表2Table 2
视频文件的标识Video file identification 弹幕数据Barrage data 存储位置storage location 存储时间Storage time
视频1Video 1 弹幕1Barrage 1 位置1Position 1 时刻1Moment 1
视频2Video 2 弹幕2Barrage 2 位置2Position 2 时刻2Moment 2
视频3Video 3 弹幕3Barrage 3 位置3Position 3 时刻3Moment 3
其中,上述表2中所示的存储时间,为最近更新的时间。例如,在视频1对应的弹幕数据更新的时候,将视频1对应的弹幕1更新,并且更新视频1对应的时刻1,因此,电子设备所记录的视频文件的弹幕数据的存储时间表示弹幕数据的最近的更新时间。Among them, the storage time shown in Table 2 above is the time of the latest update. For example, when the barrage data corresponding to video 1 is updated, the barrage 1 corresponding to video 1 is updated, and the time 1 corresponding to video 1 is updated. Therefore, the storage time of the barrage data of the video file recorded by the electronic device represents The latest update time of the barrage data.
由此,在获取到离线视频文件对应的本地弹幕数据的最近的更新时间之后,确定该更新时间是否早于预设时间点,其中,预设时间点为用户根据需求而设定的时间点,例如,可以是当前时刻的前一天,则确定预设时间点的方式为,确定当前时刻所对应的当前日期,将当前日期的前一天的零点作为预设时间点,当然,也可以设定预设时间点与当前时刻的间隔比较短,例如,将当前时刻的前2个小时的时间点作为预设时间点,例如,当前时刻为10点50,则预设时间点为8点50。Therefore, after the latest update time of the local barrage data corresponding to the offline video file is obtained, it is determined whether the update time is earlier than a preset time point, where the preset time point is a time point set by the user according to needs For example, it may be the day before the current time, and the way to determine the preset time point is to determine the current date corresponding to the current time, using the zero point of the previous day of the current date as the preset time point, of course, it can also be set The interval between the preset time point and the current time is relatively short. For example, the time point of the first 2 hours of the current time is used as the preset time point. For example, if the current time is 10:50, the preset time point is 8:50.
另外,还可以是在电子设备处于不同的时间段而设定不同的预设时间点,具体地,定义预设时间段与当前时刻的间隔为预设间隔,则预设时间点为当前时刻之前的预设间隔的时刻。作为一种实施方式,确定当前时刻所处的时间段,如果为第一时间段,则设定预设间隔为第一时间长度,如果为第二时间段,则设定预设间隔为第二时间长度,具体地,第一时间段为18:00至24:00以及00:00至01:00,第二时间段为第一时间段之外的时间段,第一时间长度小于第二时间长度,例如,第一时间长度为30分钟,第二时间长度为2小时。例如,当前时刻为20:20,则位于第一时间段,则预设时间点为19:50。再例如,当前时刻为15:20,则位于第二时间段,则预设时间点为13:20。In addition, different preset time points may be set when the electronic device is in different time periods. Specifically, the interval between the preset time period and the current time is defined as the preset interval, and the preset time point is before the current time. At the preset interval. As an implementation manner, the time period at the current moment is determined. If it is the first time period, the preset interval is set to the first time length; if it is the second time period, the preset interval is set to the second Time length, specifically, the first time period is 18:00 to 24:00 and 00:00 to 01:00, the second time period is a time period other than the first time period, and the first time period is less than the second time The length, for example, the first time length is 30 minutes, and the second time length is 2 hours. For example, if the current time is 20:20, it is located in the first time period, and the preset time point is 19:50. For another example, if the current time is 15:20, it is located in the second time period, and the preset time point is 13:20.
由此,由于在第一时间段内,更多用户观看视频,则产生新的弹幕数据的可能性更高,因此,需要更加频繁的更新弹幕数据,也即设定的预设时间点更加接近当前时刻,因此,第一时间长度需要更短。则如果本地存储的弹幕数据大于该预设时间点,则可以认为该弹幕数据比较陈旧,需要从 服务器内下载新的弹幕数据。Therefore, since more users watch videos in the first time period, the possibility of generating new barrage data is higher. Therefore, it is necessary to update the barrage data more frequently, that is, the set preset time point It is closer to the current moment, so the first time length needs to be shorter. Then, if the barrage data stored locally is greater than the preset time point, the barrage data may be considered to be old, and new barrage data needs to be downloaded from the server.
另外,考虑到用户在观看离线视频文件的时候,可能需要输入弹幕数据,而不应当局限于在线观看视频的时候才能够输入弹幕数据,所以,本申请实施例提供的方法还能够在观看离线视频的时候,输入弹幕数据,具体,如图13所示,示出了本申请实施例提供的一种弹幕处理方法,该方法应用于电子设备的客户端,描述了在播放离线视频文件的情况下,获取用户输入的弹幕数据并播放的过程。具体地,该方法包括:S1301至S1306。In addition, considering that users may need to input barrage data when watching offline video files, and should not be limited to being able to input barrage data when watching videos online, so the method provided in the embodiments of the present application can also be used to watch When the video is offline, enter the barrage data. Specifically, as shown in FIG. 13, it shows a method for processing barrage provided by an embodiment of the present application. This method is applied to a client of an electronic device and describes how to play an offline video. In the case of a file, the process of acquiring the barrage data input by the user and playing it. Specifically, the method includes: S1301 to S1306.
S1301:获取离线视频文件的播放请求,所述离线视频文件预先存储在所述电子设备内。S1301: Acquire a playback request of an offline video file, the offline video file is pre-stored in the electronic device.
S1302:获取所述离线视频文件对应的待显示弹幕数据。S1302: Obtain the barrage data to be displayed corresponding to the offline video file.
S1303:在所述客户端的视频播放界面内播放所述离线视频文件并将所述待显示弹幕数据在所述视频播放界面内显示。S1303: Play the offline video file in the video playback interface of the client and display the barrage data to be displayed in the video playback interface.
S1304:获取用户通过所述客户端的视频播放界面的弹幕输入区域输入的目标弹幕数据。S1304: Obtain target barrage data input by the user through the barrage input area of the video playback interface of the client.
其中,弹幕输入区域为在客户端的视频播放界面内的一个用户输入文本信息的区域,具体地,可以是如图3中标号101所指示的区域,具体地可以参考前述实施例,在此不再赘述。The barrage input area is an area where a user enters text information in the video playback interface of the client. Specifically, it may be the area indicated by reference numeral 101 in FIG. 3. For details, refer to the foregoing embodiment. Repeat again.
S1305:确定所述目标弹幕数据所对应的所述离线视频文件的播放时间点。S1305: Determine a playback time point of the offline video file corresponding to the target barrage data.
作为一种实施方式,在用户输入弹幕数据之后点击发送时,视频文件的播放进度作为该目标弹幕数据对应的离线视频文件的播放时间点。作为另一种实施方式,在用户点击该弹幕输入区域时,当前播放的离线视频文件会被暂停,则记录此时的视频文件的播放进度作为用户所输入的目标弹幕数据对应的播放时间点。As an implementation manner, when a user clicks to send after inputting the barrage data, the playback progress of the video file is taken as the playback time point of the offline video file corresponding to the target barrage data. As another embodiment, when the user clicks on the barrage input area, the currently played offline video file will be paused, and the playback progress of the video file at this time is recorded as the playback time corresponding to the target barrage data input by the user point.
S1306:根据所述播放时间点将所述目标弹幕数据在所述视频播放界面内显示。S1306: Display the target barrage data in the video playback interface according to the playback time point.
具体的播放过程可参考前述关于播放待显示弹幕数据的描述,另外,用户在通过弹幕输入区域输入目标弹幕数据的时候,可以选择该弹幕数据的显示信息,其中,显示信息包括显示位置和显示字体以及颜色等,其中,不同的显示位置所对应的显示方式也是不同的,例如,在视频播放界面的顶部显示时,显示方式为从视频播放界面的右侧向左侧划过,而在视频播放界面的底部显示时,位于底部的中间位置闪烁显示。For the specific playback process, please refer to the previous description about playing the barrage data to be displayed. In addition, when the user inputs the target barrage data through the barrage input area, the user can select the display information of the barrage data, where the display information includes the display Position, display font and color, etc., the display modes corresponding to different display positions are also different, for example, when displayed at the top of the video playback interface, the display mode is to swipe from the right to the left of the video playback interface, When displayed at the bottom of the video playback interface, it is displayed at the middle of the bottom flashing.
当然,也可以是单独设定显示方式,则上述显示信息除了所包括的显示位置和显示字体以及颜色之外,还可以包括显示方式。Of course, the display mode can also be set separately, then the above display information can include the display mode in addition to the included display position, display font and color.
而且弹幕输入区域还可以通过用户输入的操作手势而呼出,即在平时播放视频的时候处于隐藏状态,在用户输入预设操作手势时,该弹幕输入区域在视频播放界面上显示,例如,用户点击视频播放界面的底部,能够将该弹幕输入区域呼出,即该视频播放界面上显示该弹幕输入区域。Moreover, the barrage input area can also be called out through the operation gesture input by the user, that is, it is hidden when the video is usually played. When the user inputs the preset operation gesture, the barrage input area is displayed on the video playback interface, for example, The user can call out the barrage input area by clicking the bottom of the video playback interface, that is, the barrage input area is displayed on the video playback interface.
由此,用户在观看离线视频文件的时候,能够输入目标弹幕数据并且在视频文件的视频播放界面上显示。Therefore, when watching offline video files, the user can input target barrage data and display them on the video playback interface of the video file.
另外,在根据所述播放时间点将所述目标弹幕数据在所述视频播放界面内显示之后,电子设备还可以检测所述电子设备与服务器是否处于连接状态,若未处于连接状态,将所述目标弹幕数据存储至所述电子设备内的与所述离线视频文件对应的本地弹幕数据内,具体地,利用目标弹幕数据更新电子设备所存储的与离线视频文件对应的本地弹幕数据,即在与离线视频文件对应的本地弹幕数据加入目标弹幕数据,具体地,可以根据目标弹幕数据对应的播放时间点在本地弹幕数据的播放时间点对应的位置处写入目标弹幕数据。In addition, after displaying the target barrage data in the video playback interface according to the playback time point, the electronic device can also detect whether the electronic device and the server are in a connected state. The target barrage data is stored in the local barrage data corresponding to the offline video file in the electronic device, specifically, the target barrage data is used to update the local barrage corresponding to the offline video file stored in the electronic device Data, that is, the target barrage data is added to the local barrage data corresponding to the offline video file. Specifically, the target can be written to the target at the position corresponding to the playback time point of the local barrage data according to the playback time point corresponding to the target barrage data Barrage data.
再者,当检测到所述电子设备与所述服务器建立连接之后,发送存储请求至所述服务器,所述存储请求包括所述目标弹幕数据,所述存储请求用于指示所述服务器将所述目标弹幕数据存储至所述离线视频文件对应的网络弹幕数据内。Furthermore, after detecting that the electronic device establishes a connection with the server, a storage request is sent to the server. The storage request includes the target barrage data. The storage request is used to instruct the server to The target barrage data is stored in the network barrage data corresponding to the offline video file.
由此,能够在用户播放离线视频的时候,提供一个弹幕输入区域,并且获取用户通过该区域输入的目标弹幕数据,并且在视频播放界面将该目标弹幕数据显示。即使当前电子设备处于无网络的状态,即当前电子设备与服务器断开连接,并且与互联网也断开连接,但是,用户所输入的目标弹幕数据依然能够在视频播放界面上显示。如果当前未连接服务器,先将目标弹幕数据存储在电子设备本地的本地弹幕数据内,如果恢复网络连接,即在检测到电子设备与服务器建立了连接之后,将该弹幕数据发送至服务器内存储,从而使得用户在离线播放离线视频文件的时候,也能够对视频文件输入弹幕数据。Thus, when the user plays the offline video, a barrage input area can be provided, and the target barrage data input by the user through the area can be obtained, and the target barrage data can be displayed on the video playback interface. Even if the current electronic device is in a state without a network, that is, the current electronic device is disconnected from the server and also disconnected from the Internet, the target barrage data input by the user can still be displayed on the video playback interface. If the server is not currently connected, first store the target barrage data in the local barrage data of the electronic device. If the network connection is restored, that is, after detecting that the electronic device has established a connection with the server, the barrage data is sent to the server Internal storage, so that when users play offline video files offline, they can also input barrage data to the video files.
另外,考虑到用户在观看视频的时候会多次输入弹幕数据,如果频繁的发送弹幕数据至服务器,可能会导致一些网络资源的浪费,因此,当检测到所述电子设备与所述服务器建立连接之后,发送存储请求至所述服务器的具体实施方式为:当检测到所述电子设备与所述服务器建立连接之后,获取所述离线视频文件的播放情况,若所述播放情况满足指定条件,发送存储请求至所述服务器。In addition, considering that the user will enter the barrage data multiple times while watching the video, if the barrage data is frequently sent to the server, some network resources may be wasted. Therefore, when the electronic device and the server are detected After the connection is established, a specific implementation manner of sending a storage request to the server is: after detecting that the electronic device establishes a connection with the server, acquiring the playback status of the offline video file, if the playback status meets the specified conditions To send a storage request to the server.
其中,离线视频文件的播放情况可以是播放进度、播放次数或者播放视频文件时的系统时间点等,于本申请实施例中,该播放情况可以是播放进度。则播放情况满足指定条件可以是该播放进度与离线视频文件的整体播放进度的比例大于预设值,其中,预设值可以是50%至100%之间的数据,其中,包括50%和100%。也就是说,如果当前的播放进度大于整体播放进度的一半,则可以在每获取到一个目标弹幕数据的时候,并且在电子设备与服务器连接的情况下,将该目标弹幕数据发送至服务器。其中,预设值可以根据用户的需求而自由设定。The playback condition of the offline video file may be playback progress, playback times, or system time point when playing the video file, etc. In the embodiment of the present application, the playback condition may be playback progress. Then the playback condition meeting the specified condition may be that the ratio of the playback progress to the overall playback progress of the offline video file is greater than a preset value, where the preset value may be data between 50% and 100%, including 50% and 100 %. In other words, if the current playback progress is greater than half of the overall playback progress, you can send the target barrage data to the server each time you obtain target barrage data, and when the electronic device is connected to the server . Among them, the preset value can be freely set according to the needs of the user.
于本申请实施例中,所述若所述播放情况满足指定条件,发送存储请求至所述服务器的实施方式为:判断所述播放进度是否为已完成播放;若为已完成播放,获取在播放所述离线视频文件的过程中所有用户输入的弹幕数据,作为目标弹幕数据;发送存储请求至所述服务器。In the embodiment of the present application, if the playback condition meets a specified condition, the implementation manner of sending a storage request to the server is: judging whether the playback progress is completed playback; if it is completed playback, acquiring the ongoing playback In the process of the offline video file, all barrage data input by the user is used as target barrage data; and a storage request is sent to the server.
其中,播放进度为已完成播放,可以是当前的播放进度与离线视频文件的整体播放进度的比例为100%,也可以是大于预设比例,其中,预设比例为离线视频文件的结尾处的播放进度与离线视频文件的整体播放进度的比例,例如,离线视频文件的整体播放时间为20分钟,而片尾曲在18分钟的位置,则预设比例为18与20的比例,即为90%。Among them, the playback progress is completed playback, which may be the ratio of the current playback progress to the overall playback progress of the offline video file is 100%, or may be greater than a preset ratio, where the preset ratio is at the end of the offline video file The ratio of the playback progress to the overall playback progress of the offline video file. For example, the overall playback time of the offline video file is 20 minutes, and the ending song is at the position of 18 minutes, the preset ratio is the ratio of 18 to 20, which is 90% .
如果该播放进度表示离线视频文件已经播放完毕了,则获取在播放所述离线视频文件的过程中所有用户输入的弹幕数据。具体地,在电子设备的客户端播放离线视频文件的过程中,用户会输入多次弹幕数据,还有可能会有其他用户输入弹幕数据,则将在播放过程中所获取的所有弹幕数据暂时存储在电子设备的本地存储空间内,在播放结束之后将离线视频文件播放过程存储的弹幕数据均发送至服务器。具体地,发送一个存储请求至服务器内,该存储请求可以是一个数据包,该数据包内存储有目标弹幕数据以及离线视频文件的标识,服务器在获取到该数据包之后,解析该数据包然后获取该视频文件的标识,从而查找该离线视频文件的标识对应的网络弹幕数据,将所获取的目标弹幕数据存储至该网络弹幕数据内。If the playback progress indicates that the offline video file has been played, all barrage data input by the user during the playback of the offline video file is acquired. Specifically, during the playback of the offline video file by the client of the electronic device, the user will enter the barrage data multiple times, and there may be other users who enter the barrage data, and all the barrage obtained during the playback process will be The data is temporarily stored in the local storage space of the electronic device, and after the end of the playback, the barrage data stored in the offline video file playback process are all sent to the server. Specifically, a storage request is sent to the server. The storage request may be a data packet. The data packet stores the target barrage data and the identifier of the offline video file. After obtaining the data packet, the server parses the data packet. Then, the identifier of the video file is acquired, so as to find the network barrage data corresponding to the identifier of the offline video file, and the acquired target barrage data is stored in the network barrage data.
另外,还可能由于当前的网络状态不好,或者网络资源比较缺乏,如果发送弹幕数据可能会占用网络带宽,因此,可以选择在网络状态比较理想的时候再发送目标弹幕数据,则作为另一种实施方式,当检测到所述电子设备与所述服务器建立连接之后,发送存储请求至所述服务器的具体实施方式还可以是:获取所述电子设备与所述服务器之间的通信链路的通信质量;若所述通信质量满足预设标准,将所述目标弹幕数据和所述视频文件的标识发送至所述服务器。In addition, it may also be due to the current network state is not good, or the network resources are relatively scarce, if sending barrage data may occupy the network bandwidth, therefore, you can choose to send the target barrage data when the network state is more ideal, as another In an embodiment, after detecting that the electronic device establishes a connection with the server, the specific implementation of sending a storage request to the server may also be: acquiring a communication link between the electronic device and the server Communication quality; if the communication quality meets a preset standard, send the target barrage data and the identification of the video file to the server.
其中,通信质量可以是电子设备与服务器之间的信号强度,如果该信号强度大于预设强度值,则判定该通信质量满足预设标准,将所述目标弹幕数据和所述视频文件的标识发送至所述服务器。The communication quality may be the signal strength between the electronic device and the server. If the signal strength is greater than the preset strength value, it is determined that the communication quality meets the preset standard, and the target barrage data and the identification of the video file are determined. Send to the server.
另外,通信质量还可以是电子设备与服务器之间的信道质量。其中,信道质量可以是信道的误差向量幅度、接入点个数、信号强度等。其中,误差向量幅度(Error Vector Magnitude,简称EVM)指在给定时刻理想无误差基准信号与实际发射信号的向量差,用于衡量调制信号的幅度误差和相位误差,EVM具体表示接收终端对信号进行解调时产生的IQ分量与理想信号分量的接近程度,是考量调制信号质量的一种指标。EVM越小,信道的信道质量越好。而接入点的个数也可以在信道扫描的时候,获取每个信道上的接入点,由此就能够确定每个信道上的接入点个数,接入点的个数越多,信道质量越差,反之,越好。同理,信号强度也可以在信道扫描的时候获得,信号强度越高,则信道质量越高,反之,越低。In addition, the communication quality may also be the channel quality between the electronic device and the server. The channel quality may be the error vector amplitude of the channel, the number of access points, and signal strength. Among them, Error Vector Magnitude (EVM) refers to the vector difference between the ideal error-free reference signal and the actual transmitted signal at a given time, and is used to measure the amplitude error and phase error of the modulated signal. EVM specifically represents the signal received by the receiving terminal. The closeness of the IQ component generated during demodulation to the ideal signal component is an indicator of the quality of the modulated signal. The smaller the EVM, the better the channel quality of the channel. The number of access points can also be obtained during the channel scan, and the number of access points on each channel can be determined. The more the number of access points, The worse the channel quality, the better. Similarly, the signal strength can also be obtained during channel scanning. The higher the signal strength, the higher the channel quality, and vice versa, the lower.
移动终端在进入到一个新的网络环境的时候,会根据预设信道扫描顺序对所支持的多个信道进行扫描,而在每个信道的扫描过程中,能够得到该信道上的无线接入点,由此就能够确定每个无线接入点所在的信道,于本申请实施例中,电子设备与服务器通过无线接入点连接,无线接入点可以是Wi-Fi接入点。由此,就能够确定所连接的无线音频播放设备所在的信道,进而获取该信道对应的误差向量幅度。When a mobile terminal enters a new network environment, it scans multiple supported channels according to the preset channel scanning order, and during the scanning process of each channel, it can obtain the wireless access point on the channel In this way, the channel where each wireless access point is located can be determined. In the embodiment of the present application, the electronic device and the server are connected through the wireless access point, and the wireless access point may be a Wi-Fi access point. Thus, the channel where the connected wireless audio playback device is located can be determined, and then the error vector magnitude corresponding to the channel can be obtained.
如果该电子设备与服务器之间的误差向量幅度小于预设幅度值,则判定该通信质量满足预设标准,将所述目标弹幕数据和所述视频文件的标识发送至所述服务器。If the magnitude of the error vector between the electronic device and the server is less than the preset magnitude value, it is determined that the communication quality meets the preset standard, and the target barrage data and the identification of the video file are sent to the server.
需要说明的是,上述步骤中为详细描述的部分,可参考前述实施例,在此不再赘述。It should be noted that the above steps are described in detail, and reference may be made to the foregoing embodiment, which will not be repeated here.
请参阅图14,其示出了本申请实施例提供的一种弹幕处理装置的结构框图,该弹幕处理装置1400可以包括:获取单元1401、确定单元1402和显示单元1403。Please refer to FIG. 14, which shows a structural block diagram of a barrage processing device provided by an embodiment of the present application. The barrage processing device 1400 may include: an obtaining unit 1401, a determining unit 1402, and a display unit 1403.
获取单元1401用于获取离线视频文件的播放请求,所述离线视频文件预先存储在所述电子设备内。The obtaining unit 1401 is used to obtain a playback request of an offline video file, which is stored in the electronic device in advance.
确定单元1402用于获取所述离线视频文件对应的待显示弹幕数据。The determining unit 1402 is used to obtain the barrage data to be displayed corresponding to the offline video file.
具体地,确定单元1402还用于判断所述电子设备与所述服务器是否处于连接状态;若未处于连接状态,判断所述电子设备内是否存储有所述离线视频文件对应的本地弹幕数据;若存储有,获 取所述离线视频文件对应的本地弹幕数据,作为待显示弹幕数据。若未存储有,获取与所述电子设备处于同一个局域网内的其他电子设备内存储的所述离线视频文件对应的本地弹幕数据,作为待显示弹幕数据。Specifically, the determining unit 1402 is also used to determine whether the electronic device and the server are in a connected state; if not, determine whether the local barrage data corresponding to the offline video file is stored in the electronic device; If stored, the local barrage data corresponding to the offline video file is obtained as the barrage data to be displayed. If it is not stored, the local barrage data corresponding to the offline video files stored in other electronic devices in the same local area network as the electronic device is acquired as the barrage data to be displayed.
其中,若存储有,获取所述离线视频文件对应的本地弹幕数据;获取与所述电子设备处于同一个局域网内的其他电子设备内存储的所述离线视频文件对应的本地弹幕数据;将所获取的所有的本地弹幕数据整合成新的本地弹幕数据,作为待显示弹幕数据。Wherein, if stored, obtain local barrage data corresponding to the offline video file; obtain local barrage data corresponding to the offline video file stored in other electronic devices in the same local area network as the electronic device; All the obtained local barrage data is integrated into new local barrage data, which is used as the barrage data to be displayed.
具体地,确定单元1402获取与所述电子设备处于同一个局域网内的其他电子设备内存储的所述离线视频文件对应的本地弹幕数据的方式为:向处于同一个局域网内的其他电子设备均发送弹幕获取请求,所述弹幕获取请求包括所述离线视频文件的标识;获取所述其他电子设备基于所述弹幕获取请求而返回的所述离线视频文件对应的本地弹幕数据。Specifically, the determining unit 1402 acquires the local barrage data corresponding to the offline video files stored in other electronic devices in the same local area network as the electronic device in the same local area network: Sending a barrage acquisition request, where the barrage acquisition request includes the identifier of the offline video file; and acquiring local barrage data corresponding to the offline video file returned by the other electronic device based on the barrage acquisition request.
另外,确定单元1402还用于发送弹幕获取请求至所述服务器,所述弹幕获取请求包括所述离线视频文件的标识,所述弹幕获取请求用于指示所述服务器根据所述离线视频文件的标识查找对应的网络弹幕数据,将所述网络弹幕数据发送至所述客户端;将所获取的网络弹幕数据作为待显示弹幕数据。具体地,作为一种实施方式,确定单元1402判断所述电子设备内是否存储有所述离线视频文件对应的本地弹幕数据;若未存储有,发送弹幕获取请求至所述服务器。作为另一种实施方式,若存储有该本地弹幕数据,确定单元1402获取所述离线视频文件对应的本地弹幕数据;检测所述本地弹幕数据的更新时间是否早于预设时间点;若早于预设时间点,则发送弹幕获取请求至所述服务器。In addition, the determining unit 1402 is further configured to send a barrage acquisition request to the server, where the barrage acquisition request includes an identifier of the offline video file, and the barrage acquisition request is used to instruct the server according to the offline video The file identifier searches for the corresponding network barrage data, and sends the network barrage data to the client; the obtained network barrage data is used as the barrage data to be displayed. Specifically, as an embodiment, the determining unit 1402 determines whether the local barrage data corresponding to the offline video file is stored in the electronic device; if not, sends a barrage acquisition request to the server. As another embodiment, if the local barrage data is stored, the determining unit 1402 obtains the local barrage data corresponding to the offline video file; detects whether the update time of the local barrage data is earlier than a preset time point; If it is earlier than the preset time point, a barrage acquisition request is sent to the server.
显示单元1403用于在所述客户端的视频播放界面内播放所述离线视频文件并将所述待显示弹幕数据在所述视频播放界面内显示。The display unit 1403 is used to play the offline video file in the video playback interface of the client and display the barrage data to be displayed in the video playback interface.
进一步的,还包括输入单元、弹幕显示单元和记录单元。Further, it also includes an input unit, a barrage display unit and a recording unit.
输入单元用于获取用户通过所述客户端的视频播放界面的弹幕输入区域输入的目标弹幕数据;确定所述目标弹幕数据所对应的所述离线视频文件的播放时间点。The input unit is used to obtain target barrage data input by a user through a barrage input area of the video playback interface of the client; determine a playback time point of the offline video file corresponding to the target barrage data.
弹幕显示单元用于根据所述播放时间点将所述目标弹幕数据在所述视频播放界面内显示。The barrage display unit is used to display the target barrage data in the video playback interface according to the playback time point.
记录单元用于检测所述电子设备与服务器是否处于连接状态;若未处于连接状态,将所述目标弹幕数据存储至所述电子设备内的与所述离线视频文件对应的本地弹幕数据内。The recording unit is used to detect whether the electronic device is connected to the server; if not, store the target barrage data into local barrage data corresponding to the offline video file in the electronic device .
记录单元还用于当检测到所述电子设备与所述服务器建立连接之后,发送存储请求至所述服务器,所述存储请求包括所述目标弹幕数据,所述存储请求用于指示所述服务器将所述目标弹幕数据存储至所述离线视频文件对应的网络弹幕数据内。The recording unit is further used to send a storage request to the server after detecting that the electronic device establishes a connection with the server, the storage request includes the target barrage data, and the storage request is used to instruct the server Storing the target barrage data into the network barrage data corresponding to the offline video file.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述装置和模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and conciseness of the description, the specific working processes of the above-described device and module can be referred to the corresponding processes in the foregoing method embodiments, which will not be repeated here.
在本申请所提供的几个实施例中,模块相互之间的耦合可以是电性,机械或其它形式的耦合。In the several embodiments provided in this application, the coupling between the modules may be electrical, mechanical, or other forms of coupling.
另外,在本申请各个实施例中的各功能模块可以集成在一个处理模块中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。In addition, each functional module in each embodiment of the present application may be integrated into one processing module, or each module may exist alone physically, or two or more modules may be integrated into one module. The above integrated modules may be implemented in the form of hardware or software function modules.
请参考图15,其示出了本申请实施例提供的一种电子设备的结构框图。该电子设备100可以是智能手机、平板电脑、电子书等能够运行应用程序的电子设备。本申请中的电子设备100可以包括一个或多个如下部件:处理器110、存储器120、以及一个或多个应用程序,其中一个或多个应用程序可以被存储在存储器120中并被配置为由一个或多个处理器110执行,一个或多个程序配置用于执行如前述方法实施例所描述的方法。Please refer to FIG. 15, which shows a structural block diagram of an electronic device provided by an embodiment of the present application. The electronic device 100 may be an electronic device capable of running an application program such as a smart phone, a tablet computer, an e-book. The electronic device 100 in this application may include one or more of the following components: a processor 110, a memory 120, and one or more application programs, where one or more application programs may be stored in the memory 120 and configured to be One or more processors 110 execute, and one or more programs are configured to execute the method as described in the foregoing method embodiments.
处理器110可以包括一个或者多个处理核。处理器110利用各种接口和线路连接整个电子设备100内的各个部分,通过运行或执行存储在存储器120内的指令、程序、代码集或指令集,以及调用存储在存储器120内的数据,执行电子设备100的各种功能和处理数据。可选地,处理器110可以采用数字信号处理(Digital Signal Processing,DSP)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、可编程逻辑阵列(Programmable Logic Array,PLA)中的至少一种硬件形式来实现。处理器110可集成中央处理器(Central Processing Unit,CPU)、图像处理器(Graphics Processing Unit,GPU)和调制解调器等中的一种或几种的组合。其中,CPU主要处理操作系统、用户界面和应用程序等;GPU用于负责显示内容的渲染和绘制;调制解调器用于处理无线通信。可以理解的是,上述调制解调器也可以不集成到处理器110中,单独通过一块通信芯片进行实现。The processor 110 may include one or more processing cores. The processor 110 connects various parts of the entire electronic device 100 by using various interfaces and lines, executes or executes instructions, programs, code sets or instruction sets stored in the memory 120, and calls data stored in the memory 120 to execute Various functions and processing data of the electronic device 100. Alternatively, the processor 110 may use at least one of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). Various hardware forms. The processor 110 may integrate one or a combination of a central processing unit (Central Processing Unit, CPU), an image processing unit (Graphics Processing Unit, GPU), and a modem. Among them, CPU mainly deals with operating system, user interface and application program, etc .; GPU is used for rendering and rendering of display content; modem is used for handling wireless communication. It can be understood that the above-mentioned modem may not be integrated into the processor 110, and may be implemented by a communication chip alone.
存储器120可以包括随机存储器(Random Access Memory,RAM),也可以包括只读存储器(Read-Only Memory)。存储器120可用于存储指令、程序、代码、代码集或指令集。存储器120可 包括存储程序区和存储数据区,其中,存储程序区可存储用于实现操作系统的指令、用于实现至少一个功能的指令(比如触控功能、声音播放功能、图像播放功能等)、用于实现下述各个方法实施例的指令等。存储数据区还可以存储电子设备100在使用中所创建的数据(比如电话本、音视频数据、聊天记录数据)等。The memory 120 may include random access memory (RAM) or read-only memory (Read-Only Memory). The memory 120 may be used to store instructions, programs, codes, code sets, or instruction sets. The memory 120 may include a storage program area and a storage data area, where the storage program area may store instructions for implementing an operating system and instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.) , Instructions for implementing the following method embodiments. The storage data area may also store data created by the electronic device 100 in use (such as a phone book, audio and video data, chat history data), and the like.
则如果上述图14所示的弹幕处理装置中的各个单元作为程序包等函数模块的话,该弹幕处理装置内的各个单元存储在存储器120内,能够被处理器调用,并执行对应的功能。Then, if each unit in the barrage processing device shown in FIG. 14 is used as a function module such as a program package, each unit in the barrage processing device is stored in the memory 120 and can be called by the processor and execute the corresponding function .
而如果上述图14所示的弹幕处理装置中的各个单元作为电子设备的一个具体的电路元件,则获取单元和确定单元为电子设备的CPU而显示单元可以是电子设备的GPU。If each unit in the barrage processing device shown in FIG. 14 is used as a specific circuit element of an electronic device, the acquiring unit and the determining unit are the CPU of the electronic device and the display unit may be the GPU of the electronic device.
请参考图16,其示出了本申请实施例提供的一种计算机可读存储介质的结构框图。该计算机可读存储介质1600中存储有程序代码,所述程序代码可被处理器调用执行上述方法实施例中所描述的方法。Please refer to FIG. 16, which shows a structural block diagram of a computer-readable storage medium provided by an embodiment of the present application. The computer readable storage medium 1600 stores program codes, and the program codes can be called by a processor to execute the method described in the foregoing method embodiments.
计算机可读存储介质1600可以是诸如闪存、EEPROM(电可擦除可编程只读存储器)、EPROM、硬盘或者ROM之类的电子存储器。可选地,计算机可读存储介质1600包括非易失性计算机可读介质(non-transitory computer-readable storage medium)。计算机可读存储介质1600具有执行上述方法中的任何方法步骤的程序代码1610的存储空间。这些程序代码可以从一个或者多个计算机程序产品中读出或者写入到这一个或者多个计算机程序产品中。程序代码1610可以例如以适当形式进行压缩。The computer-readable storage medium 1600 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read Only Memory), EPROM, hard disk, or ROM. Optionally, the computer-readable storage medium 1600 includes a non-transitory computer-readable storage medium. The computer-readable storage medium 1600 has storage space for the program code 1610 to perform any of the method steps described above. These program codes can be read from or written into one or more computer program products. The program code 1610 may be compressed in an appropriate form, for example.
最后应说明的是:以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不驱使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still Modifications to the technical solutions described in the foregoing embodiments, or equivalent replacements to some of the technical features; and these modifications or replacements do not drive the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims (20)

  1. 一种弹幕处理方法,其特征在于,应用于电子设备,所述电子设备安装有客户端,所述方法包括:A method for processing a barrage, characterized by being applied to an electronic device with a client installed, the method includes:
    获取离线视频文件的播放请求,所述离线视频文件预先存储在所述电子设备内;Obtaining a playback request of an offline video file, the offline video file is pre-stored in the electronic device;
    获取所述离线视频文件对应的待显示弹幕数据;Obtaining barrage data to be displayed corresponding to the offline video file;
    在所述客户端的视频播放界面内播放所述离线视频文件并将所述待显示弹幕数据在所述视频播放界面内显示。Play the offline video file in the video playback interface of the client and display the barrage data to be displayed in the video playback interface.
  2. 根据权利要求1所述的方法,其特征在于,所述获取所述离线视频文件对应的待显示弹幕数据,包括:The method according to claim 1, wherein the acquiring the barrage data to be displayed corresponding to the offline video file comprises:
    判断所述电子设备与所述服务器是否处于连接状态;Determine whether the electronic device is connected to the server;
    若未处于连接状态,判断所述电子设备内是否存储有所述离线视频文件对应的本地弹幕数据;If it is not connected, determine whether local barrage data corresponding to the offline video file is stored in the electronic device;
    若存储有,获取所述离线视频文件对应的本地弹幕数据,作为待显示弹幕数据。If stored, the local barrage data corresponding to the offline video file is obtained as the barrage data to be displayed.
  3. 根据权利要求2所述的方法,其特征在于,所述电子设备能够通过网关与所述服务器连接,所述网关连接有多个电子设备,与所述网关连接的所有电子设备处于同一个局域网内;所述若未处于连接状态,判断所述电子设备内是否存储有所述离线视频文件对应的本地弹幕数据之后,还包括:The method according to claim 2, wherein the electronic device can be connected to the server through a gateway, the gateway is connected to a plurality of electronic devices, and all the electronic devices connected to the gateway are in the same local area network ; If it is not connected, after determining whether the local barrage data corresponding to the offline video file is stored in the electronic device, the method further includes:
    若未存储有,获取与所述电子设备处于同一个局域网内的其他电子设备内存储的所述离线视频文件对应的本地弹幕数据,作为待显示弹幕数据。If it is not stored, the local barrage data corresponding to the offline video files stored in other electronic devices in the same local area network as the electronic device is acquired as the barrage data to be displayed.
  4. 根据权利要求2所述的方法,其特征在于,所述电子设备能够通过网关与所述服务器连接,所述网关连接有多个电子设备,与所述网关连接的所有电子设备处于同一个局域网内;所述若存储有,获取所述离线视频文件对应的本地弹幕数据,作为待显示弹幕数据,包括:The method according to claim 2, wherein the electronic device can be connected to the server through a gateway, the gateway is connected to a plurality of electronic devices, and all the electronic devices connected to the gateway are in the same local area network ; If stored, obtain the local barrage data corresponding to the offline video file as the barrage data to be displayed, including:
    若存储有,获取所述离线视频文件对应的本地弹幕数据;If stored, obtain the local barrage data corresponding to the offline video file;
    获取与所述电子设备处于同一个局域网内的其他电子设备内存储的所述离线视频文件对应的本地弹幕数据;Acquiring local barrage data corresponding to the offline video files stored in other electronic devices in the same local area network as the electronic device;
    将所获取的所有的本地弹幕数据整合成新的本地弹幕数据,作为待显示弹幕数据。Integrate all the acquired local barrage data into new local barrage data as the barrage data to be displayed.
  5. 根据权利要求3或4所述的方法,其特征在于,所述获取与所述电子设备处于同一个局域网内的其他电子设备内存储的所述离线视频文件对应的本地弹幕数据,包括:The method according to claim 3 or 4, wherein the obtaining local barrage data corresponding to the offline video files stored in other electronic devices in the same local area network as the electronic device includes:
    向处于同一个局域网内的其他电子设备均发送弹幕获取请求,所述弹幕获取请求包括所述离线视频文件的标识;Send a barrage acquisition request to other electronic devices in the same local area network, where the barrage acquisition request includes the identifier of the offline video file;
    获取所述其他电子设备基于所述弹幕获取请求而返回的所述离线视频文件对应的本地弹幕数据。Acquiring local barrage data corresponding to the offline video file returned by the other electronic device based on the barrage obtaining request.
  6. 根据权利要求2所述的方法,其特征在于,还包括:The method of claim 2, further comprising:
    若处于连接状态,发送弹幕获取请求至所述服务器,所述弹幕获取请求包括所述离线视频文件的标识,所述弹幕获取请求用于指示所述服务器根据所述离线视频文件的标识查找对应的网络弹幕数据,将所述网络弹幕数据发送至所述客户端;If it is in a connected state, send a barrage acquisition request to the server, the barrage acquisition request includes the identifier of the offline video file, and the barrage acquisition request is used to instruct the server according to the identifier of the offline video file Searching for corresponding network barrage data, and sending the network barrage data to the client;
    将所获取的网络弹幕数据作为待显示弹幕数据。Use the obtained network barrage data as the barrage data to be displayed.
  7. 根据权利要求6所述的方法,其特征在于,所述若处于连接状态,发送弹幕获取请求至所述服务器,包括:The method according to claim 6, wherein the sending a barrage acquisition request to the server if in the connected state includes:
    若处于连接状态,判断所述电子设备内是否存储有所述离线视频文件对应的本地弹幕数据;If it is connected, determine whether the local barrage data corresponding to the offline video file is stored in the electronic device;
    若未存储有,发送弹幕获取请求至所述服务器。If it is not stored, a barrage acquisition request is sent to the server.
  8. 根据权利要求7所述的方法,其特征在于,所述若处于连接状态,判断所述电子设备内是否存储有所述离线视频文件对应的本地弹幕数据之后,还包括:The method according to claim 7, wherein after determining whether the electronic device stores the local barrage data corresponding to the offline video file in the connected state, the method further comprises:
    若存储有,获取所述离线视频文件对应的本地弹幕数据;If stored, obtain the local barrage data corresponding to the offline video file;
    检测所述本地弹幕数据的更新时间是否早于预设时间点;Detecting whether the update time of the local barrage data is earlier than a preset time point;
    若早于预设时间点,则发送弹幕获取请求至所述服务器。If it is earlier than the preset time point, a barrage acquisition request is sent to the server.
  9. 根据权利要求6-8任一所述的方法,其特征在于,所述发送弹幕获取请求至所述服务器,包括:The method according to any one of claims 6-8, wherein the sending a barrage acquisition request to the server includes:
    根据所述离线视频文件的视频数据生成离线视频文件的标识;Generating an offline video file identifier according to the video data of the offline video file;
    根据所述离线视频文件的标识生成弹幕获取请求;Generating a barrage acquisition request according to the identifier of the offline video file;
    发送弹幕获取请求至所述服务器。Sending a barrage acquisition request to the server.
  10. 根据权利要求9所述的方法,其特征在于,所述根据所述离线视频文件的视频数据生成离 线视频文件的标识,包括:The method according to claim 9, wherein the generating the identifier of the offline video file based on the video data of the offline video file includes:
    解析所述离线视频文件获取所述离线视频文件的音频流数据;Parse the offline video file to obtain audio stream data of the offline video file;
    获取所述音频流数据的特征值;Acquiring characteristic values of the audio stream data;
    将所述音频流数据的特征值作为所述离线视频文件的标识。The feature value of the audio stream data is used as the identifier of the offline video file.
  11. 根据权利要求10所述的方法,其特征在于,所述特征值为MD5值。The method according to claim 10, wherein the characteristic value is an MD5 value.
  12. 根据权利要求6-8任一所述的方法,其特征在于,所述发送弹幕获取请求至所述服务器,包括:The method according to any one of claims 6-8, wherein the sending a barrage acquisition request to the server includes:
    根据所述离线视频文件的标题生成离线视频文件的标识;Generating an offline video file identifier according to the title of the offline video file;
    根据所述离线视频文件的标识生成弹幕获取请求;Generating a barrage acquisition request according to the identifier of the offline video file;
    发送弹幕获取请求至所述服务器。Sending a barrage acquisition request to the server.
  13. 根据权利要求1-12所述的方法,其特征在于,所述在所述客户端的视频播放界面内播放所述离线视频文件并将所述待显示弹幕数据在所述视频播放界面内显示之后,还包括:The method according to claims 1-12, wherein after playing the offline video file in the video playback interface of the client and displaying the barrage data to be displayed in the video playback interface ,Also includes:
    获取用户通过所述客户端的视频播放界面的弹幕输入区域输入的目标弹幕数据;Obtain target barrage data input by the user through the barrage input area of the video playback interface of the client;
    确定所述目标弹幕数据所对应的所述离线视频文件的播放时间点;Determine the playing time point of the offline video file corresponding to the target barrage data;
    根据所述播放时间点将所述目标弹幕数据在所述视频播放界面内显示。Display the target barrage data in the video playback interface according to the playback time point.
  14. 根据权利要求13所述的方法,其特征在于,所述根据所述播放时间点将所述目标弹幕数据在所述视频播放界面内显示之后,还包括:The method according to claim 13, wherein after displaying the target barrage data in the video playback interface according to the playback time point, further comprising:
    检测所述电子设备与服务器是否处于连接状态;Detecting whether the electronic device is connected to the server;
    若未处于连接状态,将所述目标弹幕数据存储至所述电子设备内的与所述离线视频文件对应的本地弹幕数据内。If it is not connected, the target barrage data is stored in the local barrage data corresponding to the offline video file in the electronic device.
  15. 根据权利要求14所述的方法,其特征在于,所述检测所述电子设备与服务器是否处于连接状态之后,还包括:The method according to claim 14, wherein after detecting whether the electronic device is connected to the server, the method further comprises:
    当检测到所述电子设备与所述服务器建立连接之后,发送存储请求至所述服务器,所述存储请求包括所述目标弹幕数据,所述存储请求用于指示所述服务器将所述目标弹幕数据存储至所述离线视频文件对应的网络弹幕数据内。After detecting that the electronic device establishes a connection with the server, a storage request is sent to the server, the storage request includes the target barrage data, and the storage request is used to instruct the server to use the target barrage The screen data is stored in the network barrage data corresponding to the offline video file.
  16. 根据权利要求15所述的方法,其特征在于,当检测到所述电子设备与所述服务器建立连接之后,发送存储请求至所述服务器,包括:The method of claim 15, wherein after detecting that the electronic device establishes a connection with the server, sending a storage request to the server includes:
    当检测到所述电子设备与所述服务器建立连接之后,获取所述离线视频文件的播放情况;After detecting that the electronic device establishes a connection with the server, obtain the playback status of the offline video file;
    若所述播放情况满足指定条件,发送存储请求至所述服务器。If the playback condition meets the specified conditions, a storage request is sent to the server.
  17. 根据权利要求16所述的方法,其特征在于,所述播放情况包括播放进度,所述若所述播放情况满足指定条件,发送存储请求至所述服务器,包括:The method according to claim 16, wherein the playback condition includes playback progress, and if the playback condition meets a specified condition, sending a storage request to the server includes:
    判断所述播放进度是否为已完成播放;Determine whether the playback progress is completed playback;
    若为已完成播放,获取在播放所述离线视频文件的过程中所有用户输入的弹幕数据,作为目标弹幕数据;If the playback is completed, obtain all the barrage data input by the user during the playback of the offline video file as target barrage data;
    发送存储请求至所述服务器。Send a storage request to the server.
  18. 一种弹幕处理装置,其特征在于,应用于电子设备,所述电子设备安装有客户端,所述装置包括:A barrage processing device is characterized by being applied to electronic equipment, a client is installed in the electronic equipment, and the device includes:
    获取单元,用于获取离线视频文件的播放请求,所述离线视频文件预先存储在所述电子设备内;An obtaining unit, configured to obtain a playback request of an offline video file, the offline video file is pre-stored in the electronic device;
    确定单元,用于获取所述离线视频文件对应的待显示弹幕数据;A determining unit, configured to obtain barrage data to be displayed corresponding to the offline video file;
    显示单元,用于在所述客户端的视频播放界面内播放所述离线视频文件并将所述待显示弹幕数据在所述视频播放界面内显示。The display unit is configured to play the offline video file in the video playback interface of the client and display the barrage data to be displayed in the video playback interface.
  19. 一种电子设备,其特征在于,包括:An electronic device, characterized in that it includes:
    一个或多个处理器;One or more processors;
    存储器;Memory
    客户端;Client
    一个或多个应用程序,其中所述一个或多个应用程序被存储在所述存储器中并被配置为由所述一个或多个处理器执行,所述一个或多个程序配置用于执行如权利要求1-17任一项所述的方法。One or more application programs, wherein the one or more application programs are stored in the memory and are configured to be executed by the one or more processors, the one or more programs are configured to execute as The method of any one of claims 1-17.
  20. 一种计算机可读取存储介质,其特征在于,所述计算机可读取存储介质中存储有程序代码,所述程序代码可被处理器调用执行如权利要求1-17任一项所述的方法。A computer readable storage medium, characterized in that the computer readable storage medium stores program code, and the program code can be called by a processor to execute the method according to any one of claims 1-17 .
PCT/CN2018/115274 2018-11-13 2018-11-13 Overlay comment processing method and apparatus, electronic device, and computer-readable storage medium WO2020097803A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2018/115274 WO2020097803A1 (en) 2018-11-13 2018-11-13 Overlay comment processing method and apparatus, electronic device, and computer-readable storage medium
CN201880098222.8A CN112771881B (en) 2018-11-13 2018-11-13 Bullet screen processing method and device, electronic equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2018/115274 WO2020097803A1 (en) 2018-11-13 2018-11-13 Overlay comment processing method and apparatus, electronic device, and computer-readable storage medium

Publications (1)

Publication Number Publication Date
WO2020097803A1 true WO2020097803A1 (en) 2020-05-22

Family

ID=70730234

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/115274 WO2020097803A1 (en) 2018-11-13 2018-11-13 Overlay comment processing method and apparatus, electronic device, and computer-readable storage medium

Country Status (2)

Country Link
CN (1) CN112771881B (en)
WO (1) WO2020097803A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115190340A (en) * 2021-04-01 2022-10-14 华为终端有限公司 Live broadcast data transmission method, live broadcast equipment and medium
CN115243093A (en) * 2022-07-04 2022-10-25 网易(杭州)网络有限公司 Video barrage processing method and device, storage medium and electronic device
CN115361577A (en) * 2022-08-26 2022-11-18 维沃移动通信有限公司 Bullet screen information display method and device and electronic equipment

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115086742A (en) * 2022-06-13 2022-09-20 北京达佳互联信息技术有限公司 Audio and video generation method and device
CN116567341B (en) * 2023-07-11 2023-10-10 奥视(天津)科技有限公司 High concurrency signal processing platform based on golang

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105763950A (en) * 2014-12-19 2016-07-13 中兴通讯股份有限公司 Bullet screen display method and system
CN106210773A (en) * 2016-08-19 2016-12-07 暴风集团股份有限公司 The method and system of barrage are play in local video
US20180191987A1 (en) * 2017-01-04 2018-07-05 International Business Machines Corporation Barrage message processing

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101132518B (en) * 2006-08-26 2010-07-28 华为技术有限公司 Video-on-demand method and system and LAN gateway
US20140012910A1 (en) * 2012-07-09 2014-01-09 Mobitude, LLC, a Delaware LLC Video comment feed
CN106341408B (en) * 2016-09-20 2019-12-03 武汉斗鱼网络科技有限公司 A kind of TV equipment local area networks are interior to be broadcast live sharing method and system
CN107690078B (en) * 2017-09-28 2020-04-21 腾讯科技(深圳)有限公司 Bullet screen information display method, bullet screen information providing method and bullet screen information providing equipment
CN107872715A (en) * 2017-11-09 2018-04-03 北京奇艺世纪科技有限公司 A kind of method and device for showing displaying information
CN108495165B (en) * 2018-01-29 2021-01-08 上海哔哩哔哩科技有限公司 Bullet screen play control method, mobile terminal and bullet screen play control system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105763950A (en) * 2014-12-19 2016-07-13 中兴通讯股份有限公司 Bullet screen display method and system
CN106210773A (en) * 2016-08-19 2016-12-07 暴风集团股份有限公司 The method and system of barrage are play in local video
US20180191987A1 (en) * 2017-01-04 2018-07-05 International Business Machines Corporation Barrage message processing

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115190340A (en) * 2021-04-01 2022-10-14 华为终端有限公司 Live broadcast data transmission method, live broadcast equipment and medium
CN115190340B (en) * 2021-04-01 2024-03-26 华为终端有限公司 Live broadcast data transmission method, live broadcast equipment and medium
CN115243093A (en) * 2022-07-04 2022-10-25 网易(杭州)网络有限公司 Video barrage processing method and device, storage medium and electronic device
CN115243093B (en) * 2022-07-04 2023-08-22 网易(杭州)网络有限公司 Video bullet screen processing method and device, storage medium and electronic device
CN115361577A (en) * 2022-08-26 2022-11-18 维沃移动通信有限公司 Bullet screen information display method and device and electronic equipment
CN115361577B (en) * 2022-08-26 2024-03-05 维沃移动通信有限公司 Barrage information display method and device and electronic equipment

Also Published As

Publication number Publication date
CN112771881A (en) 2021-05-07
CN112771881B (en) 2023-02-28

Similar Documents

Publication Publication Date Title
WO2020097803A1 (en) Overlay comment processing method and apparatus, electronic device, and computer-readable storage medium
US20190007465A1 (en) Real-time placeshifting of media content to paired devices
CN106664458B (en) Method for transmitting video data, source device and storage medium
US20170339227A1 (en) Information Processing and Content Transmission for Multi-Display
WO2017092360A1 (en) Interaction method and device used when multimedia is playing
US9363551B2 (en) TV program identification method, apparatus, terminal, server and system
JP6662784B2 (en) Method and apparatus for displaying application data in a wireless communication system
US11812090B2 (en) System and method for social multi-platform media playback synchronization
US9367125B2 (en) Terminal apparatus for shooting and distributing video data and video-data distribution method
CN110647303A (en) Multimedia playing method, device, storage medium and electronic equipment
US20210274258A1 (en) Computerized system and method for pushing information between devices
JP2017139628A (en) Communication device, communication system, communication method and computer program
JP6580132B2 (en) Method and apparatus for providing information associated with media content
CN110996160B (en) Video processing method and device, electronic equipment and computer readable storage medium
CN108900855B (en) Live content recording method and device, computer readable storage medium and server
WO2015180688A1 (en) Media processing method and device
WO2016150273A1 (en) Video playing method, mobile terminal and system
US11687589B2 (en) Auto-populating image metadata
US20180167433A1 (en) Method and device for sharing multimedia content
KR20220144857A (en) Multimedia data publishing method and apparatus, device and recording medium
US10666588B2 (en) Method for sharing media content, terminal device, and content sharing system
JP2012257196A (en) System and method for transferring streaming medium based on sharing of screen
US8407312B2 (en) Data delivery apparatus
US11438287B2 (en) System and method for generating and reproducing ultra short media content
CN111031354B (en) Multimedia playing method, device and storage medium

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: 18939889

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 17.09.2021)

122 Ep: pct application non-entry in european phase

Ref document number: 18939889

Country of ref document: EP

Kind code of ref document: A1