The present disclosure relates to the field of multimedia playing technologies, and more specifically, relates to a multimedia playing method and apparatus based on Android system.
A DivX Menu file is a digital multimedia compression format file in which audio information is compressed by MP3 and video information is compressed by MPEG-4 technologies. The DivX Menu file has advantages of high resolution, taking up less memory and less internet data bandwidth, and interacting with users easily, etc. Currently, playing a DivX Menu file in Android system cannot produce Menu effects, and cannot achieve interaction between the menu and a user (i.e., a user cannot click the Menu to interact with it).
In light of the above, the embodiments of the present disclosure provide a multimedia playing method and apparatus based on Android system.
The multimedia playing method according to the embodiments of the present disclosure comprises: loading a source file, and parsing a file header of the source file to determine whether the source file is a predefined format file, wherein the predefined format file comprises menu information, and the menu information comprises default start menu information, at least two titles, at least one button for selecting a corresponding title and data for indicating corresponding relations between the buttons and the titles; storing the menu information if the source file is determined to be the predefined format file; obtaining the default start menu information; extracting data corresponding to the current title in the default start menu information; and playing the data corresponding to the current title.
The multimedia playing apparatus according to the embodiments of the present disclosure comprises: a loading and parsing module, configured to load a source file and parse a file header of the source file; a determining module, configured to determine whether the source file is a predefined format file, wherein the predefined format file comprises menu information, and the menu information comprises default start menu information, at least two titles, at least one button for selecting a corresponding title and data for indicating corresponding relations between the buttons and the titles; a storage module, configured to store the menu information if the determining module determines the source file to be the predefined format file; an obtaining module, configured to obtain the default start menu information, and extract data corresponding to a current title in the default start menu information; and a playing module, configured to play the data corresponding to the current title.
According to the multimedia playing method and apparatus, playing a DivX Menu file in Android system can have the Menu effects, and the Android system can respond to the events of user's click on the Menu.
A clear and complete description will be made on the exemplary embodiments provided by the present disclosure with references to the accompanying drawings.
The first embodiment of the present disclosure provides a multimedia playing method as shown in
Step S11: loading a source file, and parsing a file header of the source file.
The multimedia player 26 which can be embodied as an APP or an application in actual application scenarios loads the source file to be played. Regardless of the loaded source file being an audio file, a video file or other multimedia files, they are all stored in the form of data packages or segments of data, that is, the source file certainly has a file header, a payload and a file end, wherein the payload is the data content of the source file, and the file header may not only serve as an identification indicating the start of the source file, but also indicate attribute information including the format, the occupied memory and the like of the payload or the source file, while the file end serves as an ending identification of the payload.
On the above basis, a multimedia playing service module (Awesome Player) 21 is configured to initiate an extractor 22. The extractor 22 may parse and obtain the file header of the loaded source file, and determine the format of the loaded source file according to the file header.
Step S12: determining whether the source file is a predefined format file.
The predefined format file can be, for example, a DivX Menu file, it comprises menu information, and the menu information further comprises default start menu information, at least two titles, at least one button for selecting a corresponding title and data for indicating corresponding relations between the buttons and the titles. In this embodiment, the default start menu information is the menu information of the predefined format file that is automatically played when the multimedia playing apparatus is started. The at least two titles correspond to at least two segments of multimedia streams in the source file, and can be represented by the names of the at least two segments of multimedia streams. The data is the payload of the predefined format file.
If the extractor 22 determines that the loaded source file is not the predefined format file, go to step S13. If the source file is determined to be the predefined format file, go to step S14.
Step S13: not storing the menu information.
Step S14: storing the menu information.
Step S15: obtaining by a DivX Menu control service module 23 the default start menu information in the menu information of the predefined format file, and controlling the extractor 22 to extract data corresponding to the current title in the default start menu information.
Step S16: playing the data corresponding to the current title.
Wherein, the extractor 22 extracts the data corresponding to the current title. In view of the payload of the source file has been encoded when stored, thus a decoder 24 of the multimedia playing apparatus needs to decode the data corresponding to the current title in order to acquire the decoded data. A renderer 25 is configured to render the decoded data, so as to enable the multimedia player 26 to play the rendered data.
Step S31: loading a source file, and parsing a file header of the source file.
Step S32: determining whether the source file is the predefined format file.
If the source file is determined not to be the predefined format file, go to step S33. If the source file is determined to be the predefined format file, go to step S34.
Step S33: not storing the menu information.
Step S34: storing the menu information.
Step S35: obtaining the default start menu information in the menu information of the source file, and extracting the data corresponding to the current title in the default start menu information.
Step S36: playing the data corresponding to the current title.
Step S37: determining whether it needs to switch the current title being played.
If it does not need to switch, continue with the step S36, i.e., playing the data corresponding to the current title. If it needs to switch, go to step S38.
Step S38: obtaining a next title according to the corresponding relations between the buttons and the titles.
Step S39: extracting and playing the data corresponding to the next title.
In this embodiment of the present disclosure, there are at least two circumstances in which it needs to determine whether the current title being played should be switched. For the first circumstance, the data corresponding to the next title needs to be played after the playing of the data corresponding to the current title has been finished, and the next title may be the same current title or a next title different from the current title. For example, after the playing of the data corresponding to the current title has been finished, a next title may be obtained according to the menu information and determined whether it is the same as the current title, and if it is not the same, then it is determined that the current title needs to be switched. For the second circumstance, when the data corresponding to the current title is being played, the data of the next title is switched to and played according to user's instructions, wherein the user's instructions can be obtained by the user's click operations on the buttons.
Additionally, manners of determining whether the current title being played needs to be switched comprises but not limited to: determining whether there is a click operation on the buttons. if there is a click operation on the buttons, then determine whether the next title corresponding to the click operation is the same as the current title according to the stored corresponding relationship data between the buttons and titles, i.e., the stored menu information of the predefined format file; if it is not the same, then it is determined that it needs to switch; if it is the same, then there is no need to switch, and continue to play the data corresponding to the current title.
Also referring to
For the first storage manner, the multimedia player 26 obtains touch coordinates of the click operation, and transmits the touch coordinates to a DivX Menu control service module 23 via the multimedia playing service module 21 and the extractor 22, i.e., to store the menu information into the DivX Menu control service module 23.
In this case, the DivX Menu control service module 23 executes step S37, i.e., determines whether it needs to switch the current title being played.
Furthermore, between the steps S38 and S39, i.e., after obtaining the next title and before playing the data corresponding to the next title, the multimedia playing service module 21 in the multimedia playing apparatus transmits a playing complete message to the multimedia player 26 in order to inform the multimedia player 26 that the playing of the data corresponding to the current title has been finished or the current playing needs to be stopped to switch to the playing of the data corresponding to the next title. The multimedia player 26 terminates playing of the data corresponding to the current title according to the received playing complete message, and then reloads the source file and sequentially performs the subsequent steps.
For the second storage manner, the multimedia player 26 obtains the touch coordinates of the click operation and transmits the touch coordinates to the extractor 22 via the multimedia playing service module 21, i.e., storing the menu information into the extractor 22.
In this case, the extractor 22 determines whether it needs to switch the current title being played.
Furthermore, between the steps S38 and S39, i.e., after obtaining the next title and before playing the data corresponding to the next title, the extractor 22 transmits the playing complete message to the multimedia playing service module 21 in order to inform the multimedia player 26 that the playing of the data corresponding to the current title has been finished or the current playing needs to be stopped to switch to the playing of the data corresponding to the next title. The multimedia player 26 terminates playing of the data corresponding to the current title according to the received playing complete message, and the multimedia playing service module 21 obtains the information corresponding to the next title and reinitiates the decoder 24 and the renderer 25.
According to the present embodiment, playing a DivX Menu file in Android system can have the Menu effects, and would respond to the events of user's clipping on the Menu.
The playing module 47 comprises but not limited to a decoding unit 45 and a rendering unit 46. Before the playing module 47 plays the data corresponding to the current title, the decoding unit 45 is configured to decode the data corresponding to the current title in order to obtain the decoded data. Further, the rendering unit 46 is configured to render the decoded data and then the playing module 47 plays the rendered data.
The multimedia playing apparatus of this embodiment can also be applied to the situation in which the playing is switched among one or more predefined format files. Specifically, after the playing module 47 plays the data corresponding to the current title, the determining module 42 is further configured to determine whether it needs to switch the current title being played or not, if it needs to switch, then the obtaining module 44 is configured to obtain a next title according to the corresponding relations between the buttons and the titles, and extract the data corresponding to the next title, and the playing module 47 is further configured to play the data corresponding to the next title.
In this embodiment, there are at least two circumstances in which it needs to determine whether the current title being played should be switched. For the first circumstance, the data corresponding to the next title needs to be played after the playing of the data corresponding to the current title has been finished, and the next title may be the same current title or a next title different from the current title. For example, after the playing module 47 finishes the playing of the data corresponding to the current title, the obtaining module 44 may obtain a next title according to the menu information, and the determining module 42 determines whether the next title is the same as the current title, and if it is not the same, then it is determined that the current title needs to be switched. For the second circumstance, when the data corresponding to the current title is being played, the data of the next title is switched to and played according to user's instructions, wherein the user's instructions can be obtained by the user's click operations on the buttons.
Additionally, manners for the determining module 42 to determine whether the current title being played needs to be switched or not comprises but not limited to: the determining module 42 determines whether there is a click operation on the buttons. If there is a click operation on the buttons, then the determining module 42 determines whether the next title corresponding to the click operation is the same as the current title according to the corresponding relationship data between the buttons and titles stored by the storage module 43; if it is not the same, then the determining module 42 determines that it needs to switch.
After the obtaining module 44 obtains the next title, the multimedia playing service module (not shown in
The method and apparatus described herein are based on Android system, but the present disclosure is not limited thereto, other operating systems can also work well.
Those skilled in the art can easily understand the specific operating processes of the various modules in the multimedia playing apparatus may refer to the corresponding processes as described in preceding method embodiments, thus further details would be omitted for convenience and brevity. Each of the various modules can be set individually or integrally onto one chip or the like physical element. Furthermore, if the above functions are to be implemented by the form of software functional unit and sailed or used as a standalone product, then it can be stored in a computer-readable storage medium, that is to say, the embodiments of the present disclosure may be implemented in the form of software products, which comprises a plurality of instructions that enable a computer device (e.g., a personal computer, a server, a network apparatus or etc.) to execute all or some of the steps of the method described in the various embodiments of the present disclosure.
In addition, it is apparent to those skilled in the art, the present disclosure also provides a multimedia player device, which comprises a non-transitory program storage medium and a processor. The non-transitory program storage medium stores a program executed by the processor to perform the method as described in above. Furthermore, it is apparent to those skilled in the art that, various modules 21, 23, 41, 42, 43, 44, 45, 46, 47 as shown in
What described above are only the embodiments of the present disclosure, but are not intended to limit the scope of the present disclosure. Any equivalent structures or equivalent process flow modifications that are made according to the specification and the attached drawings of the present disclosure, such as combinations of technical features in different embodiments, or any direct or indirect applications of the present disclosure in other related technical fields shall all be covered within the protection scope of the present disclosure.
Number | Date | Country | Kind |
---|---|---|---|
2015 1 0268439 | May 2015 | CN | national |
Number | Name | Date | Kind |
---|---|---|---|
8660406 | Tanaka | Feb 2014 | B2 |
9137507 | Gandolph | Sep 2015 | B2 |
9529492 | Cho | Dec 2016 | B2 |
9788047 | Roberts | Oct 2017 | B2 |
10126904 | Agnetta | Nov 2018 | B2 |
20060212478 | Plastina | Sep 2006 | A1 |
20060277098 | Chung | Dec 2006 | A1 |
20070140660 | Lu | Jun 2007 | A1 |
20100162115 | Ringewald | Jun 2010 | A1 |
20160077686 | Cosio | Mar 2016 | A1 |
20160132195 | Seto | May 2016 | A1 |
Number | Date | Country |
---|---|---|
1889652 | Jan 2007 | CN |
101072250 | Nov 2007 | CN |
0101415 | Jan 2001 | WO |
Number | Date | Country | |
---|---|---|---|
20160342298 A1 | Nov 2016 | US |