Summary of the invention
One of object of the present invention is to provide provides a kind of video broadcasting method based on Android operating system, the problem that cannot support that to solve current Android operating system m3u8 format video is play continuously.
Another object of the present invention is to provide a kind of video play device based on Android operating system, the problem that cannot support that to solve current Android operating system m3u8 format video is play continuously.
Another object of the present invention is to provide a kind of Wireless Telecom Equipment, comprises above-mentioned video play device, and this equipment can solve the problem that current Android operating system cannot support that m3u8 format video is play continuously.
According to an aspect of the present invention, provide a kind of video broadcasting method based on Android operating system, comprising:
According to video playback acquisition request video play lists file, described video play lists file comprises the URL of at least one video resource;
According to the URL in described video play lists file, confirmation need to be carried out the URL of video switch;
Continuous broadcasting mark was set in video play lists file before or after confirmed URL, generates the video play lists file after mark;
Play the video play lists file after described mark.
In one or more examples aspect above-mentioned, continuous broadcasting mark was set before or after confirmed URL in video play lists file, after generating the video play lists file after mark, comprises;
Generate the URL of the video play lists file after described mark.
In one or more examples aspect above-mentioned, the video play lists file after the described mark of described broadcasting comprises:
Call video playback assembly according to the URL of the list of videos file after described mark and play the video play lists file after described mark.
In one or more examples aspect above-mentioned, the URL of the video play lists file after the described mark of described generation comprises:
Utilize at least one http server be video play lists file generated after described mark at least one meet the URL of the video play lists file after the described mark of http protocol.
According to a further aspect in the invention, wherein, described according to the URL in described video play lists file, the URL that confirmation need to be carried out video switch comprises:
Analyze line by line the URL of all video resources in described video play lists file;
When the URL that the URL that judges current video resource catches up with a video resource points to different video resource files, the URL that confirms current video resource is the URL that need to carry out video switch.
In one or more examples aspect above-mentioned, described continuous broadcasting mark is " #EXT-X-DISCONTINUITY ".
In one or more examples aspect above-mentioned, described according to before video playback acquisition request video play lists file, comprising:
Start at least one http server, described at least one http server is mapped at least one local file.
In one or more examples aspect above-mentioned, continuous broadcasting mark was set before or after confirmed URL in video play lists file, after generating the video play lists file after mark, comprises:
Video play lists file after mark is left at least one local file of described at least one http server mapping.
In one or more examples aspect above-mentioned, before video playback acquisition request video play lists file, comprising:
Judge whether described video playback request points to video play lists file, if so, according to video play lists file described in video playback acquisition request, if not, according to video playback request displaying video resource file.
According to a further aspect in the invention, provide a kind of video play device based on Android operating system, wherein, comprising:
Acquiring unit, for according to video playback acquisition request video play lists file, described video play lists file comprises the URL of at least one video resource;
Confirmation unit, according to the URL in described video play lists file, confirmation need to be carried out the URL of video switch;
Indexing unit, for continuous broadcasting mark was set before or after confirmed URL at video play lists file, generates the video play lists file after mark;
Broadcast unit, plays the video play lists file after described mark.
In one or more examples aspect above-mentioned, further comprise:
Tab file URL generation unit, at least one meets the URL of the described video play lists file of http protocol to be used to video play lists file generated after described mark.
In one or more examples aspect above-mentioned, described confirmation unit further comprises:
Analytic unit, for analyzing line by line the URL of all video resources of described video play lists file;
Judging unit, whether the URL that catches up with a video resource file for the URL that judges current video resource points to identical, the URL that catches up with a video resource file as the URL of current video resource points to different video resource files, and the URL that confirms current video resource is the URL that need to carry out video switch.
According to a further aspect in the invention, provide a kind of Wireless Telecom Equipment, comprise above-mentioned video play device.
Make Android operating system in the time playing the video of m3u8 form by video broadcasting method and the device based on Android operating system provided by the invention, the switching of former video resource fragment can not cause stopping of video, and video can be play continuously.
In order to realize above-mentioned and relevant object, one or more aspects of the present invention comprise below by the feature that describes in detail and particularly point out in the claims.Explanation below and accompanying drawing describe some illustrative aspects of the present invention in detail.But, the instruction of these aspects be only some modes that can use in the variety of way of principle of the present invention.In addition, the present invention is intended to comprise all these aspects and their equivalent.
Embodiment
A kind of video broadcasting method based on Android operating system disclosed by the invention and the various aspects of device are described below.Should be understood that, instruction herein can be with varied form imbody, and disclosed any concrete structure, function or both are only representational in this article.Based on instruction herein, those skilled in the art should be understood that, an aspect disclosed herein can be independent of any other side and realize, and two or more aspects in these aspects can combine according to variety of way.For example, can use the aspect of any number described in this paper, implement device or hands-on approach.In addition, can use other structure, function or except one or more aspects described in this paper or be not the 26S Proteasome Structure and Function of one or more aspects described in this paper, realize this device or put into practice this method.In addition, any aspect described herein can comprise at least one element of claim.
Android operating system provides the class of video playback control correlation function, we claim that these classes are MediaPlayer(media player) assembly, these classes are that Android operating system offers developer for writing the program that displaying video is relevant, and developer uses these classes just can in Android operating system, write a video reproduction program.The function that these classes provide is not only broadcasting itself, has also comprised Play Control.For example the browser in Android operating system is by transmitting the MediaPlayer assembly of a URL to Android operating system, and Android operating system utilizes MediaPlayer assembly just can play the video that this URL points to.M3u8 formatted file must be passed to MediaPlayer assembly for its access with the HTTP such as IP or domain name on-link mode (OLM), removes to resolve m3u8 and finally can not play otherwise Android operating system can create wrong player.
Each embodiment of the present invention is described below with reference to accompanying drawings.
the first embodiment
Fig. 1 shows according to the flow chart of the video broadcasting method based on Android operating system of the first embodiment of the present invention, and wherein, the method is carried out by the browser client program in the Wireless Telecom Equipment being arranged on based on Android operating system.
As shown in Figure 1, a kind of video broadcasting method based on Android operating system, comprises the steps:
In step S110, according to video playback acquisition request video play lists file, described video play lists file comprises the URL of at least one video resource.
Particularly, browser client program in Wireless Telecom Equipment receives a video playback request, this video playback request can be that the URL that clicks the video on the video website page by user directly produces, also can be video resource request command based on user by system or arbitrarily client-side program produce, the URL of the video that comprises user's program request in described video playback request.When described video playback request is passed to system video player module by browser client program, check whether the URL in this video playback request points to a video play lists file, if, according to this video play lists file of described video playback acquisition request, if not, play described URL video resource file pointed according to the URL in described video playback request.
In an example of the present invention, described video play lists file is m3u8 formatted file, its internal record the URL of multiple video resources.Described multiple video resource is for example multiple video segments, and it is a complete video resource that the content of these video segments combines, a for example film.
In addition, the video play lists file in video broadcasting method of the present invention can be m3u8 form, can be also other similar form, as long as wherein recorded the URL of multiple video resources.
Before video playback acquisition request video play lists file, comprising:
Judge whether described video playback request points to video play lists file, if so, according to video play lists file described in video playback acquisition request, if not, according to video playback request displaying video resource file.
Judge whether described video playback request points to video play lists file, specifically comprise: judge the filename suffix that described video playback request is pointed, if described suffix name is shown to be video play lists file, confirm described video playback request sensing video play lists file, otherwise confirm that described video playback request is not to point to video play lists file; Or, the mimetype of head is returned in the described video playback request of judgement request, if described in return to head mimetype be shown to be video play lists file, confirm described video playback request sensing video play lists file, otherwise confirm that described video playback request is not to point to video play lists file.
In an example of the present invention, judge the URL filename suffix pointed in video playback request, for example filename suffix pointed is " .m3u8 ", confirms a video play lists file of described video playback request sensing.
In another example of the present invention, by the URL to this video of server request, server can return to the mimetype of head, this mimetype mark the type of return data, judge by this mimetype whether the URL of this video points to a m3u8 formatted file.
In step S120, according to the URL in described video play lists file, confirmation need to be carried out the URL of video switch.
Particularly, analyze line by line the URL of all video resources in video play lists file.Check whether current line is a URL, if not, skip this line, continue to analyze; If, whether the URL that the URL that judges current video resource catches up with a video resource points to identical video resource file, and if so, the URL that confirms current video resource is the URL that does not need to carry out video switch, do not do further special processing, continue to analyze; If not, illustrating that this position done the switching of video resource file, the URL that confirms current video resource is the URL that need to carry out video switch.Until analyzed the URL of all video resources in m3u8 formatted file.
In step S130, continuous broadcasting mark was set in video play lists file before or after confirmed URL, generate the video play lists file after mark.
In a preferred example, before the URL confirming at above-mentioned steps S120, the URL of current video resource and on add lastrow mark " #EXT-X-DISCONTINUITY " between the URL of a video resource.
According to m3u8 specification, there is variation in the following attribute of explanation in the time running into " #EXT-X-DISCONTINUITY " mark: the number of file format, video track or type, coding parameter, coded sequence, timestamp.Therefore, operating system can be done special processing, for example again instantiation some play required object etc., thereby make video segment switch time video can not stop play.What kind of special processing specific operating system does belongs to the state of the art, not at this detailed description.
It should be noted that, mark can be not only " #EXT-X-DISCONTINUITY " herein, also can be other marks that file format changes, its setting can be not only before the URL of current video resource also, also can be before it, as long as the implication of its representative is the URL comparison of URL and a upper video resource of current video resource, there is video switch.
In a preferred example, before all analyses the URL that need to carry out video switch that confirmed, all carry out above-mentioned mark.The file content of crossing with mark is by analysis write to a file, generate the video play lists file after mark, as film.m3u8.
Further, in a preferred example, by the leave in/sdcard/ucvideo/film.m3u8 of video play lists file f ilm.m3u8 after the mark of generation.
In a preferred example, after generating the video play lists file after mark, be also the URL of video play lists file generated after described mark.Particularly, operating system starts a local http server of monitoring certain port in advance.Suppose that the port numbers of monitoring is 9000.This server can be mapped to certain file of SDCARD, as/sdcard/ucvideo/.This http server can will be mapped as the file request in this file the request of certain file.As, if request http: // 127.0.0.1:9000/film.m3u8, the file content of can read/sdcard/ucvideo/film.m3u8 of this server is as returning.The reason that starts in advance this http server is that the address of m3u8 formatted file must pass to MediaPlayer assembly with the HTTP such as IP or domain name on-link mode (OLM), causes correctly playing otherwise MediaPlayer assembly can create wrong player.In http server prior art, have the more scheme of increasing income, therefore, in this preferred embodiment, the details of local http server is not at this detailed description.After the video play lists file generating after mark, utilize this local http server starting in advance to generate the URL of the video play lists after described mark, as http: // 127.0.0.1:9000/film.m3u8, this URL is directly linked in the path/sdcard/ucvideo/film.m3u8 of local http server mapping.Thereby, as browse request http: when // 127.0.0.1:9000/film.m3u8, the m3u8 formatted file in will read/sdcard/ucvideo/film.m3u8 of home server file returns.
In step S140, play the video play lists file after described mark.
Particularly, Android operating system is called video playback assembly and is play the video play lists file after described mark, the multiple URL video resource file pointed recording in displaying video play list file.
In a preferred example, the URL of the video play lists file after generated described mark is passed to the video playback assembly of operating system, it is MediaPlayer assembly, MediaPlayer assembly is play the video play lists file after this mark, the URL recording in the video play lists file after this mark all video resources pointed is play one by one.
Because the video play lists file after mark in this method had carried out mark before or after the URL that need to carry out video switch, therefore, when video play lists file after MediaPlayer assembly is play described mark, operating system can be judged the URL that need to carry out video switch, and video resource file can be play continuously.
According to the video broadcasting method of the first embodiment, by video play lists file being modified in Wireless Telecom Equipment this locality, mark need to carry out the URL of video switch, the URL that utilization meets http protocol locates amended m3u8 formatted file, can make m3u8 format video can not stop because of inner video switch playing.Greatly optimize the experience that user views and admires video on the Wireless Telecom Equipment browser based on Android operating system.
It should be noted that the method by browser client program in the Wireless Telecom Equipment being arranged on based on Android operating system carry out be only one preferred embodiment; the method can also be carried out by other client-side program softwares in the Wireless Telecom Equipment based on Android operating system, and specifically what client-side program software carrying out this method by does not affect the scope of the inventive method protection.
the second embodiment
Fig. 2 shows the flow chart of the video broadcasting method based on Android operating system according to a second embodiment of the present invention.Wherein, the method is carried out by the browser client program in the Wireless Telecom Equipment being arranged on based on Android operating system.
Step S210, operating system starts a local http server of monitoring certain port in advance;
Step S220, receives the video playback request URL from user, judges whether this video playback request URL points to a m3u8 formatted file, if so, turns to step S230, if not, turns to step S270;
Step S230, initiates network request to obtain described m3u8 formatted file;
Step S240, analyzes described m3u8 formatted file line by line;
Step S241, judges that whether described m3u8 formatted file is complete by analysis, if so, forwards step S250 to, if not, forwards step S242 to;
Step S242, judges whether current line is a URL, if so, forwards step S243 to, if not, returns to step S240;
Step S243, judges whether current URL points to identical video file with a upper URL, if not, forwards S244 to, if so, returns to step S240;
Step S244, before current URL, current URL and on add lastrow mark: #EXT-X-DISCONTINUITY between a URL, then return to step S240;
Step S250, writes m3u8 formatted file after a new file generated mark by the file content after having analyzed;
Step S251, utilizes local http server, generates the URL of the m3u8 formatted file after described mark;
Step S260, passes to MediaPlayer assembly by the URL of the m3u8 formatted file after generated mark;
Step S270, MediaPlayer assembly is play the m3u8 formatted file after this mark.
It should be noted that, according to m3u8 specification, there is variation in the following attribute of explanation in the time running into " #EXT-X-DISCONTINUITY " mark: the number of file format, video track or type, coding parameter, coded sequence, timestamp.Therefore, operating system can be done special processing, for example again instantiation some play required object etc., thereby make video segment switch time video can not stop play.
According to the video broadcasting method of the second embodiment, by m3u8 formatted file being modified in Wireless Telecom Equipment this locality, between the URL that has carried out video switch, carry out mark and leave m3u8 formatted file after mark in Wireless Telecom Equipment this locality, then after utilizing local http server to generate mark, m3u8 formatted file URL carrys out the m3u8 formatted file after telltale mark, thereby makes m3u8 format video can not stop because of inner video switch playing.Greatly optimize the experience that user views and admires video on the Wireless Telecom Equipment browser based on Android operating system.
the 3rd embodiment
Fig. 3 shows the block diagram of a kind of video play device 300 based on Android operating system of a third embodiment in accordance with the invention.
As shown in Figure 3, this video play device 300 comprises acquiring unit 310, confirmation unit 320, indexing unit 330, broadcast unit 340.
Described acquiring unit 310, for according to video playback acquisition request video play lists file, described video play lists file comprises the URL of at least one video resource;
Described confirmation unit 320, be used for according to video playback acquisition request video play lists file, described video play lists file comprises the URL of at least one video resource, and according to the URL in described video play lists file, confirmation need to be carried out the URL of video switch;
Described indexing unit 330, for continuous broadcasting mark was set before or after confirmed URL at video play lists file, generates the video play lists file after mark;
Described broadcast unit 340, plays the video play lists file after described mark.
As shown in Figure 3A, in a preferred example, this video play device 300 further comprises:
Tab file URL generation unit 350, for according to the video play lists file generated after described mark, at least one meets the URL of the described video play lists file of http protocol.
As shown in Figure 3 B, in a preferred example, described confirmation unit 320 further comprises:
Analytic unit 321, for analyzing line by line the URL of all video resources of described video play lists file;
Judging unit 322, whether the URL that catches up with a video resource file for the URL that judges current video resource points to identical, the URL that catches up with a video resource file as the URL of current video resource points to different video resource files, and the URL that confirms current video resource is the URL that need to carry out video switch.The URL that catches up with a video resource file as the URL of current video resource points to identical video resource file, and the URL that confirms current video resource is the URL that does not need to carry out video switch.
In addition, can also carry out various amendments to the video play device of the present embodiment 300.
the 4th embodiment
Fig. 4 shows the block diagram of the Wireless Telecom Equipment 400 of a kind of video play device that comprises the 3rd embodiment 300 that fourth embodiment of the invention provides, and this Wireless Telecom Equipment 400 also comprises processor 410 and storage device 420.
In a preferred example, the described indexing unit 330 in video play device 300 is connected with storage device 420, when described indexing unit 330 was play continuously mark before or after the URL that need to carry out video switch.After generating the video play lists file after mark, described storage device 420 is for storing the video play lists file after described mark.
In a preferred example, operating system starts a local http server 430 of monitoring certain port in advance.Suppose that the port numbers of monitoring is 9000.This server can be mapped to described local storage 420.
the 5th embodiment
Fifth embodiment of the invention provides a kind of Wireless Telecom Equipment, comprise at least one processor, at least one memory and at least one program, described at least one program is stored in described memory, described at least one application configuration is while being carried out by described processor, and described processor is carried out following steps:
According to video playback acquisition request video play lists file, described video play lists file comprises the URL of at least one video resource;
According to the URL in described video play lists file, confirmation need to be carried out the URL of video switch;
Continuous broadcasting mark was set in video play lists file before or after confirmed URL, generates the video play lists file after mark;
Play the video play lists file after described mark.In addition, described at least one application configuration is while being carried out by described processor, and described processor can also be carried out the each step described in the first embodiment.
In addition, typically, Wireless Telecom Equipment of the present invention can be various hand-held terminal devices, such as mobile phone, PDA(Personal Digital Assistant) etc., and therefore protection scope of the present invention should not be defined as the Wireless Telecom Equipment of certain particular type.
In addition, the method according to this invention can also be implemented as the computer program of being carried out by CPU.In the time that this computer program is carried out by CPU, carry out the above-mentioned functions limiting in method of the present invention.
In addition, said method step and system unit also can utilize controller and realize for the computer readable storage devices of storing the computer program that makes controller realize above-mentioned steps or Elementary Function.
In addition, should be understood that, computer readable storage devices as herein described (for example, memory) can be volatile memory or nonvolatile memory, or can comprise volatile memory and nonvolatile memory.And nonrestrictive, nonvolatile memory can comprise read-only memory (ROM), programming ROM (PROM), electrically programmable ROM(EPROM as an example), electrically erasable programmable ROM(EEPROM) or flash memory.Volatile memory can comprise random-access memory (ram), and this RAM can serve as External Cache memory.As an example and nonrestrictive, RAM can obtain in a variety of forms, such as synchronous random access memory (DRAM), dynamic ram (DRAM), synchronous dram (SDRAM), double data rate SDRAM(DDR SDRAM), strengthen SDRAM(ESDRAM), synchronization link DRAM(SLDRAM) and direct Rambus RAM(DRRAM).The memory device of disclosed aspect is intended to include but not limited to the memory of these and other adequate types.
Those skilled in the art will also understand is that, may be implemented as electronic hardware, computer software or both combinations in conjunction with the described various illustrative logical blocks of disclosure herein, unit, circuit and algorithm steps.For this interchangeability of hardware and software is clearly described, with regard to the function of various exemplary components, square, unit, circuit and step, it is carried out to general description.This function is implemented as software or is implemented as hardware and depends on concrete application and impose on the design constraint of whole system.Those skilled in the art can realize described function in every way for every kind of concrete application, but this realization determines should not be interpreted as causing departing from the scope of the present invention.
Can utilize the following parts that are designed to carry out function described here to realize or carry out in conjunction with the described various illustrative logical blocks of disclosure herein, unit and circuit: general processor, digital signal processor (DSP), application-specific integrated circuit (ASIC) (ASIC), field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete nextport hardware component NextPort or any combination of these parts.General processor can be microprocessor, but alternatively, processor can be any conventional processors, controller, microcontroller or state machine.Processor also may be implemented as the combination of computing equipment, and for example, the combination of DSP and microprocessor, multi-microprocessor, one or more microprocessor are in conjunction with DSP core or any other this configuration.
Step in conjunction with the described method of disclosure herein or algorithm can directly be included in the software unit of carrying out in hardware, by processor or in the two combination.Software unit can reside in the storage medium of RAM memory, flash memory, ROM memory, eprom memory, eeprom memory, register, hard disk, removable dish, CD-ROM or any other form known in the art.Exemplary storage medium is coupled to processor, make processor can be from this storage medium reading information or to this storage medium writing information.In an alternative, described storage medium can be integral to the processor together.Processor and storage medium can reside in ASIC.ASIC can reside in user terminal.In an alternative, processor and storage medium can be used as discrete assembly and reside in user terminal.
In one or more exemplary design, described function can realize in hardware, software, firmware or its combination in any.If realized in software, described function can be transmitted on computer-readable medium or by computer-readable medium as one or more instructions or code storage.Computer-readable medium comprises computer-readable storage medium and communication media, and this communication media comprises any medium that contributes to computer program to be sent to from a position another position.Storage medium can be can be by any usable medium of universal or special computer access.As an example and nonrestrictive, this computer-readable medium can comprise RAM, ROM, EEPROM, CD-ROM or other optical disc memory apparatus, disk storage device or other magnetic storage apparatus, or can for carry or file layout be instruction or data structure required program code and can be by any other medium of universal or special computer or universal or special processor access.In addition, any connection can suitably be called computer-readable medium.For example, if with coaxial cable, optical fiber cable, twisted-pair feeder, Digital Subscriber Line or such as the wireless technology of infrared ray, radio and microwave come from website, server or other remote source send software, above-mentioned coaxial cable, optical fiber cable, twisted-pair feeder, DSL or the wireless technology such as infrared first, radio and microwave include the definition at medium.As used herein, disk and CD comprise compact disk (CD), laser disk, CD, digital versatile disc (DVD), floppy disk, Blu-ray disc, wherein disk rendering data magnetically conventionally, and cd-rom using laser optics ground rendering data.The combination of foregoing also should be included in the scope of computer-readable medium.
Although disclosed content shows exemplary embodiment of the present invention above, it should be noted that under the prerequisite of scope of the present invention that does not deviate from claim restriction, can carry out multiple change and amendment.Need not carry out with any particular order according to the function of the claim to a method of inventive embodiments described herein, step and/or action.In addition, although element of the present invention can be with individual formal description or requirement, also it is contemplated that multiple, unless be clearly restricted to odd number.
Be described although described each embodiment according to the present invention above with reference to figure, it will be appreciated by those skilled in the art that each embodiment that the invention described above is proposed, can also on the basis that does not depart from content of the present invention, make various improvement.