The content of the invention
An object of the present invention is to provide a kind of video broadcasting method based on Android operation system of offer, to solve mesh
Preceding Android operation system can not support the problem of m3u8 format videos are continuously played.
It is a further object of the present invention to provide a kind of video play device based on Android operation system, to solve peace at present
Tall and erect operating system can not support the problem of m3u8 format videos are continuously played.
It is a further object of the present invention to provide a kind of Wireless Telecom Equipment, above-mentioned video play device, the equipment are included
Current Android operation system, which can be solved, can not support the problem of m3u8 format videos are continuously played.
According to an aspect of the present invention there is provided a kind of video broadcasting method based on Android operation system, including:
According to video playback acquisition request video play lists file, the video play lists file includes at least one
The URL of video resource;
According to the URL in the video play lists file, the URL for needing to carry out video switching is confirmed;
Continuous play is set to mark before or after the URL confirmed in video play lists file, generation mark
Video play lists file after note;
Play the video play lists file after the mark.
In one or more examples of above-mentioned aspect, in video play lists file before the URL confirmed
Or set continuous play to mark afterwards, after the video play lists file after generation mark, including;
Generate the URL of the video play lists file after the mark.
In one or more examples of above-mentioned aspect, the video play lists file bag played after the mark
Include:
Video playback component is called to play the video after the mark according to the URL of the list of videos file after the mark
Play list file.
In one or more examples of above-mentioned aspect, video play lists file after the generation mark
URL includes:
Using at least one HTTP server, for the video play lists file generated after the mark, at least one meets
The URL of video play lists file after the mark of http protocol.
According to another aspect of the present invention, wherein, the URL in the video play lists file, confirm need
Carrying out the URL of video switching includes:
The URL of all video resources in the video play lists file is analyzed line by line;
When judging that the URL of current video resource keeps up with the URL of video resource and points to different video resource files,
The URL for then confirming current video resource is the URL for needing to carry out video switching.
In one or more examples of above-mentioned aspect, the continuous broadcasting mark is " #EXT-X-
DISCONTINUITY”。
It is described according to video playback acquisition request video play lists file in one or more examples of above-mentioned aspect
Before, including:
Start at least one HTTP server, at least one described HTTP server is mapped at least one local file
Folder.
In one or more examples of above-mentioned aspect, in video play lists file before the URL confirmed
Or set continuous play to mark afterwards, after the video play lists file after generation mark, including:
By the video play lists file after mark be stored at least one HTTP server mapping it is local extremely
In a few file.
In one or more examples of above-mentioned aspect, according to video playback acquisition request video play lists file it
Before, including:
Judge whether the video playback request points to video play lists file, if it is, please according to video playback
The acquisition video play lists file is sought, if it is not, then playing video resource file according to video playback request.
According to another aspect of the present invention there is provided a kind of video play device based on Android operation system, wherein, bag
Include:
Acquiring unit, for according to video playback acquisition request video play lists file, the video play lists text
Part includes the URL of at least one video resource;
Confirmation unit, according to the URL in the video play lists file, confirms the URL for needing to carry out video switching;
Indexing unit, continuously broadcasts for being set in video play lists file before or after the URL confirmed
Put the video play lists file after mark, generation mark;
Broadcast unit, plays the video play lists file after the mark.
In one or more examples of above-mentioned aspect, further comprise:
Tab file URL generation units, at least one to be accorded with for the video play lists file generated after the mark
Close the URL of the video play lists file of http protocol.
In one or more examples of above-mentioned aspect, the confirmation unit further comprises:
Analytic unit, the URL for analyzing all video resources in the video play lists file line by line;
Judging unit, for judge the URL of current video resource keep up with video resource file URL point to whether phase
Together, as the URL of the current video resource URL for keeping up with video resource file point to different video resource files, then confirm
The URL of current video resource is the URL for needing to carry out video switching.
According to another aspect of the present invention there is provided a kind of Wireless Telecom Equipment, above-mentioned video play device is included.
The video broadcasting method based on Android operation system and device provided by the present invention is so that Android operation system
When playing the video of m3u8 forms, the switching of former video resource fragment will not cause the stopping of video, and video can continuously be broadcast
Put.
In order to realize above-mentioned and related purpose, one or more aspects of the invention include will be explained in below and
The feature particularly pointed out in claim.Some illustrative aspects of the present invention are described in detail in following explanation and accompanying drawing.
However, some modes in the various modes for the principle that the present invention only can be used that these aspects are indicated.In addition, of the invention
It is intended to include all these aspects and their equivalent.
Embodiment
Each side of a kind of video broadcasting method and device based on Android operation system disclosed by the invention is described below
Face.It is to be understood that teaching herein can be embodied in varied form, and any tool disclosed herein
Body structure, function or both are only representational.Based on teaching herein, those skilled in the art it is to be understood that originally
One side disclosed in text can be realized independently of any other aspect, and two or more aspects in these aspects can
To combine in various manners.It is, for example, possible to use any number of the aspects set forth herein, realizes device or practice side
Method.Further, it is possible to use other structures, function or be not in addition to one or more aspects described herein or herein
The 26S Proteasome Structure and Function of the one or more aspects illustrated, realizes this device or puts into practice this method.In addition, described herein
Any aspect can include at least one element of claim.
Android operation system provides the class that video playback controls correlation function, and our these classes are called MediaPlayer
(Media player)Component, these classes are that Android operation system is supplied to developer to be used to write the program for playing video correlation
, developer can just write a video reproduction program using these classes in Android operation system.The function that these classes are provided
It is not only broadcasting in itself, further comprises broadcasting control.Such as browser in Android operation system is by transmitting a URL to peace
The MediaPlayer components of tall and erect operating system, Android operation system is referred to using MediaPlayer components with regard to that can play this URL
To video.M3u8 formatted files must be transmitted to MediaPlayer components in the HTTP link mode such as IP or domain name and be visited for it
Ask, otherwise Android operation system can create wrong player and remove parsing m3u8 and can not finally play.
Each embodiment of the present invention is described below with reference to accompanying drawings.
First embodiment
Fig. 1 shows the flow of the video broadcasting method based on Android operation system according to the first embodiment of the present invention
Figure, wherein, this method is performed by the browser client program in the Wireless Telecom Equipment based on Android operation system.
As shown in figure 1, a kind of video broadcasting method based on Android operation system, comprises the steps:
In step s 110, according to video playback acquisition request video play lists file, the video play lists text
Part includes the URL of at least one video resource.
Specifically, the browser client program in Wireless Telecom Equipment receives a video playback request, the video
Playing request can be that the URL for clicking on the video on the video website page by user is directly produced or based on use
The video resource request command at family is produced by system or any client-side program, and user's point is included in the video playback request
The URL for the video broadcast.When video playback request is passed to system video player module by browser client program, check
Whether the URL in the request of this video playback points to a video play lists file, if it is, according to the video playback
Acquisition request video play lists file, if it is not, then the URL in being asked according to the video playback plays the URL institutes
The video resource file of sensing.
In an example of the present invention, the video play lists file is m3u8 formatted files, its internal record
The URL of multiple video resources.The multiple video resource is, for example, multiple video segments, and the content of these video segments is combined
Being a complete video resource, such as one film.
In addition, the video play lists file in video broadcasting method of the present invention can be m3u8 forms or its
Its similar form, as long as wherein have recorded the URL of multiple video resources.
Before video playback acquisition request video play lists file, including:
Judge whether the video playback request points to video play lists file, if it is, please according to video playback
The acquisition video play lists file is sought, if it is not, then playing video resource file according to video playback request.
Judge whether the video playback request points to video play lists file, specifically include:Judge that the video is broadcast
The file name suffix pointed by request is put, if the suffix name is shown to be video play lists file, the video is confirmed
Playing request points to video play lists file, otherwise confirms that the video playback request is not directed to video play lists text
Part;Or, judge that the request video playback request returns to the mimetype on head, if the mimetype on the return head
Video play lists file is shown to be, then confirms that video play lists file is pointed in the video playback request, otherwise confirms institute
State video playback request and be not directed to video play lists file.
In an example of the present invention, the file name suffix pointed by the URL in video playback request, such as institute are judged
The file name suffix of sensing is " .m3u8 ", then confirms that a video play lists file is pointed in the video playback request.
In another example of the present invention, by asking the URL of this video to server, server can return to head
Mimetype, this mimetype marked the type of returned data, i.e., this video judged by this mimetype
URL whether point to a m3u8 formatted file.
In the step s 120, the URL in the video play lists file, confirms to need to carry out video switching
URL。
Specifically, the URL of all video resources line by line in analysis video play lists file.Check current line whether be
One URL, if it is not, then skipping this line, continues to analyze;If it is, judging that the URL of current video resource keeps up with one
Whether the URL of video resource points to identical video resource file, if it is, confirming the URL of current video resource to be not required to
The URL of video switching is carried out, further specially treated is not done, continues to analyze;If it is not, then illustrating that this position has been done
The switching of video resource file, that is, the URL for confirming current video resource is the URL for needing to carry out video switching.Until analysis
The URL of all video resources in complete m3u8 formatted files.
In step s 130, set and continuously broadcast before or after the URL confirmed in video play lists file
Put the video play lists file after mark, generation mark.
In a preferred example, before the URL that above-mentioned steps S120 is confirmed, i.e., in current video resource
A line flag " #EXT-X-DISCONTINUITY " is added between the URL of URL and a upper video resource.
According to m3u8 specifications, explanation there occurs with properties when " #EXT-X-DISCONTINUITY " mark is run into
Change:File format, the number of video track or type, coding parameter, coded sequence, timestamp.Therefore, operating system can be done
Special processing, such as instantiating some objects needed for playing again, so that video will not during video segment switching
Stop playing.What kind of specially treated specific operating system, which does, belongs to the state of the art, is not described here in detail.
It should be noted that it can be not only " #EXT-X-DISCONTINUITY " or tray to mark herein
Other marks that formula changes, its setting also can be not only before the URL of current video resource or before it
Face, as long as its representative is meant that the URL of current video resource is compared with the URL of a upper video resource, there occurs that video is cut
Change.
In a preferred example, it is all analysis and it is acknowledged the need for carry out video switching URL before enter
The above-mentioned mark of row.The video play lists that will be write by analysis with labeled file content after a file, generation mark
File, such as film.m3u8.
Further, in a preferred example, by the video play lists file f ilm.m3u8 after the mark of generation
Be stored in/sdcard/ucvideo/film.m3u8 in.
In a preferred example, generation mark after video play lists file after, also for the mark after
One URL of video play lists file generated.Specifically, operating system pre-actuates a local HTTP for monitoring some port
Server.Assuming that the port numbers monitored are 9000.This server can be mapped to SDCARD some file, such as/sdcard/
ucvideo/.Request to some file can be mapped as to the file request in this file by this HTTP server.Such as,
If asking http://127.0.0.1:9000/film.m3u8, then this server can read/sdcard/ucvideo/
Film.m3u8 file content is used as return.The reason for pre-actuating this HTTP server is the address of m3u8 formatted files
MediaPlayer components must be passed in the HTTP link mode such as IP or domain name, otherwise MediaPlayer components can be created
The player of mistake causes correctly to play.There is more scheme of increasing income in HTTP server, therefore in the prior art, and this is excellent
The details of local HTTP server in example is selected to be not described here in detail.After video play lists file after generation mark, utilize
This local HTTP server pre-actuated generates the URL, such as http of the video play lists after the mark://
127.0.0.1:9000/film.m3u8, the URL are directly linked to path/sdcard/ of local HTTP server mapping
In ucvideo/film.m3u8.So as to as browse request http://127.0.0.1:During 9000/film.m3u8, local clothes
Business device will read/sdcard/ucvideo/film.m3u8 files in m3u8 formatted files return.
In step S140, the video play lists file after the mark is played.
Specifically, Android operation system calls video playback component to play the video play lists file after the mark,
Play the video resource file pointed by the multiple URL recorded in video play lists file.
In a preferred example, the URL of the video play lists file after the mark generated is passed to
The video playback component of operating system, i.e. MediaPlayer components, the video that MediaPlayer components play after the mark are broadcast
List file is emplaced, i.e., to all video resources pointed by the URL described in the video play lists file after the mark one by one
Play out.
Video play lists file after due to being marked in this method is before or after needing to carry out the URL of video switching
Marked, therefore, in the video play lists file after MediaPlayer components play the mark, operating system
It may determine that the URL for needing to carry out video switching so that video resource file can be played continuously.
According to the video broadcasting method of first embodiment, by local to video play lists file in Wireless Telecom Equipment
Modify, mark is needed to carry out the URL of video switching, and amended m3u8 forms are positioned using the URL for meeting http protocol
File, enables to m3u8 format videos not stop playing because of internal video switching.User is greatly optimized in base
In the experience that video is viewed and admired on the Wireless Telecom Equipment browser of Android operation system.
It should be noted that this method is by the browser visitor in the Wireless Telecom Equipment based on Android operation system
Family end program performs only one preferred embodiment, and this method can also be set by the radio communication based on Android operation system
Other client-side program softwares in standby are performed, and specifically what client-side program software to be performed this method by and are had no effect on the present invention
The scope of method protection.
Second embodiment
Fig. 2 shows the flow of the video broadcasting method based on Android operation system according to the second embodiment of the present invention
Figure.Wherein, this method is performed by the browser client program in the Wireless Telecom Equipment based on Android operation system.
Step S210, operating system pre-actuates a local HTTP server for monitoring some port;
Step S220, receives the video playback request URL from user, judges whether the video playback request URL is pointed to
One m3u8 formatted file, if it is, step S230 is turned to, if it is not, then turning to step S270;
Step S230, initiates network request to obtain the m3u8 formatted files;
Step S240, analyzes the m3u8 formatted files line by line;
Step S241, judges whether the m3u8 formatted files have been analyzed and finishes, if it is, step S250 is gone to,
If it is not, then going to step S242;
Step S242, whether be a URL, if it is, step S243 is gone to, if it is not, then returning if judging current line
Step S240;
Step S243, judges whether a current URL and upper URL points to identical video file, if it is not, then going to
S244, if it is, return to step S240;
Step S244, before current URL, adds a line flag between i.e. current URL and a upper URL:#EXT-X-
DISCONTINUITY, is then back to step S240;
Step S250, the file content after having analyzed writes m3u8 formatted files after a new file generation mark;
Step S251, using local HTTP server, generates the URL of the m3u8 formatted files after the mark;
Step S260, MediaPlayer components are passed to by the URL of the m3u8 formatted files after the mark generated;
Step S270, MediaPlayer component plays the m3u8 formatted files after this mark.
It should be noted that according to m3u8 specifications, illustrating when " #EXT-X-DISCONTINUITY " mark is run into
Changed with properties:File format, the number of video track or type, coding parameter, coded sequence, timestamp.Cause
This, operating system can do special processing, such as instantiating some objects needed for playing again, so that video segment
Video will not stop playing during switching.
According to the video broadcasting method of second embodiment, by local to the progress of m3u8 formatted files in Wireless Telecom Equipment
Modification, be marked between having carried out the URL of video switching and by mark after m3u8 formatted files be stored in radio communication and set
It is standby local, then using m3u8 formatted files URL after local HTTP server generation mark come the m3u8 forms after telltale mark
File, so that m3u8 format videos will not stop playing because of internal video switching.User is greatly optimized in base
In the experience that video is viewed and admired on the Wireless Telecom Equipment browser of Android operation system.
3rd embodiment
Fig. 3 shows a kind of video play device based on Android operation system according to the third embodiment of the invention
300 block diagram.
As shown in figure 3, the video play device 300 includes acquiring unit 310, confirmation unit 320, indexing unit 330, broadcast
Put unit 340.
The acquiring unit 310, for according to video playback acquisition request video play lists file, the video playback
Listing file includes the URL of at least one video resource;
The confirmation unit 320, for according to video playback acquisition request video play lists file, the video playback
Listing file includes the URL of at least one video resource, and the URL in the video play lists file, confirms to need
Carry out the URL of video switching;
The indexing unit 330, for being set in video play lists file before or after the URL confirmed
The continuous video play lists file played after mark, generation mark;
The broadcast unit 340, plays the video play lists file after the mark.
As shown in Figure 3A, in a preferred example, the video play device 300 further comprises:
Tab file URL generation units 350, for according to the video play lists file generated at least one after the mark
The URL of the individual video play lists file for meeting http protocol.
As shown in Figure 3 B, in a preferred example, the confirmation unit 320 further comprises:
Analytic unit 321, the URL for analyzing all video resources in the video play lists file line by line;
Judging unit 322, points to for judging that the URL of current video resource keeps up with the URL of video resource file and is
No identical, the URL that the URL of such as current video resource keeps up with video resource file points to different video resource files, then
The URL for confirming current video resource is the URL for needing to carry out video switching.URL such as current video resource keeps up with a video
The URL of resource file points to identical video resource file, then confirms that the URL of current video resource cuts for that need not carry out video
The URL changed.
Further, it is also possible to carry out various modifications to the video play device 300 of the present embodiment.
Fourth embodiment
Fig. 4 shows a kind of video play device 300 comprising 3rd embodiment that fourth embodiment of the invention is provided
The block diagram of Wireless Telecom Equipment 400, the Wireless Telecom Equipment 400 also includes processor 410 and storage device 420.
In a preferred example, the indexing unit 330 and the phase of storage device 420 in video play device 300
Even, when the indexing unit 330 carries out continuous broadcasting mark before or after needing to carry out the URL of video switching.Generation mark
After video play lists file after note, the storage device 420 is used to store the text of the video play lists after the mark
Part.
In a preferred example, operating system pre-actuates a local HTTP server for monitoring some port
430.Assuming that the port numbers monitored are 9000.This server can be mapped to the local storage 420.
5th embodiment
Fifth embodiment of the invention provides a kind of Wireless Telecom Equipment, including at least one processor, and at least one is deposited
Reservoir and at least one program, at least one described program storage is in the memory, and at least one described program is configured to
During by the computing device, the computing device following steps:
According to video playback acquisition request video play lists file, the video play lists file includes at least one
The URL of video resource;
According to the URL in the video play lists file, the URL for needing to carry out video switching is confirmed;
Continuous play is set to mark before or after the URL confirmed in video play lists file, generation mark
Video play lists file after note;
Play the video play lists file after the mark.In addition, at least one described program is configured to by the place
When managing device execution, the processor can also carry out each step described in first embodiment.
In addition, typically, Wireless Telecom Equipment of the present invention can be various hand-held terminal devices, for example mobile phone, individual
Personal digital assistant(PDA)Deng, therefore protection scope of the present invention should not limit as certain certain types of Wireless Telecom Equipment.
In addition, the method according to the invention is also implemented as the computer program performed by CPU.In the computer journey
When sequence is performed by CPU, the above-mentioned functions limited in the method for performing the present invention.
In addition, above method step and system unit can also utilize controller and cause controller real for storing
The computer readable storage devices of the computer program of existing above-mentioned steps or Elementary Function are realized.
In addition, it should be appreciated that computer readable storage devices as described herein(For example, memory)Can be volatile
Property memory or nonvolatile memory, or both volatile memory and nonvolatile memory can be included.It is used as example
Son and it is nonrestrictive, nonvolatile memory can include read-only storage(ROM), programming ROM(PROM), electrically programmable
ROM(EPROM), electrically erasable programmable ROM(EEPROM)Or flash memory.Volatile memory can include arbitrary access
Memory(RAM), the RAM can serve as external cache.Nonrestrictive as an example, RAM can be with more
The form of kind is obtained, such as synchronous random access memory(DRAM), dynamic ram(DRAM), synchronous dram(SDRAM), double data rate SDRAM
(DDR SDRAM), enhancing SDRAM(ESDRAM), synchronization link DRAM(SLDRAM)And directly Rambus RAM(DRRAM).
The storage device of disclosed aspect is intended to the memory of including but not limited to these and other suitable type.
Those skilled in the art will also understand is that, the various illustrative logical blocks with reference to described by disclosure herein, list
Member, circuit and algorithm steps may be implemented as the combination of electronic hardware, computer software or both.It is hard in order to clearly demonstrate
This interchangeability of part and software, the function with regard to various exemplary components, square, unit, circuit and step it is entered
General description is gone.This function is implemented as software and is also implemented as hardware depending on concrete application and application
Design constraint to whole system.Those skilled in the art can in a variety of ways realize described for every kind of concrete application
Function, but this realize that decision should not be interpreted as causing a departure from the scope of the present.
Various illustrative logical blocks, unit and circuit with reference to described by disclosure herein, which can be utilized, to be designed to
The following part of function described here is performed to realize or perform:General processor, digital signal processor(DSP), special collection
Into circuit(ASIC), field programmable gate array(FPGA)Or other PLDs, discrete gate or transistor logic, point
Any combinations of vertical nextport hardware component NextPort or these parts.General processor can be microprocessor, but alternatively, processing
Device can be any conventional processors, controller, microcontroller or state machine.Processor can also be implemented as computing device
Combination, for example, the combination of DSP and microprocessor, multi-microprocessor, one or more microprocessors combination DSP core or any
Other this configurations.
The step of method with reference to described by disclosure herein or algorithm, can be directly contained in hardware, be held by processor
In capable software unit or in combination of the two.Software unit may reside within RAM memory, flash memory, ROM storages
Device, eprom memory, eeprom memory, register, hard disk, removable disk, CD-ROM or known in the art it is any its
In the storage medium of its form.Exemplary storage medium is coupled to processor so that processor can be from the storage medium
Middle reading information writes information to the storage medium.In an alternative, the storage medium can be with processor collection
Into together.Processor and storage medium may reside within ASIC.ASIC may reside within user terminal.In a replacement
In scheme, processor and storage medium can be resident in the user terminal as discrete assembly.
In one or more exemplary designs, the function can be real in hardware, software, firmware or its any combination
It is existing.If realized in software, the function can be stored in as one or more instructions or code computer-readable
Transmitted on medium or by computer-readable medium.Computer-readable medium includes computer-readable storage medium and communication media,
The communication media includes helping to be sent to computer program into any medium of another position from a position.Storage medium
It can be any usable medium that can be accessed by a general purpose or special purpose computer.It is nonrestrictive as an example, the computer
Computer-readable recording medium can include RAM, ROM, EEPROM, CD-ROM or other optical disc memory apparatus, disk storage equipment or other magnetic
Property storage device, or can be used for carrying or storage form for instruct or data structure needed for program code and can
Any other medium accessed by universal or special computer or universal or special processor.In addition, any connection can
It is properly termed as computer-readable medium.If for example, using coaxial cable, optical fiber cable, twisted-pair feeder, digital subscriber line
(DSL)Or the wireless technology of such as infrared ray, radio and microwave to send software from website, server or other remote sources,
Then the wireless technology of above-mentioned coaxial cable, optical fiber cable, twisted-pair feeder, DSL or such as infrared elder generations, radio and microwave is included in
The definition of medium.As used herein, disk and CD include compact disk(CD), laser disk, CD, digital versatile disc
(DVD), floppy disk, Blu-ray disc, wherein disk generally magnetically reproduce data, and CD utilizes laser optics ground reproduce data.On
The combination for stating content should also be as being included in the range of computer-readable medium.
Although content disclosed above shows the exemplary embodiment of the present invention, it should be noted that without departing substantially from power
On the premise of profit requires the scope of the present invention of restriction, it may be many modifications and change.It is real according to invention described herein
The function, step and/or action for applying the claim to a method of example are not required to perform with any particular order.Although in addition, the present invention
Element can describe or require in individual form, be unless explicitly limited odd number it is also contemplated that multiple.
It is described although being described above with reference to figure according to each embodiment of the present invention, people in the art
Member is it should be appreciated that each embodiment proposed to the invention described above, can also do on the basis of present invention is not departed from
Go out various improvement.